* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #FF6B6B 0%, #FFD93D 25%, #6BCF7F 50%, #4D96FF 75%, #9D4EDD 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 900px;
    width: 100%;
    min-height: 500px;
}

h1 {
    text-align: center;
    background: linear-gradient(135deg, #FF6B6B, #4D96FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-size: 3em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    text-align: center;
    color: #666;
    font-size: 1.2em;
    margin-bottom: 30px;
    font-style: italic;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Setup Screen */
.level-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
    align-items: center;
}

.level-btn {
    padding: 15px 25px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.level-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.level-1 {
    background: linear-gradient(135deg, #A8E6CF, #7FD99F);
}

.level-2 {
    background: linear-gradient(135deg, #FFD93D, #FFC93D);
}

.level-3 {
    background: linear-gradient(135deg, #FFB347, #FF9A3D);
}

.level-4 {
    background: linear-gradient(135deg, #FF8C94, #FF6B7A);
}

.level-5 {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
}

.settings {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #4D96FF;
}

.settings h3 {
    color: #4D96FF;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.setting-item label {
    font-weight: 600;
    color: #333;
}

.setting-item input {
    padding: 10px 15px;
    border: 2px solid #4D96FF;
    border-radius: 8px;
    width: 100px;
    font-size: 1em;
    font-weight: bold;
}

.setting-item input:focus {
    outline: none;
    border-color: #FF6B6B;
    box-shadow: 0 0 10px rgba(77, 150, 255, 0.3);
}

.settings-row {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.setting-item-compact {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
}

.setting-item-compact label {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.setting-item-compact input {
    padding: 8px 12px;
    border: 2px solid #4D96FF;
    border-radius: 8px;
    width: 100%;
    font-size: 1em;
    font-weight: bold;
}

.setting-item-compact input:focus {
    outline: none;
    border-color: #FF6B6B;
    box-shadow: 0 0 10px rgba(77, 150, 255, 0.3);
}

.how-to-play {
    background: linear-gradient(135deg, #FFF9C4, #FFE082);
    padding: 20px;
    border-radius: 15px;
    border: 3px solid #FFD93D;
    margin-top: 20px;
}

.how-to-play h3 {
    color: #FF6B6B;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-align: center;
}

.how-to-play p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
    text-align: center;
}

.how-to-play p:last-child {
    margin-bottom: 0;
}

/* Countdown Screen */
.countdown {
    font-size: 8em;
    font-weight: bold;
    background: linear-gradient(135deg, #FF6B6B, #4D96FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #FFD93D;
}

.level-display {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    padding: 12px 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.level-display-results {
    text-align: center;
    font-size: 1.8em;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.level-display.level-1,
.level-display-results.level-1 {
    background: linear-gradient(135deg, #A8E6CF, #7FD99F);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.level-display.level-2,
.level-display-results.level-2 {
    background: linear-gradient(135deg, #FFD93D, #FFC93D);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.level-display.level-3,
.level-display-results.level-3 {
    background: linear-gradient(135deg, #FFB347, #FF9A3D);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.level-display.level-4,
.level-display-results.level-4 {
    background: linear-gradient(135deg, #FF8C94, #FF6B7A);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.level-display.level-5,
.level-display-results.level-5 {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.timer {
    font-size: 2em;
    font-weight: bold;
    color: #4D96FF;
    padding: 10px 20px;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border-radius: 12px;
    border: 3px solid #4D96FF;
    box-shadow: 0 4px 12px rgba(77, 150, 255, 0.2);
}

.timer.warning {
    color: #E74C3C;
    background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
    border-color: #E74C3C;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.score {
    display: flex;
    gap: 15px;
    font-size: 1.1em;
}

.correct {
    color: #6BCF7F;
    font-weight: bold;
    background: #E8F5E9;
    padding: 8px 12px;
    border-radius: 8px;
}

.wrong {
    color: #FF6B6B;
    font-weight: bold;
    background: #FFEBEE;
    padding: 8px 12px;
    border-radius: 8px;
}

.game-content {
    text-align: center;
}

.expression {
    font-size: 4em;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 15px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFF9C4, #FFE082);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.meaning {
    font-size: 1.4em;
    color: #555;
    margin-bottom: 20px;
    min-height: 35px;
    font-weight: 600;
    background: #F5F5F5;
    padding: 12px;
    border-radius: 10px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.answer-input {
    width: 100%;
    padding: 18px;
    font-size: 1.5em;
    border: 4px solid #4D96FF;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s;
    font-weight: bold;
    background: white;
}

.answer-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 20px rgba(77, 150, 255, 0.3);
}

.answer-input.correct {
    background: #E8F5E9;
    border-color: #6BCF7F;
    color: #2E7D32;
}

.answer-input.wrong {
    background: #FFEBEE;
    border-color: #FF6B6B;
    color: #C62828;
}

.feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.feedback.correct {
    color: #2E7D32;
}

.feedback.wrong {
    color: #C62828;
}

.cancel-btn {
    display: block;
    margin: 20px auto 0;
    padding: 12px 40px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #FF6B6B, #E74C3C);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
}

/* Responsive - Mobile Optimizations */
@media (max-width: 768px) {
    .level-buttons {
        flex-wrap: wrap;
    }
    
    .level-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 120px;
    }
    
    .game-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .timer {
        font-size: 1.5em;
        padding: 8px 15px;
    }
    
    .score {
        font-size: 0.95em;
        gap: 10px;
    }
    
    .expression {
        font-size: 2.8em;
        min-height: 70px;
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .meaning {
        font-size: 1.1em;
        min-height: 28px;
        padding: 8px;
        margin-bottom: 15px;
    }
    
    .answer-input {
        padding: 14px;
        font-size: 1.2em;
    }
    
    .feedback {
        font-size: 1em;
    }
    
    .cancel-btn {
        padding: 10px 30px;
        font-size: 1em;
        margin-top: 15px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
        margin-bottom: 5px;
    }
    
    .subtitle {
        font-size: 0.9em;
        margin-bottom: 20px;
    }
    
    .level-display {
        font-size: 1.2em;
        padding: 8px 15px;
        margin-bottom: 12px;
    }
    
    .level-display-results {
        font-size: 1.4em;
        padding: 10px 20px;
        margin-bottom: 15px;
    }
    
    .game-header {
        flex-direction: row;
        gap: 10px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .timer {
        font-size: 1.3em;
        padding: 6px 12px;
    }
    
    .score {
        flex-direction: column;
        gap: 5px;
        font-size: 0.85em;
    }
    
    .correct, .wrong {
        padding: 5px 8px;
    }
    
    .expression {
        font-size: 2.2em;
        min-height: 55px;
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .meaning {
        font-size: 0.95em;
        min-height: 24px;
        padding: 6px;
        margin-bottom: 10px;
    }
    
    .input-wrapper {
        margin-bottom: 10px;
    }
    
    .answer-input {
        padding: 12px;
        font-size: 1.1em;
        border-width: 3px;
    }
    
    .feedback {
        font-size: 0.9em;
    }
    
    .cancel-btn {
        padding: 8px 25px;
        font-size: 0.95em;
        margin-top: 10px;
    }
    
    .level-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .level-btn {
        width: 100%;
        flex: 1 1 100%;
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .settings-row {
        flex-direction: column;
    }
    
    .setting-item-compact {
        min-width: 100%;
    }
    
    .how-to-play {
        padding: 15px;
    }
    
    .how-to-play h3 {
        font-size: 1.1em;
    }
    
    .how-to-play p {
        font-size: 0.85em;
    }
    
    .share-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .share-btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.85em;
    }
    
    .share-btn .share-icon {
        font-size: 1em;
    }
        
    .signature {
        font-size: 0.85em;
        margin-top: 20px;
        padding-top: 15px;
    }
    
}

/* Results Screen */
#resultsScreen h2 {
    background: linear-gradient(135deg, #FF6B6B, #4D96FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.final-score {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #FFF9C4, #FFE082);
    border-radius: 15px;
    border: 3px solid #FFD93D;
}

.final-score p {
    margin: 10px 0;
    font-weight: bold;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.share-icon {
    font-size: 1.2em;
}

.twitter-btn {
    background: linear-gradient(135deg, #1DA1F2, #0d8bd9);
}

.twitter-btn:hover {
    background: linear-gradient(135deg, #0d8bd9, #0a6fb8);
}

.facebook-btn {
    background: linear-gradient(135deg, #4267B2, #365899);
}

.facebook-btn:hover {
    background: linear-gradient(135deg, #365899, #2d4373);
}

.copy-btn {
    background: linear-gradient(135deg, #6BCF7F, #4CAF50);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

 .whatsapp-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    }

.whatsapp-btn:hover {
        background: linear-gradient(135deg, #128C7E, #075E54);
    }

.copy-feedback {
    text-align: center;
    color: #4CAF50;
    font-weight: bold;
    margin-top: 10px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.results-table-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#resultsTable {
    width: 100%;
    border-collapse: collapse;
}

#resultsTable th {
    background: linear-gradient(135deg, #4D96FF, #357ABD);
    color: white;
    padding: 15px;
    text-align: left;
    position: sticky;
    top: 0;
    font-size: 1.1em;
}

#resultsTable td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.05em;
}

#resultsTable tr:hover {
    background: #FFF9C4;
}

.result-correct {
    color: #6BCF7F;
    font-weight: bold;
    font-size: 1.5em;
}

.result-wrong {
    color: #FF6B6B;
    font-weight: bold;
    font-size: 1.5em;
}

.play-again-btn {
    display: block;
    margin: 0 auto;
    padding: 18px 60px;
    font-size: 1.3em;
    font-weight: bold;
    background: linear-gradient(135deg, #6BCF7F, #4CAF50);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.play-again-btn:hover {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.signature {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    font-size: 0.95em;
    color: #666;
}

.signature a {
    color: #4D96FF;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.signature a:hover {
    color: #FF6B6B;
    text-decoration: underline;
}

