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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    margin: 0;
    padding-top: 60px; /* Space for top nav */
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 20px;
}

.nav-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

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

.nav-btn:not(:first-child) {
    margin-left: 10px;
}

.nav-btn.reset-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    letter-spacing: 2px;
}

header p {
    font-size: 1.8rem;
    opacity: 0.95;
    font-weight: 600;
}

main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

.game-area {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px 40px 40px 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 750px;
}

.game-top {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
    padding: 0;
}

.spinner-container {
    text-align: center;
    margin-bottom: 40px;
}

.spinner {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #fd79a8, #6c5ce7);
    background-size: 200% 200%;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 6px solid white;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
    overflow: hidden;
    animation: subtle-rainbow 4s ease-in-out infinite;
}

.spinner.spinning {
    animation: spin 2s cubic-bezier(0.4, 0.0, 0.2, 1);
    background-animation: gradient-shift 2s ease-in-out;
}

.spinner-word {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    max-width: 300px;
    word-wrap: break-word;
    z-index: 20;
    background: rgba(255,255,255,0.9);
    padding: 15px 20px;
    border-radius: 15px;
    color: #333;
}

.current-word {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 40px;
    border-radius: 20px;
    margin: 30px 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border: 3px solid rgba(255,255,255,0.8);
}

.word-display {
    font-size: 3.5rem;
    font-weight: 900;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
}

.word-display.revealed {
    animation: wordReveal 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.spin-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Removed reset functionality */

.history-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 750px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 20px;
}

.history-panel h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.stats span {
    font-weight: 600;
}

.called-words-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.called-words {
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
}

.called-words::-webkit-scrollbar {
    width: 8px;
}

.called-words::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.called-words::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.called-words::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.word-item {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}

.word-item.new-word {
    transform: translateY(-100%);
    opacity: 0;
    animation: slideInFromTop 0.4s ease-out forwards;
}

.word-number {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.no-words {
    text-align: center;
    opacity: 0.7;
    font-style: italic;
    padding: 20px;
}

/* Bouncing Balls - RAINBOW EXPLOSION! */
.bouncing-ball {
    position: absolute;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
    animation: ball-glow 1s ease-in-out infinite alternate;
}

.bouncing-ball::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.bouncing-ball::after {
    content: '';
    position: absolute;
    top: 10%;
    right: 25%;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
}

.bouncing-ball.ball-1 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ff0000, #cc0000);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

.bouncing-ball.ball-2 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ff7f00, #cc5500);
    box-shadow: 0 0 20px rgba(255, 127, 0, 0.8);
}

.bouncing-ball.ball-3 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ffff00, #cccc00);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
}

.bouncing-ball.ball-4 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #00ff00, #00cc00);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
}

.bouncing-ball.ball-5 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #0000ff, #0000cc);
    box-shadow: 0 0 20px rgba(0, 0, 255, 0.8);
}

.bouncing-ball.ball-6 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #4b0082, #330055);
    box-shadow: 0 0 20px rgba(75, 0, 130, 0.8);
}

.bouncing-ball.ball-7 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #9400d3, #6600aa);
    box-shadow: 0 0 20px rgba(148, 0, 211, 0.8);
}

.bouncing-ball.ball-8 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ff1493, #cc1177);
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.8);
}

.bouncing-ball.ball-9 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #00ffff, #00cccc);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

.bouncing-ball.ball-10 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ff69b4, #cc5599);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.8);
}

.bouncing-ball.ball-11 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #32cd32, #22aa22);
    box-shadow: 0 0 20px rgba(50, 205, 50, 0.8);
}

.bouncing-ball.ball-12 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ffa500, #cc8800);
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.8);
}

.bouncing-ball.ball-13 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ff4500, #cc3300);
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.8);
}

.bouncing-ball.ball-14 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #8a2be2, #6622aa);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.8);
}

.bouncing-ball.ball-15 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #00fa9a, #00cc77);
    box-shadow: 0 0 20px rgba(0, 250, 154, 0.8);
}

.bouncing-ball.ball-16 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #dc143c, #aa1133);
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.8);
}

.bouncing-ball.ball-17 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #00bfff, #0099cc);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.8);
}

.bouncing-ball.ball-18 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ff6347, #cc5544);
    box-shadow: 0 0 20px rgba(255, 99, 71, 0.8);
}

/* Animations */

@keyframes subtle-rainbow {
    0% { 
        background-position: 0% 50%; 
    }
    50% { 
        background-position: 100% 50%; 
    }
    100% { 
        background-position: 0% 50%; 
    }
}

@keyframes ball-glow {
    from { 
        transform: scale(1);
        filter: brightness(1);
    }
    to { 
        transform: scale(1.05);
        filter: brightness(1.1);
    }
}

@keyframes wordReveal {
    0% {
        transform: scale(0.3) rotateY(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotateY(90deg);
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

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

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

/* Responsive Design */
@media (max-width: 1200px) {
    main {
        grid-template-columns: 1fr;
        gap: 30px;
        max-height: none;
    }
    
    .history-panel {
        position: static;
        height: fit-content;
        max-height: 500px;
    }
    
    .called-words {
        max-height: 350px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 50px;
    }
    
    .top-nav {
        padding: 10px 15px;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    header h1 {
        font-size: 3rem;
    }
    
    header p {
        font-size: 1.4rem;
    }
    
    .spinner {
        width: 300px;
        height: 300px;
    }
    
    .spinner-word {
        font-size: 1.4rem;
        max-width: 200px;
        padding: 10px 15px;
    }
    
    .game-area {
        padding: 15px 20px 30px 20px;
    }
    
    .word-display {
        font-size: 2.5rem;
        min-height: 80px;
    }
    
    .current-word {
        padding: 30px;
    }
    
    .spin-btn {
        padding: 12px 25px;
        font-size: 1.2rem;
    }
    
    .history-panel {
        height: fit-content;
        max-height: 400px;
    }
    
    .called-words {
        max-height: 280px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    header p {
        font-size: 1.1rem;
    }
    
    .spinner {
        width: 250px;
        height: 250px;
    }
    
    .spinner-word {
        font-size: 1.1rem;
        max-width: 150px;
        padding: 8px 12px;
    }
    
    .word-display {
        font-size: 1.8rem;
        min-height: 60px;
    }
    
    .current-word {
        padding: 20px;
    }
    
    .spin-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
} 