/* ==========================================================================
   Arcade shell — shared by the canvas games
   ========================================================================== */

/* The hidden attribute must always win, even over display rules */
[hidden] { display: none !important; }


html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #0b0d12;
    color: #e0e0e0;
    font-family: 'Georgia', 'Times New Roman', serif;
    overflow: hidden;
}

#game-canvas {
    position: fixed;
    inset: 0;
    display: block;
    touch-action: none;
}

#arcade-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(10, 12, 18, 0.85);
    border-bottom: 1px solid #2a2f3a;
    backdrop-filter: blur(8px);
    /* Above the game overlay, so Exit/About stay visible and clickable
       on pause, title, and end screens in every game. */
    z-index: 40;
}
.arcade-title { font-size: 0.98rem; }
.arcade-best { color: #ffd166; font-size: 0.85rem; }
.arcade-links { margin-left: auto; display: flex; gap: 0.8rem; }
.arcade-links a {
    color: #9a9a9a;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid #2a2f3a;
    border-radius: 6px;
    padding: 0.22rem 0.65rem;
    transition: all 0.2s ease;
}
.arcade-links a:hover { color: #00c8ff; border-color: #00c8ff; }

.game-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 6, 10, 0.72);
    backdrop-filter: blur(3px);
    z-index: 30;
}
.game-overlay[hidden] { display: none; }
.game-overlay-card {
    text-align: center;
    background: rgba(16, 19, 28, 0.97);
    border: 1px solid #00c8ff;
    border-radius: 16px;
    padding: 2rem 2.4rem;
    max-width: min(460px, 90vw);
    box-shadow: 0 0 50px rgba(0, 200, 255, 0.18);
    animation: overlay-in 0.25s ease;
}
@keyframes overlay-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}
.game-overlay-card h1 { margin: 0 0 0.6rem; font-size: 1.6rem; }
#overlay-text { color: #aab4c0; margin: 0 0 1.2rem; font-size: 1rem; white-space: pre-line; }
.overlay-button {
    background: #00c8ff;
    color: #001018;
    border: none;
    border-radius: 10px;
    padding: 0.8rem 2rem;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.12s ease;
}
.overlay-button:hover { filter: brightness(1.15); transform: translateY(-1px); }
.overlay-button:active { transform: scale(0.96); }
.overlay-controls { color: #8a94a2; font-size: 0.8rem; margin: 1rem 0 0; }  /* contrast: 4.0 -> 5.6:1 */

@media (prefers-reduced-motion: reduce) {
    .game-overlay-card { animation: none; }
}

/* --------------------------------------------------------------------------
   3D investigation HUD (The Gaslight Study)
   -------------------------------------------------------------------------- */
#g3-crosshair {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.2rem;
    z-index: 15;
    pointer-events: none;
    transition: color 0.12s ease, transform 0.12s ease;
}
#g3-crosshair.aimed {
    color: #ffd166;
    transform: translate(-50%, -50%) scale(1.35);
}
#g3-toast {
    position: fixed;
    left: 50%;
    bottom: 84px;
    transform: translateX(-50%);
    max-width: min(560px, 88vw);
    background: rgba(14, 12, 8, 0.94);
    border: 1px solid #d9c58a;
    border-radius: 12px;
    padding: 0.7rem 1.1rem;
    color: #efe4c8;
    font-size: 0.92rem;
    line-height: 1.55;
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}
#g3-toast.show { opacity: 1; }
#g3-toast strong { color: #ffd166; }
.g3-pressed {
    margin: 0.15rem 0 0.7rem;
    font-size: 0.82rem;
    color: #9aa3b2;
    font-style: italic;
    line-height: 1.5;
    max-width: 30rem;
}
#g3-prompt {
    position: fixed;
    left: 50%;
    top: 56%;
    transform: translateX(-50%);
    background: rgba(10, 12, 18, 0.85);
    border: 1px solid #00c8ff;
    border-radius: 8px;
    padding: 0.3rem 0.9rem;
    font-size: 0.9rem;
    color: #cfe9f5;
    z-index: 15;
    pointer-events: none;
}
#g3-objective {
    position: fixed;
    top: 52px;
    left: 12px;
    background: rgba(10, 12, 18, 0.8);
    border: 1px solid #2a2f3a;
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    font-size: 0.88rem;
    z-index: 15;
}
#g3-journal {
    position: fixed;
    top: 52px;
    right: 12px;
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    background: rgba(14, 12, 8, 0.94);
    border: 1px solid #57503f;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    z-index: 16;
    font-size: 0.88rem;
}
#g3-journal h2 { margin: 0 0 0.4rem; font-size: 1.05rem; color: #ffd166; }
#g3-journal h3 { margin: 0.8rem 0 0.3rem; font-size: 0.85rem; color: #d9c58a; text-transform: uppercase; letter-spacing: 1px; }
#g3-journal ul { margin: 0; padding-left: 1.1rem; }
#g3-journal li { margin-bottom: 0.45rem; color: #cbc2ae; }
.g3-brief { color: #aab4c0; font-style: italic; margin: 0; }
.g3-none { color: #6d7684; font-style: italic; }

#g3-accuse { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.g3-suspect-btn { font-size: 1rem !important; }
