/* ===== GAME FRAMEWORK - Shared Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Game page base */
.game-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    min-height: calc(100vh - 120px);
}

/* Header */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.game-header h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    flex: 1;
    text-align: center;
}

.game-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-back:hover { border-color: var(--accent); color: var(--text); }

/* Desktop layout */
.game-layout-desktop {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
    max-width: 800px;
}

.game-board-wrap {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border);
    box-shadow: 0 0 25px rgba(96, 165, 250, 0.1);
    animation: gameGlow 2s ease-in-out infinite alternate;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes gameGlow {
    from { box-shadow: 0 0 15px rgba(96, 165, 250, 0.1); }
    to { box-shadow: 0 0 30px rgba(96, 165, 250, 0.18); }
}

.game-board-wrap canvas {
    display: block;
    background: #0a0a1a;
}

/* Side panel (next, hold, info) */
.game-side-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 120px;
    flex-shrink: 0;
}

.game-panel-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
}

.game-panel-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}

.game-panel-box canvas {
    display: block;
    margin: 0 auto;
}

/* Score bar */
.game-score-bar {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 800px;
    flex-shrink: 0;
    padding: 0.5rem 0;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}

.game-stat { text-align: center; }

.game-stat-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.4rem;
    color: var(--text-dim);
    margin-bottom: 0.15rem;
}

.game-stat-value {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
    color: var(--accent);
}

/* Keyboard hint (desktop only) */
.game-keyboard-hint {
    margin-top: 1rem;
    text-align: center;
}

.game-keyboard-hint p {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}

.game-key {
    display: inline-block;
    padding: 0.18rem 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.4rem;
    margin: 0 0.15rem;
}

/* Mobile layout */
.game-layout-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
}

.game-layout-mobile .game-board-wrap {
    width: 100%;
    aspect-ratio: auto;
}

/* Mobile info bar */
.game-mobile-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0.3rem 0;
    flex-shrink: 0;
}

.game-mobile-next {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Hide/show based on device */
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .game-keyboard-hint { display: none !important; }
}

@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}

/* Body lock during gameplay */
body.game-playing {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}
