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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5px;
    margin: 0;
}

/* ==================== */
/* UTILITY CLASSES */
/* ==================== */
.hidden {
    display: none !important;
}

/* ==================== */
/* FEEDBACK BOX STYLES */
/* ==================== */
.feedback-box {
    height: 35px;
    line-height: 35px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    color: white;
    border-radius: 8px;
    margin: 5px 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease-out;
    pointer-events: none;
    flex-shrink: 0; 
    min-height: 35px;
    max-height: 35px; 
}

.feedback-box.active {
    opacity: 1;
    transform: translateY(0);
}

.feedback-box.correct {
    background: #2ecc71;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.4);
}

.feedback-box.wrong {
    background: #e74c3c;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
}

/* ==================== */
/* CONTAINER & LAYOUT */
/* ==================== */
.container {
    width: 100%;
    max-width: 100%;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    margin: 5px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ==================== */
/* HEADER STYLES */
/* ==================== */
header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 15px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    width: 100%;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.main-title {
    font-size: 2em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #5f27cd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Comic Neue', cursive;
}

.sub-title {
    font-size: 1em;
    opacity: 0.9;
    position: relative;
    color: #f39c12;
    font-weight: bold;
}

/* ==================== */
/* MODERN BORDER STYLES */
/* ==================== */
.modern-border {
    position: relative;
    padding: 4px;
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #5f27cd);
    border-radius: 25px;
    animation: borderRotate 4s linear infinite;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modern-border::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: white;
    border-radius: 22px;
    z-index: 1;
}

.modern-border > * {
    position: relative;
    z-index: 2;
}

@keyframes borderRotate {
    0% { 
        background-position: 0% 50%; 
        transform: rotate(0deg);
    }
    25% { 
        background-position: 50% 100%; 
    }
    50% { 
        background-position: 100% 50%; 
        transform: rotate(0.5deg);
    }
    75% { 
        background-position: 50% 0%; 
    }
    100% { 
        background-position: 0% 50%; 
        transform: rotate(0deg);
    }
}

.modern-border {
    background-size: 400% 400%;
}

/* ==================== */
/* CHILDREN FONT STYLES */
/* ==================== */
.kids-font {
    font-family: 'Comic Neue', cursive;
    font-weight: 700;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
    letter-spacing: 0.5px;
}

.fun-title {
    font-family: 'Baloo 2', cursive;
    font-size: 3em !important;
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 4px 4px 0px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    animation: bounce 2s infinite;
    line-height: 1.2;
}

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

/* ==================== */
/* GAME CONTAINER LAYOUT */
/* ==================== */

/* ==================== */
/* GAME CONTAINER FIX */
/* ==================== */
#game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

#game-container.hidden {
    display: none;
}

/* Pastikan game area memenuhi container */
#game-container .game-area {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Player panels harus expand */
#game-container .player-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Keypad harus memenuhi sisa ruang */
#game-container .keypad {
    flex: 1;
    min-height: 0;
}

/* Tug of war arena proporsional */
#game-container .tug-of-war-arena {
    flex: 2;
    min-height: 0;
}

/* Elemen dengan tinggi tetap */
#game-container .player-header,
#game-container .problem-display,
#game-container .answer-display,
#game-container .feedback-box {
    flex-shrink: 0;
}

/* Game controls tetap di bawah */
#game-container .game-controls {
    flex-shrink: 0;
}


/* ==================== */
/* GAME AREA LAYOUT - FLEXIBLE */
/* ==================== */
.game-area {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 10px;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%; 
    overflow: hidden;
}

/* Player Panel */
.player-panel {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: all 0.3s ease;
    min-height: 0; 
    height: 100%; 
    transition: all 0.3s ease;
    overflow: hidden; 
}

.player-panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Tug of War Arena */
.tug-of-war-arena {
    flex: 2;
    min-width: 500px;
    margin: 0;
    position: relative;
    background: linear-gradient(to bottom, #27ae60, #2ecc71);
    border-radius: 12px;
    border: 3px solid #2c3e50;
    overflow: hidden;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0; 
    height: auto; 
}

.player-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin: -15px -15px 15px -15px;
    font-size: 1.1em;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
    flex-shrink: 0;
    min-height: 40px; 
    max-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-header.player2 {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.problem-display {
    background: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 10px;
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 10px;
    min-height: 50px;
    max-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.answer-display {
    width: 100%;
    height: 40px;
    min-height: 40px; 
    max-height: 40px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 1.4em;
    text-align: right;
    padding: 0 10px;
    background: #ecf0f1;
    font-weight: bold;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.answer-display:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}



/* ==================== */
/* KEYPAD STYLES */
/* ==================== */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 5px;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    align-content: start;
}

.keypad button {
    padding: 8px;
    font-size: 2em;
    border: none;
    border-radius: 6px;
    background: #34495e;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    min-height: 40px;
    height: 100%; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.keypad button:active {
    background: #f1c40f;
    color: #34495e;
    transform: scale(0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) inset;
}

.keypad button.action {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.keypad button.action:active {
    background: #229954;
    transform: scale(0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) inset;
    color: white;
}

.keypad button.clear {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.keypad button.clear:active {
    background: #c0392b;
    transform: scale(0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) inset;
    color: white;
}

/* ==================== */
/* TUG OF WAR ELEMENTS */
/* ==================== */

/* ==================== */
/* TIMER CONTAINER - FIXED POSITION */
/* ==================== */
.timer-container {
    position: absolute;
    top: 10px; /* jarak dari header */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 8px 15px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 20px;
    color: white;
    z-index: 100; /* Pastikan di atas elemen lain */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid #FFFFFF;
    min-width: 140px;
}

.timer-display {
    font-size: 1.5em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #f39c12;
    text-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
}

.timer-label {
    font-size: 0.8em;
    margin-bottom: 2px;
    color: #ecf0f1;
}

.timer-warning {
    animation: pulse 1s infinite;
    color: #e74c3c !important;
}

.center-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255,255,255,0.5);
    transform: translateX(-50%);
    z-index: 2;
}

.tug-of-war-illustration {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 90%;
    max-width: 600px;
    height: 45%;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease;
    z-index: 3;
}

.tug-of-war-svg {
    width: 100%;
    height: 100%;
    background-image: url("https://bimbelbrilian.com/wp-content/uploads/2025/11/ilustrasi-bimbel-brilian-03.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
}

.victory-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 0;
}

.victory-zone.left {
    left: 0;
    border-right: 1px dashed rgba(255, 255, 255, 0.5);
}

.victory-zone.right {
    right: 0;
    border-left: 1px dashed rgba(255, 255, 255, 0.5);
}

/* ==================== */
/* ARENA SCORE DISPLAY */
/* ==================== */
.arena-score-display {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    z-index: 4;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid #2c3e50;
}

.player-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.score-label {
    font-size: 0.9em;
    font-weight: bold;
    color: #2c3e50;
}

.score-value {
    font-size: 1.4em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    min-width: 30px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 8px;
}

.player1-score .score-value {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.player2-score .score-value {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

/* ==================== */
/* MODAL STYLES */
/* ==================== */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 10px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 95%;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    transform: scale(0.7);
    transition: all 0.4s ease;
    position: relative;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #5f27cd);
    border-radius: 20px 20px 0 0;
}

.modal h2 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 2.5em;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal p {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 1em;
}

/* ==================== */
/* VICTORY MODAL STYLES */
/* ==================== */
.victory-modal .modal-content {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border: 2px solid;
    animation: victoryPulse 2s infinite;
    padding: 40px 30px;
}

.victory-modal.player1 .modal-content {
    border-color: #3498db;
}

.victory-modal.player2 .modal-content {
    border-color: #e74c3c;
}

@keyframes victoryPulse {
    0% { box-shadow: 0 0 15px rgba(52, 152, 219, 0.5); }
    50% { box-shadow: 0 0 25px rgba(52, 152, 219, 0.8); }
    100% { box-shadow: 0 0 15px rgba(52, 152, 219, 0.5); }
}

.victory-icon {
    font-size: 5em;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.victory-modal.player1 .victory-icon {
    color: #3498db;
}

.victory-modal.player2 .victory-icon {
    color: #e74c3c;
}

.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #f39c12;
    animation: confettiFall 5s linear forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(1000px) rotate(360deg); opacity: 0; }
}

/* ==================== */
/* MODE SELECTION GRID - CENTERED & IMPROVED */
/* ==================== */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 25px 0;
    justify-items: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.mode-card {
    background: #f8f9fa;
    border: 3px solid;
    border-radius: 20px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    width: 150px;
    height: 140px;
}

.mode-card:nth-child(1) { 
    border-color: #ff6b6b; 
    background: linear-gradient(135deg, #ff6b6b30, #ff6b6b15); 
}
.mode-card:nth-child(2) { 
    border-color: #feca57; 
    background: linear-gradient(135deg, #feca5730, #feca5715); 
}
.mode-card:nth-child(3) { 
    border-color: #48dbfb; 
    background: linear-gradient(135deg, #48dbfb30, #48dbfb15); 
}
.mode-card:nth-child(4) { 
    border-color: #ff9ff3; 
    background: linear-gradient(135deg, #ff9ff330, #ff9ff315); 
}
.mode-card:nth-child(5) { 
    border-color: #54a0ff; 
    background: linear-gradient(135deg, #54a0ff30, #54a0ff15); 
}
.mode-card:nth-child(6) { 
    border-color: #5f27cd; 
    background: linear-gradient(135deg, #5f27cd30, #5f27cd15); 
}
.mode-card:nth-child(7) { 
    border-color: #00d2d3; 
    background: linear-gradient(135deg, #00d2d330, #00d2d315); 
}
.mode-card:nth-child(8) { 
    border-color: #ff9f43; 
    background: linear-gradient(135deg, #ff9f4330, #ff9f4315); 
}
.mode-card:nth-child(9) { 
    border-color: #10ac84; 
    background: linear-gradient(135deg, #10ac8430, #10ac8415); 
}
.mode-card:nth-child(10) { 
    border-color: #ee5a24; 
    background: linear-gradient(135deg, #ee5a2430, #ee5a2415); 
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    transition: left 0.6s ease;
}

.mode-card:hover::before {
    left: 100%;
}

.mode-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.mode-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
    font-weight: bold;
    position: relative;
    transition: transform 0.3s ease;
}

.mode-card:hover .mode-icon {
    transform: scale(1.2);
}

.mode-card:nth-child(1) .mode-icon { color: #ff6b6b; text-shadow: 2px 2px 4px rgba(255,107,107,0.3); }
.mode-card:nth-child(2) .mode-icon { color: #feca57; text-shadow: 2px 2px 4px rgba(254,202,87,0.3); }
.mode-card:nth-child(3) .mode-icon { color: #48dbfb; text-shadow: 2px 2px 4px rgba(72,219,251,0.3); }
.mode-card:nth-child(4) .mode-icon { color: #ff9ff3; text-shadow: 2px 2px 4px rgba(255,159,243,0.3); }
.mode-card:nth-child(5) .mode-icon { color: #54a0ff; text-shadow: 2px 2px 4px rgba(84,160,255,0.3); }
.mode-card:nth-child(6) .mode-icon { color: #5f27cd; text-shadow: 2px 2px 4px rgba(95,39,205,0.3); }
.mode-card:nth-child(7) .mode-icon { color: #00d2d3; text-shadow: 2px 2px 4px rgba(0,210,211,0.3); }
.mode-card:nth-child(8) .mode-icon { color: #ff9f43; text-shadow: 2px 2px 4px rgba(255,159,67,0.3); }
.mode-card:nth-child(9) .mode-icon { color: #10ac84; text-shadow: 2px 2px 4px rgba(16,172,132,0.3); }
.mode-card:nth-child(10) .mode-icon { color: #ee5a24; text-shadow: 2px 2px 4px rgba(238,90,36,0.3); }

.mode-card h3 {
    color: #2c3e50;
    font-size: 0.9em;
    line-height: 1.4;
    font-weight: 700;
    position: relative;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* ==================== */
/* LEVEL SELECTION GRID */
/* ==================== */
.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 20px 0;
}

.level-card {
    background: #f8f9fa;
    border: 2px solid;
    border-radius: 10px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.level-card:nth-child(1) { border-color: #ffb8b8; background: linear-gradient(135deg, #ffb8b8, #ffd8d8); }
.level-card:nth-child(2) { border-color: #ffd8a8; background: linear-gradient(135deg, #ffd8a8, #ffe8c8); }
.level-card:nth-child(3) { border-color: #fff4a8; background: linear-gradient(135deg, #fff4a8, #fff8c8); }
.level-card:nth-child(4) { border-color: #d4ffa8; background: linear-gradient(135deg, #d4ffa8, #e8ffc8); }
.level-card:nth-child(5) { border-color: #a8ffd4; background: linear-gradient(135deg, #a8ffd4, #c8ffe8); }
.level-card:nth-child(6) { border-color: #a8f4ff; background: linear-gradient(135deg, #a8f4ff, #c8f8ff); }
.level-card:nth-child(7) { border-color: #a8c8ff; background: linear-gradient(135deg, #a8c8ff, #c8d8ff); }
.level-card:nth-child(8) { border-color: #d4a8ff; background: linear-gradient(135deg, #d4a8ff, #e8c8ff); }
.level-card:nth-child(9) { border-color: #ffa8f4; background: linear-gradient(135deg, #ffa8f4, #ffc8f8); }
.level-card:nth-child(10) { border-color: #ffa8b8; background: linear-gradient(135deg, #ffa8b8, #ffc8d8); }

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-card:hover::before {
    opacity: 1;
}

.level-card:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.level-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    position: relative;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.level-difficulty {
    font-size: 0.75em;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 3px;
}

.level-range {
    font-size: 0.65em;
    color: #95a5a6;
    font-weight: 500;
}

/* ==================== */
/* BUTTON STYLES */
/* ==================== */
.btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 3px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.4s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    box-shadow: 0 3px 8px rgba(39, 174, 96, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
}

.btn-back {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    margin-top: 15px;
    box-shadow: 0 3px 8px rgba(149, 165, 166, 0.3);
}

/* ==================== */
/* COUNTDOWN ANIMATION */
/* ==================== */
#countdown {
    font-size: 15vw;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(0,0,0,0.5);
    animation: pulse 1s infinite;
}

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

/* ==================== */
/* GAME CONTROLS */
/* ==================== */
.game-controls {
    text-align: center;
    margin: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

#status-message {
    font-size: 1em;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: bold;
}

/* ==================== */
/* FOOTER STYLES */
/* ==================== */
footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 10px 20px;
    text-align: center;
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.social-links a {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
}

.social-links a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}



/* ==================== */
/* ENHANCEMENTS FOR MAIN MENU */
/* ==================== */
.mode-card, .btn, .modal-content {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mode-card:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mode-card {
    animation: cardAppear 0.6s ease-out forwards;
}

.mode-card:nth-child(1) { animation-delay: 0.1s; }
.mode-card:nth-child(2) { animation-delay: 0.2s; }
.mode-card:nth-child(3) { animation-delay: 0.3s; }
.mode-card:nth-child(4) { animation-delay: 0.4s; }
.mode-card:nth-child(5) { animation-delay: 0.5s; }
.mode-card:nth-child(6) { animation-delay: 0.6s; }
.mode-card:nth-child(7) { animation-delay: 0.7s; }
.mode-card:nth-child(8) { animation-delay: 0.8s; }
.mode-card:nth-child(9) { animation-delay: 0.9s; }
.mode-card:nth-child(10) { animation-delay: 1.0s; }
