/* style.css */
:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --primary: #58a6ff;
    --primary-hover: #3182ce;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --success: #2ea043;
    --error: #f85149;
    --border: #30363d;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.15);

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 16px;
    overflow-x: hidden;
}

/* App Container */
#app-container {
    width: 100%;
    max-width: 480px;
    /* Mobile first, perfect on desktop */
    min-height: 80vh;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    pointer-events: none;
    overflow-y: auto;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: all;
    position: relative;
}

/* Common Header */
header {
    margin-bottom: 32px;
    text-align: center;
    position: relative;
}

header.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -1px;
}

header.logo h1 span {
    color: var(--primary);
}

header.logo p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 8px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    padding: 8px;
    transition: var(--transition);
}

.back-btn:hover {
    color: var(--primary);
}

/* Menu Cards */
.menu-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.menu-card {
    background: rgba(48, 54, 61, 0.4);
    border: 1px solid var(--border);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    color: white;
    text-align: left;
    transition: var(--transition);
}

.menu-card:hover:not(:disabled) {
    background: rgba(48, 54, 61, 0.8);
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}

.menu-card:active:not(:disabled) {
    transform: translateY(0);
}

.menu-card:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.menu-card .icon {
    font-size: 2rem;
}

.menu-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Credits / Footer */
.credits {
    margin-top: auto;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding-top: 32px;
    opacity: 0.8;
}

.credits strong {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Selection List */
.selection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background-size: cover;
    background-position: center;
}

.list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
    transition: var(--transition);
}

.list-item span {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.list-item:hover::before {
    background: rgba(0, 0, 0, 0.4);
}

.list-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.25);
}

/* Game Header / Progress */
.game-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-muted);
}

.timer {
    background: rgba(248, 81, 73, 0.15);
    color: var(--error);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Question Container */
.question-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

#question-text {
    text-align: center;
    font-size: 1.35rem;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 0;
}

/* Media Box */
.media-container {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    text-align: center;
}

/* Audio Player Stub */
.audio-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
}

.play-btn:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
}

.play-btn:active {
    transform: scale(0.95);
}

.lyrics-box {
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.5;
    color: #fff;
}

/* Options */
.options-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.option-btn {
    background: rgba(48, 54, 61, 0.4);
    border: 2px solid var(--border);
    padding: 16px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.option-btn:hover:not(:disabled) {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--primary);
    color: #fff;
}

.option-btn.correct {
    background: rgba(46, 160, 67, 0.15) !important;
    border-color: var(--success) !important;
    color: var(--success) !important;
}

.option-btn.wrong {
    background: rgba(248, 81, 73, 0.15) !important;
    border-color: var(--error) !important;
    color: var(--error) !important;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Result Screen */
.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 24px;
    width: 100%;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0%, transparent 0%);
    border: 8px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 0 30px rgba(88, 166, 255, 0.2);
}

#final-score {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.score-label {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

.stats {
    display: flex;
    gap: 32px;
    font-size: 1.25rem;
    font-weight: 600;
}

.correct-text {
    color: var(--success);
}

.wrong-text {
    color: var(--error);
}

.primary-btn,
.secondary-btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
}

.primary-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.4);
}

.secondary-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    #app-container {
        border-radius: var(--radius-lg);
    }
}