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

:root {
    --bg-primary: #0d1329;
    --bg-secondary: #1a2140;
    --bg-card: #252b4a;
    --accent-red: #e53935;
    --accent-red-dark: #c62828;
    --accent-purple: #7c4dff;
    --accent-purple-dark: #651fff;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --text-placeholder: #5a6380;
    --success: #4ade80;
    --error: #f87171;
    --warning: #fbbf24;
}

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

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

.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    padding: 40px 24px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
}

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

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

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

/* Onboarding Screen */
.onboarding-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    align-items: center;
    padding-top: 40px;
}

.onboarding-slides {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.onboarding-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

.onboarding-slide.active {
    display: flex;
}

.slide-icon {
    font-size: 80px;
    margin-bottom: 30px;
}

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

.slide-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 300px;
}

.onboarding-dots {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--accent-red);
    width: 30px;
    border-radius: 5px;
}

.onboarding-buttons {
    display: flex;
    gap: 16px;
    width: 100%;
    max-width: 320px;
}

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

.btn-skip:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-next-slide {
    flex: 1.5;
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%);
    border: none;
    color: white;
    padding: 16px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(229, 57, 53, 0.3);
}

.btn-next-slide:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(229, 57, 53, 0.4);
}

/* Add Team Button */
.btn-add-team {
    background: transparent;
    border: 2px solid var(--accent-red);
    color: var(--text-primary);
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 auto 30px;
    display: block;
    transition: all 0.3s ease;
}

.btn-add-team:hover {
    background: var(--accent-red);
    transform: scale(1.02);
}

.btn-add-team:active {
    transform: scale(0.98);
}

/* Teams List */
.teams-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.team-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
}

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

.team-color {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.team-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    outline: none;
}

.team-input::placeholder {
    color: var(--text-placeholder);
}

.team-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.team-remove:hover {
    color: var(--accent-red);
}

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

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

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

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

.score-btn:hover {
    background: var(--accent-red);
    color: white;
}

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

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

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

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(229, 57, 53, 0.4);
}

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

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

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

/* Turn Screen */
.team-turn-card {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    margin: 40px 0;
    box-shadow: 0 8px 32px rgba(229, 57, 53, 0.3);
}

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

.turn-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.turn-hint.secondary {
    color: var(--accent-red);
    font-weight: 600;
}

/* Game Screen */
#game-screen {
    padding-top: 20px;
}

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

.team-indicator {
    background: var(--accent-red);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

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

.timer-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.timer-text.urgent {
    color: var(--error);
    animation: pulse 0.5s ease infinite;
}

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

/* Taboo Card */
.taboo-card {
    background: linear-gradient(180deg, #fff9c4 0%, #fff59d 100%);
    border-radius: 20px;
    padding: 24px;
    margin: 10px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.main-word {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    color: #1a237e;
    text-transform: uppercase;
    padding: 16px;
    letter-spacing: 2px;
}

.taboo-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
}

.taboo-divider::before,
.taboo-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--accent-red);
}

.taboo-label {
    background: var(--accent-red);
    color: white;
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0 12px;
}

.taboo-words {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.taboo-word {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-red-dark);
    text-align: center;
    padding: 8px;
    text-transform: uppercase;
}

/* Round Score */
.round-score {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
}

.round-score-item {
    text-align: center;
}

.round-score-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
}

.round-score-item.correct .round-score-value {
    color: var(--success);
}

.round-score-item.wrong .round-score-value {
    color: var(--error);
}

.round-score-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Game Buttons */
.game-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding: 20px 0;
}

.btn-taboo, .btn-skip-word, .btn-correct {
    flex: 1;
    padding: 16px 8px;
    border-radius: 16px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-taboo {
    background: var(--error);
    color: white;
}

.btn-skip-word {
    background: var(--warning);
    color: #1a1a1a;
}

.btn-correct {
    background: var(--success);
    color: white;
}

.btn-taboo:hover, .btn-skip-word:hover, .btn-correct:hover {
    transform: scale(1.02);
}

.btn-taboo:active, .btn-skip-word:active, .btn-correct:active {
    transform: scale(0.98);
}

/* Result Screen */
.result-summary {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.result-team-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-red);
    margin-bottom: 8px;
}

.result-points {
    font-size: 36px;
    font-weight: 800;
    color: var(--success);
}

.result-points.negative {
    color: var(--error);
}

.round-words-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

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

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

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

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

.round-word-text {
    font-size: 16px;
}

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

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

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

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

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

.score-item.leading {
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.2) 0%, rgba(229, 57, 53, 0.1) 100%);
    border: 1px solid var(--accent-red);
}

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

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

/* Final Screen */
.winner-icon {
    font-size: 100px;
    text-align: center;
    margin: 20px 0;
}

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

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

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

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

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

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

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

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

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

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

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

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

    .slide-icon {
        font-size: 60px;
        margin-bottom: 20px;
    }

    .taboo-card {
        padding: 16px;
    }

    .main-word {
        font-size: 26px;
        padding: 12px;
    }

    .taboo-word {
        font-size: 16px;
        padding: 6px;
    }

    .game-buttons {
        padding: 10px 0;
    }
}

@media (max-height: 600px) {
    .taboo-words {
        gap: 4px;
    }

    .taboo-word {
        font-size: 14px;
        padding: 4px;
    }

    .round-score {
        margin: 10px 0;
    }

    .round-score-value {
        font-size: 28px;
    }
}
