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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    height: 98vh;
    height: 98dvh;
    max-height: calc(100dvh - 10px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    overflow: hidden;
}

.left-panel {
    flex: 0 0 25%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: background 0.8s ease;
}

.current-number {
    font-size: 56px;
    font-weight: bold;
    color: white;
    text-shadow: 5px 5px 15px rgba(0,0,0,0.3);
    animation: bounce 0.5s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.info {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    color: white;
    text-align: center;
}

.info h2 {
    font-size: 24px;
    margin-bottom: 10px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.top-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    width: 100%;
    gap: 15px;
}

.player-name {
    font-size: 24px;
    font-weight: bold;
    text-align: left;
    white-space: nowrap;
}

.progress-container {
    background: rgba(255,255,255,0.3);
    border-radius: 20px;
    height: 40px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    flex: 1;
}

.question-number {
    font-size: 24px;
    font-weight: bold;
    text-align: right;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.progress-bar {
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.timer {
    font-size: 18px;
}

.right-panel {
    flex: 0 0 75%;
    background: #f8f9fa;
    padding: 20px;
    overflow: hidden;
    position: relative;
    border: 5px solid #667eea;
    border-left: none;
    border-radius: 0 20px 20px 0;
}

.number-btn {
    position: absolute;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 20px;
    font-weight: bold;
    cursor: grab;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    user-select: none;
    padding: 12px 18px;
    touch-action: none;
    min-width: 110px;
    min-height: 85px;
    max-width: 220px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
}

.number-btn:active {
    cursor: grabbing;
}

.number-btn.dragging {
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.number-btn.correct {
    animation: correctAnswer 0.8s ease forwards;
    z-index: 100;
}

@keyframes correctAnswer {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.4) rotate(5deg); }
    50% { transform: scale(1.5) rotate(-5deg); background: #4ade80; }
    75% { transform: scale(1.4) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.number-btn.wrong {
    animation: wrongAnswer 0.6s ease forwards;
}

@keyframes wrongAnswer {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-15px) rotate(-5deg); }
    30% { transform: translateX(15px) rotate(5deg); }
    50% { transform: translateX(-15px) rotate(-5deg); }
    70% { transform: translateX(15px) rotate(5deg); }
    90% { transform: translateX(-5px) rotate(-2deg); }
}

.number-btn.flipping {
    animation: flip 0.6s ease forwards;
}

@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); opacity: 0.5; }
    100% { transform: rotateY(0deg); opacity: 1; }
}

.start-screen, .end-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 1000;
}

.start-screen h1 {
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 3px 3px 10px rgba(0,0,0,0.3);
}

.start-screen input {
    font-size: 24px;
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-family: 'Comic Sans MS', cursive;
}

.start-screen button, .end-screen button {
    font-size: 24px;
    padding: 15px 40px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    font-family: 'Comic Sans MS', cursive;
}

.start-screen button:hover, .end-screen button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.end-screen h2 {
    font-size: 42px;
    margin-bottom: 30px;
}

.end-screen .final-time {
    font-size: 64px;
    margin-bottom: 30px;
    text-shadow: 3px 3px 10px rgba(0,0,0,0.3);
}

.hidden {
    display: none;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        border-radius: 15px;
    }
    
    .left-panel {
        flex: 0 0 15%;
        border-radius: 15px 15px 0 0;
    }
    
    .current-number {
        font-size: 32px;
        gap: 10px;
    }
    
    .tiger {
        width: 50px !important;
        height: 50px !important;
    }
    
    .info {
        top: 5px;
        left: 10px;
        right: 10px;
    }
    
    .top-line {
        margin-bottom: 5px;
        gap: 8px;
    }
    
    .player-name {
        font-size: 18px;
    }
    
    .progress-container {
        height: 30px;
    }
    
    .question-number {
        font-size: 18px;
    }
    
    .progress-bar {
        font-size: 14px;
    }
    
    .timer {
        font-size: 14px;
    }
    
    .right-panel {
        flex: 0 0 85%;
        padding: 15px;
        border: 5px solid #667eea;
        border-top: none;
        border-radius: 0 0 15px 15px;
    }
    
    .number-btn {
        font-size: 18px;
    }
}