/* === CSS VARIABLES === */
:root {
    --magenta: #FF006E;
    --cyan: #00D4FF;
    --yellow: #FFE600;
    --orange: #FF6B00;
    --lime: #7FFF00;
    --purple: #8B00FF;
    --red: #FF3333;
    --teal: #00CED1;
    --gold: #FFD700;
    --pink: #FF69B4;
    --black: #000000;
    --white: #FFFFFF;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

/* === SCREENS === */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
}

.content {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
}

/* === BACKGROUNDS === */
.bg-magenta { background: var(--magenta); }
.bg-cyan { background: var(--cyan); }
.bg-yellow { background: var(--yellow); }
.bg-orange { background: var(--orange); }
.bg-lime { background: var(--lime); }
.bg-purple { background: var(--purple); color: var(--white); }
.bg-red { background: var(--red); }
.bg-teal { background: var(--teal); }
.bg-gold { background: var(--gold); }
.bg-pink { background: var(--pink); }

/* === TYPOGRAPHY === */
.title-mega {
    font-family: 'Bangers', cursive;
    font-size: clamp(4rem, 15vw, 10rem);
    line-height: 0.9;
    color: var(--black);
    text-shadow: 6px 6px 0 var(--white);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.bg-purple .title-mega {
    text-shadow: 6px 6px 0 var(--black);
    color: var(--white);
}

.title {
    font-family: 'Bangers', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: var(--black);
    text-shadow: 4px 4px 0 var(--white);
    margin-bottom: 1.5rem;
    letter-spacing: 0.03em;
}

.bg-purple .title {
    text-shadow: 4px 4px 0 var(--black);
    color: var(--white);
}

.subtitle {
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: var(--black);
    margin-bottom: 2rem;
    font-weight: 900;
}

.bg-purple .subtitle,
.bg-purple .hint {
    color: var(--white);
}

.hint {
    font-size: 1.1rem;
    color: var(--black);
    margin: 1rem 0;
    opacity: 0.8;
}

/* === BUTTONS === */
.btn {
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    padding: 1rem 3rem;
    border: 4px solid var(--black);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 6px 6px 0 var(--black);
}

.btn:hover {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 var(--black);
}

.btn:active {
    transform: translate(6px, 6px);
    box-shadow: 0 0 0 var(--black);
}

.btn-black {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.3);
}

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

.btn-danger {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.5);
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    opacity: 0.8;
    box-shadow: none;
}

.btn-danger:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

.btn-correct {
    background: var(--lime);
    color: var(--black);
    font-size: 2rem;
    padding: 1.5rem 4rem;
}

/* === PLAYER COUNT SELECTOR === */
.player-count-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.btn-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--black);
    color: var(--white);
    font-size: 2.5rem;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-circle:hover {
    transform: scale(1.1);
}

.count-display {
    font-family: 'Bangers', cursive;
    font-size: 6rem;
    color: var(--black);
    min-width: 120px;
}

/* === TEAM SETUP === */
.teams-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.team-tab {
    padding: 0.8rem 1.5rem;
    background: var(--black);
    color: var(--white);
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    border: 3px solid var(--black);
    transition: all 0.15s ease;
}

.team-tab.active {
    background: var(--white);
    color: var(--black);
}

.player-names-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--black);
}

#player-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.player-input-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    background: #FFFFFF;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 3px solid #000000;
    margin-bottom: 0.5rem;
    min-height: 50px;
}

.player-input-row select {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    border: 2px solid #000000;
    border-radius: 8px;
    background: #FFE600;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 55px;
}

.player-input-row input {
    flex: 1;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    outline: none;
    background: transparent;
    color: #000000;
    min-width: 100px;
    width: 100%;
}

.player-input-row input::placeholder {
    color: #666666;
}

/* === WORD INPUT === */
.current-player-label {
    font-size: 1.8rem;
    color: var(--black);
    margin-bottom: 0.5rem;
    font-weight: 900;
}

.current-player-label span {
    background: var(--black);
    color: var(--white);
    padding: 0.2rem 1rem;
    border-radius: 50px;
}

.word-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.word-input {
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border: 4px solid var(--black);
    border-radius: 50px;
    text-align: center;
    outline: none;
    transition: transform 0.15s ease;
}

.word-input:focus {
    transform: scale(1.02);
    box-shadow: 4px 4px 0 var(--black);
}

.progress-text {
    font-size: 1.2rem;
    color: var(--black);
    margin-top: 1rem;
    font-weight: 900;
}

/* === ROUND INTRO === */
.round-name {
    font-family: 'Bangers', cursive;
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: var(--black);
    margin-bottom: 1rem;
}

.round-rules {
    font-size: 1.3rem;
    color: var(--black);
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255,255,255,0.5);
    border-radius: 20px;
}

.score-display {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.team-score {
    background: var(--white);
    padding: 1rem 2rem;
    border-radius: 20px;
    border: 4px solid var(--black);
    min-width: 150px;
}

.team-score .team-name {
    font-weight: 900;
    font-size: 1rem;
    color: var(--black);
}

.team-score .score {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    color: var(--black);
}

/* === TURN SCREEN === */
.team-badge {
    display: inline-block;
    background: var(--white);
    color: var(--black);
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    padding: 0.5rem 2rem;
    border-radius: 20px;
    border: 4px solid var(--black);
    margin-bottom: 1rem;
}

.turn-player {
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: 2rem;
}

.turn-player span {
    background: var(--black);
    padding: 0.2rem 1rem;
    border-radius: 50px;
}

/* === GAMEPLAY === */
.play-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 2rem;
}

.timer-container {
    flex-shrink: 0;
}

.timer {
    font-family: 'Bangers', cursive;
    font-size: clamp(5rem, 20vw, 12rem);
    color: var(--white);
    text-shadow: 6px 6px 0 var(--black);
    animation: pulse 1s ease-in-out infinite;
}

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

.timer.urgent {
    color: var(--yellow);
    animation: shake 0.3s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.word-card {
    background: var(--white);
    padding: 2rem 3rem;
    border-radius: 30px;
    border: 6px solid var(--black);
    box-shadow: 10px 10px 0 var(--black);
    max-width: 90%;
}

.word-card span {
    font-family: 'Bangers', cursive;
    font-size: clamp(2.5rem, 10vw, 5rem);
    color: var(--black);
    word-break: break-word;
}

.play-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.team-score-live {
    font-size: 1.5rem;
    color: var(--white);
    font-weight: 900;
}

.team-score-live span {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
}

/* === TURN END === */
.turn-result {
    font-size: 1.8rem;
    color: var(--black);
    margin-bottom: 2rem;
}

.turn-result span {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
}

/* === FINAL RESULTS === */
.winner-announcement {
    font-family: 'Bangers', cursive;
    font-size: clamp(2rem, 8vw, 4rem);
    color: var(--black);
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 20px;
    border: 4px solid var(--black);
}

.final-scores {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.final-score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 1rem 2rem;
    border-radius: 50px;
    border: 4px solid var(--black);
}

.final-score-row.winner {
    background: var(--lime);
    transform: scale(1.05);
}

.final-score-row .team-name {
    font-weight: 900;
    font-size: 1.3rem;
}

.final-score-row .score {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--black);
    border-radius: 10px;
}

/* === WELCOME BUTTONS === */
.welcome-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* === HELP BUTTON === */
.btn-help {
    background: transparent;
    color: var(--black);
    margin-top: 2.5rem;
    font-size: 0.95rem;
    padding: 0.5rem 1.5rem;
    border: 3px solid var(--black);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
    opacity: 0.85;
}

.btn-help:hover {
    opacity: 1;
    background: rgba(255,255,255,0.3);
}

/* === HELP MODAL === */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.help-modal.active {
    display: flex;
}

.help-content {
    background: var(--yellow);
    border: 6px solid var(--black);
    border-radius: 30px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 12px 12px 0 var(--black);
    animation: popIn 0.3s ease;
}

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

.help-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--black);
    color: var(--white);
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.help-close:hover {
    transform: scale(1.1) rotate(90deg);
}

.help-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--black);
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 3px 3px 0 var(--white);
}

.help-section {
    background: var(--white);
    border: 4px solid var(--black);
    border-radius: 20px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

.help-section h3 {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    color: var(--black);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.help-section p {
    font-size: 1rem;
    color: var(--black);
    line-height: 1.5;
}

.round-explain {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin: 0.8rem 0;
}

.round-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    color: var(--black);
    border: 3px solid var(--black);
    flex-shrink: 0;
}

.round-explain div {
    font-size: 0.95rem;
    line-height: 1.4;
}

.round-explain strong {
    font-family: 'Bangers', cursive;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.help-content .btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .content {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.8rem 2rem;
        font-size: 1.2rem;
    }
    
    .btn-correct {
        padding: 1rem 2rem;
        font-size: 1.5rem;
    }
    
    .word-card {
        padding: 1.5rem 2rem;
    }
    
    .score-display {
        gap: 0.5rem;
    }
    
    .team-score {
        padding: 0.5rem 1rem;
        min-width: 100px;
    }
    
    .team-score .score {
        font-size: 2rem;
    }
    
    .help-content {
        padding: 1.5rem;
        padding-top: 3rem;
    }
    
    .help-section {
        padding: 0.8rem 1rem;
    }
    
    .help-title {
        font-size: 1.6rem;
    }
    
    .btn-help {
        font-size: 0.85rem;
        padding: 0.4rem 1.2rem;
        margin-top: 2rem;
    }
}

