/* ═══════════════════════════════════════
   Escape Room — Dark Calm Theme
   ═══════════════════════════════════════ */

:root {
    --bg-primary: #0b1120;
    --bg-secondary: #111a2e;
    --bg-card: #162033;
    --bg-card-hover: #1c2840;
    --text-primary: #dce3f0;
    --text-secondary: #8896b0;
    --text-muted: #546e7a;
    --accent-purple: #7c4dff;
    --accent-cyan: #00e5ff;
    --accent-green: #00e676;
    --accent-red: #ff5252;
    --accent-orange: #ffab40;
    --border-color: #1e2d47;
    --border-light: #2a3a5c;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
}

/* Reset & Base */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════ */

.home-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% 30%, rgba(124, 77, 255, 0.05) 0%, transparent 100%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 229, 255, 0.04) 0%, transparent 100%),
        var(--bg-primary);
}

.home-header {
    text-align: center;
    margin-bottom: 3rem;
}

.game-title {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

.home-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 700px;
    width: 100%;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-purple);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-join::before {
    background: var(--accent-cyan);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.card h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.player-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.card-create .player-label {
    background: rgba(124, 77, 255, 0.15);
    color: var(--accent-purple);
}

.card-join .player-label {
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-cyan);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.join-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    width: 100%;
    max-width: 260px;
}

.code-input {
    flex: 1;
    padding: 0.65rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s ease;
}

.code-input:focus {
    border-color: var(--accent-cyan);
}

.btn-join {
    padding: 0.65rem 1.25rem;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-join:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-join:not(:disabled):hover {
    opacity: 0.85;
}

/* ═══════════════════════════════════════
   GAME CONTAINER (shared by A & B)
   ═══════════════════════════════════════ */

.game-container {
    min-height: 100vh;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse 70% 50% at 30% 20%, rgba(124, 77, 255, 0.04) 0%, transparent 100%),
        radial-gradient(ellipse 60% 50% at 70% 80%, rgba(0, 229, 255, 0.03) 0%, transparent 100%),
        var(--bg-primary);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.room-code {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.room-code strong {
    color: var(--text-primary);
    letter-spacing: 0.15em;
}

.player-badge {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    text-transform: uppercase;
}

.player-badge.player-a {
    background: rgba(124, 77, 255, 0.15);
    color: var(--accent-purple);
}

.player-badge.player-b {
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-cyan);
}

/* Waiting */

.waiting-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius);
    text-align: center;
}

.waiting-notice p {
    color: var(--text-secondary);
}

.waiting-notice .hint {
    font-size: 0.9rem;
}

.waiting-notice .hint strong {
    color: var(--accent-cyan);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Puzzle Layout */

.puzzle-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.panel-title {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.instruction {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1rem;
}

.instruction.hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════
   SYMBOLS — A's ordered view
   ═══════════════════════════════════════ */

.symbols-panel .symbols-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.symbol-card {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    position: relative;
    transition: all 0.2s ease;
}

.symbol-card:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.1);
}

/* ═══════════════════════════════════════
   SYMBOLS — B's input grid
   ═══════════════════════════════════════ */

.symbols-input-panel .symbols-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 280px;
}

.symbol-btn {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.symbol-btn:not(:disabled):hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.08);
}

.symbol-btn:not(:disabled):active {
    transform: scale(0.95);
}

.symbol-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.symbol-btn.symbol-used {
    border-color: var(--accent-green);
    background: rgba(0, 230, 118, 0.08);
    opacity: 0.6;
}

/* Progress dots */

.progress-dots {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.dot-empty {
    background: var(--border-light);
}

.dot-filled {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

/* ═══════════════════════════════════════
   CONSOLE (A's numeric keypad)
   ═══════════════════════════════════════ */

.code-display {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    min-width: 200px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.code-placeholder {
    color: var(--text-muted);
}

.code-value {
    color: var(--accent-cyan);
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 220px;
    width: 100%;
}

.key {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.key:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent-purple);
}

.key:active:not(:disabled) {
    transform: scale(0.95);
}

.key:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.key-clear {
    color: var(--accent-red);
}

.key-submit {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--bg-primary);
}

.key-submit:hover:not(:disabled) {
    background: #00c853 !important;
    border-color: #00c853 !important;
}

.console-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
}

.console-locked .instruction {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   CLUE (B's reveal)
   ═══════════════════════════════════════ */

.clue-panel {
    min-height: 320px;
    transition: all 0.5s ease;
}

.clue-hidden .panel-title {
    color: var(--text-muted);
}

.clue-hidden-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
}

.clue-revealed {
    border-color: var(--accent-orange);
    box-shadow: 0 0 30px rgba(255, 171, 64, 0.08);
    animation: clueGlow 2s ease-in-out;
}

@keyframes clueGlow {
    0% { box-shadow: 0 0 0 rgba(255, 171, 64, 0); }
    50% { box-shadow: 0 0 60px rgba(255, 171, 64, 0.15); }
    100% { box-shadow: 0 0 30px rgba(255, 171, 64, 0.08); }
}

.clue-poster {
    padding: 1rem;
}

.poster-border {
    border: 2px solid var(--accent-orange);
    padding: 1.5rem;
    position: relative;
    background: rgba(255, 171, 64, 0.03);
}

.poster-border::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(255, 171, 64, 0.2);
    pointer-events: none;
}

.poster-text {
    text-align: center;
}

.poster-line {
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.poster-line:first-child {
    font-weight: 700;
    color: var(--accent-orange);
    margin-bottom: 0.75rem;
}

.poster-year {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-orange);
    letter-spacing: 0.1em;
    margin-top: 0.75rem;
    text-shadow: 0 0 40px rgba(255, 171, 64, 0.3);
}

/* ═══════════════════════════════════════
   WIN SCREEN
   ═══════════════════════════════════════ */

.win-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    position: relative;
}

.win-screen h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--accent-green);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 40px rgba(0, 230, 118, 0.3);
}

.win-screen p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.win-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 230, 118, 0.06) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.btn-back {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-back:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    text-decoration: none;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   ERROR / NOTIFICATIONS
   ═══════════════════════════════════════ */

.error-message {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.error-flash {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
    .home-cards {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .game-title {
        font-size: 2rem;
    }

    .puzzle-layout {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .game-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .symbols-row {
        gap: 0.5rem;
    }

    .symbol-card {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ═══════════════════════════════════════
   Blazor Error UI
   ═══════════════════════════════════════ */

.blazor-error-ui {
    background: var(--accent-red);
    color: #fff;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.blazor-error-ui .reload {
    color: #fff;
    text-decoration: underline;
    margin-left: 0.5rem;
}

.blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ═══════════════════════════════════════
   BROWSE ROOMS SECTION (Home page)
   ═══════════════════════════════════════ */

.browse-section {
    margin-top: 2.5rem;
    text-align: center;
}

.btn-browse {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-browse:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    text-decoration: none;
    box-shadow: var(--shadow);
}

/* ═══════════════════════════════════════
   ROOM BROWSER PAGE
   ═══════════════════════════════════════ */

.browser-page {
    min-height: 100vh;
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
    background:
        radial-gradient(ellipse 70% 50% at 30% 20%, rgba(124, 77, 255, 0.04) 0%, transparent 100%),
        var(--bg-primary);
}

.browser-header {
    text-align: center;
    margin-bottom: 2rem;
}

.browser-header h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.browser-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.rooms-table-wrapper {
    overflow-x: auto;
}

.rooms-table {
    width: 100%;
    border-collapse: collapse;
}

.rooms-table th {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.rooms-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.rooms-table tr:hover td {
    background: rgba(22, 32, 51, 0.5);
}

.code-cell .room-code-badge {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--accent-cyan);
    font-variant-numeric: tabular-nums;
}

.time-cell {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
}

.status-open {
    background: rgba(0, 230, 118, 0.12);
    color: var(--accent-green);
}

.action-cell .btn-join {
    padding: 0.45rem 1rem;
    background: transparent;
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-sm);
    color: var(--accent-cyan);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-cell .btn-join:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 2rem;
}

.loading-state p {
    color: var(--text-secondary);
}

.browser-page .empty-state svg {
    margin-bottom: 0.5rem;
}

.browser-page .empty-state .hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.browser-page .error-flash {
    text-align: center;
    margin-top: 1rem;
}

/* ═══════════════════════════════════════
   RESPONSIVE — Room Browser
   ═══════════════════════════════════════ */

@media (max-width: 600px) {
    .browser-page {
        padding: 1rem;
    }

    .rooms-table th,
    .rooms-table td {
        padding: 0.75rem 0.5rem;
    }

    .code-cell .room-code-badge {
        font-size: 1rem;
    }

    .browser-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ═══════════════════════════════════════
   HOME — Narrative & Room Previews
   ═══════════════════════════════════════ */

.home-lore {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0.75rem auto 0;
    line-height: 1.5;
}

.room-list-preview {
    margin-top: 2.5rem;
    text-align: center;
}

.room-list-preview h3 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.room-steps {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.room-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.step-num {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-purple);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ═══════════════════════════════════════
   GAME — Room Progress Bar / Header
   ═══════════════════════════════════════ */

.room-progress {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.room-view {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

.room-header {
    text-align: center;
    margin-bottom: 2rem;
}

.room-header h2 {
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.room-story {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

.room-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.room-badge-1 { background: rgba(76, 175, 80, 0.15); color: #4caf50; }
.room-badge-2 { background: rgba(33, 150, 243, 0.15); color: #2196f3; }
.room-badge-3 { background: rgba(255, 152, 0, 0.15); color: #ff9800; }
.room-badge-4 { background: rgba(156, 39, 176, 0.15); color: #ce93d8; }

.btn-submit {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.75rem 2rem;
    background: var(--accent-green);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-submit:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.25);
}

.success-message {
    text-align: center;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid var(--accent-green);
    border-radius: var(--radius-sm);
    color: var(--accent-green);
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.section-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

/* ═══════════════════════════════════════
   ROOM 1 — Greenhouse / Probes
   ═══════════════════════════════════════ */

.probes-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.probe {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    min-width: 160px;
}

.probe-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.probe-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
}

.probe-red .probe-value { color: #ef5350; }
.probe-blue .probe-value { color: #42a5f5; }
.probe-yellow .probe-value { color: #ffd54f; }

.probe-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.probe-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.probe-btn:hover:not(:disabled) {
    border-color: var(--accent-purple);
    background: var(--bg-card-hover);
}

.probe-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.probe-bar {
    width: 16px;
    height: 80px;
    background: var(--bg-primary);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.probe-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 8px 8px;
    transition: height 0.3s ease;
}

.probe-fill-red { background: linear-gradient(to top, #c62828, #ef5350); }
.probe-fill-blue { background: linear-gradient(to top, #1565c0, #42a5f5); }
.probe-fill-yellow { background: linear-gradient(to top, #f9a825, #ffd54f); }

.probe-summary {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

/* Manual de Campo (B) */

.manual-container {
    display: flex;
    justify-content: center;
}

.manual-page {
    background: linear-gradient(135deg, #1a2320, #1e2d1e);
    border: 1px solid #2e4a2e;
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.manual-header {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #66bb6a;
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #2e4a2e;
}

.manual-illustration {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1.25rem;
    opacity: 0.8;
}

.manual-entry {
    margin-bottom: 1.25rem;
}

.manual-entry h3 {
    font-size: 0.95rem;
    color: #a5d6a7;
    margin-bottom: 0.35rem;
}

.manual-note {
    font-size: 0.85rem;
    color: #b9dbb9;
    line-height: 1.5;
    font-style: italic;
}

.manual-hint {
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: rgba(102, 187, 106, 0.1);
    border: 1px solid #2e4a2e;
    border-radius: var(--radius-sm);
    text-align: center;
}

.manual-hint p {
    color: #81c784;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* ═══════════════════════════════════════
   ROOM 2 — Navigation / Maze
   ═══════════════════════════════════════ */

.maze-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.maze-grid {
    display: grid;
    grid-template-columns: repeat(6, 56px);
    gap: 3px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.maze-cell {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.cell-empty { background: #0d1b2a; }
.cell-wall { background: #1a2a44; }
.cell-start { background: rgba(33, 150, 243, 0.15); }
.cell-end { background: rgba(0, 230, 118, 0.15); }
.cell-player {
    background: rgba(124, 77, 255, 0.25);
    box-shadow: 0 0 15px rgba(124, 77, 255, 0.3);
    animation: pulse 1.5s ease-in-out infinite;
}

.laser-icon { color: var(--accent-purple); font-size: 1.6rem; }
.target-icon { color: var(--accent-green); font-size: 1.4rem; }
.start-icon { color: var(--accent-cyan); font-size: 1.2rem; opacity: 0.5; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(124, 77, 255, 0.2); }
    50% { box-shadow: 0 0 25px rgba(124, 77, 255, 0.5); }
}

.maze-instruction {
    text-align: center;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
}

.maze-instruction p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Dark Interface (B) */

.dark-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: radial-gradient(ellipse at center, #0a0e1a, #050810);
    border: 1px solid #1a2a44;
    border-radius: var(--radius);
    max-width: 400px;
    margin: 0 auto;
}

.radar-display {
    text-align: center;
    padding: 1rem 2rem;
    background: rgba(0, 229, 255, 0.03);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: var(--radius-sm);
}

.radar-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.radar-value {
    font-size: 3rem;
    font-weight: 300;
    color: var(--accent-cyan);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
}

.radar-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.direction-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dir-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dir-btn {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.dir-btn:hover:not(:disabled) {
    background: rgba(124, 77, 255, 0.15);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.dir-btn:active:not(:disabled) {
    transform: scale(0.92);
}

.dir-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.dir-center {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dir-blank {
    color: rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
}

.btn-fire {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, #ff5252, #d50000);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    animation: pulse 1.5s ease-in-out infinite;
    transition: all 0.2s ease;
}

.btn-fire:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(255, 82, 82, 0.4);
}

/* ═══════════════════════════════════════
   ROOM 3 — Energy Core / Cables
   ═══════════════════════════════════════ */

.cables-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.cables-pool, .cables-slots {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.cables-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cable-item {
    padding: 0.65rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.cable-item:hover:not(:disabled) {
    border-color: var(--accent-purple);
    background: rgba(124, 77, 255, 0.08);
}

.cable-selected {
    border-color: var(--accent-purple) !important;
    background: rgba(124, 77, 255, 0.15) !important;
    box-shadow: 0 0 12px rgba(124, 77, 255, 0.2);
}

.cable-placed {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.slots-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 48px;
}

.slot:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.03);
}

.slot-occupied {
    border-style: solid;
    border-color: var(--border-light);
    cursor: default;
}

.slot-correct {
    border-color: var(--accent-green) !important;
    background: rgba(0, 230, 118, 0.05);
}

.slot-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 24px;
}

.slot-cable {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.slot-empty {
    flex: 1;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.slot-remove {
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.slot-remove:hover {
    opacity: 1;
}

/* Wave Diagnostics (B) */

.diagnostics-container {
    display: flex;
    justify-content: center;
}

.wave-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
    width: 100%;
}

.wave-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    transition: border-color 0.2s ease;
}

.wave-card:hover {
    border-color: var(--border-light);
}

.wave-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.wave-slot {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.wave-visual {
    font-size: 1.2rem;
}

.wave-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ═══════════════════════════════════════
   ROOM 4 — Archive / Clues
   ═══════════════════════════════════════ */

.clues-container {
    max-width: 600px;
    margin: 0 auto;
}

.clue-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.clue-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-purple);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.clue-entry {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-purple);
}

.clue-entry p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.clue-entry strong {
    color: var(--accent-cyan);
}

.clue-summary {
    border-left-color: var(--accent-green);
    margin-bottom: 0;
}

.clue-summary p {
    font-weight: 600;
}

.password-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.password-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.password-section .hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.password-input-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    max-width: 380px;
    margin: 0 auto;
}

.password-input-row .code-input {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 1rem;
}

.guess-status {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--accent-cyan);
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}

/* ═══════════════════════════════════════
   ROOM RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 700px) {
    .cables-container {
        grid-template-columns: 1fr;
    }

    .probes-container {
        gap: 1rem;
    }

    .probe {
        min-width: 130px;
        padding: 1rem 0.75rem;
    }

    .maze-grid {
        grid-template-columns: repeat(6, 40px);
    }

    .maze-cell {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .laser-icon { font-size: 1.2rem; }
    .target-icon { font-size: 1rem; }
}

@media (max-width: 480px) {
    .maze-grid {
        grid-template-columns: repeat(6, 32px);
        gap: 2px;
        padding: 4px;
    }

    .maze-cell {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .dir-btn {
        width: 48px;
        height: 48px;
    }

    .radar-value {
        font-size: 2rem;
    }
}
