/* ==========================================================================
   CouplePlay — Game UI Components
   ========================================================================== */

/* ---------- Games Dashboard ---------- */
.games-dashboard {
    padding: var(--space-2xl) 0;
}

.games-filters {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    padding-left: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--fs-base);
    transition: var(--transition-base);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 79, 129, 0.1);
}

.search-bar i {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.category-filters {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.category-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ---------- Game Page Layout ---------- */
.game-page {
    padding: var(--space-xl) 0;
    max-width: 900px;
    margin: 0 auto;
}

.game-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.game-header h1 {
    font-size: var(--fs-2xl);
    margin-bottom: var(--space-xs);
}

.game-header p {
    color: var(--text-secondary);
}

.game-back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-lg);
    transition: var(--transition-base);
}

.game-back-btn:hover {
    color: var(--primary);
}

/* ---------- Scoreboard ---------- */
.scoreboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.scoreboard-player {
    text-align: center;
    flex: 1;
}

.scoreboard-player.active {
    position: relative;
}

.scoreboard-player.active::after {
    content: '▼';
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--primary);
    font-size: var(--fs-sm);
    animation: bounce 1s ease infinite;
}

.scoreboard-name {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.scoreboard-score {
    font-size: var(--fs-2xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scoreboard-divider {
    font-size: var(--fs-xl);
    color: var(--text-muted);
    font-weight: 300;
}

/* ---------- Game Board Container ---------- */
.game-board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

/* ---------- Game Controls ---------- */
.game-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

/* ---------- Game Status ---------- */
.game-status {
    text-align: center;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--fs-md);
    font-weight: 600;
    min-width: 200px;
}

/* ---------- Timer ---------- */
.game-timer {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--fs-lg);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.game-timer i {
    color: var(--primary);
}

.game-timer.warning {
    color: var(--warning);
    border-color: var(--warning);
}

.game-timer.danger {
    color: var(--danger);
    border-color: var(--danger);
    animation: pulse 0.5s ease infinite;
}

/* ---------- Move Counter ---------- */
.move-counter {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

/* ---------- Tic Tac Toe ---------- */
.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 320px;
    height: 320px;
    background: var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
}

.ttt-cell {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-3xl);
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
    user-select: none;
}

.ttt-cell:hover:not(.taken) {
    background: var(--bg-tertiary);
}

.ttt-cell.taken {
    cursor: default;
}

.ttt-cell.x {
    color: var(--primary);
}

.ttt-cell.o {
    color: var(--secondary);
}

.ttt-cell.winner {
    background: rgba(255, 79, 129, 0.15);
    animation: pulseGlow 1s ease infinite;
}

.ttt-cell .mark {
    animation: scaleInBounce 0.3s ease;
}

/* Winning line overlay */
.ttt-win-line {
    position: absolute;
    background: var(--gradient-primary);
    border-radius: 4px;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

/* ---------- RPS (Rock Paper Scissors) ---------- */
.rps-arena {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3xl);
    padding: var(--space-2xl);
}

.rps-player {
    text-align: center;
}

.rps-choice-display {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 3.5rem;
    margin-bottom: var(--space-md);
    transition: var(--transition-base);
}

.rps-choice-display.selected {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.rps-vs {
    font-size: var(--fs-2xl);
    font-weight: 800;
    color: var(--text-muted);
}

.rps-choices {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    margin-top: var(--space-xl);
}

.rps-choice-btn {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 2.2rem;
    cursor: pointer;
    transition: var(--transition-bounce);
}

.rps-choice-btn:hover {
    transform: scale(1.15);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.rps-choice-btn.selected {
    background: var(--gradient-primary);
    border-color: transparent;
    transform: scale(1.1);
}

.rps-mode-selector {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-xl);
}

/* ---------- Memory Game ---------- */
.memory-board {
    display: grid;
    gap: 12px;
    justify-content: center;
}

.memory-board.size-4x4 {
    grid-template-columns: repeat(4, 80px);
}

.memory-board.size-6x4 {
    grid-template-columns: repeat(6, 70px);
}

.memory-card {
    width: 100%;
    aspect-ratio: 1;
    perspective: 600px;
    cursor: pointer;
}

.memory-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 2rem;
}

.memory-card-front {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--primary);
}

.memory-card-front i {
    transition: var(--transition-base);
}

.memory-card:hover .memory-card-front i {
    transform: scale(1.2);
}

.memory-card-back {
    background: var(--gradient-primary);
    transform: rotateY(180deg);
}

.memory-card.matched {
    opacity: 0.7;
    pointer-events: none;
}

.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
    animation: pop 0.3s ease;
}

/* ---------- Connect Four ---------- */
.c4-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    background: var(--secondary);
    padding: 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.c4-cell {
    width: 56px;
    height: 56px;
    background: var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
}

.c4-cell:hover {
    background: var(--bg-secondary);
}

.c4-cell.player1 {
    background: var(--primary);
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.3);
}

.c4-cell.player2 {
    background: var(--accent);
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.3);
}

.c4-cell.winner-cell {
    animation: pulseGlow 1s ease infinite;
}

.c4-cell.drop-animation {
    animation: dropIn 0.4s cubic-bezier(0.2, 0, 0.38, 0.9);
}

@keyframes dropIn {
    0% { transform: translateY(-400px); }
    60% { transform: translateY(10px); }
    80% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

/* ---------- Truth or Dare ---------- */
.tod-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.tod-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    margin-bottom: var(--space-xl);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.tod-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.tod-card.truth::before { background: var(--gradient-primary); }
.tod-card.dare::before { background: var(--gradient-secondary); }

.tod-type {
    font-size: var(--fs-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-lg);
}

.tod-type.truth { color: var(--primary); }
.tod-type.dare { color: var(--secondary); }

.tod-question {
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    animation: fadeInUp 0.3s ease;
}

.tod-category {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tod-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.tod-btn-truth {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-md) var(--space-2xl);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--fs-md);
    transition: var(--transition-base);
    cursor: pointer;
}

.tod-btn-dare {
    background: var(--gradient-secondary);
    color: white;
    padding: var(--space-md) var(--space-2xl);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--fs-md);
    transition: var(--transition-base);
    cursor: pointer;
}

.tod-btn-truth:hover, .tod-btn-dare:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.tod-category-filters {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
}

/* ---------- Would You Rather ---------- */
.wyr-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.wyr-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.wyr-option {
    padding: var(--space-2xl);
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
}

.wyr-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wyr-option.selected {
    background: rgba(255, 79, 129, 0.1);
}

.wyr-option-text {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.wyr-divider {
    padding: var(--space-md);
    background: var(--bg-secondary);
    font-weight: 800;
    font-size: var(--fs-lg);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Spin The Wheel ---------- */
.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.wheel-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
}

.wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 79, 129, 0.3);
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--primary);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    z-index: 2;
}

.wheel-result {
    font-size: var(--fs-xl);
    font-weight: 700;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Hangman ---------- */
.hangman-container {
    text-align: center;
}

.hangman-figure {
    width: 200px;
    height: 240px;
    margin: 0 auto var(--space-xl);
    position: relative;
}

.hangman-word {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.hangman-letter {
    width: 40px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid var(--text-secondary);
    font-size: var(--fs-xl);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
}

.hangman-letter.revealed {
    animation: bounceIn 0.3s ease;
    color: var(--primary);
}

.hangman-keyboard {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

.hangman-key {
    width: 40px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    text-transform: uppercase;
}

.hangman-key:hover:not(.used) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.hangman-key.correct {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
    border-color: var(--success);
    cursor: default;
}

.hangman-key.wrong {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
    border-color: var(--danger);
    cursor: default;
    opacity: 0.5;
}

/* ---------- Emoji Guess ---------- */
.emoji-display {
    font-size: 4rem;
    text-align: center;
    padding: var(--space-2xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
    letter-spacing: 10px;
}

.emoji-input {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.emoji-input input {
    flex: 1;
    max-width: 400px;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--fs-base);
}

.emoji-input input:focus {
    border-color: var(--primary);
}

/* ---------- Love Quiz ---------- */
.quiz-container {
    max-width: 650px;
    margin: 0 auto;
}

.quiz-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    margin-bottom: var(--space-xl);
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.quiz-question {
    font-size: var(--fs-lg);
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.quiz-option {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    font-size: var(--fs-base);
    text-align: left;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: rgba(255, 79, 129, 0.05);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(255, 79, 129, 0.1);
}

.quiz-option.correct {
    border-color: var(--success);
    background: rgba(46, 204, 113, 0.1);
}

.quiz-option.wrong {
    border-color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

/* ---------- Compatibility Meter ---------- */
.compatibility-meter {
    text-align: center;
    padding: var(--space-2xl);
}

.meter-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-xl);
    position: relative;
}

.meter-circle::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--bg-primary);
}

.meter-value {
    position: relative;
    z-index: 1;
    font-size: var(--fs-3xl);
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Drawing Canvas ---------- */
.drawing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.drawing-canvas-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.drawing-canvas {
    display: block;
    cursor: crosshair;
}

.drawing-tools {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
}

.color-picker-wrapper {
    display: flex;
    gap: var(--space-sm);
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-base);
}

.color-swatch:hover,
.color-swatch.active {
    border-color: white;
    transform: scale(1.2);
}

.brush-size-slider {
    width: 120px;
    -webkit-appearance: none;
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    outline: none;
}

.brush-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

/* ---------- Chess Board ---------- */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.chess-cell {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.chess-cell.light { background: #E8D5B5; }
.chess-cell.dark { background: #B58863; }

.chess-cell.selected {
    background: rgba(255, 79, 129, 0.5) !important;
}

.chess-cell.valid-move::after {
    content: '';
    width: 14px;
    height: 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
}

.chess-cell.in-check {
    background: rgba(231, 76, 60, 0.6) !important;
}

/* ---------- Checkers Board ---------- */
.checkers-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.checkers-cell {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.checkers-cell.light { background: #F5E6CA; }
.checkers-cell.dark { background: #6B8E4E; }

.checkers-piece {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    position: relative;
    transition: var(--transition-base);
}

.checkers-piece.red {
    background: radial-gradient(circle at 30% 30%, #FF6B6B, #C0392B);
}

.checkers-piece.black {
    background: radial-gradient(circle at 30% 30%, #555, #222);
}

.checkers-piece.king::after {
    content: '♛';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: gold;
}

.checkers-cell.valid-move {
    position: relative;
}

.checkers-cell.valid-move::after {
    content: '';
    width: 16px;
    height: 16px;
    background: rgba(255, 215, 0, 0.5);
    border-radius: 50%;
}

.checkers-cell.selected .checkers-piece {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    transform: scale(1.1);
}

/* ---------- Coin Toss ---------- */
.coin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.coin {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease;
    cursor: pointer;
}

.coin.flipping {
    animation: coinFlip 1s ease;
}

@keyframes coinFlip {
    0% { transform: rotateY(0); }
    100% { transform: rotateY(1800deg); }
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-2xl);
    font-weight: 800;
    backface-visibility: hidden;
    box-shadow: var(--shadow-md);
}

.coin-heads {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #8B6914;
}

.coin-tails {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: #333;
    transform: rotateY(180deg);
}

/* ---------- Dice ---------- */
.dice-container {
    display: flex;
    gap: var(--space-xl);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.dice {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: var(--radius-md);
    display: grid;
    padding: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    position: relative;
}

.dice.rolling {
    animation: diceRoll 0.6s ease;
}

@keyframes diceRoll {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(0.8); }
    50% { transform: rotate(180deg) scale(1.1); }
    75% { transform: rotate(270deg) scale(0.9); }
    100% { transform: rotate(360deg) scale(1); }
}

.dice-dot {
    width: 12px;
    height: 12px;
    background: #333;
    border-radius: 50%;
}

/* ---------- Never Have I Ever ---------- */
.nhie-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.nhie-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.nhie-prefix {
    font-size: var(--fs-sm);
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-lg);
}

.nhie-statement {
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    animation: fadeInUp 0.3s ease;
}

.nhie-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.nhie-btn {
    padding: var(--space-md) var(--space-2xl);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--fs-md);
    cursor: pointer;
    transition: var(--transition-base);
}

.nhie-btn-did {
    background: var(--primary);
    color: white;
}

.nhie-btn-didnt {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.nhie-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ---------- Sliding Puzzle ---------- */
.sliding-puzzle-board {
    display: grid;
    gap: 4px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.sliding-puzzle-board.size-3 { grid-template-columns: repeat(3, 80px); }
.sliding-puzzle-board.size-4 { grid-template-columns: repeat(4, 70px); }
.sliding-puzzle-board.size-5 { grid-template-columns: repeat(5, 60px); }

.puzzle-tile {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    font-size: var(--fs-xl);
    font-weight: 800;
    color: white;
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}

.puzzle-tile:hover {
    transform: scale(0.95);
}

.puzzle-tile.empty {
    background: transparent;
    cursor: default;
}

.puzzle-tile.empty:hover {
    transform: none;
}

/* ---------- Secret Message ---------- */
.secret-message-container {
    max-width: 600px;
    margin: 0 auto;
}

.secret-textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--fs-base);
    resize: vertical;
    margin-bottom: var(--space-md);
}

.secret-textarea:focus {
    border-color: var(--primary);
}

.secret-output {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 80px;
    word-break: break-all;
    font-family: monospace;
    color: var(--primary);
}

/* ---------- Statistics Page ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.stat-chart {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.stat-chart h3 {
    font-size: var(--fs-md);
    margin-bottom: var(--space-lg);
}

/* CSS-only bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 150px;
    padding-top: var(--space-md);
}

.bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: var(--gradient-primary);
    min-height: 4px;
    transition: height 0.5s ease;
    position: relative;
}

.bar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

/* CSS-only donut chart */
.donut-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-chart::before {
    content: '';
    position: absolute;
    inset: 15px;
    border-radius: 50%;
    background: var(--bg-card);
}

.donut-value {
    position: relative;
    z-index: 1;
    font-size: var(--fs-lg);
    font-weight: 700;
}

/* ---------- Achievements Page ---------- */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.achievement-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.achievement-card.unlocked {
    border-color: rgba(255, 215, 0, 0.3);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.achievement-card:hover {
    transform: translateY(-4px);
}

.achievement-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--fs-xl);
}

.achievement-card.unlocked .achievement-icon {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent);
}

.achievement-card.locked .achievement-icon {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.achievement-name {
    font-size: var(--fs-base);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.achievement-desc {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

.achievement-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: var(--space-md);
    overflow: hidden;
}

.achievement-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ---------- Settings Page ---------- */
.settings-list {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.settings-item-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.settings-item-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: var(--fs-lg);
    color: var(--primary);
}

.settings-item-text h4 {
    font-size: var(--fs-base);
    font-weight: 600;
}

.settings-item-text p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    width: 52px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transition: var(--transition-base);
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-base);
}

.toggle-switch.active::after {
    left: 27px;
}

/* ---------- Responsive Game Styles ---------- */
@media (max-width: 768px) {
    .ttt-board { width: 260px; height: 260px; }
    .ttt-cell { font-size: var(--fs-2xl); }
    .rps-arena { gap: var(--space-xl); flex-direction: column; }
    .rps-choice-display { width: 90px; height: 90px; font-size: 2.5rem; }
    .rps-choice-btn { width: 65px; height: 65px; font-size: 1.8rem; }
    .c4-cell { width: 42px; height: 42px; }
    .chess-cell { width: 42px; height: 42px; font-size: 1.5rem; }
    .checkers-cell { width: 42px; height: 42px; }
    .checkers-piece { width: 32px; height: 32px; }
    .memory-board.size-4x4 { grid-template-columns: repeat(4, 65px); }
    .memory-board.size-6x4 { grid-template-columns: repeat(4, 65px); }
    .hangman-key { width: 34px; height: 38px; font-size: var(--fs-sm); }
    .wheel-wrapper { width: 280px; height: 280px; }
    .scoreboard { gap: var(--space-lg); }
    .game-page { padding: var(--space-md) 0; }
}

@media (max-width: 480px) {
    .ttt-board { width: 240px; height: 240px; }
    .c4-cell { width: 36px; height: 36px; }
    .chess-cell { width: 36px; height: 36px; font-size: 1.2rem; }
    .checkers-cell { width: 36px; height: 36px; }
    .memory-board.size-4x4 { grid-template-columns: repeat(4, 55px); }
    .wheel-wrapper { width: 240px; height: 240px; }
    .drawing-canvas-wrapper { width: 100%; }
    .emoji-display { font-size: 2.5rem; letter-spacing: 5px; }
}

/* ---------- Multiplayer Lobby & Status Styles ---------- */
.multiplayer-lobby-overlay {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.multiplayer-lobby-overlay h2 {
    color: var(--primary);
}

.multiplayer-lobby-overlay input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 79, 129, 0.15);
}

.animate-spin {
    animation: cp_spin 2s linear infinite;
}

@keyframes cp_spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
