/* ==========================================
   HIDE AND SEEK (Campus Chase)
   Extracted from games.css in Wave 5 cleanup — Phase 7 CSS refactor.
   Pure H&S selectors + media query. No shared rules.
   ========================================== */

@layer features {


.hs-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(2px, 0.5dvh, 8px);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 48px clamp(2px, 0.3dvh, 8px) clamp(2px, 0.3dvh, 8px);
    height: 100%;
    overflow: hidden;
}
/* breakpoint snap 600px -> 768px (Phase 7.6 ladder) */
@media (max-width: 768px) {
    .hs-container { padding-top: 42px; justify-content: flex-start; }
}

.hs-container > .ttt-controls {
    flex-shrink: 0;
    margin-top: auto;
    padding-bottom: clamp(2px, 0.5dvh, 6px);
}

.hs-board {
    position: relative;
    width: min(90vw, 50dvh, 520px);
    max-width: min(90vw, 50dvh, 520px);
    aspect-ratio: 1;
    flex-shrink: 1;
    min-height: 0;
    overflow: visible;
    text-align: center;
}

.hs-grid {
    display: grid;
    grid-template-columns: repeat(30, 1fr);
    grid-template-rows: repeat(30, 1fr);
    gap: 0px;
    background: var(--bg-dark);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(var(--secondary-rgb),0.3);
    aspect-ratio: 1;
    box-shadow: 0 0 30px rgba(var(--secondary-rgb),0.08), inset 0 0 40px rgba(0, 0, 0, 0.4);
}

.hs-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    transition: background 0.15s;
    min-width: 0;
    min-height: 0;
}

.hs-path {
    background: rgba(var(--secondary-rgb), 0.08);
    border: 1px solid rgba(var(--secondary-rgb),0.06);
    box-sizing: border-box;
}

.hs-wall {
    background: rgba(var(--secondary-rgb), 0.28);
    border: none;
    box-shadow: none;
}
/* Only show border on wall edges that face non-wall cells */
.hs-wall.hs-wall-top { border-top: 1px solid rgba(var(--secondary-rgb),0.25); }
.hs-wall.hs-wall-bottom { border-bottom: 1px solid rgba(var(--secondary-rgb),0.25); }
.hs-wall.hs-wall-left { border-left: 1px solid rgba(var(--secondary-rgb),0.25); }
.hs-wall.hs-wall-right { border-right: 1px solid rgba(var(--secondary-rgb),0.25); }

.hs-seekable {
    cursor: pointer;
}

/* Phase 7.7: !important stripped from these H&S zone-state classes.
   Each is same-specificity as .hs-path / .hs-cell base rules but defined
   at a later source position, so source-order already wins. Overlapping
   class combinations (e.g. .hs-revealed + .hs-hider-here) resolve to the
   later-declared class, which matches the author's intent. */
.hs-seekable:hover {
    background: rgba(var(--primary-rgb),0.2);
    border-color: rgba(var(--primary-rgb),0.4);
}

/* Hot/Cold zone bands */
.hs-zone-burning {
    background: rgba(231, 76, 60, 0.3);
    border: 1px solid rgba(231, 76, 60, 0.5);
}
.hs-zone-hot {
    background: rgba(243, 156, 18, 0.22);
    border: 1px solid rgba(243, 156, 18, 0.4);
}
.hs-zone-warm {
    background: rgba(var(--primary-rgb),0.15);
    border: 1px solid rgba(var(--primary-rgb),0.3);
}
.hs-zone-cold {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.25);
}

.hs-revealed {
    background: rgba(231, 76, 60, 0.18);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.hs-hider-here {
    background: rgba(46, 204, 113, 0.25);
    border: 1px solid rgba(46, 204, 113, 0.5);
}

.hs-chosen-spot {
    background: rgba(var(--primary-rgb),0.5);
    border: 1px solid rgba(var(--primary-rgb),0.8);
    cursor: pointer;
    animation: hs-pulse 1s ease-in-out infinite;
}

.hs-valid-move {
    background: rgba(var(--secondary-rgb),0.08);
    cursor: pointer;
    border: 1px solid rgba(var(--secondary-rgb),0.06);
}

.hs-valid-move:hover {
    background: rgba(var(--secondary-rgb),0.22);
}

/* H&S confirm popup now uses unified .game-board-confirm-overlay */

.hs-piece {
    font-size: clamp(0.45rem, 1.8vw, 0.9rem);
    line-height: 1;
    z-index: 2;
}

.hs-runner { animation: hs-bounce 0.6s ease-in-out infinite; }

@keyframes hs-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes hs-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes hs-explode {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); opacity: 1; }
}


/* Heat bar — smooth gradient blue→red + cell range label */
.hs-temp-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: min(90vw, 540px);
    flex-shrink: 0;
    padding: 0.2rem 0;
    margin-top: 0.3rem;
    padding-left: 3em;
}

.hs-heatbar {
    flex: 1;
    height: clamp(8px, 1.4dvh, 12px);
    border-radius: 99px;
    overflow: hidden;
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(var(--secondary-rgb),0.15);
    position: relative;
}

.hs-heatbar-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #3498db, #2ecc71, var(--primary), var(--primary-dark), #e74c3c);
    opacity: 0.75;
    transition: width 0.5s ease;
}

.hs-heatbar-label {
    font-size: clamp(0.6rem, 1.4vw, 0.78rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    min-width: 4em;
    text-align: right;
}

.hs-attempts-badge {
    font-size: clamp(0.6rem, 1.4vw, 0.8rem);
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

/* Building labels */
.hs-building-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.hs-building-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: clamp(0.35rem, 1.2vw, 0.6rem);
    font-weight: 700;
    color: rgba(var(--secondary-rgb),0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Info bar */
.hs-info {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.4rem 0;
    gap: 0.5rem;
    text-align: center;
}

.hs-role-badge {
    font-size: clamp(0.7rem, 1.8vw, 0.85rem);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
}

.hs-role-badge.hider {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.hs-role-badge.seeker {
    background: rgba(var(--primary-rgb),0.15);
    color: var(--primary);
    border: 1px solid rgba(var(--primary-rgb),0.3);
}

/* Mobile adjustments */
/* breakpoint snap 600px -> 768px (Phase 7.6 ladder) */
@media (max-width: 768px) {
    .hs-container {
        padding: 52px 0.15rem 0.15rem;
        gap: clamp(1px, 0.3dvh, 3px);
        overflow: hidden;
    }
    .hs-board {
        width: min(90vw, 42dvh, 380px);
        max-width: min(90vw, 42dvh, 380px);
        flex-shrink: 1;
    }
    .hs-piece { font-size: clamp(0.35rem, 1.2vw, 0.6rem); }
    .hs-info {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        padding: 0.2rem 0;
    }
    .hs-role-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
        text-align: center;
    }
    .hs-temp-bar {
        margin-top: 0.5rem;
        padding-left: 2.5em;
    }
    .hs-heatbar {
        height: clamp(6px, 1.2dvh, 10px);
    }
    .hs-heatbar-label {
        font-size: clamp(0.5rem, 1.2vw, 0.7rem);
    }
    .hs-building-label { font-size: 0.3rem; }
}


} /* end @layer features */
