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

:root {
    /* Team Colors */
    --team1-color: #ef4444;
    --team1-light: #fca5a5;
    --team1-dark: #b91c1c;

    --team2-color: #3b82f6;
    --team2-light: #93c5fd;
    --team2-dark: #1e40af;

    /* UI Colors */
    --bg-dark: #0f172a;
    --bg-medium: #1e293b;
    --bg-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --accent-gold: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;

    /* Shadows */
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.7);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ===== SCREEN MANAGEMENT ===== */
.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    padding: 2vh;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ===== START SCREEN ===== */
.logo-container {
    text-align: center;
    margin-bottom: 5vh;
    animation: fadeInDown 1s ease;
}

.logo-icon {
    font-size: 15vh;
    color: var(--accent-gold);
    margin-bottom: 2vh;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.5));
}

.game-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 12vh;
    letter-spacing: 1.5vh;
    background: linear-gradient(45deg, var(--team1-color), var(--accent-gold), var(--team2-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1vh;
    text-shadow: 0 0 40px rgba(251, 191, 36, 0.3);
}

.subtitle {
    font-size: 3vh;
    color: var(--text-secondary);
    font-weight: 300;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 2vh;
    width: 50vw;
    max-width: 600px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 2.5vh 4vw;
    font-size: 3vh;
    font-weight: 600;
    border: none;
    border-radius: 1.5vh;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5vw;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.2vh;
    box-shadow: var(--shadow-lg);
}

.btn i {
    font-size: 3.5vh;
}

.btn-primary {
    background: linear-gradient(135deg, var(--team1-color), var(--team2-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-0.5vh) scale(1.02);
    box-shadow: var(--shadow-xl);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-medium);
    transform: translateY(-0.5vh);
}

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

.btn-success:hover {
    filter: brightness(1.2);
}

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

.btn-danger:hover {
    filter: brightness(1.2);
}

.btn-clue {
    background: var(--accent-gold);
    color: var(--bg-dark);
}

.btn-clue:hover {
    filter: brightness(1.15);
}

.btn-penalty {
    background: #f97316;
    color: white;
}

.btn-penalty:hover {
    filter: brightness(1.2);
}

.btn-large {
    padding: 3vh 5vw;
    font-size: 3.5vh;
}

.btn-small {
    padding: 1.5vh 2vw;
    font-size: 2vh;
}

.btn-reveal {
    margin-top: 2vh;
    padding: 1.5vh 3vw;
    font-size: 2.5vh;
    background: var(--bg-light);
    color: var(--text-primary);
    border: none;
    border-radius: 1vh;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.btn-reveal:hover {
    background: var(--bg-medium);
    transform: scale(1.05);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-medium);
    border-radius: 2vh;
    width: 70vw;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--bg-light);
}

.modal-large {
    width: 85vw;
    max-width: 1200px;
}

.modal-small {
    width: 50vw;
    max-width: 600px;
    min-width: 400px;
}

.modal-header {
    padding: 3vh 4vw;
    border-bottom: 2px solid var(--bg-light);
    background: var(--bg-dark);
    border-radius: 2vh 2vh 0 0;
}

.modal-header h2 {
    font-size: 4vh;
    font-family: 'Righteous', sans-serif;
    display: flex;
    align-items: center;
    gap: 2vw;
}

.modal-body {
    padding: 3vh 4vw;
}

.modal-footer {
    padding: 2vh 4vw;
    border-top: 2px solid var(--bg-light);
    display: flex;
    gap: 2vw;
    justify-content: flex-end;
}

/* ===== SETUP FORM ===== */
.setup-section {
    margin-bottom: 3vh;
}

.setup-section label {
    display: block;
    font-size: 2.5vh;
    font-weight: 600;
    margin-bottom: 1vh;
    color: var(--text-secondary);
}

.setup-section input {
    width: 100%;
    padding: 1.5vh 2vw;
    font-size: 2.5vh;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    border-radius: 1vh;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
}

.setup-section input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.setup-section select {
    width: 100%;
    padding: 1.5vh 2vw;
    font-size: 2.5vh;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    border-radius: 1vh;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

.setup-section select:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.word-count-info {
    margin-top: 1vh;
    padding: 1vh 2vw;
    background: var(--bg-dark);
    border-radius: 0.5vh;
    font-size: 2vh;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 1vw;
}

.input-hint {
    margin-top: 0.5vh;
    font-size: 1.8vh;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== RULES ===== */
.rules-content {
    font-size: 2.2vh;
    line-height: 1.8;
}

.rules-content h3 {
    font-size: 3vh;
    margin-bottom: 2vh;
    color: var(--accent-gold);
}

.rules-content ol {
    margin-left: 3vw;
}

.rules-content li {
    margin-bottom: 1.5vh;
}

.rules-content ul {
    margin-left: 2vw;
    margin-top: 1vh;
}

/* ===== GAME SCREEN ===== */
#gameScreen.active {
    display: block;
    padding: 0;
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2vh 3vw;
    background: var(--bg-dark);
    border-bottom: 3px solid var(--accent-gold);
    height: 18vh;
}

.team-score {
    display: flex;
    align-items: center;
    gap: 2vw;
    flex: 1;
}

.team1-score {
    color: var(--team1-color);
}

.team2-score {
    color: var(--team2-color);
    flex-direction: row-reverse;
    text-align: right;
}

.team-icon {
    font-size: 6vh;
    background: var(--bg-medium);
    width: 10vh;
    height: 10vh;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team1-score .team-icon {
    background: linear-gradient(135deg, var(--team1-dark), var(--team1-color));
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.team2-score .team-icon {
    background: linear-gradient(135deg, var(--team2-dark), var(--team2-color));
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.team-info h3 {
    font-size: 3vh;
    font-weight: 700;
    margin-bottom: 0.5vh;
}

.score {
    font-size: 6vh;
    font-weight: 900;
    font-family: 'Bebas Neue', sans-serif;
}

.round-info {
    text-align: center;
    flex: 1;
}

.password-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3vh;
    letter-spacing: 0.5vh;
    color: var(--accent-gold);
    margin-bottom: 1vh;
}

.timer-container {
    font-size: 6vh;
    font-weight: 900;
    font-family: 'Bebas Neue', sans-serif;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1vw;
}

.timer-container.warning {
    color: var(--danger);
    animation: pulse 1s infinite;
}

.timer-container.infinite {
    color: var(--accent-gold);
}

/* ===== GAME AREA ===== */
.game-area {
    height: calc(82vh);
    padding: 3vh 4vw;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3vh;
}

.turn-indicator {
    text-align: center;
    font-size: 4vh;
    font-weight: 700;
    padding: 2vh;
    background: var(--bg-medium);
    border-radius: 1.5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2vw;
    animation: slideInDown 0.5s ease;
}

.turn-indicator i {
    color: var(--accent-gold);
    font-size: 5vh;
}

/* ===== PASSWORD DISPLAY ===== */
.password-display {
    display: flex;
    justify-content: center;
    margin: 2vh 0;
}

.password-card {
    background: linear-gradient(135deg, var(--bg-medium), var(--bg-light));
    border: 3px solid var(--accent-gold);
    border-radius: 2vh;
    padding: 4vh 6vw;
    text-align: center;
    box-shadow: var(--shadow-xl);
    min-width: 50vw;
    position: relative;
}

.password-icon {
    font-size: 6vh;
    color: var(--text-secondary);
    margin-bottom: 2vh;
}

.password-word {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 10vh;
    letter-spacing: 1vh;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
    margin-bottom: 2vh;
    filter: blur(0px);
    transition: filter 0.3s ease;
}

.password-card.hidden .password-word {
    filter: blur(15px);
    user-select: none;
}

.password-card.hidden .password-icon {
    color: var(--danger);
}

.password-card.revealed .password-icon {
    color: var(--success);
}

/* ===== CLUE SECTION ===== */
.clue-section {
    background: var(--bg-medium);
    border-radius: 1.5vh;
    padding: 2vh 3vw;
}

.clue-section h3 {
    font-size: 3vh;
    margin-bottom: 2vh;
    display: flex;
    align-items: center;
    gap: 1.5vw;
    color: var(--accent-gold);
}

.clues-container {
    min-height: 8vh;
    max-height: 20vh;
    overflow-y: auto;
    margin-bottom: 2vh;
}

.no-clues {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 2.5vh;
    text-align: center;
    padding: 2vh 0;
}

.clue-item {
    background: var(--bg-dark);
    padding: 1.5vh 2vw;
    margin-bottom: 1vh;
    border-radius: 1vh;
    font-size: 2.8vh;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2vw;
    animation: slideInLeft 0.3s ease;
}

.clue-number {
    background: var(--accent-gold);
    color: var(--bg-dark);
    width: 4vh;
    height: 4vh;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-family: 'Bebas Neue', sans-serif;
}

.clue-count {
    text-align: center;
    font-size: 3vh;
    font-weight: 700;
    color: var(--accent-gold);
    padding: 1.5vh;
    background: var(--bg-dark);
    border-radius: 1vh;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 2vw;
    justify-content: center;
}

.control-buttons {
    display: flex;
    gap: 2vw;
    justify-content: center;
    margin-top: auto;
}

/* ===== WINNER MODAL ===== */
.winner-content {
    text-align: center;
}

.winner-celebration {
    padding: 5vh 4vw;
}

.trophy-icon {
    font-size: 15vh;
    color: var(--accent-gold);
    margin-bottom: 3vh;
    animation: bounce 1s infinite;
    filter: drop-shadow(0 0 40px rgba(251, 191, 36, 0.6));
}

.winner-celebration h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 8vh;
    margin-bottom: 2vh;
    background: linear-gradient(45deg, var(--accent-gold), #fde047);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-score {
    font-size: 4vh;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== WORD LIST ===== */
.word-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5vh;
}

.word-item {
    background: var(--bg-dark);
    padding: 1.5vh 2vw;
    border-radius: 1vh;
    font-size: 2.5vh;
    font-weight: 600;
    text-align: center;
    border-left: 4px solid var(--accent-gold);
}

.word-item.guessed {
    border-left-color: var(--success);
    opacity: 0.6;
}

.word-item.passed {
    border-left-color: var(--danger);
    opacity: 0.6;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-3vh);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-5vh);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-5vw);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2vh);
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 1vh;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-light);
    border-radius: 1vh;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* ===== ACTIVE TEAM HIGHLIGHT ===== */
.team1-score.active {
    animation: glow-red 1s ease-in-out infinite;
}

.team2-score.active {
    animation: glow-blue 1s ease-in-out infinite;
}

@keyframes glow-red {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8));
    }
}

@keyframes glow-blue {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.8));
    }
}

/* ===== WORD MANAGER ===== */
.word-manager-section {
    margin-bottom: 3vh;
    padding: 2vh 0;
    border-bottom: 1px solid var(--bg-light);
}

.word-manager-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2vh;
}

.section-header h3 {
    font-size: 2.8vh;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 1vw;
}

.word-actions {
    display: flex;
    gap: 1vw;
}

.list-actions {
    margin-top: 1.5vh;
    display: flex;
    gap: 1vw;
}

#managerListSelect {
    width: 100%;
    padding: 1.5vh 2vw;
    font-size: 2.5vh;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    border-radius: 1vh;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

/* ===== ADD WORD FORM ===== */
.add-word-form {
    display: flex;
    gap: 1vw;
    margin-bottom: 2vh;
    padding: 1.5vh;
    background: var(--bg-dark);
    border-radius: 1vh;
    animation: slideInDown 0.3s ease;
}

.add-word-form input {
    flex: 1;
    padding: 1.5vh 2vw;
    font-size: 2.5vh;
    background: var(--bg-medium);
    border: 2px solid var(--bg-light);
    border-radius: 1vh;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
}

.add-word-form input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

/* ===== WORDS DISPLAY ===== */
.words-display {
    max-height: 40vh;
    overflow-y: auto;
    background: var(--bg-dark);
    border-radius: 1vh;
    padding: 1.5vh;
}

.no-words {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 2.2vh;
    padding: 3vh;
}

.word-chip {
    display: inline-flex;
    align-items: center;
    gap: 1vw;
    background: var(--bg-medium);
    padding: 1vh 1.5vw;
    margin: 0.5vh;
    border-radius: 1vh;
    font-size: 2.2vh;
    font-weight: 600;
    border: 2px solid var(--bg-light);
    animation: fadeIn 0.3s ease;
}

.word-chip .word-text {
    color: var(--text-primary);
}

.word-chip .delete-word {
    background: var(--danger);
    color: white;
    border: none;
    width: 3vh;
    height: 3vh;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5vh;
    transition: all 0.2s ease;
}

.word-chip .delete-word:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* ===== IMPORT SECTION ===== */
.import-section {
    margin-bottom: 2vh;
}

.import-section h4 {
    font-size: 2.5vh;
    margin-bottom: 1vh;
    color: var(--accent-gold);
}

.import-section textarea {
    width: 100%;
    padding: 1.5vh 2vw;
    font-size: 2.2vh;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    border-radius: 1vh;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    resize: vertical;
}

.import-section textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.import-section input[type="file"] {
    width: 100%;
    padding: 1.5vh 2vw;
    font-size: 2.2vh;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    border-radius: 1vh;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

.import-section input[type="file"]::-webkit-file-upload-button {
    background: var(--accent-gold);
    color: var(--bg-dark);
    border: none;
    padding: 1vh 2vw;
    border-radius: 0.5vh;
    cursor: pointer;
    font-weight: 600;
    margin-right: 1vw;
}

/* ===== HELP SECTION ===== */
.help-section {
    background: var(--bg-dark);
    border-radius: 1vh;
    padding: 1.5vh 2vw;
}

.help-section summary {
    font-size: 2.5vh;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 1vw;
}

.help-section summary:hover {
    color: var(--accent-gold);
}

.help-content {
    margin-top: 2vh;
    font-size: 2vh;
    line-height: 1.6;
}

.help-content h4 {
    color: var(--accent-gold);
    margin: 1.5vh 0 1vh 0;
    font-size: 2.2vh;
}

.help-content p {
    margin-bottom: 1vh;
    color: var(--text-secondary);
}

.help-content pre {
    background: var(--bg-medium);
    padding: 1vh 1.5vw;
    border-radius: 0.5vh;
    border-left: 3px solid var(--accent-gold);
    font-size: 1.8vh;
    overflow-x: auto;
}

/* ===== CUSTOM ALERT/PROMPT MODALS ===== */
.alert-message {
    font-size: 2.5vh;
    line-height: 1.6;
    color: var(--text-primary);
    text-align: center;
    margin: 2vh 0;
}

.prompt-input {
    width: 100%;
    padding: 1.5vh 2vw;
    font-size: 2.5vh;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    border-radius: 1vh;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    margin-top: 2vh;
}

.prompt-input:focus {
    outline: none;
    border-color: var(--accent-gold);
}
