@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800;900&family=Open+Sans:wght@400;600&display=swap');

:root {
    --dark: #0c1445;
    --darker: #080e30;
    --gold: #f5c518;
    --gold-dim: rgba(245, 197, 24, 0.3);
    --blue: #4a9eff;
    --pink: #e91e63;
    --green: #4caf50;
    --red: #ef5350;
    --white: #ffffff;
    --text: #e0e0e0;
    --card: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 50%, #1a1060 100%);
    color: var(--text);
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ──────────────────────────── */

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    text-align: center;
    padding: 2rem 0;
}

.header h1 {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(245, 197, 24, 0.3);
    letter-spacing: 1px;
}

.header .subtitle {
    color: var(--text);
    margin-top: 0.5rem;
    font-size: 1.1rem;
    opacity: 0.8;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--text);
    opacity: 0.7;
    transition: opacity 0.2s;
}
.back-link:hover { opacity: 1; text-decoration: none; }

/* ─── Cards ───────────────────────────── */

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    transition: transform 0.2s, border-color 0.2s;
}
.card:hover {
    transform: translateY(-2px);
    border-color: var(--gold-dim);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* ─── Home cards ──────────────────────── */

.mode-card {
    text-align: center;
    padding: 2.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s;
}
.mode-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 8px 32px rgba(245, 197, 24, 0.15);
}
.mode-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.mode-card h2 {
    color: var(--white);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.mode-card p {
    opacity: 0.7;
    font-size: 0.95rem;
}

/* ─── Buttons ─────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #e0a800);
    color: var(--darker);
}
.btn-gold:hover { box-shadow: 0 4px 16px rgba(245, 197, 24, 0.4); transform: translateY(-1px); }

.btn-blue {
    background: var(--blue);
    color: var(--white);
}
.btn-blue:hover { box-shadow: 0 4px 16px rgba(74, 158, 255, 0.4); }

.btn-red {
    background: var(--red);
    color: var(--white);
}
.btn-red:hover { box-shadow: 0 4px 16px rgba(239, 83, 80, 0.4); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ─── Forms ───────────────────────────── */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--white);
    font-size: 0.9rem;
}

input[type="text"], select, textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--white);
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
}

textarea { resize: vertical; min-height: 150px; }

/* ─── Song list ───────────────────────── */

.song-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.song-info h3 {
    color: var(--white);
    font-size: 1.1rem;
}
.song-info .artist {
    color: var(--gold);
    font-size: 0.9rem;
}
.song-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-green { background: rgba(76, 175, 80, 0.2); color: var(--green); }
.badge-red { background: rgba(239, 83, 80, 0.2); color: var(--red); }
.badge-blue { background: rgba(74, 158, 255, 0.2); color: var(--blue); }
.badge-gold { background: rgba(245, 197, 24, 0.2); color: var(--gold); }

/* ─── Player mode ─────────────────────── */

.game-container {
    max-width: 800px;
    margin: 0 auto;
}

.audio-player {
    text-align: center;
    margin: 1.5rem 0;
}
.audio-player audio {
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
}

.lyrics-game {
    margin: 2rem 0;
}

.lyric-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
    margin-bottom: 0.8rem;
    font-size: 1.15rem;
    line-height: 2.2;
}

.lyric-text {
    white-space: pre-wrap;
}

.lyric-blank {
    display: inline-block;
    min-width: 80px;
    padding: 0.1rem 0.4rem;
    margin: 0 0.15rem;
    background: rgba(245, 197, 24, 0.1);
    border: 2px dashed var(--gold-dim);
    border-radius: 6px;
    color: var(--gold);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}
.lyric-blank:focus {
    border-color: var(--gold);
    background: rgba(245, 197, 24, 0.15);
    outline: none;
}
.lyric-blank.correct {
    border-color: var(--green);
    background: rgba(76, 175, 80, 0.15);
    color: var(--green);
}
.lyric-blank.wrong {
    border-color: var(--red);
    background: rgba(239, 83, 80, 0.15);
    color: var(--red);
}

/* ─── Results ─────────────────────────── */

.results-box {
    text-align: center;
    padding: 3rem 2rem;
}
.results-box .score-big {
    font-family: 'Montserrat', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 40px rgba(245, 197, 24, 0.4);
}
.results-box .score-label {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

.result-line {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.8;
}
.result-word-correct {
    color: var(--green);
    font-weight: 600;
}
.result-word-wrong {
    color: var(--red);
    text-decoration: line-through;
}
.result-word-expected {
    color: var(--gold);
    font-weight: 600;
}

/* ─── Presenter mode ──────────────────── */

.presenter-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #050a25 0%, #0c1445 40%, #1a1060 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.presenter-header {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0.6;
}
.presenter-header .song-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: var(--gold);
}
.presenter-header .song-artist {
    font-size: 0.9rem;
    color: var(--text);
}

.presenter-lyrics {
    text-align: center;
    width: 90%;
    max-width: 1200px;
}

.presenter-line {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}
.presenter-line.visible {
    opacity: 1;
    transform: translateY(0);
}
.presenter-line.past {
    opacity: 0.3;
    font-size: 1.8rem;
    transform: translateY(-10px);
}

.presenter-blank {
    display: inline-block;
    min-width: 100px;
    border-bottom: 4px solid var(--gold);
    margin: 0 0.2rem;
    padding-bottom: 4px;
    color: transparent;
    position: relative;
}
.presenter-blank.revealed {
    color: var(--gold);
    border-bottom-color: transparent;
    text-shadow: 0 0 20px rgba(245, 197, 24, 0.6);
    animation: revealWord 0.6s ease-out;
}

.presenter-title-screen {
    text-align: center;
}
.presenter-title-screen h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 60px rgba(245, 197, 24, 0.4);
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}
.presenter-title-screen h2 {
    font-size: 2rem;
    color: var(--text);
    font-weight: 400;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}
.presenter-title-screen .hint {
    margin-top: 3rem;
    font-size: 1rem;
    opacity: 0.4;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.presenter-controls {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2rem;
    font-size: 0.8rem;
    opacity: 0.3;
    color: var(--text);
    transition: opacity 0.3s;
}
.presenter-controls:hover { opacity: 0.7; }

.presenter-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--gold);
    transition: width 0.3s;
}

.presenter-finished {
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}
.presenter-finished h1 {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
}
.presenter-finished p {
    font-size: 1.3rem;
    opacity: 0.7;
}

/* ─── Animations ──────────────────────── */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes revealWord {
    0% { opacity: 0; transform: scale(1.4); }
    50% { opacity: 1; transform: scale(1.1); color: #fff; text-shadow: 0 0 40px var(--gold); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in { animation: fadeInUp 0.5s ease-out; }

/* ─── Modal ───────────────────────────── */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--dark);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    color: var(--gold);
    margin-bottom: 1.5rem;
}

/* ─── Misc ────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    opacity: 0.5;
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }

.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ─── Responsive ──────────────────────── */

@media (max-width: 768px) {
    .header h1 { font-size: 1.6rem; }
    .container { padding: 1rem; }
    .presenter-line { font-size: 1.8rem; }
    .presenter-line.past { font-size: 1.2rem; }
    .presenter-title-screen h1 { font-size: 2.2rem; }
    .presenter-title-screen h2 { font-size: 1.3rem; }
}
