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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 35%, #D62828 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.15) 100%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 18px,
            rgba(255, 255, 255, 0.06) 18px,
            rgba(255, 255, 255, 0.06) 20px
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 18px,
            rgba(255, 255, 255, 0.06) 18px,
            rgba(255, 255, 255, 0.06) 20px
        );
    pointer-events: none;
    z-index: 0;
}

body > .container {
    position: relative;
    z-index: 1;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    position: relative;
}

.back-to-home-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.btn-back-home {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: 600;
    color: #D62828;
    background: #fff5f0;
    border: 2px solid #FF6B35;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-back-home:hover {
    background: #ffe8dd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-back-home-inline {
    display: inline-block;
    padding: 15px 30px;
    font-size: 1em;
    font-weight: 600;
    color: #666;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-left: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-back-home-inline:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

h1 {
    font-size: 2.5em;
    color: #333;
    text-align: center;
    margin-bottom: 10px;
}

h2 {
    font-size: 2em;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

h3 {
    font-size: 1.5em;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

.subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.instructions {
    background: #f8f9fa;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 30px;
    border-left: 4px solid #2196F3;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.instructions-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    margin-bottom: 14px;
}

.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px 24px;
}

.instructions-list li {
    display: flex;
    align-items: flex-start;
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
}

.instructions-list .bullet-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    margin-right: 8px;
    font-size: 0.8em;
    font-weight: 700;
    color: #1976D2;
    background: #e3f2fd;
}

.instructions-list strong {
    font-weight: 700;
}

.start-form {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 1em;
    color: #333;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

#playerName {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

#playerName:focus {
    outline: none;
    border-color: #667eea;
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-difficulty {
    flex: 1;
    min-width: 120px;
    padding: 20px 15px;
    font-size: 1em;
    background: white;
    border: 3px solid #e0e0e0;
    color: #333;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: normal;
}

.btn-difficulty[data-difficulty="easy"] {
    border-color: #4caf50;
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-difficulty[data-difficulty="easy"]:hover {
    border-color: #4caf50;
    background: #c8e6c9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-difficulty[data-difficulty="easy"].selected {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    border-color: #4caf50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-difficulty[data-difficulty="medium"] {
    border-color: #2196F3;
    background: #e3f2fd;
    color: #1565c0;
}

.btn-difficulty[data-difficulty="medium"]:hover {
    border-color: #2196F3;
    background: #bbdefb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.btn-difficulty[data-difficulty="medium"].selected {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border-color: #2196F3;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.btn-difficulty[data-difficulty="hard"] {
    border-color: #f44336;
    background: #ffebee;
    color: #c62828;
}

.btn-difficulty[data-difficulty="hard"]:hover {
    border-color: #f44336;
    background: #ffcdd2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

.btn-difficulty[data-difficulty="hard"].selected {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
    color: white;
    border-color: #f44336;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.difficulty-range {
    display: block;
    font-size: 0.85em;
    margin-top: 5px;
    opacity: 0.8;
}

.btn-difficulty.selected .difficulty-range {
    opacity: 0.9;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.game-header-spacer {
    flex: 1;
    min-width: 0;
}

.game-header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    text-align: center;
}

.game-header-center .best-badge {
    align-self: center;
}

.best-badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    font-size: 0.8em;
    font-weight: 600;
    color: #f57c00;
}

.game-header .difficulty-badge {
    flex: 1;
    min-width: 100px;
    display: flex;
    justify-content: flex-end;
}

.header-home-link {
    display: none;
    font-size: 0.9em;
    font-weight: 600;
    color: #D62828;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    background: #fff5f0;
    border: 2px solid #FF6B35;
    flex-shrink: 0;
}

.header-home-link:hover {
    background: #ffe8dd;
}

.game-over-mobile-actions {
    display: none;
}

.difficulty-badge {
    min-width: 120px;
    text-align: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.difficulty-badge-label {
    font-size: 0.85em;
}

.difficulty-badge-range {
    font-size: 0.75em;
    opacity: 0.85;
}

.difficulty-badge.easy {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #4caf50;
}

.difficulty-badge.medium {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #2196F3;
}

.difficulty-badge.hard {
    background: #ffebee;
    color: #c62828;
    border-color: #f44336;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.current-number-display {
    text-align: center;
}

.label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.number-display {
    font-size: 3em;
    font-weight: bold;
    color: #2196F3;
    background: #f0f0f0;
    border-radius: 15px;
    padding: 20px 40px;
    min-width: 150px;
    text-align: center;
}

.numbers-placed {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.numbers-placed-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.numbers-placed-counter {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 999px;
    background: #e3f2fd;
    border: 2px solid #2196F3;
    font-weight: 700;
    color: #1565c0;
    gap: 3px;
}

.numbers-placed-counter span {
    font-size: 1.6em;
}

.high-score {
    font-size: 0.9em !important;
    margin-top: 5px;
}

.high-score span {
    font-size: 1.2em;
    color: #ff9800;
}

.slots-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.slot {
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 100px;
    width: 80px;
    flex: 0 0 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.slot:hover:not(.filled):not(.disabled) {
    border-color: #2196F3;
    background: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.slot.filled {
    background: #e8f5e9;
    border-color: #4caf50;
    cursor: pointer;
}

.slot.filled.movable {
    background: #e3f2fd;
    border-color: #2196F3;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.slot.filled.movable:active {
    cursor: grabbing;
}

.slot.filled:hover.movable {
    background: #bbdefb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.slot.drag-over {
    background: #90caf9;
    border-color: #2196F3;
    border-width: 4px;
}

.slot.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.slot.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slot.movable.selected-move {
    outline: 4px solid #2196F3;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #fff, 0 0 16px rgba(33, 150, 243, 0.6);
}

/* Mobile movable slot visual hint */
@media (max-width: 768px) {
    .slot.filled.movable {
        animation: mobilePulse 1.5s ease-in-out infinite;
        position: relative;
    }
    
    .slot.filled.movable::after {
        content: 'tap to move';
        position: absolute;
        bottom: -22px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.65em;
        color: #2196F3;
        font-weight: 600;
        white-space: nowrap;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    @keyframes mobilePulse {
        0%, 100% {
            box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4);
        }
        50% {
            box-shadow: 0 0 0 8px rgba(33, 150, 243, 0);
        }
    }
}

.slot-number {
    font-size: 0.9em;
    color: #999;
    font-weight: 600;
    margin-bottom: 5px;
}

.slot-content {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.score-display {
    text-align: center;
    margin: 10px 0 24px;
}

.score-label {
    font-size: 0.95em;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.final-score-display {
    font-size: 4.5em;
    font-weight: 800;
    color: #1976D2;
    margin: 0;
    padding: 22px 42px;
    background: radial-gradient(circle at top, #e8f3ff 0%, #d0e4ff 45%, #bcd8ff 100%);
    border-radius: 24px;
    border: none;
    display: inline-block;
    min-width: 160px;
    box-shadow: 0 16px 40px rgba(25, 118, 210, 0.35);
}

.final-score-display.highlighted {
    animation: scorePulse 1s ease-in-out;
}

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

.player-stats {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
    border-left: 4px solid #2196F3;
}

.player-stats h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    justify-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    min-width: 150px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #2196F3;
}

.game-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-over-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-secondary {
    background: linear-gradient(135deg, #78909c 0%, #607d8b 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(96, 125, 139, 0.35);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(96, 125, 139, 0.45);
}

.start-button-group {
    text-align: center;
    margin-top: 10px;
}

.btn-start {
    padding: 14px 48px;
    font-size: 1.05em;
    font-weight: 700;
    border-radius: 999px;
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(76, 175, 80, 0.45);
}

.btn-start:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(76, 175, 80, 0.6);
}

.btn-start:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.message {
    text-align: center;
    font-size: 1.05em;
    color: #555;
    margin: 22px auto 26px;
    padding: 14px 22px;
    background: #f9fafb;
    border-radius: 999px;
    max-width: 780px;
}

.final-slots {
    margin: 28px 0 18px;
}

.final-slots h3 {
    font-size: 1.15em;
    margin-bottom: 16px;
}

.final-slots .slots-container {
    padding: 14px 18px;
    border-radius: 14px;
    background: #fafafa;
    border: 1px dashed #e0e0e0;
}

.final-slots .slot {
    cursor: default;
}

.final-slots .slot:hover {
    transform: none;
    border-color: #4caf50;
}

.problem-number-display {
    text-align: center;
    margin: 26px 0 24px;
    padding: 20px 24px;
    background: #fff7f7;
    border-radius: 16px;
    border: 1px solid #ffcdd2;
}

.problem-label {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.problem-number {
    font-size: 3.2em;
    font-weight: 800;
    color: #d32f2f;
    margin: 10px 0 6px;
    padding: 14px 26px;
    background: #ffebee;
    border-radius: 18px;
}

.blocking-numbers {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.blocking-number {
    font-size: 1.6em;
    font-weight: 700;
    color: #fff;
    background: #ef5350;
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.35);
}

.slot.highlight-problem {
    background: #ffebee !important;
    border-color: #f44336 !important;
    border-width: 4px !important;
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.6) !important;
}

/* Home screen difficulty stats */
.difficulty-stats-wrapper {
    margin-top: 20px;
}

.difficulty-stats-wrapper > label {
    font-size: 0.95em;
    color: #1565c0;
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
}

.difficulty-stats-card {
    background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
    border: 2px solid #2196F3;
    overflow: hidden;
}

.difficulty-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.difficulty-stats-table th,
.difficulty-stats-table td {
    padding: 14px 18px;
    text-align: left;
}

.difficulty-stats-table th {
    background: rgba(33, 150, 243, 0.25);
    font-weight: 700;
    color: #0d47a1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.85em;
}

.difficulty-stats-table tbody tr {
    border-top: 1px solid rgba(33, 150, 243, 0.3);
}

.difficulty-stats-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.5);
}

.difficulty-stats-table .difficulty-name {
    font-weight: 700;
    color: #0d47a1;
}

.difficulty-stats-table td:nth-child(2),
.difficulty-stats-table td:nth-child(3) {
    text-align: center;
    font-weight: 700;
    color: #1565c0;
}

.difficulty-stats-table td:nth-child(3) span {
    color: #f57c00;
    font-weight: 800;
}

/* Fireworks celebration */
.fireworks-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 20;
}

.gameOverScreen,
#gameOverScreen {
    position: relative;
}

.celebration-active .final-score-display {
    box-shadow: 0 0 40px rgba(255, 193, 7, 0.9);
}

/* Firework rocket trail */
.firework {
    position: absolute;
    bottom: -20px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fw-color, #FFD700);
    box-shadow: 0 0 6px 2px var(--fw-color, #FFD700);
    animation: fireworkLaunch var(--fw-duration, 1s) ease-out forwards;
    animation-delay: var(--fw-delay, 0s);
}

/* Trail effect */
.firework::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 30px;
    background: linear-gradient(to top, transparent, var(--fw-color, #FFD700));
    opacity: 0.7;
}

/* Explosion burst container */
.firework-burst {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: fireworkAppear var(--fw-duration, 1s) ease-out forwards;
    animation-delay: var(--fw-delay, 0s);
}

/* Individual spark particles */
.firework-spark {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--spark-color, #FFD700);
    box-shadow: 0 0 6px 2px var(--spark-color, #FFD700);
    animation: sparkFly 1.2s ease-out forwards;
    animation-delay: calc(var(--fw-delay, 0s) + var(--fw-duration, 1s) * 0.6);
}

@keyframes fireworkLaunch {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    60% {
        transform: translateY(calc(-1 * var(--fw-height, 50vh))) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(calc(-1 * var(--fw-height, 50vh))) scale(0);
        opacity: 0;
    }
}

@keyframes fireworkAppear {
    0%, 59% {
        opacity: 0;
        transform: translateY(0);
    }
    60% {
        opacity: 1;
        transform: translateY(calc(-1 * var(--fw-height, 50vh)));
    }
    100% {
        opacity: 1;
        transform: translateY(calc(-1 * var(--fw-height, 50vh)));
    }
}

@keyframes sparkFly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--spark-x, 50px), var(--spark-y, 50px)) scale(0.3);
        opacity: 0;
    }
}

/* Win animation */
@keyframes winPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.slot.filled.win {
    animation: winPulse 0.5s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .back-to-home-container {
        display: none;
    }

    .header-home-link {
        display: inline-block;
    }

    .game-header {
        flex-wrap: wrap;
        margin-bottom: 12px;
        gap: 8px;
        justify-content: center;
    }
    
    .game-header-spacer {
        display: none;
    }
    
    .game-header .header-home-link {
        order: 1;
        flex: 0 0 auto;
    }
    
    .game-header-center {
        order: 3;
        flex: 1 0 100%;
        margin-top: 4px;
    }

    .game-header-center h2 {
        font-size: 1.35em;
    }

    .game-header-center .best-badge {
        font-size: 0.8em;
    }
    
    .game-header .difficulty-badge {
        order: 2;
        flex: 0 0 auto;
        min-width: auto;
        padding: 6px 12px;
        font-size: 0.75em;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    .slots-container {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        margin-bottom: 25px;
        max-width: 100%;
    }

    .slot {
        width: 100%;
        min-width: 0;
        flex: none;
        min-height: 82px;
        padding: 14px 10px;
    }

    .slot-content {
        font-size: 1.5em;
    }

    .game-info {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-bottom: 25px;
    }

    .number-display {
        font-size: 2em;
        padding: 18px 28px;
        min-width: 120px;
    }

    .game-controls .btn-primary {
        padding: 18px 36px;
        min-height: 48px;
    }

    .game-over-mobile-actions {
        display: block;
        margin: 20px 0;
        text-align: center;
    }

    .game-over-mobile-actions .btn {
        width: 100%;
        max-width: 280px;
        padding: 16px 32px;
        font-size: 1.1em;
    }

    .game-over-controls {
        flex-direction: column;
    }

    .btn-back-home-inline {
        margin-left: 0;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .slots-container {
        gap: 6px;
    }

    .slot {
        min-height: 74px;
        padding: 12px 8px;
    }

    .slot-content {
        font-size: 1.4em;
    }

    .slot-number {
        font-size: 0.8em;
    }
}
