body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: #000;
    font-family: 'Share Tech Mono', monospace;
    color: #00ffff;
}

/* --- CUSTOM SCROLLBARS --- */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: #000208;
    border-left: 1px solid rgba(0, 255, 255, 0.1);
    border-top: 1px solid rgba(0, 255, 255, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 150, 200, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.7);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}
::-webkit-scrollbar-corner {
    background: #000208;
}

#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
    
    /* Responsive Grid Layout */
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.hud-panel {
    padding: 1rem;
    background: rgba(0, 20, 40, 0.4);
    border: 0.1rem solid #00ffff;
    box-shadow: 0 0 1rem rgba(0, 255, 255, 0.2), inset 0 0 1rem rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    text-shadow: 0 0 0.5rem #00ffff;
    pointer-events: auto;
    width: 100%;
    box-sizing: border-box;
}

/* Mobile-first positioning within grid */
.top-left {
    grid-column: 1;
    grid-row: 1;
}

.top-right {
    grid-column: 1;
    grid-row: 2;
}

.bottom-left {
    grid-column: 1;
    grid-row: 4;
}

/* Desktop Multi-column Layout */
@media (min-width: 768px) {
    #ui-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto 1fr auto;
        padding: 2vw;
        gap: 2vw;
    }

    .top-left {
        grid-column: 1;
        grid-row: 1;
        max-width: 25rem;
    }

    .top-right {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        max-width: 20rem;
    }

    .bottom-left {
        grid-column: 1;
        grid-row: 3;
        align-self: end;
        max-width: 25rem;
    }
}

.cyber-button {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    color: #00ffff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    padding: 10px 20px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.2);
}

.cyber-button:hover, .cyber-button:focus {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
    text-shadow: 0 0 5px #fff;
    outline: none;
}

/* --- WALLET MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 5, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(0, 20, 40, 0.8);
    border: 0.1rem solid #00ffff;
    border-radius: 1rem;
    padding: 2rem;
    width: 90vw;
    max-width: 450px;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2), inset 0 0 20px rgba(0, 255, 255, 0.1);
    color: #fff;
    pointer-events: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s;
}

.close-btn:hover {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

/* Asset Cards */
.asset-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1.5rem;
}

.asset-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    color: #111;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.asset-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-right: 16px;
}

.asset-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}

.asset-title {
    font-family: 'Baloo 2', 'Helvetica Neue', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    color: #111;
}

.asset-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: #888;
    margin-top: 4px;
}

.asset-balance {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: #111;
}

h3 {
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.5);
    padding-bottom: 5px;
    letter-spacing: 2px;
}

p {
    font-size: 0.9rem;
    margin: 8px 0;
    letter-spacing: 1px;
}

.status-ok {
    color: #00ff88;
    text-shadow: 0 0 5px #00ff88;
}

.loreland-item {
    font-size: 0.85rem;
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    transition: background 0.2s;
    padding: 2px 5px;
    border: 1px solid transparent;
}

.loreland-item:hover, .loreland-item:focus {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.5);
    outline: none;
    cursor: pointer;
}

/* --- CENTER CORE UI --- */
#center-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 15;
}

.toby-glow {
    position: absolute;
    top: -20px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(0,255,100,0.4) 0%, rgba(0,0,0,0) 60%);
    z-index: -1;
    pointer-events: none;
}

#toby-logo {
    width: 120px;
    height: auto;
    margin-bottom: 5px;
    animation: hoverPulse 3s ease-in-out infinite;
}

.toby-title {
    font-family: 'Share Tech Mono', monospace; /* A more futuristic squarish font would be better, but we'll stick to this and style it */
    font-size: 4.5rem;
    line-height: 0.9;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(0, 255, 255, 0.5);
    font-weight: bold;
    letter-spacing: 2px;
}

.core-dots {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    margin-bottom: 25px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.core-stats {
    font-size: 1.1rem;
    color: #7ab4ff;
    letter-spacing: 4px;
    margin: 0;
    text-shadow: 0 0 10px rgba(122, 180, 255, 0.5);
}

@keyframes hoverPulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Scanline effect */
body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 20;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* --- RESPONSIVE SEARCH UI --- */
.search-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 999;
    display: flex;
    gap: 10px;
    pointer-events: auto;
    align-items: center;
}

.search-box {
    display: flex;
    background: rgba(0,20,30,0.6);
    border: 1px solid rgba(0,255,255,0.4);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,255,255,0.1);
}

#deed-search-input {
    background: transparent;
    border: none;
    color: #00ffff;
    font-family: 'Share Tech Mono', monospace;
    padding: 8px 12px;
    outline: none;
    width: 140px;
    font-size: 14px;
}

#deed-search-input::placeholder {
    color: rgba(0,255,255,0.4);
}

#deed-search-btn {
    padding: 8px 15px;
    background: rgba(0,255,255,0.1);
    border: none;
    border-left: 1px solid rgba(0,255,255,0.4);
    font-size: 14px;
    margin: 0;
    box-shadow: none;
}

.pond-link {
    position: absolute;
    top: 90px;
    right: 20px;
    z-index: 999;
    pointer-events: auto;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.pond-link:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px #00ffff);
}

.pond-link img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #00ffff;
    background: rgba(0,20,30,0.8);
    object-fit: cover;
}

.faucet-link {
    position: absolute;
    top: 160px;
    right: 20px;
    z-index: 999;
    pointer-events: auto;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.faucet-link:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px #00ffff);
}

.faucet-link img {
    box-sizing: border-box;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #00ffff;
    background: rgba(0,20,30,0.8);
    object-fit: contain;
    padding: 2px;
}

.toby-link {
    position: absolute;
    top: 230px;
    right: 20px;
    z-index: 999;
    pointer-events: auto;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.toby-link:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px #00ffff);
}

.toby-link img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #00ffff;
    background: rgba(0,20,30,0.8);
    object-fit: cover;
}

.taboshi-link {
    position: absolute;
    top: 300px;
    right: 20px;
    z-index: 999;
    pointer-events: auto;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.taboshi-link:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px #00ffff);
}

.taboshi-link img {
    box-sizing: border-box;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #00ffff;
    background: rgba(0,20,30,0.8);
    object-fit: contain;
    padding: 2px;
}

.patience-link {
    position: absolute;
    top: 370px;
    right: 20px;
    z-index: 999;
    pointer-events: auto;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.patience-link:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px #00ffff);
}

.patience-link img {
    box-sizing: border-box;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #00ffff;
    background: #000000;
    object-fit: contain;
    padding: 2px;
}

.search-instruction {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    pointer-events: none;
    color: #00ffff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
    text-align: center;
    width: 100%;
    letter-spacing: 2px;
    background: transparent;
    border: none;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .search-container {
        left: 50%;
        transform: translateX(-50%);
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 8px;
    }
    
    .search-box {
        width: 280px;
    }
    
    #deed-search-input {
        flex: 1;
        width: auto;
        text-align: center;
    }
    
    .pond-link {
        top: 75px;
        right: 10px;
    }
    .pond-link img {
        width: 45px;
        height: 45px;
    }

    .faucet-link {
        top: 130px;
        right: 10px;
    }
    .faucet-link img {
        width: 45px;
        height: 45px;
    }
    
    .toby-link {
        top: 185px;
        right: 10px;
    }
    .toby-link img {
        width: 45px;
        height: 45px;
    }
    
    .taboshi-link {
        top: 240px;
        right: 10px;
    }
    .taboshi-link img {
        width: 45px;
        height: 45px;
    }
    
    .patience-link {
        top: 295px;
        right: 10px;
    }
    .patience-link img {
        width: 45px;
        height: 45px;
    }

    .search-instruction {
        bottom: 20px;
        font-size: 12px;
        letter-spacing: 1px;
    }
    
    /* Ensure the land details modal also fits perfectly */
    .land-container {
        padding: 1.5rem !important;
        margin-top: 60px; /* Leave space for back button */
    }
    
    /* Ensure back button doesn't overlap on mobile */
    #back-btn {
        top: 10px !important;
        left: 10px !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
}


/* Custom Cyber Cursor */
body, html {
    cursor: url('public/cursor-default.png') 16 16, crosshair;
}

button, .cyber-button, a, input, select {
    cursor: url('public/cursor-hover.png') 16 16, pointer;
}


.home-link {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 999;
    pointer-events: auto;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.home-link:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px #00ffff);
}

.home-link img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #00ffff;
    background: rgba(0,20,30,0.8);
    object-fit: cover;
}

@media (max-width: 768px) {
    .home-link {
        top: 20px;
        right: 10px;
    }
    .home-link img {
        width: 45px;
        height: 45px;
    }
}

