/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: linear-gradient(rgb(18 15 25 / 2%), rgba(0, 0, 0, 0.5)), url(faishinebg.webp);
    background-size: contain;
    background-position: top;
    background-repeat: no-repeat;
    background-color: #ad170a;
}


.container {
    width: 100%;
    max-width: 420px;
    background: rgba(5, 8, 20, 0.88);
    border-radius: 1.25rem;
    padding: 2.2rem 1rem 2.4rem;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.03);
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.6);
    color: #ffd700;
    margin-bottom: 0.9rem;
}

.sparkle {
    font-size: 0.9rem;
}

/* Headings & text */
h1 {
    font-size: 1.7rem;
    margin: 0 0 0.35rem;
    line-height: 1.25;
}

.subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 1.8rem;
}

.event-info {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255, 215, 0, 0.85);
    margin-bottom: 1.3rem;
}

/* Form */
form {
    text-align: left;
    margin-top: 0.5rem;
}

label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: rgba(255, 255, 255, 0.88);
}

input[type="text"],
input:not([type]) {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(8, 12, 28, 0.95);
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

input:focus {
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.6);
    background: rgba(12, 17, 40, 0.98);
}

.help-text {
    font-size: 0.78rem;
    margin-top: 0.25rem;
    color: rgba(255, 255, 255, 0.55);
}

/* Button */
button[type="submit"] {
    margin-top: 1.4rem;
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #2a1700;
    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Footer */
.footer-note {
    margin-top: 1.6rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* Slightly bigger screens */
@media (min-width: 480px) {
    .container {
    padding: 2.2rem 0.4rem 2.4rem;
    }

    h1 {
        font-size: 1.9rem;
    }
}

/* --- Bingo-sivun lisätyylit --- */

.bingo-container {
    max-width: 540px;
}

.top-bar {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: stretch;
    margin-bottom: 1.4rem;
}

.top-bar-text {
    text-align: left;
}

.bingo-title {
    margin: 0.25rem 0 0.3rem;
    font-size: 1.4rem;
    line-height: 1.2;
}

.subtitle--compact {
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.badge--small {
    font-size: 0.7rem;
    padding-inline: 0.7rem;
    margin-bottom: 0.3rem;
}

.logout-form {
    text-align: right;
}

.button-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.32);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
        transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 0 0 0 0 transparent;
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
}

.button-secondary:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
}

/* Grid 5x5 */

.card-wrapper {
    margin-top: 0.4rem;
}

.grid.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
}

.cell {
    position: relative;
    padding: 0.85rem 0.4rem;
    border-radius: 0.75rem;
    background: linear-gradient(145deg, rgba(15, 20, 45, 0.95), rgba(6, 9, 24, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(0, 0, 0, 0.5);
    font-size: clamp(0.68rem, 1.9vw, 0.8rem);
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    user-select: none;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        border-color 0.12s ease,
        background 0.12s ease,
        color 0.12s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-height: none;
}

/* Pieni hohto yläreunassa */
.cell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.11),
            transparent 40%,
            transparent);
    opacity: 0.7;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* Hover-efekti (lähinnä desktop) */
.cell:hover {
    transform: translateY(-1px);
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.7);
}

/* Aktivoitu (merkattu) ruutu */
.cell.marked {
    background: radial-gradient(circle at top, #ffd700, #ff9b2f);
    color: #2a1600;
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

.cell.marked::before {
    opacity: 0.35;
}

/* Lisää pieni "X" -fiilis ilman että teksti peittyy kokonaan */

.cell.marked::after {
    content: "✦";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: rgba(60, 32, 0, 0.35);
    pointer-events: none;
}

/* Pieni lisätila mobiilissa */

.footer-note--hint {
    margin-top: 1.3rem;
}

/* Isommilla näytöillä vähän väljempi layout */

@media (min-width: 540px) {
    .top-bar {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }

    .bingo-title {
        font-size: 1.6rem;
    }

    .grid.bingo-grid {
        gap: 0.45rem;
    }

    .cell {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
    }
}