/* ========== GENERAL & WEDDING THEME ========== */

body {
    font-family: 'Playfair Display', serif;
    background-color: #fff8fA;
    color: #5d5d5d;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    text-align: center;
    transition: background-color 0.5s;
    position: relative;
    box-sizing: border-box;
}

#app {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Serif font for all headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

/* Smaller subtitle text */
.heading__subtitle {
    font-size: 0.8em;
    font-weight: 400;
    margin-top: 0.3em;
}

/* ========== WINNER STATES ========== */

/* Main game winner styling */
body.body--winner #results-section {
    background-color: #cc5555 !important;
    color: #ffd700 !important;
}

body.body--winner #results-section .results-list__item {
    color: #ffd700 !important;
    border-bottom-color: rgba(255, 215, 0, 0.3) !important;
}

/* Raffle winner styling */
body.body--raffle-winner #results-section {
    background-color: #9b59b6 !important;
    color: #ffd700 !important;
}

body.body--raffle-winner #results-section .results-list__item {
    color: #ffd700 !important;
    border-bottom-color: rgba(255, 215, 0, 0.3) !important;
}

/* ========== CONTAINER & LAYOUT ========== */

.container {
    background-color: #fff;
    padding: 2em 1.5em;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: relative;
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
}

/* Gold heading color */
.container__heading {
    font-family: 'Playfair Display', serif;
    color: #e4c25f;
    font-weight: 700;
}

/* Large primary heading */
.container__heading--primary {
    font-size: 4em;
    margin-bottom: 0.2em;
}

/* Medium secondary heading */
.container__heading--secondary {
    font-size: 2.2em;
    margin-top: 0;
}

/* Paragraph text */
.container__paragraph {
    font-size: 1.6em;
    font-weight: 600;
}

/* ========== FORM INPUTS ========== */

.container__input {
    padding: 14px 16px;
    border-radius: 8px;
    border: 2px solid #f4c5d7;
    width: calc(100% - 32px);
    margin-bottom: 1em;
    font-family: 'Montserrat', sans-serif;
    font-size: 1em;
    color: #5d5d5d;
    transition: all 0.3s;
}

.container__input:focus {
    outline: none;
    border-color: #e4c25f;
    box-shadow: 0 0 0 3px rgba(228, 194, 95, 0.1);
}

/* Name and standard inputs */
#name,
.input {
    width: 100%;
    padding: 18px 16px;
    border-radius: 8px;
    border: 2px solid #f4c5d7;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2em;
    color: #5d5d5d;
    transition: all 0.3s;
    margin-bottom: 1.5em;
    display: block;
    box-sizing: border-box;
    background-color: #fff;
}

/* Input placeholder text */
#name::placeholder,
.input::placeholder {
    color: #bbb;
}

/* Input focus state */
#name:focus,
.input:focus {
    outline: none;
    border-color: #e4c25f;
    box-shadow: 0 0 0 3px rgba(228, 194, 95, 0.1);
}

#join-button {
    background-color: #e4c25f;
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    font-size: 1.3em;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

#join-button:hover {
    background-color: #d1b04b;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

#join-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.button {
    background-color: #e4c25f;
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-size: 1em;
}

.button:hover {
    background-color: #d1b04b;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ========== PLAYER QUESTION VIEW ========== */

/* Question timer and score display */
#question-section p {
    font-size: 1.8em;
    font-weight: 600;
    margin: 0.8em 0;
}

/* Answer buttons container */
.answers {
    list-style-type: none;
    padding: 0;
}

/* Individual answer button */
.answers__item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 12px;
    padding: 18px 24px;
    background-color: #f7d9e3; /* Soft Pink */
    color: #5d5d5d;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    font-size: 1.2em;
    text-align: center;
    min-height: 50px;
}

.answers__item:hover {
    background-color: #f4c5d7;
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.answers__item:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.answers__item:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ========== ANSWER FEEDBACK ========== */

/* Correct answer styling (green) */
.answers__item--correct {
    background-color: #4CAF50;
    color: white;
}

.answers__item--correct:hover {
    background-color: #4CAF50;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    transform: none;
}

/* Incorrect answer styling (red) */
.answers__item--incorrect {
    background-color: #f44336;
    color: white;
}

.answers__item--incorrect:hover {
    background-color: #f44336;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    transform: none;
}

/* --- Results Page Specifics --- */
.results-list {
    list-style-type: none;
    padding: 0;
    font-size: 1.4em;
}

.results-list__item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.results-list__item--first {
    font-weight: bold;
    color: #e4c25f;
}

.results-list__item--last {
    border-bottom: none;
}

/* Raffle winner display (red) */
.results-list__item--raffle {
    color: #f44336;
    font-weight: bold;
}

/* Score display for non-winners */
.results__score-display {
    font-size: 1.2em;
    font-weight: 600;
    color: #5d5d5d;
    margin: 0.8em 0 1.5em 0;
}

/* Prize message for winners (with animation) */
.results__prize-message {
    font-size: 1.3em;
    font-weight: bold;
    color: #e4c25f;
    margin: 1.5em 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.raffle-section p {
    font-size: 1.3em;
    font-weight: bold;
    color: #e4c25f;
    margin: 1.5em 0;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========== LOBBY PLAYER COUNT ========== */

/* Player count container and display */
.player-count {
    margin: 2em 0;
}

.player-count__text {
    font-size: 1.5em;
    font-weight: 600;
    color: #e4c25f;
    margin: 0;
}

/* --- User List Styling --- */
.user-list {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.user-list__item {
    background-color: #f7d9e3;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 1.05em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- Admin Page Specifics --- */
.admin {
    display: block;
    background-color: #f4f6f8;
    color: #333;
    padding: 2em;
}

.panel {
    background-color: #fff;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2em;
    text-align: left;
}

.panel__heading {
    color: #444;
}

.panel__button {
    background-color: #e4c25f;
    color: white;
    padding: 14px 24px !important;
    margin: 8px 6px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    display: inline-block;
}

.panel__button:hover {
    background-color: #d1b04b;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.panel__button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scoreboard {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.scoreboard__item {
    background-color: #f7d9e3;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.scoreboard__button {
    background-color: #f4c5d7; /* Lighter, rosy pink */
    color: #5d5d5d;
    margin-left: 10px;
    padding: 8px 10px;
}

.scoreboard__toggle {
    background-color: #e4c25f;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s;
}

.scoreboard__toggle:hover {
    background-color: #d1b04b;
}

/* --- Keyframe Animations --- */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* --- Corner Embellishments --- */
.container::before, .container::after {
    content: '❀'; /* More detailed flower */
    color: #f7d9e3;
    position: absolute;
    font-size: 3em;
    opacity: 0.8;
    animation: spin 25s linear infinite; /* Add slow rotation */
}

.container::before {
    top: 10px;
    left: 15px;
}

.container::after {
    bottom: 10px;
    right: 15px;
    animation-delay: -12.5s; /* Offset the animation */
}

/* --- Floating Hearts --- */
body::before, body::after {
    content: '♥';
    color: #f4c5d7;
    position: absolute;
    font-size: 2.5em;
    opacity: 0.6;
    animation: bob 4s ease-in-out infinite;
}

body::before {
    top: 20%;
    left: 5%;
}

body::after {
    top: 65%;
    right: 5%;
    animation-delay: -2s; /* Offset the animation */
}

/* --- Debug Panel --- */
.debug-panel {
    background: #f0f0f0;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    border: 1px solid #ccc;
    font-family: monospace;
}

/* --- Toast Notification --- */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #e4c25f; /* Gold */
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 16px;
    position: fixed;
    z-index: 10;
    left: 50%;
    transform: translateX(-50%);
    top: 30px;
    font-size: 1em;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.toast--show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 9.5s;
}

@keyframes fadein {
    from {top: 0; opacity: 0;}
    to {top: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {top: 30px; opacity: 1;}
    to {top: 0; opacity: 0;}
}

/* --- Language Toggle --- */
.lang-toggle-container {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 20;
}

.lang-toggle {
    background-color: #f7d9e3;
    color: #5d5d5d;
    padding: 11px 16px;
    font-size: 1em;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-toggle:hover {
    background-color: #f4c5d7;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* --- Utility Classes --- */
.is-hidden {
    display: none !important;
}

/* --- Upload Form (BEM) --- */
.upload-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.upload-form__input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
}

.upload-form__button {
    white-space: nowrap;
}

.upload-form__status {
    margin-top: 10px;
    font-size: 14px;
}

/* --- Questions List (BEM) --- */
.questions-list {
    list-style-position: inside;
    padding-left: 0;
}

.questions-list--scrollable {
    max-height: 300px;
    overflow-y: auto;
}

.questions-list__item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.questions-list__item small {
    display: block;
    color: #666;
    margin-top: 4px;
}

/* ========== MARQUEE ANIMATION ========== */

/** Scrolling text animation */
@keyframes marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Marquee container with horizontal scroll overflow */
.marquee-container {
    width: 100%;
    overflow: hidden;
    background-color: #f7d9e3;
    padding: 20px 0;
    margin-bottom: 20px;
    border-radius: 8px;
}

/* Animated marquee element */
.marquee {
    display: flex;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
    gap: 40px;
}

/* Individual marquee item */
.marquee-item {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1.3em;
    color: #5d5d5d;
    font-weight: 600;
    flex-shrink: 0;
}

/* ========== SPECTATOR MODE ========== */

/** Wider layout for spectator views */
.is-spectator .container {
    max-width: 1000px;
}

.is-spectator #single-card {
    display: none;
}

.is-spectator #spectator-cards {
    display: flex !important;
    gap: 20px;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
}

#spectator-cards.is-hidden {
    display: none !important;
}

.question-card {
    background-color: #fff;
    padding: 1.5em;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    flex: 1;
    min-width: 0;
}

.question-card__title {
    font-family: 'Playfair Display', serif;
    color: #5d5d5d;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 1.2em;
    font-weight: 700;
}

.answers--spectator {
    list-style-type: none;
    padding: 0;
}

.answers--spectator .answers__item {
    font-size: 0.95em;
    padding: 12px 16px;
    margin-bottom: 8px;
}

/* ========== MOBILE OPTIMIZATIONS ========== */

/** Tablet and smaller screens */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .button {
        padding: 14px 24px;
        font-size: 0.95em;
    }

    .answers__item {
        padding: 14px 16px;
        margin-bottom: 10px;
        min-height: 48px;
        display: flex;
        align-items: center;
        font-size: 0.95em;
    }

    .panel__button {
        padding: 12px 18px !important;
        margin: 6px 4px;
        font-size: 0.9em;
    }

    .container {
        padding: 1.5em 1.2em;
        width: 100%;
    }

    .container__heading--primary {
        font-size: 3em;
        margin-bottom: 0.3em;
    }

    .container__heading--secondary {
        font-size: 1.6em;
    }

    .container__paragraph {
        font-size: 1.3em;
    }

    #question-section p {
        font-size: 1.5em;
    }

    .user-list__item {
        padding: 8px 12px;
        font-size: 0.95em;
    }

    .answers__item {
        font-size: 1.1em;
    }

    .upload-form {
        flex-direction: column;
    }

    .upload-form__input {
        width: 100%;
    }

    .upload-form__button {
        width: 100%;
    }

    .lang-toggle-container {
        top: 12px;
        right: 12px;
    }

    .lang-toggle {
        padding: 8px 12px;
        font-size: 0.8em;
    }

    #name {
        font-size: 1em;
    }

    #join-button {
        font-size: 1em;
        padding: 14px 24px;
    }
}

/** Mobile phones */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 1.2em 1em;
        border-radius: 8px;
    }

    .container__heading--primary {
        font-size: 2.4em;
        margin-bottom: 0.4em;
    }

    .container__heading--secondary {
        font-size: 1.4em;
    }

    .container__paragraph {
        font-size: 1.2em;
    }

    .answers__item {
        padding: 14px 12px;
        font-size: 1.05em;
        min-height: 48px;
    }

    #question-section p {
        font-size: 1.3em;
        margin: 0.6em 0;
    }

    .results-list {
        font-size: 1.2em;
    }

    .user-list {
        gap: 8px;
    }

    .user-list__item {
        padding: 7px 10px;
        font-size: 0.95em;
    }

    .lang-toggle-container {
        top: 8px;
        right: 8px;
    }

    .lang-toggle {
        padding: 8px 10px;
        font-size: 0.85em;
    }
    }
