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

html {
    background-color: #0a0a0a;
    min-height: 100%;
}

:root {
    --dark-bg: #0a0a0a;
    --app-gradient: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    --dark-card: #1a1a1a;
    --dark-surface: #252525;
    --dark-border: #333333;
    --accent-primary: #ff6b35;
    --accent-secondary: #4ecdc4;
    --accent-success: #95e1d3;
    --accent-warning: #fce38a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0a0a0a;
    background-image: var(--app-gradient);
    color: var(--text-primary);
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Soft glow — static position (moving layer caused black corners on iOS Safari) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(78, 205, 196, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 40% 20%, rgba(149, 225, 211, 0.1) 0%, transparent 55%);
    animation: backgroundGlow 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px;
    padding-top: max(env(safe-area-inset-top), 8px);
    padding-bottom: max(env(safe-area-inset-bottom), 8px);
    padding-left: max(env(safe-area-inset-left), 8px);
    padding-right: max(env(safe-area-inset-right), 8px);
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Screen Management */
.screen {
    display: none;
    height: 100dvh;
    min-height: 100dvh;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background-color: #0a0a0a;
    background-image: var(--app-gradient);
}

/* Fully hide inactive game UI (prevents bleed-through on mobile) */
#game-screen:not(.active) {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

#game-screen:not(.active) * {
    visibility: hidden;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

#game-screen.active {
    display: flex;
}

/* Menu Pages */
.menu-page {
    display: none;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.menu-page.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-in;
}

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

/* Header & Logo */
header,
.app-header {
    text-align: center;
    color: var(--text-primary);
    padding: 8px;
    margin-bottom: 8px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    min-height: 120px;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Logo - default size for settings/players pages - much bigger */
.app-logo {
    max-width: 350px;
    width: auto;
    height: auto;
    max-height: 175px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    animation: gentlePulse 4s ease-in-out infinite;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

/* Logo expanded - 50% of screen on home page (no entrance animation — shows with page) */
.app-logo.logo-expanded {
    max-width: 50vw;
    max-height: 50vh;
    animation: gentlePulse 4s ease-in-out infinite;
}

/* Logo shrunk - large size on other pages */
.app-logo.logo-shrunk {
    max-width: 350px;
    max-height: 175px;
    animation: gentlePulse 4s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); }
    50% { transform: scale(1.02); filter: drop-shadow(0 12px 24px rgba(255, 107, 53, 0.3)); }
}

/* Logo transition animation when page changes */
@keyframes logoShrink {
    from {
        max-width: 50vw;
        max-height: 50vh;
        transform: scale(1);
    }
    to {
        max-width: 350px;
        max-height: 175px;
        transform: scale(1);
    }
}

@keyframes logoExpand {
    from {
        max-width: 350px;
        max-height: 175px;
        transform: scale(1);
    }
    to {
        max-width: 50vw;
        max-height: 50vh;
        transform: scale(1);
    }
}

/* Menu Content */
.menu-content {
    background: var(--dark-card);
    border: 2px solid var(--dark-border);
    border-radius: 12px;
    padding: 12px;
    box-shadow: var(--shadow-card), inset 0 0 15px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    animation: slideUp 0.6s ease-out;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Stats page — hide logo header for more chart/data space */
#main-menu.menu-stats-active header {
    display: none;
}

#main-menu.menu-stats-active .container {
    padding-top: max(env(safe-area-inset-top), 4px);
}

#main-menu.menu-stats-active #stats-page .menu-content {
    padding-top: 8px;
}

/* Stats Page */
#stats-profile-select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--dark-border);
    background: var(--dark-card);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

#stats-profile-select:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.2);
}

#stats-profile-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.3);
}

#stats-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.stats-card {
    background: linear-gradient(135deg, var(--dark-surface) 0%, var(--dark-card) 100%);
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--dark-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.stats-card--empty {
    text-align: center;
    padding: 30px;
}

.stats-profile-name {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--accent-primary);
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
}

.stats-tap-hint {
    margin: 0 0 10px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}

.stats-empty-msg {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-tile {
    background: var(--dark-surface);
    border: 2px solid var(--dark-border);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    font: inherit;
    color: inherit;
}

.stat-tile--wide {
    grid-column: 1 / -1;
}

.stat-tile--primary { border-color: var(--accent-primary); }
.stat-tile--success { border-color: var(--accent-success); }
.stat-tile--warning { border-color: var(--accent-warning); }

.stat-tile--active,
.stat-tile:active {
    transform: scale(0.97);
    box-shadow: 0 0 14px rgba(255, 107, 53, 0.35);
    border-color: var(--accent-primary);
}

.stat-tile-label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-tile-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-tile--warning .stat-tile-value { color: var(--accent-warning); }
.stat-tile--success .stat-tile-value { color: var(--accent-success); }

.stat-detail-panel {
    margin-top: 12px;
    padding: 12px;
    background: var(--dark-surface);
    border: 2px solid var(--accent-primary);
    border-radius: 10px;
}

.stat-detail-title {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-detail-caption {
    margin: 0 0 8px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.stat-detail-canvas {
    width: 100%;
    display: block;
    border-radius: 6px;
}

.stats-throws-block {
    margin-top: 12px;
    padding: 10px;
    background: var(--dark-surface);
    border: 2px solid var(--dark-border);
    border-radius: 8px;
}

.stats-section-title {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.stats-throws-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stats-throw-tag {
    background: var(--dark-card);
    padding: 6px 10px;
    border-radius: 6px;
    border: 2px solid var(--accent-primary);
    font-size: 12px;
    color: var(--text-secondary);
}

.stats-throw-tag strong {
    color: var(--accent-primary);
}

@media (max-width: 480px) {
    #stats-profile-select {
        padding: 8px;
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    #stats-content [style*="font-size: 32px"] {
        font-size: 24px !important;
    }
    
    #stats-content [style*="font-size: 20px"] {
        font-size: 16px !important;
    }
    
    #stats-content [style*="height: 120px"] {
        height: 100px !important;
    }
}

/* Settings Header */
.settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.settings-header .icon-btn {
    flex-shrink: 0;
}

.settings-header h2 {
    margin: 0;
    flex: 1;
    text-align: center;
}

@media (max-width: 480px) {
    .settings-header {
        margin-bottom: 20px;
        gap: 10px;
    }
    
    .settings-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .settings-header h2 {
        font-size: 18px;
    }
}

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

section {
    margin-bottom: 12px;
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    flex-shrink: 0;
}

.player-selection {
    margin-top: 8px;
    clear: both;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }

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

h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
}

h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--accent-secondary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

@media (max-width: 480px) {
    section {
        margin-bottom: 15px;
    }
    
    .player-selection {
        margin-top: 20px;
    }
    
    .game-settings {
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }
}

/* Game Selection */
.game-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.game-btn {
    background: linear-gradient(135deg, var(--dark-surface) 0%, var(--dark-card) 100%);
    color: var(--text-primary);
    border: 3px solid var(--dark-border);
    border-radius: 15px;
    padding: 20px 12px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 100px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

@media (max-width: 480px) {
    .game-buttons {
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .game-btn {
        padding: 8px 4px;
        min-height: 70px;
        border-width: 2px;
        border-radius: 8px;
        gap: 4px;
        width: 100%;
        box-sizing: border-box;
    }
}

.game-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-btn:hover::before,
.game-btn:active::before {
    opacity: 1;
}

.game-btn:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4), var(--shadow-glow);
}

.game-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.game-btn.selected {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #ff8c5a 100%);
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.1);
    animation: selectedPulse 1.5s ease-in-out infinite;
}

@keyframes selectedPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 107, 53, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 0 40px rgba(255, 107, 53, 0.8), inset 0 0 40px rgba(255, 255, 255, 0.2); }
}

.game-icon {
    font-size: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

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

/* Settings */
.game-settings {
    background: var(--dark-surface);
    padding: 10px;
    border-radius: 10px;
    margin-top: 8px;
    margin-bottom: 8px;
    border: 2px solid var(--dark-border);
    animation: expandDown 0.5s ease-out;
    clear: both;
}

.game-settings h3 {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--dark-border);
}

@keyframes expandDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

.setting-group {
    margin-bottom: 8px;
    padding: 6px 0;
}

.killer-number-select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: var(--dark-surface);
    color: var(--text-primary);
    border: 2px solid var(--dark-border);
    font-size: 16px;
    font-family: inherit;
}

@media (max-width: 480px) {
    .killer-number-select {
        padding: 8px;
        font-size: 14px;
    }
}
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.setting-group label {
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.radio-group {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    margin-left: 10px;
}

.radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.radio-group label {
    font-size: 14px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-right: 8px;
    accent-color: var(--accent-primary);
}

input[type="number"] {
    width: 60px;
    height: 32px;
    font-size: 14px;
    text-align: center;
    background: var(--dark-card);
    color: var(--text-primary);
    border: 2px solid var(--dark-border);
    border-radius: 6px;
    margin: 0 6px;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

input[type="number"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Player Selection */
.player-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.player-btn {
    background: var(--dark-surface);
    color: var(--text-primary);
    border: 2px solid var(--dark-border);
    border-radius: 10px;
    padding: 10px 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.player-btn:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: var(--accent-secondary);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.3);
}

.player-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.player-btn.selected {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, #6dd5d1 100%);
    color: var(--dark-bg);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 25px rgba(78, 205, 196, 0.5);
    animation: selectedGlow 1.5s ease-in-out infinite;
}

.player-btn.disabled,
.player-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--dark-surface);
    color: var(--text-secondary);
    border-color: var(--dark-border);
}

.player-btn.disabled:hover,
.player-btn:disabled:hover {
    transform: none;
    border-color: var(--dark-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes selectedGlow {
    0%, 100% { box-shadow: 0 0 25px rgba(78, 205, 196, 0.5); }
    50% { box-shadow: 0 0 35px rgba(78, 205, 196, 0.7); }
}

#name-inputs {
    display: grid;
    gap: 8px;
    animation: expandDown 0.5s ease-out;
}

.name-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.name-input-group label {
    font-size: 14px;
    min-width: 80px;
    color: var(--text-primary);
}

.name-input-group input {
    flex: 1;
    height: 36px;
    font-size: 14px;
    padding: 0 10px;
    background: var(--dark-card);
    color: var(--text-primary);
    border: 2px solid var(--dark-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.name-input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
    transform: scale(1.02);
}

/* Primary Button */
.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-success) 0%, #6dd5d1 100%);
    color: var(--dark-bg);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 3px 10px rgba(149, 225, 211, 0.4);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.primary-btn:hover::before {
    width: 300px;
    height: 300px;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(149, 225, 211, 0.6);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(-1px) scale(0.98);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Game Screen — flex only when active; otherwise .screen { display: none } applies */
#game-screen {
    height: 100dvh;
    flex-direction: column;
    overflow: hidden;
}

#game-screen.active {
    visibility: visible;
}

#game-screen.active * {
    visibility: visible;
}

.game-header {
    background: linear-gradient(135deg, var(--dark-card) 0%, var(--dark-surface) 100%);
    color: var(--text-primary);
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    border-bottom: 2px solid var(--dark-border);
}

.game-header h2 {
    font-size: 16px;
    color: var(--text-primary);
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.icon-btn {
    background: var(--dark-surface);
    color: var(--text-primary);
    border: 2px solid var(--dark-border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

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

.game-content {
    padding: 6px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

/* In-game compact layout — HUD + keypad (all game modes) */
#game-screen.compact-play .game-header {
    padding: 4px 8px;
    flex-shrink: 0;
}

#game-screen.compact-play .game-header h2 {
    font-size: 14px;
}

#game-screen.compact-play .game-content {
    padding: 4px;
    gap: 0;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, auto) minmax(0, 1fr);
    grid-template-areas:
        "hud"
        "keypad";
    overflow: hidden;
}

/* Checkout + turn panel removed from layout — info is inside HUD cards */
#game-screen.compact-play .turn-checkout-container {
    display: none !important;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

#game-screen.compact-play .turn-info {
    display: none !important;
}

#game-screen.compact-play .score-display {
    grid-area: hud;
    margin-bottom: 0;
    flex-shrink: 0;
    max-height: min(20dvh, 108px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#game-screen.compact-play .score-input-section {
    grid-area: keypad;
}

#game-screen.compact-play .game-hud-card {
    padding: 6px 10px !important;
    text-align: left;
    transform: none !important;
    animation: none !important;
}

#game-screen.compact-play .game-hud-card::before {
    display: none;
}

#game-screen.compact-play .player-score-card {
    border-width: 2px;
}

#game-screen.compact-play .player-score-card.active {
    transform: none !important;
    animation: none !important;
    box-shadow: 0 0 16px rgba(255, 107, 53, 0.4);
}

#game-screen.compact-play .game-hud-card.active {
    transform: none !important;
    animation: none !important;
    box-shadow: 0 0 16px rgba(255, 107, 53, 0.4);
}

#game-screen.compact-play .game-hud-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 0;
}

#game-screen.compact-play .game-hud-row--top {
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
}

#game-screen.compact-play .game-hud-row--top + .game-hud-turn {
    margin-top: 4px;
}

#game-screen.compact-play .game-hud-name {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

#game-screen.compact-play .game-hud-score {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    animation: none;
}

#game-screen.compact-play .game-hud-meta {
    font-size: 11px;
    opacity: 0.9;
    margin-left: auto;
    text-align: right;
    min-width: 0;
    flex-shrink: 0;
}

#game-screen.compact-play .game-hud-target {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.05;
    padding: 4px 10px;
    text-align: right;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

#game-screen.compact-play .game-hud-target-word {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #0a0a0a;
    line-height: 1.2;
}

#game-screen.compact-play .game-hud-target-num {
    font-size: 28px;
    font-weight: 900;
    color: #0a0a0a;
    line-height: 1;
}

#game-screen.compact-play .player-score-card.active .game-hud-target {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.2);
}

#game-screen.compact-play .player-score-card.active .game-hud-target-word,
#game-screen.compact-play .player-score-card.active .game-hud-target-num {
    color: #0a0a0a;
}

#game-screen.compact-play .game-hud-dbl-hint {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-secondary);
    text-align: right;
    margin-top: 2px;
    opacity: 0.9;
}

#game-screen.compact-play .player-score-card.active .game-hud-dbl-hint {
    color: rgba(255, 255, 255, 0.85);
}

#game-screen.compact-play .game-hud-lives-row {
    margin-top: 2px;
}

#game-screen.compact-play .game-hud-lives {
    font-size: 12px;
    letter-spacing: 2px;
}

#game-screen.compact-play .game-hud-turn-label {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

#game-screen.compact-play .game-hud-turn-text {
    color: var(--text-secondary);
    font-weight: 600;
}

#game-screen.compact-play .game-hud-turn-label strong {
    color: var(--accent-warning);
    font-size: 17px;
    font-weight: 800;
}

#game-screen.compact-play .player-score-card.active .game-hud-turn-text {
    color: rgba(255, 255, 255, 0.92);
}

#game-screen.compact-play .player-score-card.active .game-hud-turn-label {
    color: #ffffff;
}

#game-screen.compact-play .player-score-card.active .game-hud-turn-label strong {
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

#game-screen.compact-play .player-score-card.active .dart-chip {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
}

#game-screen.compact-play .game-hud-chips {
    display: flex;
    flex: 1;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
}

#game-screen.compact-play .dart-chip {
    flex-shrink: 0;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--accent-secondary);
}

#game-screen.practice-mode .game-hud-chips {
    overflow-x: hidden;
    overflow-y: hidden;
    justify-content: flex-end;
}

#game-screen.practice-mode .dart-chip--omitted {
    opacity: 0.75;
    border-style: dashed;
    font-size: 10px;
    min-width: 1.5em;
}

.practice-settings-hint,
.game-rules-hint {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
    margin: 10px 0 0;
}

.game-rules-hint:first-of-type {
    margin-top: 0;
}

.game-settings-subtitle {
    margin-top: 14px;
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-primary);
    border-top: 1px solid var(--dark-border);
    padding-top: 12px;
}

.game-hud-stats-off {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-warning);
    margin-top: 2px;
}

#game-screen.compact-play .game-hud-checkout {
    font-size: 10px;
    line-height: 1.2;
    color: var(--accent-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

#game-screen.compact-play .player-score-card.active .game-hud-checkout {
    color: rgba(255, 255, 255, 0.92);
    border-top-color: rgba(255, 255, 255, 0.25);
}

#game-screen.compact-play .score-input-section {
    flex: none;
    min-height: 0;
    max-height: 100%;
    padding: 4px;
    gap: 3px;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

#game-screen.compact-play .multiplier-btn {
    min-height: 34px;
    padding: 5px 4px;
    font-size: 12px;
}

#game-screen.compact-play .score-input-buttons {
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
    grid-auto-rows: minmax(0, 1fr);
}

#game-screen.compact-play .score-input-buttons.has-extras {
    grid-template-rows: repeat(6, minmax(0, 1fr));
}

#game-screen.compact-play .score-btn.extra-btn {
    font-size: clamp(10px, 2.8vw, 13px);
}

#game-screen.compact-play .score-actions .action-btn {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
}

/* iPhone-sized viewports — keypad always wins vertical space */
@media (max-width: 430px), (max-height: 740px) {
    #game-screen.compact-play .score-display {
        max-height: min(16dvh, 88px);
    }

    #game-screen.compact-play .game-hud-score {
        font-size: 18px;
    }

    #game-screen.compact-play .game-hud-card {
        padding: 4px 8px !important;
    }

    #game-screen.compact-play .multiplier-btn {
        min-height: 28px;
        padding: 4px 2px;
        font-size: 11px;
    }

    #game-screen.compact-play .score-actions .action-btn {
        min-height: 28px;
        padding: 5px 6px;
        font-size: 10px;
    }
}

/* Score Display */
.score-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
    margin-bottom: 6px;
    flex-shrink: 0;
    visibility: visible;
}

.player-score-card {
    background: linear-gradient(135deg, var(--dark-card) 0%, var(--dark-surface) 100%);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 3px solid var(--dark-border);
    position: relative;
    overflow: hidden;
}

@media (max-width: 480px) {
    .score-display {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        margin-bottom: 6px;
    }
    
    .player-score-card {
        padding: 6px;
        border-radius: 8px;
        border-width: 2px;
    }
}

.player-score-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.player-score-card.active::before {
    opacity: 1;
}

.player-score-card.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #ff8c5a 100%);
    color: var(--text-primary);
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(255, 107, 53, 0.7), var(--shadow-glow), inset 0 0 30px rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    animation: activeCardPulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes activeCardPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 107, 53, 0.7), var(--shadow-glow), inset 0 0 30px rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 0 50px rgba(255, 107, 53, 0.9), 0 0 30px rgba(255, 107, 53, 0.5), inset 0 0 40px rgba(255, 255, 255, 0.15); }
}

.player-score-card.winner {
    background: linear-gradient(135deg, var(--accent-success) 0%, #6dd5d1 100%);
    color: var(--dark-bg);
    border-color: var(--accent-success);
    animation: winnerCelebration 1s ease-in-out infinite;
}

@keyframes winnerCelebration {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-3deg); }
    75% { transform: scale(1.1) rotate(3deg); }
}

.player-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.player-score {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 8px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
    animation: scorePop 0.5s ease-out;
}

@keyframes scorePop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.player-info {
    font-size: 13px;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Killer lives hearts styling */
.player-score-card .player-info {
    font-size: 20px;
    letter-spacing: 4px;
    line-height: 1.2;
}

@media (max-width: 480px) {
    .player-score-card .player-info {
        font-size: 16px;
        letter-spacing: 2px;
    }
}

.killer-number-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
    margin: 16px 0;
    padding: 12px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.killer-number-value {
    font-size: 56px;
    font-weight: 900;
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.8), 0 0 40px rgba(255, 107, 53, 0.5);
    display: inline-block;
    animation: killerNumberPulse 2s ease-in-out infinite;
    line-height: 1;
    padding: 8px 16px;
    margin: 8px 0;
}

/* Make killer number stand out on active card */
.player-score-card.active .killer-number-display {
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.5);
}

.player-score-card.active .killer-number-value {
    color: #ffffff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 255, 255, 0.3), 0 0 40px rgba(255, 255, 255, 0.2);
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.8));
}

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

/* Turn Info */
.turn-checkout-container {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    align-items: stretch;
    flex-shrink: 0;
}

.checkout-display:empty,
.checkout-display[style*="display: none"] {
    display: none !important;
}

.turn-info {
    background: linear-gradient(135deg, var(--dark-card) 0%, var(--dark-surface) 100%);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    text-align: center;
    border: 2px solid var(--dark-border);
    animation: slideIn 0.5s ease-out;
    flex: 1;
    min-width: 0;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.current-player {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 107, 53, 0.5);
    animation: textShimmer 2s ease-in-out infinite;
}

@keyframes textShimmer {
    0%, 100% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 107, 53, 0.5); }
    50% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 107, 53, 0.8); }
}

.turn-score {
    font-size: 18px;
    color: var(--text-secondary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Input Mode Toggle */
.input-mode-toggle {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 10px 0 15px 0;
}

.toggle-btn {
    background: var(--dark-surface);
    color: var(--text-primary);
    border: 3px solid var(--dark-border);
    border-radius: 15px;
    padding: 15px 35px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.toggle-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-secondary);
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #ff8c5a 100%);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 25px rgba(255, 107, 53, 0.5);
    animation: toggleGlow 1.5s ease-in-out infinite;
}

@keyframes toggleGlow {
    0%, 100% { box-shadow: 0 0 25px rgba(255, 107, 53, 0.5); }
    50% { box-shadow: 0 0 35px rgba(255, 107, 53, 0.7); }
}

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

/* Digital Dartboard */
.dartboard-container {
    background: #000000;
    border-radius: 20px;
    padding: 15px;
    margin: 0 0 10px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-height: 50vh;
    min-height: 200px;
    overflow: hidden;
    position: relative;
    flex-shrink: 1;
    border: 3px solid var(--dark-border);
    animation: dartboardAppear 0.5s ease-out;
}

@keyframes dartboardAppear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.dartboard-canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 50vh !important;
    min-height: 200px !important;
    aspect-ratio: 1;
    cursor: crosshair;
    touch-action: none;
    object-fit: contain;
    display: block;
}

@media (min-width: 768px) {
    .dartboard-container {
        max-height: 55vh;
        min-height: 300px;
        padding: 20px;
    }
    
    .dartboard-canvas {
        max-height: 55vh;
        min-height: 300px;
    }
}

@media (min-width: 1024px) {
    .dartboard-container {
        max-height: 60vh;
        min-height: 350px;
    }
    
    .dartboard-canvas {
        max-height: 60vh;
        min-height: 350px;
    }
}

/* Checkout Display */
.checkout-display {
    background: linear-gradient(135deg, var(--dark-card) 0%, var(--dark-surface) 100%);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--dark-border);
    flex: 1;
    min-width: 0;
}

.checkout-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-secondary);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.checkout-item {
    display: flex;
    gap: 12px;
    padding: 10px 15px;
    margin-bottom: 8px;
    background: var(--dark-surface);
    border-radius: 10px;
    font-size: 14px;
    border: 2px solid var(--dark-border);
    transition: all 0.3s ease;
}

.checkout-item:hover {
    background: var(--dark-card);
    border-color: var(--accent-secondary);
    transform: translateX(5px);
}

.checkout-darts {
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 90px;
}

.checkout-combo {
    color: var(--text-primary);
    font-family: 'Monaco', 'Courier New', monospace;
}

.checkout-message {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 15px;
}

/* Score Input */
.score-input-section {
    background: linear-gradient(135deg, var(--dark-card) 0%, var(--dark-surface) 100%);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--dark-border);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.score-multiplier-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    flex-shrink: 0;
}

.multiplier-btn {
    background: var(--dark-surface);
    color: var(--text-secondary);
    border: 2px solid var(--dark-border);
    border-radius: 10px;
    padding: 10px 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.multiplier-btn.active {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.35);
}

.multiplier-btn[data-multiplier="single"].active {
    background: linear-gradient(135deg, #2d4a4f 0%, #3d5a5f 100%);
}

.multiplier-btn[data-multiplier="double"].active {
    background: linear-gradient(135deg, #5a1e1e 0%, #7a2e2e 100%);
    border-color: #ff4444;
}

.multiplier-btn[data-multiplier="triple"].active {
    background: linear-gradient(135deg, #1e5a3e 0%, #2e7a5e 100%);
    border-color: var(--accent-success);
}

.multiplier-btn:active {
    transform: scale(0.97);
}

.score-input-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(52px, 1fr);
    align-content: stretch;
    gap: 5px;
    flex: 1;
    min-height: 0;
}

.score-extra-buttons {
    display: none;
}

.score-input-buttons.has-extras {
    grid-auto-rows: minmax(52px, 1fr);
}

.score-btn {
    background: var(--dark-surface);
    color: var(--text-primary);
    border: 2px solid var(--dark-border);
    border-radius: 10px;
    padding: 4px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.score-btn.number-btn.single {
    background: linear-gradient(135deg, #2d4a4f 0%, #3d5a5f 100%);
    border-color: var(--accent-secondary);
}

.score-btn.number-btn.double {
    background: linear-gradient(135deg, #5a1e1e 0%, #7a2e2e 100%);
    border-color: #ff4444;
}

.score-btn.number-btn.triple {
    background: linear-gradient(135deg, #1e5a3e 0%, #2e7a5e 100%);
    border-color: var(--accent-success);
}

.score-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.score-btn:active::before {
    width: 200px;
    height: 200px;
}

.score-btn:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.score-btn.bull {
    background: linear-gradient(135deg, #fce38a 0%, #ffd93d 100%);
    color: var(--dark-bg);
    border-color: var(--accent-warning);
}

.score-btn.bullseye {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.score-btn.miss {
    background: var(--dark-surface);
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.score-btn.extra-btn {
    min-height: 0;
}

.score-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex-shrink: 0;
}

.score-actions .action-btn {
    min-height: 44px;
    font-size: 13px;
    padding: 10px 8px;
}

.action-btn {
    background: var(--dark-surface);
    color: var(--text-primary);
    border: 2px solid var(--dark-border);
    border-radius: 8px;
    padding: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.action-btn:active {
    transform: translateY(0) scale(0.98);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent-success) 0%, #6dd5d1 100%);
    color: var(--dark-bg);
    border: none;
    font-weight: 800;
}

.action-btn.danger {
    background: linear-gradient(135deg, #ff4444 0%, #ff6666 100%);
    color: var(--text-primary);
    border: none;
}

/* Overlay */
/* Turn End Animation Overlay */
.turn-end-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.turn-end-overlay.visible {
    opacity: 1;
}

.turn-end-content {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    padding: 30px 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 60px rgba(255, 107, 53, 0.3);
    max-width: 600px;
    border: 3px solid var(--accent-primary);
}


.turn-end-content {
    text-align: center;
    color: var(--text-primary);
    animation: turnEndPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes turnEndPop {
    0% { opacity: 0; transform: scale(0.8); }
    50% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

.turn-end-player-name {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent-primary);
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.8), 0 0 40px rgba(255, 107, 53, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.turn-end-score {
    font-size: 42px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 10px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}

.turn-end-remaining {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.turn-end-next {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-success);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 20px;
    text-shadow: 0 0 15px rgba(109, 213, 209, 0.6);
}

.next-player-name {
    display: block;
    font-size: 48px;
    font-weight: 900;
    color: var(--accent-primary);
    margin-top: 10px;
    text-shadow: 0 0 30px rgba(255, 107, 53, 0.9), 0 0 60px rgba(255, 107, 53, 0.5);
    animation: nextPlayerGlow 1s ease-in-out infinite;
}

@keyframes nextPlayerGlow {
    0%, 100% { text-shadow: 0 0 40px rgba(255, 107, 53, 0.9), 0 0 80px rgba(255, 107, 53, 0.5); }
    50% { text-shadow: 0 0 60px rgba(255, 107, 53, 1), 0 0 120px rgba(255, 107, 53, 0.7); }
}

/* Bust Animation Overlay */
.bust-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bust-overlay.visible {
    opacity: 1;
}

.bust-content {
    background: rgba(139, 0, 0, 0.95);
    border-radius: 20px;
    padding: 40px 60px;
    box-shadow: 0 10px 40px rgba(139, 0, 0, 0.8), 0 0 80px rgba(255, 0, 0, 0.5);
    max-width: 600px;
    border: 3px solid #ff0000;
    text-align: center;
    animation: bustPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bustPop {
    0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.bust-player-name {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.bust-message {
    font-size: 96px;
    font-weight: 900;
    color: #ff0000;
    margin: 20px 0;
    text-shadow: 0 0 40px rgba(255, 0, 0, 1), 0 0 80px rgba(255, 0, 0, 0.8);
    animation: bustPulse 0.8s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 8px;
}

@keyframes bustPulse {
    0%, 100% { transform: scale(1); text-shadow: 0 0 40px rgba(255, 0, 0, 1), 0 0 80px rgba(255, 0, 0, 0.8); }
    50% { transform: scale(1.1); text-shadow: 0 0 60px rgba(255, 0, 0, 1), 0 0 120px rgba(255, 0, 0, 1); }
}

.bust-next {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    margin-top: 30px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

.bust-next-player-name {
    display: block;
    font-size: 42px;
    font-weight: 900;
    color: #ffcc00;
    margin-top: 10px;
    text-shadow: 0 0 30px rgba(255, 204, 0, 0.9);
}

@media (max-width: 768px) {
    .bust-content {
        padding: 30px 40px;
    }
    
    .bust-player-name {
        font-size: 28px;
    }
    
    .bust-message {
        font-size: 64px;
    }
    
    .bust-next {
        font-size: 22px;
    }
    
    .bust-next-player-name {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .bust-content {
        padding: 20px 30px;
    }
    
    .bust-player-name {
        font-size: 20px;
    }
    
    .bust-message {
        font-size: 48px;
        letter-spacing: 4px;
    }
    
    .bust-next {
        font-size: 18px;
    }
    
    .bust-next-player-name {
        font-size: 28px;
    }
}

/* Death Animation Overlay (Killer mode) */
.death-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.death-overlay.visible {
    opacity: 1;
}

.death-content {
    background: rgba(50, 0, 0, 0.95);
    border-radius: 25px;
    padding: 50px 70px;
    box-shadow: 0 15px 50px rgba(139, 0, 0, 0.9), 0 0 100px rgba(255, 0, 0, 0.6), inset 0 0 50px rgba(139, 0, 0, 0.5);
    max-width: 700px;
    border: 4px solid #8b0000;
    text-align: center;
    animation: deathPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes deathPop {
    0% { opacity: 0; transform: scale(0.5) rotate(-15deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.death-player-name {
    font-size: 64px;
    font-weight: 900;
    color: #ff0000;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255, 0, 0, 1), 0 0 60px rgba(255, 0, 0, 0.8), 0 0 90px rgba(255, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 4px;
    animation: deathPulse 1s ease-in-out infinite;
}

@keyframes deathPulse {
    0%, 100% { transform: scale(1); text-shadow: 0 0 30px rgba(255, 0, 0, 1), 0 0 60px rgba(255, 0, 0, 0.8); }
    50% { transform: scale(1.05); text-shadow: 0 0 40px rgba(255, 0, 0, 1), 0 0 80px rgba(255, 0, 0, 1); }
}

.death-message {
    font-size: 56px;
    font-weight: 900;
    color: #ffffff;
    margin: 20px 0 30px 0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 6px;
}

.death-killer {
    font-size: 32px;
    font-weight: 700;
    color: #ffcccc;
    text-transform: uppercase;
    margin-top: 30px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
}

.death-killer-name {
    display: block;
    font-size: 52px;
    font-weight: 900;
    color: #ff6600;
    margin-top: 15px;
    text-shadow: 0 0 30px rgba(255, 102, 0, 0.9), 0 0 60px rgba(255, 102, 0, 0.6);
    animation: killerGlow 1.2s ease-in-out infinite;
}

@keyframes killerGlow {
    0%, 100% { text-shadow: 0 0 30px rgba(255, 102, 0, 0.9), 0 0 60px rgba(255, 102, 0, 0.6); }
    50% { text-shadow: 0 0 50px rgba(255, 102, 0, 1), 0 0 100px rgba(255, 102, 0, 0.8); }
}

@media (max-width: 768px) {
    .death-content {
        padding: 35px 50px;
    }
    
    .death-player-name {
        font-size: 42px;
    }
    
    .death-message {
        font-size: 36px;
    }
    
    .death-killer {
        font-size: 22px;
    }
    
    .death-killer-name {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .death-content {
        padding: 25px 35px;
    }
    
    .death-player-name {
        font-size: 32px;
        letter-spacing: 2px;
    }
    
    .death-message {
        font-size: 28px;
        letter-spacing: 3px;
    }
    
    .death-killer {
        font-size: 18px;
    }
    
    .death-killer-name {
        font-size: 28px;
    }
}

/* Winner Animation Overlay */
.winner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

.winner-overlay.visible {
    opacity: 1;
}

.winner-content {
    background: rgba(0, 50, 0, 0.95);
    border-radius: 30px;
    padding: 60px 80px;
    box-shadow: 0 20px 60px rgba(0, 100, 0, 0.9), 0 0 120px rgba(0, 255, 0, 0.6), inset 0 0 60px rgba(0, 100, 0, 0.5);
    max-width: 800px;
    border: 5px solid #00ff00;
    text-align: center;
    animation: winnerPop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: default;
    pointer-events: auto;
}

@keyframes winnerPop {
    0% { opacity: 0; transform: scale(0.3) rotate(-20deg); }
    50% { transform: scale(1.15) rotate(10deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.winner-player-name {
    font-size: 80px;
    font-weight: 900;
    color: #00ff00;
    margin-bottom: 30px;
    text-shadow: 0 0 40px rgba(0, 255, 0, 1), 0 0 80px rgba(0, 255, 0, 0.8), 0 0 120px rgba(0, 255, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 6px;
    animation: winnerGlow 1.5s ease-in-out infinite;
}

@keyframes winnerGlow {
    0%, 100% { 
        transform: scale(1); 
        text-shadow: 0 0 40px rgba(0, 255, 0, 1), 0 0 80px rgba(0, 255, 0, 0.8), 0 0 120px rgba(0, 255, 0, 0.6);
    }
    50% { 
        transform: scale(1.1); 
        text-shadow: 0 0 60px rgba(0, 255, 0, 1), 0 0 120px rgba(0, 255, 0, 1), 0 0 180px rgba(0, 255, 0, 0.8);
    }
}

.winner-message {
    font-size: 72px;
    font-weight: 900;
    color: #ffffff;
    margin-top: 20px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.9), 0 0 60px rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 8px;
    animation: winnerPulse 1.2s ease-in-out infinite;
}

.winner-continue-btn {
    margin-top: 40px;
    padding: 18px 50px;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    color: #000000;
    border: 3px solid #00ff00;
    border-radius: 15px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8), 0 6px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.winner-continue-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(0, 255, 0, 1), 0 8px 30px rgba(0, 0, 0, 0.7);
}

.winner-continue-btn:active {
    transform: scale(1.05);
}

@keyframes winnerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 768px) {
    .winner-content {
        padding: 40px 60px;
    }
    
    .winner-player-name {
        font-size: 52px;
        letter-spacing: 4px;
    }
    
    .winner-message {
        font-size: 48px;
        letter-spacing: 5px;
    }
    
    .winner-continue-btn {
        margin-top: 30px;
        padding: 14px 35px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .winner-content {
        padding: 30px 40px;
    }
    
    .winner-player-name {
        font-size: 36px;
        letter-spacing: 2px;
    }
    
    .winner-message {
        font-size: 32px;
        letter-spacing: 3px;
    }
    
    .winner-continue-btn {
        margin-top: 25px;
        padding: 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .turn-end-player-name {
        font-size: 32px;
    }
    
    .turn-end-score {
        font-size: 42px;
    }
    
    .turn-end-remaining {
        font-size: 24px;
    }
    
    .turn-end-next {
        font-size: 28px;
    }
    
    .next-player-name {
        font-size: 48px;
    }
    
    .killer-number-display {
        font-size: 14px;
        margin: 12px 0;
        padding: 8px 0;
    }
    
    .killer-number-value {
        font-size: 42px;
        padding: 6px 12px;
        margin: 6px 0;
    }
}

@media (max-width: 480px) {
    .turn-end-player-name {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .turn-end-score {
        font-size: 32px;
        margin-bottom: 10px;
    }
    
    .turn-end-remaining {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .turn-end-next {
        font-size: 20px;
        margin-top: 25px;
    }
    
    .next-player-name {
        font-size: 36px;
        margin-top: 10px;
    }
    
    .killer-number-display {
        font-size: 12px;
        margin: 10px 0;
        padding: 6px 0;
    }
    
    .killer-number-value {
        font-size: 32px;
        padding: 4px 10px;
        margin: 4px 0;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-content {
    background: linear-gradient(135deg, var(--dark-card) 0%, var(--dark-surface) 100%);
    border-radius: 25px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    box-shadow: var(--shadow-card), 0 0 50px rgba(255, 107, 53, 0.3);
    border: 3px solid var(--dark-border);
    animation: modalPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.overlay-content h3 {
    margin-bottom: 25px;
    text-align: center;
    color: var(--accent-primary);
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.menu-option-btn {
    width: 100%;
    background: var(--dark-surface);
    color: var(--text-primary);
    border: 3px solid var(--dark-border);
    border-radius: 15px;
    padding: 18px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.menu-option-btn:hover {
    transform: translateX(5px);
    border-color: var(--accent-primary);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.menu-option-btn:active {
    transform: translateX(2px) scale(0.98);
}

/* Dart Input Display */
.dart-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.dart-input {
    background: var(--dark-surface);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    min-width: 70px;
    text-align: center;
    border: 2px solid var(--dark-border);
    animation: dartAppear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@keyframes dartAppear {
    from { opacity: 0; transform: scale(0) rotate(-180deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.dart-input.single { 
    border-left: 5px solid var(--accent-secondary);
    background: linear-gradient(90deg, rgba(78, 205, 196, 0.2) 0%, var(--dark-surface) 100%);
}
.dart-input.double { 
    border-left: 5px solid #ff4444;
    background: linear-gradient(90deg, rgba(255, 68, 68, 0.2) 0%, var(--dark-surface) 100%);
}
.dart-input.triple { 
    border-left: 5px solid var(--accent-success);
    background: linear-gradient(90deg, rgba(149, 225, 211, 0.2) 0%, var(--dark-surface) 100%);
}
.dart-input.bull { 
    border-left: 5px solid var(--accent-warning);
    background: linear-gradient(90deg, rgba(252, 227, 138, 0.2) 0%, var(--dark-surface) 100%);
}
.dart-input.miss { 
    border-left: 5px solid var(--text-muted);
    background: var(--dark-surface);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 6px;
    border: 2px solid var(--dark-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Responsive Design for Tablets (iPad) */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .menu-content {
        padding: 25px;
    }
    
    .app-logo {
        max-width: 300px;
        max-height: 150px;
    }
    
    .app-logo.logo-shrunk {
        max-width: 300px;
        max-height: 150px;
    }
}

/* Responsive Design for Large Phones / Small Tablets */
@media (max-width: 768px) {
    .game-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .player-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .score-input-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .app-logo {
        max-width: 200px;
    }
    
    .player-score {
        font-size: 28px;
    }
    
    .score-card {
        padding: 12px;
    }
    
    .game-header {
        padding: 10px 15px;
    }
    
    .game-content {
        padding: 10px;
    }
    
    .dartboard-container {
        padding: 10px;
        min-height: 250px;
        max-height: calc(100vh - 400px);
    }
    
    .turn-checkout-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .turn-info {
        padding: 10px;
    }
    
    .current-player {
        font-size: 18px;
    }
    
    .turn-score {
        font-size: 14px;
    }
    
    .checkout-display {
        padding: 10px;
    }
    
    .action-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .toggle-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Responsive Design for Phones (iPhone) */
@media (max-width: 480px) {
    body {
        font-size: 11px;
        overflow-x: hidden;
    }
    
    * {
        max-width: 100%;
    }
    
    .container {
        padding: 4px;
        width: 100%;
        box-sizing: border-box;
    }
    
    header {
        padding: 6px 4px;
        margin-bottom: 6px;
    }
    
    .app-logo {
        max-width: 180px;
        max-height: 90px;
        margin-bottom: 4px;
    }
    
    .app-logo.logo-expanded {
        max-width: 40vw;
        max-height: 40vh;
    }
    
    .app-logo.logo-shrunk {
        max-width: 180px;
        max-height: 90px;
    }
    
    .menu-content {
        padding: 8px;
        border-radius: 10px;
        margin: 0 auto;
        max-width: 100%;
        box-sizing: border-box;
        width: calc(100% - 8px);
    }
    
    .game-selection h2,
    .player-selection h2 {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .game-btn {
        padding: 8px 6px;
        border-radius: 8px;
        min-height: 70px;
    }
    
    .game-icon {
        font-size: 20px;
    }
    
    .game-name {
        font-size: 11px;
    }
    
    .player-buttons {
        gap: 6px;
    }
    
    .player-btn {
        padding: 6px 8px;
        font-size: 11px;
        border-radius: 6px;
    }
    
    .primary-btn {
        padding: 10px 15px;
        font-size: 12px;
        margin-top: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .name-inputs {
        width: 100%;
    }
    
    .name-inputs input {
        width: 100%;
        box-sizing: border-box;
        padding: 8px;
        font-size: 12px;
    }
    
    .game-header {
        padding: 8px 10px;
    }
    
    .game-header h2 {
        font-size: 14px;
    }
    
    .icon-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .score-display {
        gap: 4px;
        margin-bottom: 6px;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .player-score-card {
        padding: 6px;
        border-radius: 8px;
        border-width: 2px;
    }
    
    .player-name {
        font-size: 9px;
        margin-bottom: 2px;
    }
    
    .player-score {
        font-size: 16px;
        line-height: 1.2;
        margin-bottom: 2px;
    }
    
    .score-meta {
        font-size: 7px;
        margin-top: 1px;
    }
    
    .player-score-card.active {
        transform: scale(1.02);
    }
    
    .score-input-section {
        padding: 5px;
        gap: 5px;
    }

    #game-screen.compact-play .score-display {
        grid-template-columns: 1fr;
        max-height: min(18dvh, 96px);
    }

    #game-screen.compact-play .game-hud-checkout {
        font-size: 9px;
    }

    #game-screen.compact-play .game-hud-score {
        font-size: 20px;
    }

    #game-screen.compact-play .multiplier-btn {
        min-height: 30px;
        font-size: 11px;
        padding: 4px 2px;
    }

    #game-screen.compact-play .score-input-buttons {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: unset;
        gap: 3px;
    }

    #game-screen.compact-play .score-input-buttons:not(.has-extras) {
        grid-template-rows: repeat(5, minmax(0, 1fr));
    }

    #game-screen.compact-play .score-input-buttons.has-extras {
        grid-template-rows: repeat(6, minmax(0, 1fr));
    }

    #game-screen.compact-play .score-btn {
        font-size: 16px;
    }

    #game-screen.compact-play .score-actions .action-btn {
        min-height: 30px;
        font-size: 10px;
        padding: 5px 4px;
    }

    #game-screen.compact-play .game-hud-card {
        padding: 5px 8px !important;
    }

    .multiplier-btn {
        min-height: 42px;
        font-size: 14px;
        padding: 8px 4px;
    }

    .score-input-buttons {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: minmax(48px, 1fr);
        gap: 4px;
    }

    .score-btn {
        font-size: 17px;
        border-radius: 8px;
    }

    .score-btn.extra-btn {
        font-size: clamp(10px, 2.6vw, 12px);
    }

    .score-actions {
        gap: 5px;
    }

    .score-actions .action-btn {
        min-height: 42px;
        font-size: 12px;
        padding: 8px 6px;
    }

    .turn-checkout-container {
        margin-bottom: 4px;
    }

    .score-display {
        gap: 4px;
        margin-bottom: 4px;
    }

    .player-score-card {
        padding: 6px 8px;
    }
    
    .dartboard-container {
        padding: 5px;
        min-height: 150px;
        max-height: 35vh;
        border-radius: 12px;
        margin-bottom: 8px;
    }
    
    .input-mode-toggle {
        margin-bottom: 6px;
        gap: 6px;
    }
    
    .toggle-btn {
        padding: 6px 12px;
        font-size: 11px;
        border-radius: 8px;
    }
    
    .turn-info {
        padding: 6px;
        border-radius: 8px;
    }
    
    .current-player {
        font-size: 13px;
    }
    
    .turn-score {
        font-size: 11px;
    }
    
    .checkout-display {
        padding: 6px;
        font-size: 11px;
        border-radius: 8px;
        margin-bottom: 8px;
    }
    
    .overlay-content {
        padding: 15px;
        width: 90%;
    }
    
    .menu-option-btn {
        padding: 10px;
        font-size: 12px;
    }
    
    /* Game settings */
    .game-settings {
        padding: 15px;
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    .game-settings h3 {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .player-selection {
        margin-top: 20px;
        clear: both;
    }
    
    .setting-group {
        font-size: 11px;
        margin-bottom: 15px;
        padding: 8px 0;
    }
    
    .radio-group {
        gap: 12px;
        margin-top: 6px;
    }
    
    .radio-group label {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .game-content {
        padding: 5px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .score-display {
        width: 100%;
        box-sizing: border-box;
    }
    
    .score-input-section {
        width: 100%;
        box-sizing: border-box;
    }
    
    .score-input-buttons {
        width: 100%;
        box-sizing: border-box;
    }
    
    .input-mode-toggle {
        width: 100%;
        box-sizing: border-box;
    }
    
    .dartboard-container {
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .app-logo {
        max-width: 150px;
        max-height: 75px;
    }
    
    .app-logo.logo-expanded {
        max-width: 35vw;
        max-height: 35vh;
    }
    
    .app-logo.logo-shrunk {
        max-width: 150px;
        max-height: 75px;
    }
    
    .score-btn {
        font-size: 15px;
    }

    .multiplier-btn {
        font-size: 13px;
        min-height: 40px;
    }
    
    .player-score {
        font-size: 18px;
    }
    
    .menu-content {
        padding: 8px;
    }
    
    .game-btn {
        padding: 8px;
    }
    
    .game-icon {
        font-size: 20px;
    }
}

/* Landscape orientation on phones */
@media (max-height: 500px) and (orientation: landscape) {
    .dartboard-container {
        max-height: 40vh;
        min-height: 150px;
    }
    
    .game-content {
        padding: 5px;
    }
    
    .turn-checkout-container {
        gap: 4px;
        margin-bottom: 6px;
    }
    
    .turn-info {
        padding: 5px;
    }
    
    .checkout-display {
        padding: 5px;
    }
    
    .score-display {
        margin-bottom: 5px;
    }
}
