@import url("https://fonts.googleapis.com/css2?family=Bodoni+Moda:wght@400;600&family=Oswald:wght@300;400;500&display=swap");

:root {
    --cream: #f8ecdc;
    --ink: #512b20;
    --red: #d41f2f;
    --border: #6c4c42;
    --shadow: rgba(52, 30, 22, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--cream);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: "Oswald", Arial, sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.app-nav {
    position: sticky;
    z-index: 50;
    top: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid rgba(81, 43, 32, 0.2);
    background: rgba(248, 236, 220, 0.97);
}

.app-nav a {
    padding: 9px 12px;
    border-radius: 999px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.82rem;
}

.app-nav a.active {
    color: white;
    background: var(--ink);
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.primary-button {
    color: white;
    background: var(--ink);
}

.secondary-button {
    background: transparent;
}

.danger-button {
    color: white;
    border-color: var(--red);
    background: var(--red);
}

.flash-container {
    position: fixed;
    z-index: 100;
    top: 70px;
    left: 50%;
    width: min(92%, 520px);
    transform: translateX(-50%);
}

.flash {
    margin-bottom: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
}

.landing-page,
.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.landing-card,
.auth-card {
    width: min(100%, 520px);
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--cream);
    box-shadow: 0 18px 60px var(--shadow);
    text-align: center;
}

.landing-icons {
    display: flex;
    justify-content: space-between;
    font-size: 3rem;
}

.small-heading {
    margin: 12px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.25em;
}

.landing-card h1,
.descriptions-header h1 {
    margin: 6px 0;
    font-family: "Bodoni Moda", Georgia, serif;
    font-size: clamp(3rem, 15vw, 6rem);
    font-weight: 400;
    letter-spacing: 0.2em;
}

.landing-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.auth-card {
    text-align: left;
}

.auth-card h1 {
    text-align: center;
    font-family: "Bodoni Moda", Georgia, serif;
}

.auth-card label {
    display: block;
    margin: 14px 0 6px;
    text-transform: uppercase;
}

.auth-card input {
    width: 100%;
    min-height: 48px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.auth-card .button {
    width: 100%;
    margin-top: 22px;
}

.auth-link {
    text-align: center;
}

.bingo-card {
    width: min(100%, 1024px);
    margin: 18px auto 32px;
    overflow: hidden;
    border: 2px solid var(--border);
    border-radius: 28px;
    background: var(--cream);
    box-shadow: 0 18px 55px var(--shadow);
}

.bingo-card.full-house {
    border: 8px solid var(--red);
}

.bingo-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    min-height: 275px;
    align-items: center;
    padding: 18px;
}

.header-decoration {
    text-align: center;
    font-size: clamp(4rem, 12vw, 8rem);
}

.header-title {
    text-align: center;
    text-transform: uppercase;
}

.header-title p {
    margin: 0;
    font-family: "Bodoni Moda", Georgia, serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: 0.15em;
}

.header-title h1 {
    margin: 0;
    font-family: "Bodoni Moda", Georgia, serif;
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 400;
    letter-spacing: 0.2em;
    line-height: 1;
}

.header-title span {
    display: block;
    margin-top: 16px;
    letter-spacing: 0.08em;
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.bingo-tile {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 300px;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    padding: 14px 9px 20px;
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-align: center;
}

.tile-colour-0 {
    background: #f6da77;
}

.tile-colour-1 {
    background: #cbb6e5;
}

.tile-colour-2 {
    background: #c8dfad;
}

.tile-colour-3 {
    background: #add8eb;
}

.tile-colour-4 {
    background: #eda5b6;
}

.tile-colour-5 {
    background: #8fd9cf;
}

.tile-colour-6 {
    background: #f3b88d;
}

.tile-colour-7 {
    background: #f2cd6f;
}

.tile-number {
    align-self: flex-start;
    font-family: "Bodoni Moda", Georgia, serif;
    font-size: 1.6rem;
}

.tile-icon {
    display: grid;
    min-height: 125px;
    place-items: center;
    font-size: clamp(4rem, 8vw, 7rem);
}

.tile-title {
    text-transform: uppercase;
    font-size: clamp(0.9rem, 2vw, 1.35rem);
    line-height: 1.25;
}

.red-cross {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    display: none;
    color: rgba(206, 21, 36, 0.88);
    font-family: Arial, sans-serif;
    font-size: clamp(12rem, 22vw, 20rem);
    line-height: 1;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-8deg);
}

.bingo-tile.completed .red-cross {
    display: block;
}

.bingo-tile.line-complete {
    box-shadow: inset 0 0 0 6px var(--red);
}

.bingo-footer {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    min-height: 255px;
    align-items: center;
    padding: 20px;
}

.footer-illustration {
    text-align: center;
    font-size: clamp(3rem, 8vw, 6rem);
}

.footer-message {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.modal,
.celebration {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(42, 24, 18, 0.72);
}

.modal-card,
.celebration-card {
    position: relative;
    width: min(100%, 560px);
    padding: 28px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--cream);
}

.modal-card textarea {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 2rem;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
}

.celebration-card {
    text-align: center;
}

.celebration-card h2 {
    color: var(--red);
    font-family: "Bodoni Moda", Georgia, serif;
    font-size: 4rem;
}

.descriptions-page {
    width: min(100%, 880px);
    margin: 0 auto;
    padding: 36px 18px 60px;
}

.descriptions-header {
    text-align: center;
}

.description-list {
    display: grid;
    gap: 14px;
    margin-top: 30px;
}

.description-card {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 18px;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.45);
}

.description-icon {
    text-align: center;
    font-size: 3.8rem;
}

.description-card h2 {
    margin: 0 0 8px;
    text-transform: uppercase;
}

.description-card p {
    white-space: pre-wrap;
}

.empty-state {
    padding: 40px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    text-align: center;
}

@media (max-width: 800px) {
    .bingo-card {
        margin-top: 0;
        border-radius: 0;
    }

    .bingo-header {
        min-height: 190px;
        padding: 10px;
    }

    .header-decoration {
        font-size: 3rem;
    }

    .header-title h1 {
        font-size: clamp(2.3rem, 12vw, 4.6rem);
        letter-spacing: 0.12em;
    }

    .header-title p {
        font-size: 1rem;
    }

    .header-title span {
        font-size: 0.72rem;
    }

    .bingo-grid {
        grid-template-columns: repeat(5, minmax(105px, 1fr));
        overflow-x: auto;
    }

    .bingo-tile {
        min-height: 230px;
        padding: 8px 5px 12px;
    }

    .tile-icon {
        min-height: 90px;
        font-size: 3.7rem;
    }

    .tile-title {
        font-size: 0.78rem;
    }

    .tile-number {
        font-size: 1rem;
    }

    .bingo-footer {
        min-height: 170px;
    }
}

.bingo-actions {
    display: flex;
    justify-content: center;
    width: min(100%, 1024px);
    margin: 18px auto 10px;
    padding: 0 14px;
}

.bingo-actions form {
    margin: 0;
}

.reset-button {
    color: #512b20;
    border: 1px solid #512b20;
    background: transparent;
}

.reset-button:hover {
    color: #ffffff;
    background: #d41f2f;
    border-color: #d41f2f;
}

@media (max-width: 800px) {
    .bingo-actions {
        margin: 12px auto;
    }

    .reset-button {
        min-height: 42px;
        padding: 9px 15px;
        font-size: 0.78rem;
    }
}
