/* Countdown Game Show Styles */

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

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

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

/* Header Styles */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 3px solid #ffd700;
    position: relative;
}

.game-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 8px;
    color: #ffd700;
    text-shadow: 3px 3px 0px #ff6b35, 6px 6px 0px #1e3c72;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timer-container {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: center;
}

.timer {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 15px 25px;
    border-radius: 50%;
    border: 4px solid #ffd700;
    min-width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.timer.warning {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    animation: pulse 1s infinite;
}

.timer-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffd700;
    margin-top: 5px;
    letter-spacing: 2px;
}

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

/* Game Selection */
.game-selection {
    text-align: center;
    padding: 40px 0;
}

.game-selection h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #ffd700;
    text-shadow: 2px 2px 0px #1e3c72;
}

.game-buttons {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.game-btn {
    padding: 25px 40px;
    font-size: 1.5rem;
    font-weight: 700;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.numbers-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.letters-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.settings-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid #ffd700;
}

.game-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.btn-icon {
    font-size: 2rem;
}

/* Game Screens */
.game-screen {
    display: none;
    animation: slideIn 0.5s ease-out;
}

.game-screen.active {
    display: block;
}

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

.game-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.game-info h2 {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 10px;
}

.game-info p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Numbers Game Styles */
.target-display {
    text-align: center;
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.target-label {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.target-number {
    font-size: 4rem;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.numbers-selection, .letters-selection {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.selection-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.selection-controls label {
    font-weight: 700;
    font-size: 1.1rem;
}

.selection-controls select {
    padding: 10px 15px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
}

.generate-btn, .letter-type-btn {
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.generate-btn:hover, .letter-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.selected-numbers, .selected-letters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.number-tile, .letter-tile {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: 3px solid #ffd700;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

/* .letter-tile {
    background: linear-gradient(135deg, #f093fb, #f5576c);
} */

.number-tile:hover, .letter-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.number-tile.used, .letter-tile.used {
    opacity: 0.5;
    transform: scale(0.9);
}

/* Calculation Area */
.calculation-area, .word-input-area {
    margin: 30px 0;
    padding: 25px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.input-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.input-section label {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 120px;
}

.input-section input {
    flex: 1;
    min-width: 300px;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background: white;
    color: #333;
}

.calculate-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

.result-display {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 20px;
    border-radius: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-display.success {
    background: linear-gradient(135deg, #2ed573, #1e90ff);
    color: white;
}

.result-display.partial {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    color: white;
}

.result-display.error {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
}

/* Letters Game Specific */
.vowel-consonant-controls {
    display: flex;
    gap: 15px;
}

.letter-count {
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffd700;
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.start-btn {
    background: linear-gradient(135deg, #2ed573, #1e90ff);
    color: white;
}

.reset-btn {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    color: white;
}

.back-btn {
    background: linear-gradient(135deg, #747d8c, #57606f);
    color: white;
}

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

/* Score Display */
.score-display {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.8);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid #ffd700;
}

.score-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    min-width: 180px;
}

.score-label {
    font-weight: 700;
    color: #ffd700;
}

.score-value {
    font-weight: 900;
    color: white;
}

.total-score {
    border-top: 2px solid #ffd700;
    padding-top: 10px;
    margin-top: 10px;
}

.total-score .score-label,
.total-score .score-value {
    font-size: 1.2rem;
    color: #ffd700;
}

/* Settings Screen Styles */
.settings-screen {
    max-width: 800px;
    margin: 0 auto;
}

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.setting-section {
    background: rgba(255,255,255,0.1);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,215,0,0.2);
}

.setting-section h3 {
    color: #ffd700;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.setting-section p {
    margin-bottom: 20px;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
    padding-left: 35px;
    user-select: none;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background: rgba(255,255,255,0.2);
    border: 2px solid #ffd700;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-label:hover input ~ .checkmark {
    background: rgba(255,215,0,0.2);
}

.checkbox-label input:checked ~ .checkmark {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #333;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
    padding-left: 35px;
    user-select: none;
}

.radio-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.radio-mark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background: rgba(255,255,255,0.2);
    border: 2px solid #ffd700;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.radio-label:hover input ~ .radio-mark {
    background: rgba(255,215,0,0.2);
}

.radio-label input:checked ~ .radio-mark {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
}

.radio-mark:after {
    content: "";
    position: absolute;
    display: none;
}

.radio-label input:checked ~ .radio-mark:after {
    display: block;
}

.radio-label .radio-mark:after {
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
}

/* Dictionary Options */
.dictionary-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dictionary-info {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255,215,0,0.1);
    border-radius: 8px;
    border: 1px solid rgba(255,215,0,0.3);
}

.dictionary-info small {
    color: #ffd700;
    font-style: italic;
}

/* API Configuration */
.api-config-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.api-config-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.api-config-panel {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 1px solid rgba(255,215,0,0.3);
}

.api-config-panel h4 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.api-config-panel p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.api-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border: 1px solid rgba(255,215,0,0.2);
}

.api-section label {
    display: block;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 10px;
}

.api-section input {
    width: 200px;
    padding: 8px 12px;
    margin: 5px 10px 5px 0;
    border: 1px solid #ffd700;
    border-radius: 6px;
    background: rgba(255,255,255,0.9);
    color: #333;
}

.api-section button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #2ed573, #1e90ff);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.api-section button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.api-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255,215,0,0.1);
    border-radius: 8px;
    border: 1px solid rgba(255,215,0,0.3);
}

.api-info h5 {
    color: #ffd700;
    margin-bottom: 10px;
}

.api-info ul {
    margin-left: 20px;
}

.api-info li {
    margin-bottom: 5px;
}

.api-info a {
    color: #87ceeb;
    text-decoration: none;
}

.api-info a:hover {
    text-decoration: underline;
}

.api-status {
    margin-left: 10px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.api-status.enabled {
    color: #2ed573;
}

.api-status.disabled {
    color: #ff4757;
}

/* Timer Controls */
.timer-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.timer-controls label {
    font-weight: 700;
    color: #ffd700;
}

.timer-controls input[type="range"] {
    flex: 1;
    min-width: 200px;
    height: 8px;
    border-radius: 5px;
    background: rgba(255,255,255,0.2);
    outline: none;
    appearance: none;
}

.timer-controls input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.timer-controls input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#timer-value {
    font-weight: 700;
    color: #ffd700;
    min-width: 30px;
}

/* Option Controls */
.option-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Settings Controls */
.settings-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.save-btn {
    background: linear-gradient(135deg, #2ed573, #1e90ff);
    color: white;
}

/* Responsive Settings */
@media (max-width: 768px) {
    .settings-container {
        gap: 20px;
    }
    
    .setting-section {
        padding: 20px;
    }
    
    .radio-group,
    .dictionary-options,
    .option-controls {
        gap: 10px;
    }
    
    .timer-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timer-controls input[type="range"] {
        min-width: 100%;
    }
    
    .settings-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .settings-controls .control-btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }
    
    .timer-container {
        position: static;
        margin-top: 20px;
    }
    
    .timer {
        font-size: 2rem;
        width: 80px;
        height: 80px;
        padding: 10px 15px;
    }
    
    .game-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .game-btn {
        min-width: 250px;
    }
    
    .target-number {
        font-size: 3rem;
    }
    
    .selection-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .input-section input {
        min-width: 250px;
    }
    
    .score-display {
        position: static;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .number-tile, .letter-tile {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .selected-numbers, .selected-letters {
        gap: 10px;
    }
    
    .number-tile, .letter-tile {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}
