/* AXS TV Music Mashup — hand-written, no framework. Matches /emoji's light theme. */

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f4f6;
    color: #1a1a1c;
    line-height: 1.5;
}

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

/* ---------- header ---------- */

header { text-align: center; margin-bottom: 24px; }

header h1 {
    margin: 0 0 6px;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #141416;
}

.tagline {
    margin: 0 0 12px;
    color: #57575c;
    font-size: 0.95rem;
}

.header-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #6a6a70;
}

.streak-badge {
    background: #fff2e2;
    color: #b35300;
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 600;
}

.icon-button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #c9c9ce;
    background: #fff;
    color: #57575c;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.icon-button:hover { background: #f0f0f2; }

/* ---------- panels ---------- */

.phrase-panel,
.slots-panel,
.clues-panel {
    background: #fff;
    border: 1px solid #e2e2e6;
    border-radius: 12px;
    padding: 18px 18px 20px;
    margin-bottom: 16px;
}

.panel-label {
    margin: 0 0 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a8a90;
}

/* ---------- the mashup phrase ---------- */

.mashup-phrase {
    margin: 0 0 14px;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #141416;
    text-align: center;
}

/* The unsolved board: letters masked, spacing preserved so words are countable. */
.mashup-phrase.masked {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.12em;
    color: #b9b9c0;
    font-size: 1.25rem;
    word-spacing: 0.5em;
}

/* A letter revealed by naming one of the songs — filled into the board. */
.mashup-phrase.masked .filled {
    color: #141416;
    font-weight: 700;
}

.mashup-phrase .seam {
    background: #ffe0b8;
    border-radius: 4px;
    padding: 0 4px;
    color: #a34600;
}

.score-meter {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid #f0f0f2;
    padding-top: 12px;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #FF7B00;
}

.score-label { color: #57575c; font-size: 0.9rem; }

.guesses-left {
    margin-left: 8px;
    font-size: 0.8rem;
    color: #8a8a90;
}

.guesses-left.last-chance {
    color: #b3261e;
    font-weight: 600;
}

/* ---------- song slots ---------- */

.song-slots { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.slot {
    border: 1px solid #e2e2e6;
    border-radius: 10px;
    padding: 10px 14px;
    background: #fbfbfc;
    transition: border-color 0.15s, background 0.15s;
}

.slot.active { border-color: #FF7B00; background: #fffaf4; cursor: pointer; }
.slot.solved { border-color: #b6e2c0; background: #f4fbf6; }

.slot-num {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9a9aa0;
    margin-bottom: 2px;
}

.slot-answer { font-weight: 600; font-size: 1.02rem; }
.slot-answer.placeholder { color: #b0b0b6; font-weight: 400; font-style: italic; }
.slot-meta { font-size: 0.85rem; color: #6a6a70; margin-top: 2px; }

/* ---------- guessing ---------- */

.guess-area { position: relative; }

.guess-row { display: flex; gap: 8px; }

.guess-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #c9c9ce;
    border-radius: 8px;
    background: #fff;
    color: #1a1a1c;
}

.guess-input:focus { outline: none; border-color: #FF7B00; box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.15); }

.guess-submit,
.primary-button {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    background: #FF7B00;
    color: #fff;
    cursor: pointer;
}

.guess-submit:disabled { background: #e0e0e4; color: #a0a0a6; cursor: default; }
.guess-submit:not(:disabled):hover,
.primary-button:hover { background: #e56e00; }

.secondary-button {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid #c9c9ce;
    border-radius: 8px;
    background: #fff;
    color: #3a3a3e;
    cursor: pointer;
}

.secondary-button:hover { background: #f0f0f2; }

.reveal-button { width: 100%; margin-top: 12px; }

.wrong-list { margin-top: 8px; font-size: 0.82rem; color: #b3261e; }

/* ---------- autocomplete ---------- */

.suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #d4d4d9;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 20;
}

.suggestion { padding: 9px 12px; cursor: pointer; font-size: 0.95rem; }
.suggestion.highlighted { background: #fff2e2; }
.suggestion .artist,
.result-row .artist { color: #8a8a90; font-size: 0.85em; }

/* ---------- clues ---------- */

.clue-list { display: flex; flex-direction: column; gap: 8px; }

.clue {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 9px 12px;
    border-radius: 8px;
    background: #fbfbfc;
    border: 1px solid #eeeef1;
    font-size: 0.93rem;
}

.clue.revealed { background: #fffaf4; border-color: #ffdcb8; }

.clue-num {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9aa0;
}

.clue-text.muted { color: #b0b0b6; font-style: italic; }

/* ---------- results ---------- */

.summary-bar { text-align: center; margin-top: 8px; }

/* An author `display` declaration beats the UA stylesheet's `[hidden] { display: none }`,
   so every element the JS toggles via .hidden needs this or it never disappears.
   (.modal-overlay is the one that bites: display:flex kept both modals on screen,
   swallowing every click on the page underneath.) */
.modal-overlay[hidden],
#game[hidden],
#loading[hidden],
.summary-bar[hidden],
.streak-badge[hidden],
.guess-area[hidden],
.suggestions[hidden],
.reveal-button[hidden] {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 22, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 50;
}

.modal {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.modal h2 { margin: 0 0 8px; font-size: 1.3rem; }

.streak-info { margin: 0 0 14px; color: #57575c; font-size: 0.92rem; }
.streak-count { font-weight: 800; color: #FF7B00; }

.results-grid { text-align: left; margin-bottom: 14px; }

.result-phrase {
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eeeef1;
}

.result-row { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 0.95rem; }
.result-row .mark { flex: 0 0 auto; }

.result-note { margin-top: 10px; font-size: 0.82rem; color: #8a8a90; text-align: center; }

.countdown { color: #8a8a90; font-size: 0.85rem; margin: 0 0 14px; }

.modal-buttons { display: flex; gap: 10px; justify-content: center; }

.help-list { text-align: left; padding-left: 20px; margin: 0 0 14px; font-size: 0.93rem; }
.help-list li { margin-bottom: 8px; }

.help-example {
    text-align: left;
    font-size: 0.88rem;
    background: #fbfbfc;
    border: 1px solid #eeeef1;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0 0 16px;
    color: #3a3a3e;
}

/* ---------- misc ---------- */

.loading { text-align: center; color: #8a8a90; padding: 40px 0; }

/* Honest failure state — no puzzle is being shown, and it should look like it. */
.load-error {
    color: #1a1a1c;
    background: #fff;
    border: 1px solid #e2e2e6;
    border-left: 4px solid #b3261e;
    border-radius: 12px;
    padding: 22px 20px;
    text-align: left;
}

.load-error-headline { margin: 0 0 6px; font-weight: 700; font-size: 1.05rem; }
.load-error-detail { margin: 0 0 10px; color: #57575c; font-size: 0.93rem; }

.load-error-technical {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    color: #8a8a90;
    word-break: break-word;
}

.site-footer { margin-top: 28px; text-align: center; }

.cross-promo { font-size: 0.85rem; color: #6a6a70; margin: 10px 0 0; }
.cross-promo a { color: #FF7B00; text-decoration: none; font-weight: 600; }
.cross-promo a:hover { text-decoration: underline; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: #141416;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.9rem;
    z-index: 100;
}

.shake { animation: shake 0.42s; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.4rem; }
    .mashup-phrase { font-size: 1.28rem; }
    .guess-row { flex-direction: column; }
}
