/**
 * Game Page Styles - 4weird Games Template
 * Cyberpunk/Matrix High-Fidelity Retro Neon Redesign
 */

/* ===== 1. THEME VARIABLES ===== */
:root {
    --cyber-black: #050508;
    --cyber-dark: #0a0a0f;
    --cyber-dark-blue: #0f0f1a;
    --cyber-gray: #1a1a26;
    --cyber-panel: rgba(10, 10, 15, 0.75);
    
    --neon-cyan: #00f2fe;
    --neon-magenta: #ff0077;
    --neon-yellow: #fcf003;
    --neon-purple: #8b5cf6;
    
    --glow-cyan: 0 0 10px rgba(0, 242, 254, 0.5), 0 0 20px rgba(0, 242, 254, 0.3);
    --glow-magenta: 0 0 10px rgba(255, 0, 119, 0.5), 0 0 20px rgba(255, 0, 119, 0.3);
    --glow-yellow: 0 0 10px rgba(252, 240, 3, 0.5), 0 0 20px rgba(252, 240, 3, 0.3);
    --glow-purple: 0 0 10px rgba(139, 92, 246, 0.5), 0 0 20px rgba(139, 92, 246, 0.3);

    --border-cyber: 1px solid rgba(0, 242, 254, 0.2);
    --border-cyber-purple: 1px solid rgba(139, 92, 246, 0.3);
    
    --font-cyber: 'Orbitron', 'Inter', sans-serif;
}

/* ===== 2. LAYOUT & CORE RESET ===== */
.TEMPLATE-4weird-game-page {
    background-color: var(--cyber-black);
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--navbar-height, 70px);
    position: relative;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}

/* Scanlines/Matrix ambient grid effect */
.TEMPLATE-4weird-game-page::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 999;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}

/* Background animated glow matrix */
.cyber-bg-dots {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(rgba(139, 92, 246, 0.15) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -2;
    pointer-events: none;
}

/* ===== 3. GAME HEADER ===== */
.TEMPLATE-4weird-game-header {
    background: linear-gradient(180deg, rgba(5, 5, 8, 0.95) 0%, rgba(10, 10, 15, 0.8) 100%);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--neon-purple);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 0;
}

.TEMPLATE-4weird-game-header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.TEMPLATE-4weird-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--neon-cyan);
    text-decoration: none;
    font-family: var(--font-cyber);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 8px 16px;
    border-radius: 4px;
    background: rgba(0, 242, 254, 0.05);
    border: var(--border-cyber);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 0 5px rgba(0, 242, 254, 0.1);
}

.TEMPLATE-4weird-back-link:hover {
    color: #fff;
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    transform: translateX(-4px);
}

.TEMPLATE-4weird-game-title {
    font-family: var(--font-cyber);
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: var(--glow-purple);
    margin: 0;
    animation: neonPulse 2s infinite alternate;
}

.TEMPLATE-4weird-game-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.TEMPLATE-4weird-game-genre {
    font-family: var(--font-cyber);
    color: var(--neon-cyan);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid rgba(0, 242, 254, 0.4);
    padding: 4px 10px;
    border-radius: 4px;
}

.TEMPLATE-4weird-game-status.live {
    font-family: var(--font-cyber);
    background: var(--neon-magenta);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 4px;
    box-shadow: var(--glow-magenta);
    animation: cyberBlink 1.5s infinite;
}

/* ===== 4. MAIN LAYOUT GRID ===== */
.TEMPLATE-4weird-game-main {
    flex: 1;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

/* ===== 5. GAME VIEWPORT FRAME ===== */
.TEMPLATE-4weird-game-frame {
    position: relative;
    background: #030305;
    border-radius: 12px;
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    aspect-ratio: 4/3;
    display: flex;
    flex-direction: column;
    /* Keep the frame put while the mobile keyboard opens/closes:
       no scroll chaining, no double-tap zoom reflow. JS additionally locks
       the frame to a fixed px height during PLAYING (see lockFrameHeight). */
    overscroll-behavior: contain;
    touch-action: manipulation;
}

.TEMPLATE-4weird-game-frame::after {
    content: "TERMINAL ACTIVE";
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-family: var(--font-cyber);
    font-size: 0.6rem;
    color: rgba(139, 92, 246, 0.5);
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 2;
}

/* ===== 6. REAL-TIME GAME HUD ===== */
#game-hud {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

.hud-item {
    background: rgba(5, 5, 8, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(8px);
}

.hud-label {
    font-family: var(--font-cyber);
    font-size: 0.65rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.hud-value {
    font-family: var(--font-cyber);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    text-shadow: var(--glow-cyan);
}

/* Integrity Health Bar styling */
.hud-integrity-container {
    width: 160px;
}

.integrity-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#health-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--neon-magenta), #ff5500);
    box-shadow: var(--glow-magenta);
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 7. GAME STATE OVERLAYS ===== */
.TEMPLATE-4weird-game-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(4, 4, 6, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 20px 0;
}

.TEMPLATE-4weird-game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.TEMPLATE-4weird-overlay-content {
    text-align: center;
    max-width: 480px;
    padding: 30px;
    border-radius: 12px;
    background: rgba(10, 10, 15, 0.85);
    border: var(--border-cyber-purple);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(139, 92, 246, 0.05);
    z-index: 11;
    margin: auto;
}

.TEMPLATE-4weird-overlay-content h2 {
    font-family: var(--font-cyber);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: var(--glow-cyan);
}

.TEMPLATE-4weird-overlay-content p {
    font-size: 0.95rem;
    color: #a0aec0;
    line-height: 1.6;
    margin-bottom: 25px;
}

.TEMPLATE-4weird-controls-hint {
    margin-top: 25px;
    padding: 15px;
    background: rgba(0, 242, 254, 0.04);
    border: var(--border-cyber);
    border-radius: 8px;
    font-size: 0.85rem;
}

.TEMPLATE-4weird-controls-hint kbd {
    background: #1e1e2d;
    border: 1px solid #4a5568;
    box-shadow: 0 2px 0 #4a5568;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    margin: 0 3px;
}

.TEMPLATE-4weird-final-score {
    font-family: var(--font-cyber);
    font-size: 1.5rem;
    color: var(--neon-yellow);
    text-shadow: var(--glow-yellow);
    margin: 15px 0 25px;
    font-weight: 700;
}

/* Buttons style */
.btn {
    font-family: var(--font-cyber);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-purple), #7c3aed);
    color: #fff;
    border: 1px solid var(--neon-purple);
    box-shadow: var(--glow-purple);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed, var(--neon-purple));
    box-shadow: 0 0 25px var(--neon-purple);
    transform: scale(1.05);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

.btn-emoji {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* ===== 8. HIGH-TECH INFO SIDEBAR ===== */
.TEMPLATE-4weird-game-info-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.TEMPLATE-4weird-panel-section {
    background: var(--cyber-panel);
    border: var(--border-cyber-purple);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(139, 92, 246, 0.03);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.TEMPLATE-4weird-panel-section::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--neon-purple);
    box-shadow: var(--glow-purple);
}

.TEMPLATE-4weird-panel-section.high-score-section::before {
    background: var(--neon-yellow);
    box-shadow: var(--glow-yellow);
}

.TEMPLATE-4weird-panel-section h3 {
    font-family: var(--font-cyber);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.TEMPLATE-4weird-panel-section p {
    color: #a0aec0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Tabs switcher for Controls */
.controls-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #9fb0c3;
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: var(--neon-cyan);
    border-bottom: 2px solid var(--neon-cyan);
}

.controls-tab-content {
    display: none;
}

.controls-tab-content.active {
    display: block;
}

.TEMPLATE-4weird-panel-section ul {
    list-style: none;
}

.TEMPLATE-4weird-panel-section li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: #cbd5e0;
}

.TEMPLATE-4weird-panel-section li:last-child {
    border-bottom: none;
}

.TEMPLATE-4weird-panel-section kbd {
    background: #1a1a24;
    border: 1px solid #4a5568;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    margin-left: 5px;
}

/* Score animation */
.TEMPLATE-4weird-high-score {
    font-family: var(--font-cyber);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--neon-yellow);
    text-shadow: var(--glow-yellow);
    text-align: center;
    letter-spacing: 2px;
}

/* Sound controller panel */
.sound-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sound-toggle-btn {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: var(--neon-purple);
    font-family: var(--font-cyber);
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

.sound-toggle-btn.active {
    background: var(--neon-magenta);
    border-color: var(--neon-magenta);
    color: #fff;
    box-shadow: var(--glow-magenta);
}

/* ===== 9. CAROUSEL & SHARE BUTTONS ===== */
/* Share container */
.share-section {
    padding: 10px 0;
    margin-top: 10px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.share-btn {
    flex: 1;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e0;
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff;
}

.share-btn.copy:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.05);
}

.share-btn.copy.copied {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
    color: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.share-btn.twitter:hover {
    border-color: #1da1f2;
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.05);
}

.share-btn.reddit:hover {
    border-color: #ff4500;
    color: #ff4500;
    background: rgba(255, 69, 0, 0.05);
}

/* More Games Carousel section */
.TEMPLATE-4weird-more-games {
    background: var(--cyber-dark);
    border-top: 2px solid var(--neon-purple);
    padding: 50px 0;
}

.TEMPLATE-4weird-more-games-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.TEMPLATE-4weird-more-games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.TEMPLATE-4weird-more-games h2 {
    font-family: var(--font-cyber);
    font-size: 1.5rem;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
}

.carousel-nav {
    display: flex;
    gap: 10px;
}

.carousel-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    border: var(--border-cyber-purple);
    color: var(--neon-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.carousel-nav-btn:hover {
    background: var(--neon-purple);
    color: #fff;
    box-shadow: var(--glow-purple);
}

.carousel-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 10px 0;
}

.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-card {
    flex: 0 0 250px;
    min-height: 280px;
    background: var(--cyber-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.carousel-card:hover {
    transform: translateY(-8px);
    border-color: var(--neon-cyan);
    box-shadow: 0 8px 30px rgba(0, 242, 254, 0.15);
}

.carousel-card-emoji {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.carousel-card h3 {
    font-family: var(--font-cyber);
    font-size: 1rem;
    color: #fff;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.carousel-card p {
    font-size: 0.8rem;
    color: #a0aec0;
    line-height: 1.5;
    margin: 0 0 15px;
    flex-grow: 1;
}

.carousel-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.carousel-tag {
    font-family: var(--font-cyber);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e0;
    padding: 2px 8px;
    border-radius: 4px;
}

.carousel-play-btn {
    width: 100%;
    text-align: center;
    background: rgba(0, 242, 254, 0.08);
    border: var(--border-cyber);
    color: var(--neon-cyan);
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    padding: 10px 0;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 5px rgba(0, 242, 254, 0.05);
}

.carousel-play-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: var(--glow-cyan);
}

/* ===== 10. FOOTER & MISC ===== */
.TEMPLATE-4weird-footer {
    background: var(--cyber-black);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 0;
    text-align: center;
    font-size: 0.85rem;
    color: #9fb0c3;
}

.TEMPLATE-4weird-footer a {
    color: var(--neon-cyan);
    text-decoration: none;
}

.TEMPLATE-4weird-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Fullscreen Toggle Button (FW-ARCADE-A: ⛶ overlay, top-right) */
.TEMPLATE-4weird-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 50;
    background: rgba(5, 5, 8, 0.8);
    border: 1px solid rgba(0, 242, 254, 0.4);
    color: var(--neon-cyan);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    pointer-events: auto;
}

.TEMPLATE-4weird-fullscreen-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: var(--glow-cyan);
}

/* Fullscreen mode layouts overrides */
.TEMPLATE-4weird-game-frame:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    aspect-ratio: auto;
}

.TEMPLATE-4weird-game-frame:fullscreen #canvas-container canvas {
    width: 100%;
    height: 100%;
}

/* FW-ARCADE-A feature: fullscreen keeps the HUD / powerups visible. */
.TEMPLATE-4weird-game-frame:fullscreen #game-hud {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: calc(10px + env(safe-area-inset-left, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
}
.TEMPLATE-4weird-game-frame:fullscreen #powerup-bar {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

/* Loading spinner */
.TEMPLATE-4weird-loading-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--cyber-black);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.5s ease;
}

.TEMPLATE-4weird-loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 242, 254, 0.1);
    border-top: 3px solid var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: var(--glow-cyan);
}

/* ===== 12. ANIMATIONS ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes neonPulse {
    0% { text-shadow: 0 0 5px rgba(139, 92, 246, 0.2), 0 0 10px rgba(139, 92, 246, 0.2); }
    100% { text-shadow: 0 0 10px rgba(139, 92, 246, 0.6), 0 0 20px rgba(139, 92, 246, 0.4); }
}

@keyframes cyberBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ===== 13. RESPONSIVE COMPACT MEDIA ===== */
@media (max-width: 900px) {
    .TEMPLATE-4weird-game-main {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .TEMPLATE-4weird-game-frame {
        aspect-ratio: auto;
        height: 50vh;
        height: 50svh;
        min-height: 350px;
    }
}

@media (max-width: 600px) {
    .TEMPLATE-4weird-game-header-inner {
        flex-direction: column;
        align-items: stretch;
    }
    
    .TEMPLATE-4weird-game-title {
        font-size: 1.4rem;
        text-align: center;
    }
    
    .TEMPLATE-4weird-game-meta {
        justify-content: center;
    }

    .hud-integrity-container {
        width: 100px;
    }

    .TEMPLATE-4weird-game-frame {
        height: 60vh;
        height: 60svh;
        min-height: 300px;
    }
}

/* ===== 14. CUSTOM DECRYPT GAME STYLING ===== */
.store-grid::-webkit-scrollbar {
  width: 4px;
}
.store-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.store-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.store-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px 18px;
  transition: background 0.2s;
}

.store-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.store-card-info {
  text-align: left;
}

.store-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.store-card p {
    font-size: 0.8rem;
    color: #9fb0c3;
    font-family: var(--font-cyber);
}

.btn-buy {
  padding: 8px 16px;
  background: var(--neon-cyan);
  color: #020205;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: var(--font-cyber);
}

.btn-buy:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--glow-cyan);
}

.btn-buy:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: #718096;
  cursor: default;
}

.btn-equip {
  padding: 8px 16px;
  background: var(--neon-purple);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: var(--font-cyber);
}

.btn-equip:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--glow-purple);
}

/* ===== 15. DIFFICULTY LEVEL STYLES ===== */
.btn-diff {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a0aec0;
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn-diff:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--neon-cyan);
  color: #fff;
}
.btn-diff.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
  font-weight: 700;
}

/* ===== 15.5 LEVEL SELECTION STYLES ===== */
.btn-level {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a0aec0;
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn-level:hover {
  background: rgba(189, 0, 255, 0.08);
  border-color: var(--neon-magenta);
  color: #fff;
}
.btn-level.active {
  background: rgba(189, 0, 255, 0.15);
  border-color: var(--neon-magenta);
  color: var(--neon-magenta);
  box-shadow: 0 0 10px rgba(189, 0, 255, 0.3);
  font-weight: 700;
}

/* ===== 16. MOBILE KEYBOARD TRIGGER ===== */
/* Hidden typing input. Stays anchored inside the game frame so focusing it
   never scrolls the page (the previous off-screen -9999px position made
   mobile browsers jump vertically to reveal it). 16px font-size stops iOS
   auto-zoom on focus; pointer-events:none lets taps fall through to the
   frame, which focuses programmatically with preventScroll. */
.mobile-typing-input {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 16px;
  height: 16px;
  opacity: 0.01;
  border: 0;
  padding: 0;
  font-size: 16px;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  pointer-events: none;
  z-index: 4;
}
.mobile-keyboard-trigger {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  color: #020205;
  border: none;
  border-radius: 30px;
  font-family: var(--font-cyber);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-keyboard-trigger:active {
  transform: scale(0.95);
  box-shadow: 0 0 5px rgba(0, 242, 254, 0.2);
}

/* ===== 17. GLOSSARY/DEFINITIONS CONTAINER ===== */
.definitions-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(0, 0, 0, 0.1);
}
.word-def-entry {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--neon-cyan);
  padding: 10px 15px;
  border-radius: 0 6px 6px 0;
}
.word-def-title {
  font-family: var(--font-cyber);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 5px;
  text-transform: uppercase;
}
.word-def-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #e2e8f0;
}
.word-def-list li {
  margin-bottom: 4px;
}

/* ===== 18. GAME SPEED TRIGGER ===== */
.game-speed-trigger {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 60, 0, 0.15);
  border: 1px solid rgb(255, 85, 0);
  border-radius: 30px;
  color: rgb(255, 120, 50);
  font-family: var(--font-cyber);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 15px rgba(255, 85, 0, 0.3);
  user-select: none;
  -webkit-user-select: none;
}

.game-speed-trigger:hover {
  background: rgba(255, 60, 0, 0.25);
  box-shadow: 0 0 20px rgba(255, 85, 0, 0.5);
  color: #fff;
}

.game-speed-trigger.active {
  background: rgba(255, 60, 0, 0.55);
  border-color: rgb(255, 120, 50);
  color: #fff;
  box-shadow: 0 0 25px rgba(255, 60, 0, 0.7);
  transform: scale(0.95);
}

/* ===== 19. AWESOME HUD: vignette, crosshair, banners, boss, powerups ===== */
#damage-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 0, 60, 0.55) 100%);
  transition: opacity 0.12s linear;
}
#damage-vignette.frozen {
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 242, 254, 0.45) 100%);
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  opacity: 0.85;
}
#crosshair.hidden { display: none; }
#crosshair .ch-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 5px;
  background: var(--neon-cyan);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: var(--glow-cyan);
}
#crosshair .ch-ring {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(0, 242, 254, 0.7);
  border-radius: 50%;
  transition: transform 0.08s ease-out;
}
#crosshair.pulse .ch-ring { transform: scale(1.5); border-color: #fff; }
#crosshair::before, #crosshair::after {
  content: "";
  position: absolute;
  background: rgba(0, 242, 254, 0.6);
}
#crosshair::before { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }
#crosshair::after { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }

#wave-banner {
  position: absolute;
  top: 22%;
  left: 0; right: 0;
  text-align: center;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#wave-banner.show { opacity: 1; transform: scale(1); }
#wave-banner .wave-banner-title {
  font-family: var(--font-cyber);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 0 20px var(--neon-cyan), 0 0 60px rgba(0, 242, 254, 0.5);
  animation: bannerGlitch 0.5s ease 2;
}
#wave-banner.boss .wave-banner-title {
  color: #ffd700;
  text-shadow: 0 0 20px #ff5500, 0 0 60px rgba(255, 85, 0, 0.6);
  animation: bossFlash 0.4s ease 4;
}
#wave-banner .wave-banner-sub {
  font-family: var(--font-cyber);
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: #cbd5e0;
  margin-top: 6px;
}

#kill-announce {
  position: absolute;
  top: 34%;
  left: 0; right: 0;
  text-align: center;
  z-index: 8;
  pointer-events: none;
  font-family: var(--font-cyber);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 4px;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
#kill-announce.show { opacity: 1; transform: translateY(0) scale(1.05); }
#kill-announce-sub {
  position: absolute;
  top: calc(34% + 2.4rem);
  left: 0; right: 0;
  text-align: center;
  z-index: 8;
  pointer-events: none;
  font-family: var(--font-cyber);
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: #e2e8f0;
  opacity: 0;
  transition: opacity 0.18s ease;
}
#kill-announce-sub.show { opacity: 0.95; }

#boss-bar {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: min(70%, 420px);
  z-index: 6;
  pointer-events: none;
  text-align: center;
}
#boss-bar.hidden { display: none; }
#boss-name {
  font-family: var(--font-cyber);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 85, 0, 0.8);
  margin-bottom: 4px;
}
.boss-hp-bg {
  height: 10px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.6);
  border-radius: 6px;
  overflow: hidden;
}
#boss-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff5500, #ffd700);
  box-shadow: 0 0 12px rgba(255, 85, 0, 0.8);
  transition: width 0.15s ease;
}

#wave-progress {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 4px;
  z-index: 6;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
#wave-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  box-shadow: var(--glow-cyan);
  transition: width 0.3s ease;
}

#powerup-bar {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  gap: 8px;
}
#powerup-bar.hidden { display: none; }
.powerup-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(5, 5, 8, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: #fff;
  font-family: var(--font-cyber);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.15s ease;
}
.powerup-btn:hover { border-color: #fff; transform: translateY(-2px); box-shadow: var(--glow-cyan); }
.powerup-btn.depleted { opacity: 0.35; filter: grayscale(1); }
.powerup-btn span {
  background: rgba(0, 242, 254, 0.15);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.7rem;
}

.hud-types-legend {
    font-family: var(--font-cyber);
    font-size: 0.6rem;
    letter-spacing: 1px;
    color: #a9b8c7;
    margin-top: 4px;
}

#score-val.score-pop {
  display: inline-block;
  animation: scorePop 0.25s ease;
}

.gameover-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
}
.gameover-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gameover-stats span {
    font-family: var(--font-cyber);
    font-size: 0.6rem;
    letter-spacing: 1px;
    color: #a9b8c7;
}
.gameover-stats b {
  font-family: var(--font-cyber);
  font-size: 1.05rem;
  color: #fff;
}
#newbest-badge {
  font-size: 0.7rem;
  color: #020205;
  background: linear-gradient(135deg, #ffd700, #ff9100);
  padding: 2px 10px;
  border-radius: 12px;
  vertical-align: middle;
  animation: bossFlash 0.6s ease infinite alternate;
}
#glossary-stats { letter-spacing: 1px; }

@keyframes scorePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); color: var(--neon-yellow); }
  100% { transform: scale(1); }
}
@keyframes bannerGlitch {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) skewX(-2deg); }
  75% { transform: translateX(4px) skewX(2deg); }
}
@keyframes bossFlash {
  from { opacity: 1; }
  to { opacity: 0.65; }
}

@media (max-width: 600px) {
  #wave-banner .wave-banner-title { font-size: 2rem; letter-spacing: 3px; }
  #kill-announce { font-size: 1.1rem; }
  #powerup-bar { bottom: 64px; }
  .gameover-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 20. POLISH PASS: a11y, robustness, responsive, motion-safety ===== */

/* Safety: HUD must stay hidden until PLAYING even if template CSS misses it */
#game-hud.hidden { display: none; }

/* Renderer canvas: kill inline-element baseline gap */
#canvas-container canvas { display: block; }

/* Start-screen menu stats chips */
.menu-stats {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.menu-stats span {
  font-family: var(--font-cyber);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: #e2e8f0;
  background: rgba(0, 242, 254, 0.06);
  border: var(--border-cyber);
  border-radius: 20px;
  padding: 5px 12px;
}
.menu-stats b { color: var(--neon-yellow); }

/* 3-step tutorial */
.menu-tutorial {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(0, 242, 254, 0.04);
  border: var(--border-cyber);
  border-radius: 8px;
  text-align: left;
  font-size: 0.82rem;
  color: #cbd5e0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: step;
}
.menu-tutorial li { display: flex; gap: 10px; align-items: baseline; }
.menu-tutorial li::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--font-cyber);
  font-weight: 800;
  font-size: 0.7rem;
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 242, 254, 0.5);
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu-tutorial b { color: #fff; }

.menu-key-hint {
    font-size: 0.78rem;
    color: #a9b8c7;
    margin: 0;
}
.menu-key-hint kbd {
  background: #1e1e2d;
  border: 1px solid #4a5568;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
}

/* Settings + store helpers */
.slider-val {
  color: var(--neon-cyan);
  font-weight: 700;
  margin-left: 6px;
}
.store-hint {
    font-family: var(--font-cyber);
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: #a9b8c7;
    margin: 0 0 15px;
}
.store-hint kbd {
  background: #1e1e2d;
  border: 1px solid #4a5568;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
}
.loading-error {
  font-family: var(--font-cyber);
  font-size: 0.75rem;
  color: #ff5577;
  max-width: 420px;
  line-height: 1.5;
}
.webgl-error {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 200;
  background: #3d0a18;
  color: #ffd7de;
  font-family: var(--font-cyber);
  font-size: 0.8rem;
  padding: 12px 16px;
  text-align: center;
}

/* Visible keyboard focus on every interactive element */
.btn:focus-visible,
.tab-btn:focus-visible,
.powerup-btn:focus-visible,
.share-btn:focus-visible,
a.share-btn:focus-visible,
.sound-toggle-btn:focus-visible,
.carousel-nav-btn:focus-visible,
.carousel-play-btn:focus-visible,
.TEMPLATE-4weird-fullscreen-btn:focus-visible,
.mobile-keyboard-trigger:focus-visible,
.game-speed-trigger:focus-visible,
.btn-buy:focus-visible,
.btn-equip:focus-visible,
input[type="range"]:focus-visible,
input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

/* 44px minimum touch targets on coarse pointers */
@media (pointer: coarse) {
  .btn-diff, .btn-level { min-height: 44px; }
  .powerup-btn { min-height: 44px; }
  .share-btn { min-height: 44px; }
  .tab-btn { min-height: 44px; }
}

/* HUD wraps instead of overflowing on narrow screens */
@media (max-width: 700px) {
  #game-hud { flex-wrap: wrap; gap: 8px; }
  .hud-item { padding: 6px 10px; }
  .hud-value { font-size: 1rem; }
  #boss-bar { top: 104px; width: min(86%, 420px); }
}

/* Notch / gesture safe-area for floating controls */
.TEMPLATE-4weird-fullscreen-btn {
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: calc(10px + env(safe-area-inset-right, 0px));
}
.mobile-keyboard-trigger {
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
#powerup-bar { bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 600px) {
  #powerup-bar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* Cheaper vignette compositing */
#damage-vignette { will-change: opacity; }
#wave-banner, #kill-announce { will-change: opacity, transform; }

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  #wave-banner .wave-banner-title,
  #wave-banner.boss .wave-banner-title,
  #newbest-badge,
  .TEMPLATE-4weird-game-title,
  .TEMPLATE-4weird-game-status.live,
  .spinner {
    animation: none;
  }
  .carousel-track { transition: none; }
  .btn-primary:hover { transform: none; }
  .carousel-card:hover { transform: none; }
}

/* Health bar states by integrity level */
#health-bar-fill.hp-high { background: linear-gradient(90deg, #00ff66, #00cc88); box-shadow: 0 0 10px rgba(0, 255, 102, 0.5); }
#health-bar-fill.hp-mid { background: linear-gradient(90deg, #fcf003, #ff9100); box-shadow: var(--glow-yellow); }
#health-bar-fill.hp-low {
  background: linear-gradient(90deg, var(--neon-magenta), #ff5500);
  box-shadow: var(--glow-magenta);
  animation: bossFlash 0.5s ease infinite alternate;
}

/* Keep tall overlays scrollable without chaining the page behind */
.TEMPLATE-4weird-game-overlay { overscroll-behavior: contain; }

/* ===== 21. BREAKPOINT SWEEP: 1280 / 768 / 360 + short landscape ===== */

/* Maker bio helpers (populated from game.json; empty until then) */
.TEMPLATE-4weird-maker-name:empty { display: none; }
.TEMPLATE-4weird-maker-link:empty { display: none; }
.TEMPLATE-4weird-maker-link {
    font-family: var(--font-cyber);
    font-size: 0.8rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

/* 1280px: tighten the two-column shell before the 900px collapse */
@media (max-width: 1100px) {
    .TEMPLATE-4weird-game-main {
        gap: 16px;
        padding: 16px;
    }
}

/* 768px: roomier wrapped HUD, scaled banner text, wrapping selectors */
@media (max-width: 768px) {
    #game-hud {
        flex-wrap: wrap;
        gap: 8px;
    }
    .hud-item {
        flex: 1 1 140px;
        min-width: 0;
        padding: 6px 10px;
    }
    .hud-value { font-size: 1rem; }
    .hud-types-legend { overflow-wrap: break-word; }
    #boss-bar { top: 110px; width: min(86%, 420px); }
    .TEMPLATE-4weird-overlay-content { width: 92%; }
    .TEMPLATE-4weird-overlay-content h2 { font-size: 1.6rem; }
    .difficulty-options, .level-options { flex-wrap: wrap; }
}

/* 360px: compact overlays, stacked floating triggers so the powerup bar,
   the keyboard/speed triggers, and the fullscreen button never collide */
@media (max-width: 400px) {
    .TEMPLATE-4weird-game-main { padding: 10px; }
    .TEMPLATE-4weird-overlay-content { padding: 18px 14px; width: 94%; }
    .TEMPLATE-4weird-overlay-content h2 { font-size: 1.35rem; letter-spacing: 1px; }
    .TEMPLATE-4weird-final-score { font-size: 1.15rem; }
    #game-hud { top: 8px; left: 8px; right: 8px; gap: 6px; }
    .hud-item { flex: 1 1 100%; padding: 5px 8px; }
    .hud-integrity-container { width: 100%; }
    /* Lift the centered powerup pills above the corner triggers */
    #powerup-bar {
        bottom: calc(112px + env(safe-area-inset-bottom, 0px));
        gap: 6px;
        max-width: calc(100% - 16px);
        flex-wrap: wrap;
        justify-content: center;
    }
    .powerup-btn { padding: 6px 10px; font-size: 0.7rem; }
    /* Corner triggers sit above the fullscreen button, split left/right */
    .mobile-keyboard-trigger {
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        right: 12px;
        padding: 10px 14px;
        font-size: 0.75rem;
    }
    .game-speed-trigger {
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        padding: 10px 14px;
        font-size: 0.7rem;
    }
    .TEMPLATE-4weird-fullscreen-btn { padding: 6px 8px; font-size: 0.65rem; }
    #wave-banner .wave-banner-title { font-size: 1.6rem; letter-spacing: 2px; }
    #kill-announce { font-size: 1rem; letter-spacing: 2px; }
    .gameover-stats { grid-template-columns: repeat(2, 1fr); }
    .store-grid { max-height: 180px; }
    .share-buttons { flex-direction: column; }
}

/* Short landscape phones: keep overlays usable when height is the constraint */
@media (max-height: 500px) {
    .TEMPLATE-4weird-overlay-content { padding: 16px; gap: 8px; }
    .TEMPLATE-4weird-overlay-content h2 { font-size: 1.3rem; margin-bottom: 8px; }
    .TEMPLATE-4weird-overlay-content p { margin-bottom: 12px; }
    .TEMPLATE-4weird-controls-hint { margin-top: 12px; padding: 10px; }
}
