/* ------------ Game shell ------------ */
main {
    position: relative;
    padding: 10px 50px 50px 50px;
}

body.intro-open main::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    pointer-events: none;
    z-index: 5;
}

body.intro-open {
    overflow: hidden;
}

body.boot-loader-active {
    overflow: hidden;
}

body.boot-loader-active .game-actions,
body.boot-loader-active .concert-info,
body.boot-loader-active .divider,
body.boot-loader-active .timer-wrapper,
body.boot-loader-active #setlist-container,
body.boot-loader-active footer {
    display: none;
}

body.boot-loader-active main {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boot-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    min-height: 180px;
    width: min(100%, 36rem);
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
}

.boot-loader.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.boot-loader .game-loading-text {
    margin-bottom: 0;
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
}

.game-loading-state {
    width: min(32rem, 100%);
    margin: 1.75rem auto 0;
    padding: 1.6rem 1.25rem 1.35rem;
    text-align: center;
}

.game-loading-spinner {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 2px solid rgba(var(--color-grateful-blue), 0.3);
    border-top-color: rgba(var(--color-grateful-blue), 0.9);
    animation: game-loading-spin 1.5s linear infinite;
}

.game-loading-text {
    font-family: 'SN Pro', sans-serif;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    line-height: 1;
    margin-bottom: 0.5rem;
    color: rgba(var(--color-cream), 1);
    letter-spacing: 0.02em;
}

.game-loading-dots {
    display: flex;
    justify-content: center;
    gap: 0.42rem;
    margin-top: 0.9rem;
}

.game-loading-dots span {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: rgba(var(--color-grateful-blue), 1);
    opacity: 0.55;
    animation: game-loading-bounce 1.2s ease-in-out infinite;
}

.game-loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.game-loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes game-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes game-loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.45;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.game-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.difficulty-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.difficulty-wrapper label {
    font-size: 0.85rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.difficulty-wrapper select {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--color-text);
    font-family: 'SN Pro', sans-serif;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.difficulty-wrapper select:hover,
.difficulty-wrapper select:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

.date-input-wrapper {
    margin: 0.6rem 0 0.3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.date-input-wrapper label {
    font-size: 0.85rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#date-input {
    width: 220px;
    max-width: 80%;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    text-align: center;
    font-family: 'SN Pro', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

#date-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

#date-input:focus {
    border-color: rgba(var(--color-accent-yellow), 0.6);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-yellow), 0.08);
}

#date-input:-webkit-autofill,
#date-input:-webkit-autofill:hover,
#date-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-text);
    caret-color: var(--color-text);
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset;
    transition: background-color 9999s ease-in-out 0s;
}

#date-feedback {
    min-height: 1.5rem;
    font-size: 1rem;
    text-align: center;
}

#date-feedback.correct {
    color: rgba(var(--color-accent-green), 1);
    font-weight: 700;
}

#date-feedback.incorrect {
    color: rgba(var(--color-grateful-red), 1);
    font-weight: 700;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.action-buttons button,
.start-game-btn,
.sign-in-btn,
.modal-buttons button,
.swap-cancel-btn {
    cursor: pointer;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--color-text);
    font-family: 'SN Pro', sans-serif;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.action-buttons button {
    min-width: 88px;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
}

.action-buttons button:hover,
.start-game-btn:hover,
.sign-in-btn:hover,
.modal-buttons button:hover,
.swap-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
}

#submit-date-btn {
    border-color: rgba(var(--color-accent-green), 0.5);
    background: rgba(255, 255, 255, 0.05);
}

#submit-date-btn:hover {
    background: rgba(var(--color-accent-green), 0.12);
    border-color: rgba(var(--color-accent-green), 0.7);
}

#clear-date-btn {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

#clear-date-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

#reset-game-btn {
    border-color: rgba(var(--color-accent-yellow), 0.5);
    background: rgba(255, 255, 255, 0.05);                
}

#reset-game-btn:hover {
    background: rgba(var(--color-accent-yellow), 0.08);
    border-color: rgba(var(--color-accent-yellow), 0.7);
}

#give-up-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(var(--color-grateful-red), 0.5);
}

#give-up-btn:hover {
    background: rgba(var(--color-grateful-red), 0.1);
    border-color: rgba(var(--color-grateful-red), 0.7);
}

/* ------------ Concert info ------------ */
.concert-info {
    text-align: center;
    margin-bottom: 10px;
}

.concert-date {
    font-family: 'Ga Maamli', cursive;
    font-size: 1.8rem;
    color: rgba(var(--color-cream), 1);
    min-height: 2.3rem;
}

.concert-venue {
    font-size: 1.1rem;
    opacity: 0.85;
}

/* ------------ Dividers ------------ */
.divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.25);
    margin: 0 auto 0rem;
}

.divider-wide { width: 80%; }
.divider-narrow { width: 20%; }

/* ------------ Timer ------------ */
.timer-wrapper {
    text-align: center;
    margin-bottom: 5px;
    margin-left: 15px;
}

.timer-display {
    font-family: 'Ga Maamli', cursive;
    font-size: 2rem;
    letter-spacing: 0.05em;
    display: inline-block;
    min-width: 4.5rem;
    text-align: left;
    color: rgba(var(--color-cream), 1);
}

/* ------------ Setlist ------------ */
#setlist-container {
    margin: 2rem 0 0;
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.set-wrapper {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto 1.5rem;
    text-align: left;
}

.set-header {
    font-family: 'Ga Maamli', cursive;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    padding-left: 0.5rem;
    border-left: 3px solid rgba(var(--color-grateful-red), 0.8);
    color: rgba(var(--color-cream), 1);
}

.song-list {
    padding-left: 0.5rem;
}

.setlist-song {
    display: block;
    padding: 0.3rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0.93;
}

.setlist-song:last-child {
    border-bottom: none;
}

/* ------------ Modals (aligned with Game 1) ------------ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 0; /* remove extra offset so centering is exact */
    min-height: 100vh;
}

.modal.active { display: flex; }

.modal-content {
    background: rgba(var(--color-surface-raised), 1);
    padding: 1.5rem;
    border-radius: 12px;
    width: min(92%, 520px);
    max-width: 520px;
    position: relative;
    margin: 0 auto; /* ensure centered in case of layout quirks */
}

.modal-content h2 { margin-bottom: 1.5rem; text-align: center; }

.modal-content button#close-modal,
.modal-content button#close-give-up-modal,
.modal-content button#close-win-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-buttons,
.win-actions,
.share-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }

.modal-buttons { margin-top: 1rem; }

.modal-buttons button,
.sign-in-btn,
.start-game-btn,
.swap-cancel-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    padding: 0.75rem 1.2rem;
    font-size: 0.95rem;
}

.modal p { line-height: 1.55; opacity: 0.88; }


.win-modal-content {
    text-align: center;
    max-width: 520px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.25rem;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.win-title {
    font-family: 'Crimson Text', serif;
    font-size: clamp(1.0rem, 3.2vw, 1.4rem);
    margin-bottom: 0.05rem;
    line-height: 1.15;
    color: rgba(var(--color-cream), 1);
}

.win-time {
    font-family: 'Ga Maamli', cursive;
    font-size: clamp(1.4rem, 4.5vw, 2rem);
    color: rgba(var(--color-accent-green), 1);
    margin-bottom: 0.45rem;
    line-height: 1.05;
}

.win-result-date,
.win-score {
    font-size: 0.95rem;
    line-height: 1.4;
}

.win-result-date { color: rgba(var(--color-cream), 1); }
.win-score { margin-bottom: 0.45rem; opacity: 0.82; }

.win-stats-title {
    font-family: 'Crimson Text', serif;
    font-size: clamp(1.0rem, 2.8vw, 1.25rem);
    opacity: 0.8;
    margin-bottom: 0.4rem;
    color: rgba(var(--color-cream), 1);
}

.win-difficulty { font-size: 0.92rem; opacity: 0.78; margin-bottom: 0.65rem; text-transform: capitalize; }

.win-actions { display: flex; justify-content: center; gap: 0.6rem; margin: 0.6rem 0 0.6rem 0; flex-wrap: wrap; }

.share-panel { margin: 0.8rem auto 0.5rem; max-width: 720px; text-align: center; }

.share-panel-title { font-size: 0.78rem; letter-spacing: 0.12em; opacity: 0.72; text-transform: uppercase; margin-bottom: 0.5rem; }

.share-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; }

.sign-in-btn { background: rgba(var(--color-accent-yellow), 0.15); color: var(--color-text); border: 1px solid rgba(var(--color-accent-yellow), 0.6); border-radius: 8px; padding: 0.65rem 0.9rem; }

.sign-in-btn:hover { background: rgba(var(--color-accent-yellow), 0.22); }

.score-saved-msg { font-size: 0.98rem; color: rgba(var(--color-accent-green), 1); font-weight: 600; }

.win-subtitle {
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    opacity: 0.6;
    margin-top: clamp(0.4rem, 1.5vh, 1rem);
    margin-bottom: 0.5rem;
}

.archive-link {
    display: inline-block;
    font-size: 0.85rem;
    color: rgba(var(--color-accent-yellow), 1);
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s ease;
    margin-top: 0.5rem;
}

.archive-link:hover { opacity: 1; text-decoration: underline; }

/* ------------ Intro modal ------------ */
#intro-modal {
    background: rgba(0, 0, 0, 0.32);
    pointer-events: none;
    z-index: 40;
    align-items: center;
    justify-content: center;
    padding-top: 0;
}

#intro-modal .intro-modal-content {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 34rem);
    width: min(92%, 520px);
    padding: 0;
}

.intro-scroll {
    padding: 1.5rem 1.5rem 0.8rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: left;
}

.intro-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.9rem 1.5rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.14);
}

.intro-copy {
    font-size: 1rem;
    line-height: 1.58;
    opacity: 0.9;
    margin-bottom: 0.95rem;
}

.start-game-btn {
    border-color: rgba(var(--color-accent-green), 0.55);
}

.start-game-btn:hover {
    background: rgba(var(--color-accent-green), 0.12);
    border-color: rgba(var(--color-accent-green), 0.82);
}

/* ------------ Responsive ------------ */
@media (max-width: 720px) {
    main {
        padding: 20px;
    }

    .timer-display {
        min-width: 4.7rem;
        font-size: 1.85rem;
    }

    #date-input {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .content-container {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .content-container {
        width: 100%;
    }
}
