/* Play page — full-viewport terminal client */

/* Hide site background image; terminal IS the background */
.play-page::before {
    display: none;
}

.play-page {
    overflow: hidden;
    background: #0a0a0a;
}

/* Terminal fills between navbar and vitals bar */
#terminal-container {
    position: fixed;
    top: 32px;
    bottom: 66px;
    left: 0;
    right: 0;
    background: #0a0a0a;
    overflow: hidden;
}

#terminal-container .xterm {
    height: 100%;
    padding: 2px 4px;
}

/* Vitals bar — fixed bottom */
.vitals-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    gap: 0.75rem;
    font-size: 0.72rem;
    z-index: 100;
}

.vitals-bar.hidden {
    display: none;
}

/* When vitals are hidden, shift down past input bar only */
.vitals-bar.hidden ~ #terminal-container,
body:has(.vitals-bar.hidden) #terminal-container {
    bottom: 30px;
}

body:has(.vitals-bar.hidden) .input-bar {
    bottom: 0;
}

body:has(.vitals-bar.hidden) .map-panel {
    bottom: 30px;
}

.vitals-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.vitals-name {
    color: #d7af5f;
    font-weight: 600;
    white-space: nowrap;
}

.vitals-gauges {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.gauge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.gauge-label {
    color: #606060;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    width: 30px;
}

.gauge-track {
    width: 80px;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.gauge-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 1px;
}

.gauge-hp .gauge-fill {
    background: #5faf5f;
}

.gauge-hp .gauge-fill.low {
    background: #af5f5f;
}

.gauge-hp .gauge-fill.mid {
    background: #d7af5f;
}

.gauge-mana .gauge-fill {
    background: #5f87af;
}

.gauge-move .gauge-fill {
    background: #d7af5f;
}

.gauge-text {
    color: #808080;
    font-size: 0.68rem;
    white-space: nowrap;
    min-width: 55px;
    flex-shrink: 0;
}

.vitals-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: auto;
}

.vitals-room {
    color: #5fafaf;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.vitals-status {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.vitals-status.connected {
    color: #5faf5f;
}

.vitals-status.reconnecting {
    color: #d7af5f;
}

.vitals-status.disconnected {
    color: #af5f5f;
}

/* Connection overlay */
.connect-status {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 1rem 1.5rem;
    color: #808080;
    font-size: 0.85rem;
    z-index: 200;
}

.connect-status.hidden {
    display: none;
}

/* Input bar — between terminal and vitals */
.input-bar {
    position: fixed;
    bottom: 36px;
    left: 0;
    right: 0;
    min-height: 30px;
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: flex-start;
    padding: 4px 0.5rem;
    z-index: 100;
}

.input-prompt {
    color: #5faf5f;
    font-family: 'Berkeley Mono', 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 22px;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #c0c0c0;
    font-family: 'Berkeley Mono', 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    caret-color: #5faf5f;
}

.input-field::placeholder {
    color: #404040;
}

.input-field.password-mode {
    -webkit-text-security: disc;
    color: #5faf5f;
}

/* Map panel — right side, resizable */
.map-panel {
    position: fixed;
    top: 32px;
    bottom: 66px;
    right: 0;
    width: 240px;
    min-width: 140px;
    max-width: 50vw;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.map-panel.hidden {
    display: none;
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.map-title {
    color: #606060;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-close {
    background: none;
    border: none;
    color: #505050;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.map-close:hover {
    color: #af5f5f;
}

.map-drag {
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    z-index: 51;
}

.map-drag:hover,
.map-drag.dragging {
    background: rgba(95, 175, 95, 0.3);
}

#map-canvas {
    flex: 1;
    width: 100%;
    min-height: 0;
    image-rendering: pixelated;
}

/* Map toggle button */
.map-toggle {
    position: fixed;
    top: 36px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(5, 5, 5, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    color: #505050;
    font-size: 1rem;
    cursor: pointer;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.map-toggle:hover {
    color: #5faf5f;
    border-color: rgba(95, 175, 95, 0.3);
}

.map-toggle.hidden {
    display: none;
}

/* Popout button (in navbar) */
.popout-btn {
    background: none;
    border: none;
    color: #606060;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.15rem;
    line-height: 1;
    vertical-align: middle;
}

.popout-btn:hover {
    color: #5faf5f;
}

/* Popout mode — no navbar, terminal fills to top */
.play-page.popout .navbar,
.play-page.popout .mobile-overlay,
.play-page.popout .mobile-nav,
.play-page.popout .popout-btn {
    display: none !important;
}

.play-page.popout #terminal-container {
    top: 0;
}

.play-page.popout .map-panel {
    top: 0;
}

.play-page.popout .map-toggle {
    top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .map-panel,
    .map-toggle {
        display: none !important;
    }

    #terminal-container {
        right: 0 !important;
        top: 32px;
        bottom: 102px;
    }

    .vitals-bar {
        height: auto;
        min-height: 36px;
        flex-wrap: wrap;
        padding: 0.35rem 0.5rem;
        gap: 0.25rem;
    }

    .vitals-gauges {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }

    .gauge-track {
        width: 60px;
    }

    .vitals-room {
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .navbar {
        height: 40px;
    }

    #terminal-container {
        top: 40px;
    }

    .gauge-label {
        display: none;
    }

    .gauge-text {
        font-size: 0.6rem;
        min-width: 40px;
    }

    .gauge-track {
        width: 50px;
    }
}
