html, body {
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    font-family: ui-monospace, monospace;
    color: #9ae6b4;
    width: 100%;
    height: 100%;
}

*:focus,
*:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

#ui {
    position: fixed;
    inset: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

#game {
    position: fixed;
    inset: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

#world {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    background: #000;
    pointer-events: auto;
}

#topbar {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 9999;
    display: flex;
    gap: 6px;
    align-items: center;
}

.atlas-btn,
#spawnBtn {
    padding: 3px 8px;
    background: rgba(0,0,0,0.45);
    border: 1px solid #1a3;
    color: #9ae6b4;
    font-size: 11px;
    font-family: ui-monospace, monospace;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.atlas-btn:hover,
#spawnBtn:hover {
    filter: brightness(1.25);
}

#expansa-bottom-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(6,18,12,0.88);
    border-top: 1px solid #1a3;
    backdrop-filter: blur(3px);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #9ae6b4;
    font-family: ui-monospace, monospace;
    font-size: 12px;
    z-index: 9999;
    box-sizing: border-box;
}

.bottom-row {
    width: 100%;
    display: flex;
    align-items: center;
}

#row-status {
    justify-content: flex-start;
}

#row-actions {
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

/* =================================
   TERMINAL LOG WINDOW
================================= */

#log {
    position: fixed;
    left: 8px;
    bottom: 72px;

    width: 240px;
    height: 200px;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    padding: 6px 8px;

    border: 1px solid #1a3;
    background: rgba(0,0,0,0.25);

    backdrop-filter: blur(2px);

    font-family: ui-monospace, monospace;
    font-size: 11px;
    line-height: 1.4;

    z-index: 9998;
    pointer-events: none;
}

.log-line {
    display: block;
    white-space: nowrap;
    overflow: visible;
    padding: 1px 0;
    color: #9ae6b4;
}

/* =================================
   PAWN PANEL
================================= */

.pawn-panel {
    position: fixed;
    right: 8px;
    bottom: 72px;

    width: 240px;
    min-height: 200px;

    padding: 6px 8px;

    border: 1px solid #1a3;
    background: rgba(0,0,0,0.25);

    backdrop-filter: blur(2px);

    font-family: ui-monospace, monospace;
    font-size: 11px;
    line-height: 1.4;

    z-index: 9998;
    pointer-events: none;
    box-sizing: border-box;
}

.pawn-panel.hidden {
    display: none;
}

.pawn-panel-head {
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(34, 170, 51, 0.35);
}

#pawn-panel-title {
    color: #9ae6b4;
    text-transform: lowercase;
}

.pawn-panel-body {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.pawn-panel-sprite-wrap {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border: 1px solid rgba(34, 170, 51, 0.35);
    background: rgba(0,0,0,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#pawn-panel-sprite {
    width: 56px;
    height: 56px;
    image-rendering: pixelated;
    object-fit: contain;
    display: block;
}

.pawn-panel-stats {
    flex: 1;
    min-width: 0;
}

.pawn-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    white-space: nowrap;
}

.pawn-label {
    color: #6fbd84;
    opacity: 0.95;
}

/* stats */

#tile-stats,
#player-info {
    white-space: nowrap;
    font-size: 11px;
    opacity: 0.9;
}

/* =================================
   MOBILE
================================= */

@media (max-width: 900px) {

    #topbar {
        top: 6px;
        left: 6px;
    }

    #spawnBtn,
    .atlas-btn {
        font-size: 10px;
        padding: 4px 6px;
    }

    #log {
        left: 6px;
        right: auto;
        width: 200px;
        bottom: 86px;
        height: 140px;
    }

    .pawn-panel {
        right: 6px;
        width: 200px;
        bottom: 86px;
        min-height: 140px;
    }

    .pawn-panel-body {
        gap: 8px;
    }

    .pawn-panel-sprite-wrap {
        width: 52px;
        height: 52px;
        flex: 0 0 52px;
    }

    #pawn-panel-sprite {
        width: 46px;
        height: 46px;
    }

    .log-line,
    .pawn-panel,
    .pawn-row {
        font-size: 10px;
    }

    #expansa-bottom-panel {
        padding: 6px 6px 8px 6px;
        gap: 4px;
    }

    #row-actions {
        gap: 4px;
    }

}