* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d1329;
    --bg-secondary: #1a2140;
    --bg-card: #252b4a;
    --accent-cyan: #06b6d4;
    --accent-cyan-dark: #0891b2;
    --onboarding-accent: var(--accent-cyan);
    --onboarding-accent-dark: var(--accent-cyan-dark);
    --onboarding-shadow: rgba(6, 182, 212, 0.3);
    --onboarding-shadow-hover: rgba(6, 182, 212, 0.4);
    --accent-pink: #ff3b6f;
    --accent-pink-dark: #cc2f59;
    --accent-blue: #4a6cf7;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --text-placeholder: #5a6380;
    --success: #4ade80;
    --error: #f87171;
    --settings-accent: var(--accent-cyan);
    --settings-accent-dark: var(--accent-cyan-dark);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, #0a0f1f 100%);
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
    color: var(--text-primary);
    overflow-x: hidden;
}

.app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
    position: relative;
}

.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
    padding: 40px 24px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
}

/* ===== Back Button ===== */
.btn-back {
    position: absolute;
    top: calc(40px + env(safe-area-inset-top, 0px));
    left: 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
}

/* ===== Mode Selection Screen ===== */
.mode-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.mode-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 28px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
}

@media (hover: hover) {
    .mode-card:hover {
        transform: translateY(-3px);
        border-color: var(--accent-cyan);
        box-shadow: 0 8px 30px rgba(6, 182, 212, 0.2);
    }
}

.mode-card:active {
    transform: scale(0.98);
}

.mode-card-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.mode-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mode-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Add Player / Add Team buttons — now use shared .ps-add-btn from player-setup.css */

/* ===== Players List ===== */
/* Player items now use shared .ps-entry styles from player-setup.css */
.players-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* ===== Teams List ===== */
/* Team items now use shared .ps-entry styles from player-setup.css */
.teams-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* ===== Settings Row (Timer) ===== */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 10px;
}

.settings-label {
    color: var(--text-secondary);
    font-size: 16px;
}

.time-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.time-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-cyan);
    background: transparent;
    color: var(--accent-cyan);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) {
    .time-btn:hover {
        background: var(--accent-cyan);
        color: white;
    }
}

.time-btn:active {
    transform: scale(0.95);
}

.time-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 40px;
    text-align: center;
}

/* ===== Bottom Section ===== */
.bottom-section {
    padding: 20px 0;
    margin-top: auto;
}

/* ===== Toggle ===== */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 12px;
}

.toggle {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Play Button ===== */
.btn-play {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-cyan-dark) 100%);
    border: none;
    color: white;
    padding: 18px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

@media (hover: hover) {
    .btn-play:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 25px rgba(6, 182, 212, 0.4);
    }
}

.btn-play:active {
    transform: translateY(0);
}

.btn-play:disabled {
    background: var(--bg-card);
    box-shadow: none;
    cursor: not-allowed;
}

.play-icon {
    font-size: 20px;
}

/* ===== Packs Screen ===== */
.subtitle {
    text-align: center;
    color: var(--accent-cyan);
    font-size: 18px;
    margin-bottom: 30px;
}

.packs-container {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.packs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.pack-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

@media (hover: hover) {
    .pack-card:hover {
        transform: translateY(-2px);
        border-color: var(--accent-cyan);
    }
}

.pack-card:active {
    transform: scale(0.97);
}

.pack-card.selected {
    border-color: var(--accent-cyan);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(74, 108, 247, 0.15) 100%);
}

.pack-card.selected .pack-icon {
    transform: scale(1.1);
}

.pack-icon {
    font-size: 36px;
    transition: transform 0.3s ease;
}

.pack-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.pack-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.pack-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 22px;
    height: 22px;
    background: var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: 700;
}

.packs-summary {
    text-align: center;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 12px;
}

.summary-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.summary-text strong {
    color: var(--accent-cyan);
    font-size: 18px;
}

/* ===== Ready Screen ===== */
#ready-screen {
    align-items: center;
    justify-content: center;
}

.ready-info {
    text-align: center;
    margin-bottom: 40px;
}

.drawer-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 8px;
}

.ready-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.ready-hint {
    font-size: 16px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.turn-words-left {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 20px;
}

.turn-words-left strong {
    color: var(--accent-cyan);
    font-size: 24px;
}

/* ===== Turn Screen (Team mode) ===== */
#turn-screen {
    align-items: center;
    justify-content: center;
}

.team-turn-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 250px;
}

.team-turn-name {
    font-size: 32px;
    font-weight: 700;
}

/* ===== Word Display Screen ===== */
#word-screen {
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.word-timer-display {
    background: var(--bg-card);
    padding: 8px 20px;
    border-radius: 20px;
    text-align: center;
}

.word-timer-display span {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-cyan);
}

.word-timer-display.warning span {
    color: var(--error);
}

.word-hint-top {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    opacity: 0.8;
}

.word-card-scene {
    perspective: 1000px;
    width: 100%;
    max-width: 320px;
}

.word-flip-card {
    position: relative;
    width: 100%;
    min-height: 160px;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
}

.word-flip-card.flipped {
    transform: rotateY(180deg);
}

.word-flip-card-front,
.word-flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    box-sizing: border-box;
}

.word-flip-card-front {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    gap: 12px;
}

.word-tap-icon {
    font-size: 40px;
}

.word-tap-hint {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
}

.word-flip-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
    box-shadow: 0 8px 32px rgba(255, 59, 111, 0.3);
}

.word-text {
    font-size: 28px;
    font-weight: 600;
}

.word-counter {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.btn-show-canvas {
    width: 100%;
    max-width: 300px;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-cyan-dark) 100%);
    border: none;
    color: white;
    padding: 18px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .btn-show-canvas:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 25px rgba(6, 182, 212, 0.4);
    }
}

.btn-show-canvas:active {
    transform: translateY(0);
}

.btn-show-canvas:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== Canvas Screen ===== */
#canvas-screen {
    padding: 0;
    gap: 0;
    position: relative;
}

#canvas-screen.active {
    animation: slideUpCanvas 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpCanvas {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Canvas Timer Bar */
.canvas-timer-bar {
    position: relative;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-card);
}

.timer-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-cyan-dark) 100%);
    transition: width 1s linear;
    width: 100%;
    z-index: 1;
}

.timer-progress-bar.timer-warning {
    background: linear-gradient(90deg, var(--error) 0%, #dc2626 100%);
}

.timer-bar-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 12px;
}

.timer-seconds {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-cyan);
    min-width: 30px;
}

.timer-seconds.warning {
    color: var(--error);
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.canvas-current-word {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
    text-align: center;
}

.canvas-toolbar {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-card);
    gap: 8px;
}

.toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.color-palette {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    padding: 0;
}

.color-btn.active {
    border-color: var(--accent-cyan);
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.toolbar-tools {
    display: flex;
    gap: 6px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

@media (hover: hover) {
    .tool-btn:hover {
        background: var(--bg-primary);
    }
}

.tool-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.brush-sizes {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brush-size-btn {
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.brush-size-btn.small {
    width: 28px;
    height: 28px;
}

.brush-size-btn.medium {
    width: 32px;
    height: 32px;
}

.brush-size-btn.large {
    width: 38px;
    height: 38px;
}

.brush-size-btn.active {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15);
}

.brush-dot {
    display: block;
    border-radius: 50%;
    background: var(--text-primary);
}

.brush-size-btn.small .brush-dot {
    width: 4px;
    height: 4px;
}

.brush-size-btn.medium .brush-dot {
    width: 8px;
    height: 8px;
}

.brush-size-btn.large .brush-dot {
    width: 14px;
    height: 14px;
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #1a1a2e;
}

#drawing-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

.canvas-actions {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
}

.btn-guessed {
    flex: 2;
    background: var(--success);
    border: none;
    color: #1a1a1a;
    padding: 16px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .btn-guessed:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
    }
}

.btn-guessed:active {
    transform: translateY(0);
}

.btn-skip-word {
    flex: 1;
    background: var(--bg-card);
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 16px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .btn-skip-word:hover {
        border-color: var(--error);
        color: var(--error);
    }
}

/* ===== Round Results ===== */
.round-drawer-label {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 10px;
}

.round-drawer-label:empty {
    display: none;
}

.round-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 30px 0;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-cyan);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.guessed-words {
    flex: 1;
    overflow-y: auto;
    margin: 20px 0;
}

.guessed-word-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 8px;
}

.guessed-word-item.correct {
    border-left: 3px solid var(--success);
}

.guessed-word-item.skipped {
    border-left: 3px solid var(--error);
}

.word-status {
    font-size: 18px;
}

.words-remaining-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
}

.words-remaining-info strong {
    color: var(--accent-cyan);
    font-size: 18px;
}

/* ===== Scoreboard (Team mode) ===== */
.scoreboard {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    margin: 16px 0;
}

.scoreboard-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.scoreboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.score-item.leading {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
    border: 1px solid var(--accent-cyan);
}

.score-team-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.score-team-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
}

.score-points {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-cyan);
}

/* ===== Final Results ===== */
.winner-icon {
    font-size: 80px;
    text-align: center;
    margin-bottom: 10px;
}

.winner-name {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: var(--accent-cyan);
    margin-bottom: 30px;
}

.winner-name:empty {
    display: none;
}

.final-results {
    flex: 1;
    overflow-y: auto;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 12px;
}

.result-position {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 16px;
}

.result-position.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #1a1a1a;
}

.result-position.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: #1a1a1a;
}

.result-position.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #a05a20 100%);
    color: #1a1a1a;
}

.result-position.other {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.result-name {
    flex: 1;
    font-size: 18px;
}

.result-score {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-cyan);
}

.result-team-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}


/* ===== Pause Button & Overlay ===== */
.btn-pause {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (hover: hover) {
    .btn-pause:hover {
        background: rgba(255, 255, 255, 0.2);
        color: var(--text-primary);
    }
}

.pause-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 19, 41, 0.95);
    z-index: 50;
    align-items: center;
    justify-content: center;
}

.pause-overlay.active {
    display: flex;
    cursor: pointer;
}

.pause-overlay-text {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-secondary);
}

.btn-guessed:disabled,
.btn-skip-word:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 480px) {
    .app {
        max-width: 100%;
    }

    .screen {
        padding: 20px 12px;
        padding-top: calc(20px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    #canvas-screen {
        padding: 0;
    }

    .title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .mode-card {
        padding: 22px 20px;
    }

    .mode-card-icon {
        font-size: 40px;
        margin-bottom: 8px;
    }

    .mode-card-title {
        font-size: 18px;
    }

    .mode-card-desc {
        font-size: 13px;
    }

    .settings-row {
        padding: 0 4px;
    }

    .settings-label {
        font-size: 14px;
    }

    .time-value {
        font-size: 20px;
    }

    .time-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .subtitle {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .packs-grid {
        gap: 10px;
    }

    .pack-card {
        padding: 16px 12px;
        border-radius: 12px;
    }

    .pack-icon {
        font-size: 30px;
    }

    .pack-name {
        font-size: 13px;
    }

    .pack-count {
        font-size: 11px;
    }

    .pack-check {
        width: 20px;
        height: 20px;
        font-size: 10px;
        top: 6px;
        left: 6px;
    }

    .packs-summary {
        padding: 10px;
    }

    .summary-text {
        font-size: 13px;
    }

    .summary-text strong {
        font-size: 16px;
    }

    .word-reveal-card {
        padding: 30px 20px;
        min-width: auto;
        margin: 0 10px;
    }

    .word-text {
        font-size: 22px;
    }

    .btn-show-canvas {
        font-size: 16px;
        padding: 16px;
    }

    .color-btn {
        width: 24px;
        height: 24px;
    }

    .tool-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .brush-size-btn.small { width: 26px; height: 26px; }
    .brush-size-btn.medium { width: 30px; height: 30px; }
    .brush-size-btn.large { width: 34px; height: 34px; }

    .canvas-actions {
        padding: 10px;
        gap: 8px;
    }

    .btn-guessed, .btn-skip-word {
        padding: 14px;
        font-size: 14px;
    }

    .round-stats {
        gap: 30px;
        margin: 20px 0;
    }

    .stat-value {
        font-size: 40px;
    }

    .stat-label {
        font-size: 12px;
    }

    .result-item {
        padding: 12px;
        margin-bottom: 10px;
    }

    .result-position {
        width: 36px;
        height: 36px;
        font-size: 13px;
        margin-right: 12px;
    }

    .result-name {
        font-size: 16px;
    }

    .result-score {
        font-size: 18px;
    }

    .toggle-label {
        font-size: 13px;
    }

    .btn-play {
        padding: 16px;
        font-size: 16px;
    }

    .drawer-name {
        font-size: 26px;
    }

    .team-turn-card {
        padding: 30px 20px;
        min-width: auto;
    }

    .team-turn-name {
        font-size: 26px;
    }

    .winner-icon {
        font-size: 60px;
    }

    .winner-name {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .scoreboard {
        padding: 16px;
    }

    .score-item {
        padding: 10px 12px;
    }

    .score-points {
        font-size: 20px;
    }
}

/* ===== Responsive Height ===== */
@media (max-height: 700px) {
    .screen {
        padding: 20px;
    }

    #canvas-screen {
        padding: 0;
    }

    .title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .word-reveal-card {
        padding: 30px 40px;
    }

    .word-text {
        font-size: 24px;
    }

    .canvas-toolbar {
        padding: 6px 10px;
        gap: 4px;
    }

    .canvas-timer-bar .timer-bar-content {
        padding: 6px 10px;
    }
}

/* ===== Tablet and larger ===== */
@media (min-width: 768px) {
    .app {
        max-width: 100%;
    }

    .screen {
        padding: 50px 40px;
    }

    #canvas-screen {
        padding: 0;
    }

    .title {
        font-size: 32px;
        margin-bottom: 40px;
    }

    .word-reveal-card {
        padding: 50px 80px;
        min-width: 400px;
    }

    .word-text {
        font-size: 36px;
    }

    .packs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .pack-card {
        padding: 24px 20px;
    }

    .pack-icon {
        font-size: 42px;
    }

    .pack-name {
        font-size: 16px;
    }

    .pack-count {
        font-size: 13px;
    }

    .color-btn {
        width: 32px;
        height: 32px;
    }

    .tool-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .btn-guessed, .btn-skip-word {
        padding: 18px;
        font-size: 18px;
    }

    .mode-cards {
        max-width: 500px;
    }

    .mode-card {
        padding: 36px 32px;
    }

    .mode-card-icon {
        font-size: 56px;
    }

    .mode-card-title {
        font-size: 24px;
    }

    .mode-card-desc {
        font-size: 16px;
    }
}
