:root {
    --bg: #090a0c;
    --panel: #111318;
    --panel-strong: #0d1014;
    --line: #2a313a;
    --text: #e7ebf0;
    --text-dim: #9ea8b4;
    --accent: #6ecbff;
    --accent-soft: rgba(110, 203, 255, 0.16);
    --accent-2: #ffb86b;
    --accent-2-soft: rgba(255, 184, 107, 0.16);
    --warn: #ffb86b;
    --danger: #ff6f6f;
    --ok: #6ecbff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: linear-gradient(180deg, #090a0c, #07080a);
    min-height: 100vh;
    color: var(--text);
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    flex: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text);
}

header h1 {
    font-size: 2.1em;
    margin-bottom: 8px;
    letter-spacing: 0.08em;
}

header p {
    font-size: 1em;
    color: var(--text-dim);
}

.game-modes {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

.mode-btn.active {
    border-color: var(--accent-2);
    color: var(--accent-2);
    background: var(--accent-2-soft);
}

.game-area,
.start-screen {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.start-screen {
    text-align: center;
}

.welcome-message h2 {
    color: var(--accent-2);
    margin-bottom: 16px;
}

.welcome-message ul {
    text-align: left;
    margin: 18px auto;
    max-width: 360px;
    color: var(--text-dim);
}

.welcome-message li {
    margin: 8px 0;
    font-size: 14px;
}

.freeplay-options {
    margin: 14px 0 10px;
    font-size: 14px;
    color: var(--text-dim);
}

.start-btn {
    background: var(--accent-2-soft);
    color: var(--accent-2);
    border: 1px solid var(--accent-2);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.start-btn:hover {
    background: rgba(255, 184, 107, 0.25);
}

.audio-section {
    margin-bottom: 22px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
}

#audio-player {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.daily-audio-shell {
    display: grid;
    gap: 10px;
}

.daily-audio-shell.hidden {
    display: none !important;
}

.daily-audio-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.daily-audio-btn {
    border: 1px solid var(--accent);
    background: rgba(110, 203, 255, 0.12);
    color: var(--accent);
    border-radius: 6px;
    padding: 8px 10px;
    min-width: 78px;
    cursor: pointer;
    font-size: 13px;
}

.daily-audio-time {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 13px;
}

.daily-audio-progress {
    position: relative;
    width: 100%;
    height: 12px;
    border-radius: 99px;
    border: 1px solid var(--line);
    background: #0a110c;
    overflow: hidden;
    cursor: pointer;
}

.daily-audio-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(110, 203, 255, 0.22), rgba(110, 203, 255, 0.95));
}

.audio-info {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-dim);
    min-height: 22px;
}

.audio-info span {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(42, 49, 58, 0.45);
}

.freeplay-progress-wrap {
    margin: 10px auto 0;
    width: 100%;
    height: 10px;
    background: #0b0d11;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.freeplay-progress-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(110, 203, 255, 0.45), rgba(255, 184, 107, 0.92));
    transition: width 0.1s linear;
}

.guess-section {
    margin-bottom: 22px;
}

.guess-input-area {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.guess-search-wrap {
    flex: 1;
    position: relative;
}

#guess-search {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #0a0d11;
    color: var(--text);
}

#guess-search::placeholder {
    color: #758191;
}

#guess-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.guess-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #10141a;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
}

.guess-suggestion {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 9px 10px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.guess-suggestion:hover,
.guess-suggestion.active {
    background: rgba(110, 203, 255, 0.12);
}

#submit-guess {
    padding: 12px 16px;
    background: rgba(110, 203, 255, 0.12);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

#submit-guess:hover:not(:disabled) {
    background: rgba(110, 203, 255, 0.22);
}

#submit-guess:disabled {
    border-color: #3b4552;
    color: #778290;
    background: #14181f;
    cursor: not-allowed;
}

#guess-counter {
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
}

.freeplay-score {
    margin-bottom: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--accent-2);
    font-weight: 600;
}

.daily-guess-track {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.daily-guess-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #12161d;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.daily-guess-box.active {
    border-color: var(--accent);
    background: rgba(110, 203, 255, 0.1);
}

.daily-guess-box.correct_song {
    border-color: var(--ok);
    background: rgba(83, 245, 159, 0.12);
}

.daily-guess-box.correct_album {
    border-color: var(--warn);
    background: var(--accent-2-soft);
}

.daily-guess-box.incorrect {
    border-color: var(--danger);
    background: rgba(255, 111, 111, 0.12);
}

.daily-guess-header {
    font-size: 12px;
    font-weight: 700;
    color: #95a2b0;
    letter-spacing: 0.03em;
}

.daily-guess-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.daily-guess-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
}

.daily-inline-guess-host {
    margin-top: 7px;
}

.daily-inline-guess-host .guess-input-area {
    margin-bottom: 0;
    align-items: center;
}

.daily-inline-guess-host #guess-search {
    padding: 11px;
    font-size: 14px;
}

.daily-inline-guess-host #submit-guess {
    padding: 11px 14px;
    min-width: 86px;
}

.daily-guess-box.correct_song .daily-guess-status {
    color: var(--ok);
}

.daily-guess-box.correct_album .daily-guess-status {
    color: var(--warn);
}

.daily-guess-box.incorrect .daily-guess-status {
    color: var(--danger);
}

.game-result {
    position: relative;
    text-align: center;
    padding: 18px;
    border-radius: 8px;
    margin-top: 18px;
    border: 1px solid var(--line);
}

.result-share {
    position: absolute;
    top: 8px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.result-share-text {
    font-size: 11px;
    color: var(--text-dim);
}

.result-share-icon {
    border: none;
    background: transparent;
    color: var(--accent);
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    transform: translateY(-1px);
}

.result-share-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.result-share-icon:hover {
    color: #9fdfff;
}

.result-share-status {
    font-size: 11px;
    color: var(--text-dim);
}

.answer-loading {
    display: inline-block;
    filter: blur(3px);
    opacity: 0.9;
    animation: answerPulse 1.1s ease-in-out infinite;
}

@keyframes answerPulse {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.95;
    }
    100% {
        opacity: 0.5;
    }
}

.game-result.won {
    background: rgba(83, 245, 159, 0.12);
    color: var(--ok);
    border-color: var(--ok);
}

.game-result.lost {
    background: rgba(255, 111, 111, 0.12);
    color: var(--danger);
    border-color: var(--danger);
}

#result-message {
    font-size: 17px;
    font-weight: 400;
    margin-bottom: 16px;
}

#play-again {
    padding: 10px 16px;
    background: rgba(110, 203, 255, 0.12);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

#play-again:hover {
    background: rgba(110, 203, 255, 0.22);
}

.loading {
    text-align: center;
    padding: 28px;
}

.spinner {
    border: 3px solid #252c35;
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-message {
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    color: var(--danger);
    border: 1px solid var(--danger);
    background: rgba(255, 111, 111, 0.12);
    margin: 18px 0;
}

#retry-btn {
    margin-top: 12px;
    padding: 9px 16px;
    background: rgba(255, 111, 111, 0.16);
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 6px;
    cursor: pointer;
}

.freeplay-flash-win {
    animation: freeplayFlashWin 500ms ease;
}

.freeplay-flash-loss {
    animation: freeplayFlashLoss 500ms ease;
}

@keyframes freeplayFlashWin {
    0% {
        box-shadow: 0 0 0 0 rgba(83, 245, 159, 0);
    }

    30% {
        box-shadow: 0 0 0 9999px rgba(83, 245, 159, 0.12) inset;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(83, 245, 159, 0);
    }
}

@keyframes freeplayFlashLoss {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 111, 111, 0);
    }

    30% {
        box-shadow: 0 0 0 9999px rgba(255, 111, 111, 0.12) inset;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 111, 111, 0);
    }
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    margin-top: auto;
    padding: 0 20px 18px;
    color: #8491a0;
    font-size: 13px;
}

@media (max-width: 600px) {
    .container {
        padding: 14px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .game-area,
    .start-screen {
        padding: 16px;
    }

    .guess-input-area {
        flex-direction: column;
    }

    .daily-inline-guess-host .guess-input-area {
        flex-direction: column;
    }

    .guess-search-wrap,
    #submit-guess {
        width: 100%;
    }

    .game-modes {
        flex-direction: column;
        align-items: center;
    }

    .mode-btn {
        width: 220px;
    }

    .daily-audio-top {
        flex-wrap: wrap;
    }

    .daily-audio-time {
        margin-left: 0;
    }
}

.disclaimer {
    padding-bottom: 8px;
}
