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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Logo */
.logo {
    font-size: 3.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #00d4ff, #ff00d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.logo-small {
    font-size: 2rem;
    margin: 0;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card h2 {
    margin-bottom: 25px;
    font-size: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #00d4ff;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(255, 255, 255, 0.15);
}

input[type="text"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: rgba(0, 212, 255, 0.4);
    background: rgba(0, 212, 255, 0.05);
    color: rgba(0, 212, 255, 0.8);
    font-style: italic;
}

/* Team Inputs */
.team-input {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.team-input input {
    flex: 1;
}

/* Buttons */
button {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(45deg, #00d4ff, #0088ff);
    color: #fff;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-remove {
    background: rgba(255, 0, 100, 0.2);
    color: #ff0066;
    border: 2px solid rgba(255, 0, 100, 0.3);
    padding: 15px 20px;
    font-size: 1.2rem;
}

.btn-remove:hover {
    background: rgba(255, 0, 100, 0.3);
}

.btn-remove:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-text {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    padding: 10px;
    margin-top: 15px;
}

.btn-text:hover {
    color: #fff;
}

.btn-large {
    font-size: 1.5rem;
    padding: 25px 50px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #ff00d4);
    transition: width 0.3s;
    width: 0%;
}

.status-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

/* Button Groups */
.word-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.word-input-group input {
    flex: 1;
}

.btn-random-word {
    background: rgba(255, 200, 0, 0.15);
    color: #ffd700;
    border: 2px solid rgba(255, 200, 0, 0.3);
    border-radius: 10px;
    padding: 15px 18px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    width: auto;
}

.btn-random-word:hover {
    background: rgba(255, 200, 0, 0.3);
    transform: translateY(-2px);
}

.btn-random-word:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.button-group button {
    flex: 1;
}

/* Game Screen */
.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.round-indicator {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
}

/* Scoreboard */
.scoreboard {
    margin-bottom: 30px;
}

#scores-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.team-score {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.team-score.active {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.team-score .team-name {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.team-score .score {
    font-size: 2rem;
    font-weight: 900;
    color: #00d4ff;
}

/* Game Area */
.game-area {
    position: relative;
}

.turn-state {
    display: none;
}

.turn-state.active {
    display: block;
}

.text-center {
    text-align: center;
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Timer */
.timer-display {
    font-size: 4rem;
    font-weight: 900;
    text-align: center;
    color: #00d4ff;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* Word Card */
.word-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 60px 30px;
    margin-bottom: 30px;
    text-align: center;
    border: 3px solid rgba(0, 212, 255, 0.3);
}

#current-word {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.btn-pass {
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: #fff;
    font-size: 1.3rem;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.btn-pass:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.6);
}

.btn-correct {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: #fff;
    font-size: 1.3rem;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.btn-correct:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.6);
}

.turn-score {
    text-align: center;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.turn-score span {
    font-weight: 900;
    font-size: 1.5rem;
    color: #00ff88;
}

.words-left {
    text-align: center;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.words-left span {
    font-weight: 700;
    color: #fff;
}

/* Score Display */
.score-display {
    font-size: 4rem;
    font-weight: 900;
    color: #00ff88;
    margin: 30px 0;
}

/* Round End */
#round-scores {
    margin: 30px 0;
}

#round-scores .team-score {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
}

/* Final Results */
.final-results {
    margin: 30px 0;
}

.final-team {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.final-team:first-child {
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.btn-end-game {
    margin-top: 20px;
    width: 100%;
}

.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .card {
        padding: 20px;
    }
    
    #current-word {
        font-size: 1.8rem;
    }
    
    .word-card {
        padding: 40px 20px;
    }
    
    .timer-display {
        font-size: 3rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .btn-pass, .btn-correct {
        padding: 20px;
    }
    
    .score-display {
        font-size: 3rem;
    }
}

/* Time Options Buttons */
.time-options {
    display: flex;
    gap: 10px;
}

.btn-time {
    flex: 1; /* Make buttons share the space equally */
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 15px 10px; /* Adjust padding for smaller buttons */
    font-size: 1rem;
    text-align: center;
}

.btn-time:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-time.active {
    background: #00d4ff;
    color: #1a1a2e; /* Dark text for contrast */
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

/* Header Buttons */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.btn-header {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.btn-header:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-abort-game {
    display: block;
    width: fit-content;
    margin: 40px auto 20px auto;
    background: rgba(255, 0, 100, 0.2);
    color: #ff0066;
    border: 2px solid rgba(255, 0, 100, 0.3);
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-abort-game:hover {
    background: rgba(255, 0, 100, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
}

.modal-buttons .btn {
    width: auto;
    min-width: 100px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex; /* Shown when active */
}

.modal-content {
    background: #1e1e3f;
    padding: 30px;
    border-radius: 15px;
    max-width: 90%;
    width: 500px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #00d4ff;
}

.modal-content h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #00d4ff;
}

.modal-content p, .modal-content li {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.modal-content ul, .modal-content ol {
    padding-left: 20px;
    margin-bottom: 15px;
}