:root {
    --red: #d92828;
    --deep-red: #9f1d1d;
    --cream: #fff4db;
    --cream-2: #ffe8b2;
    --ink: #31231d;
    --muted: #765f55;
    --green: #2e9f64;
    --blue: #2578c6;
    --shadow: 0 18px 40px rgba(91, 43, 20, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(180deg, #fff9ec 0%, #fff1d8 45%, #ffe6c3 100%);
    display: flex;
    flex-direction: column;
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
}

main {
    flex: 1;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.site-header {
    align-items: center;
    background: rgba(255, 249, 236, 0.92);
    border-bottom: 1px solid rgba(217, 40, 40, 0.15);
    display: flex;
    justify-content: space-between;
    padding: 16px clamp(18px, 4vw, 48px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand,
.top-nav,
.actions,
.admin-nav,
.table-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.brand {
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
}

.brand-logo {
    background: white;
    border-radius: 50%;
    height: 48px;
    object-fit: contain;
    width: 48px;
}

.top-nav a,
.admin-nav a,
.table-actions a {
    color: var(--deep-red);
    font-weight: 700;
    text-decoration: none;
}

.site-footer {
    color: var(--muted);
    margin-top: auto;
    padding: 28px;
    text-align: center;
}

.container {
    margin: 0 auto;
    max-width: 1120px;
    padding: 28px 20px;
    width: 100%;
}

.hero {
    align-items: center;
    display: grid;
    gap: 36px;
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
    min-height: calc(100vh - 84px);
    padding: 42px clamp(20px, 5vw, 72px);
}

.hero-content {
    align-self: end;
}

.hero h1,
.page-intro h1,
.detail-copy h1,
.registration-copy h1,
.result-card h1,
.admin-page h1 {
    font-size: clamp(2rem, 5vw, 4.4rem);
    line-height: 1.04;
    margin: 8px 0 16px;
}

.hero-copy,
.page-intro p,
.detail-copy p,
.registration-copy p,
.game-help p,
.learning-message {
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.eyebrow,
.label {
    color: var(--deep-red);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-plate {
    animation: floatPlate 4s ease-in-out infinite;
    background: #ffffff;
    border: 10px solid var(--cream-2);
    border-radius: 50%;
    box-shadow: var(--shadow);
    padding: clamp(18px, 4vw, 40px);
}

.hero-landing-art {
    align-self: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    grid-row: 1 / span 2;
    grid-column: 2;
    box-shadow: none;
    margin: 0 auto;
    max-width: 560px;
    overflow: hidden;
    padding: 0;
    width: 100%;
}

.hero-actions {
    align-self: start;
    grid-column: 1;
    margin-top: -8px;
}

.hero-landing-art img {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

.button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    text-decoration: none;
}

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

.button-light {
    background: white;
    color: var(--deep-red);
}

.card-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pasta-page-intro {
    padding-bottom: 16px;
}

.pasta-page-intro p {
    max-width: 720px;
}

.pasta-grid {
    align-items: stretch;
    gap: clamp(16px, 2.6vw, 24px);
    padding-top: 18px;
}

.recipe-card,
.result-card,
.game-help,
.admin-form,
.assignment-card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(217, 40, 40, 0.16);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.recipe-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    overflow: hidden;
    padding: clamp(14px, 2vw, 18px);
}

.recipe-card-media {
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.94), rgba(255, 247, 232, 0.82)),
        #fff8ed;
    border-radius: 8px;
    display: grid;
    min-height: 0;
    overflow: hidden;
    place-items: center;
}

.recipe-card img {
    aspect-ratio: 4 / 3;
    max-height: 260px;
    object-fit: contain;
    padding: clamp(10px, 2vw, 18px);
    width: 100%;
}

.recipe-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.recipe-card h2,
.detail-copy h2,
.game-help h2,
.assignment-card h2 {
    margin: 0 0 10px;
}

.recipe-card h2 {
    font-size: clamp(1.18rem, 2.2vw, 1.45rem);
    line-height: 1.18;
    margin: 0;
}

.recipe-card p,
.small-text {
    color: var(--muted);
    line-height: 1.55;
}

.recipe-card p {
    margin: 0;
}

.small-text {
    font-size: 0.92rem;
    font-weight: 700;
}

.recipe-count {
    align-self: flex-start;
    background: #fff1df;
    border: 1px solid rgba(217, 40, 40, 0.13);
    border-radius: 8px;
    color: var(--deep-red);
    font-size: 0.84rem;
    font-weight: 800;
    margin-top: auto;
    padding: 7px 10px;
}

.recipe-card .button {
    min-height: 46px;
    width: 100%;
}

.recipe-detail,
.game-layout,
.registration-layout {
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
}

.registration-layout {
    align-items: stretch;
    gap: clamp(24px, 5vw, 54px);
    min-height: calc(100vh - 190px);
    padding-bottom: 46px;
    padding-top: 54px;
}

.registration-form {
    align-self: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 247, 0.94)),
        #ffffff;
    border-color: rgba(217, 40, 40, 0.2);
    box-shadow: 0 24px 54px rgba(91, 43, 20, 0.16);
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 640px;
    min-height: 390px;
    overflow: hidden;
    padding: clamp(22px, 3.4vw, 38px);
    position: relative;
    width: 100%;
}

.registration-form::before {
    background: linear-gradient(90deg, var(--red), #f5ad37, var(--green));
    content: "";
    height: 5px;
    inset: 0 0 auto;
    position: absolute;
}

.registration-copy {
    align-self: center;
}

.registration-copy h1 {
    max-width: 560px;
}

.registration-copy p {
    max-width: 620px;
}

.registration-preview {
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(217, 40, 40, 0.12);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(91, 43, 20, 0.08);
    display: inline-flex;
    gap: 14px;
    margin-top: 28px;
    padding: 12px 16px 12px 12px;
}

.registration-preview img {
    border-radius: 50%;
    height: 54px;
    object-fit: contain;
    width: 54px;
}

.registration-preview span,
.registration-preview strong,
.form-heading span,
.form-heading h2 {
    display: block;
}

.registration-preview span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.registration-preview strong {
    color: var(--deep-red);
    font-size: 1.02rem;
}

.form-heading {
    margin-bottom: 24px;
}

.form-heading h2 {
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.15;
    margin: 6px 0 0;
}

.form-heading p {
    color: var(--muted);
    line-height: 1.55;
    margin: 8px 0 0;
}

.registration-fields {
    display: grid;
    gap: 18px;
}

.registration-field {
    display: grid;
    gap: 9px;
}

.field-label {
    color: var(--deep-red);
    font-size: 0.94rem;
    font-weight: 800;
}

.field-control {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(159, 29, 29, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(91, 43, 20, 0.06);
    display: grid;
    gap: 12px;
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 54px;
    padding: 7px 12px 7px 8px;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field-control:focus-within {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(217, 40, 40, 0.12), 0 12px 24px rgba(91, 43, 20, 0.08);
    transform: translateY(-1px);
}

.field-control input {
    background: transparent;
    border: 0;
    color: var(--ink);
    font: inherit;
    min-height: 38px;
    min-width: 0;
    padding: 0;
    width: 100%;
}

.field-control input:focus {
    outline: none;
}

.field-control input::placeholder {
    color: rgba(118, 95, 85, 0.76);
}

.field-icon {
    background: #fff2e8;
    border: 1px solid rgba(217, 40, 40, 0.12);
    border-radius: 8px;
    display: block;
    height: 38px;
    position: relative;
    width: 38px;
}

.field-icon-user::before {
    background: var(--deep-red);
    border-radius: 50%;
    content: "";
    height: 9px;
    left: 14px;
    position: absolute;
    top: 9px;
    width: 9px;
}

.field-icon-user::after {
    background: var(--deep-red);
    border-radius: 999px 999px 5px 5px;
    content: "";
    height: 10px;
    left: 10px;
    position: absolute;
    top: 21px;
    width: 17px;
}

.field-icon-phone::before {
    border: solid var(--deep-red);
    border-radius: 4px;
    border-width: 3px 2px;
    content: "";
    height: 20px;
    left: 13px;
    position: absolute;
    top: 8px;
    transform: rotate(-18deg);
    width: 10px;
}

.field-icon-phone::after {
    background: var(--deep-red);
    border-radius: 50%;
    content: "";
    height: 3px;
    left: 18px;
    position: absolute;
    top: 26px;
    width: 3px;
}

.form-actions {
    justify-content: flex-end;
    margin-top: 28px;
}

.registration-form .button {
    min-height: 48px;
    min-width: 112px;
}

.registration-form .button-light {
    border: 1px solid rgba(159, 29, 29, 0.12);
    box-shadow: 0 8px 18px rgba(91, 43, 20, 0.06);
}

.detail-image {
    align-self: start;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.ingredient-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 22px;
}

.ingredient-list span,
.ingredient-card {
    background: #fff;
    border: 1px solid rgba(217, 40, 40, 0.2);
    border-radius: 8px;
    color: var(--deep-red);
    font-weight: 800;
    padding: 8px 12px;
}

.ingredient-gallery {
    gap: 14px;
}

.ingredient-card {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 118px;
    min-width: 104px;
    text-align: center;
}

.ingredient-card img {
    height: 58px;
    object-fit: contain;
    width: 58px;
}

.ingredient-card span {
    background: transparent;
    border: 0;
    padding: 0;
}

.ingredient-list.compact span {
    font-size: 0.88rem;
    padding: 6px 10px;
}

.steps {
    line-height: 1.7;
    padding-left: 22px;
}

.cooking-step-list {
    font-size: 1.08rem;
    margin: 8px 0 26px;
}

.cooking-step-list li {
    margin-bottom: 8px;
}

.game-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
}

.game-panel {
    min-width: 0;
}

.game-topbar {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(82px, 0.8fr));
    margin-bottom: 12px;
}

.game-topbar > div {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(91, 43, 20, 0.08);
    min-width: 0;
    padding: 10px 12px;
}

.game-topbar strong,
.game-topbar .label {
    display: block;
}

.game-topbar strong span {
    display: inline;
}

.game-topbar strong {
    font-size: 0.96rem;
    line-height: 1.15;
}

.game-stage {
    background:
        linear-gradient(180deg, rgba(37, 120, 198, 0.12), rgba(46, 159, 100, 0.08)),
        #fffaf0;
    border: 3px solid #f6bc66;
    border-radius: 8px;
    height: 560px;
    overflow: hidden;
    position: relative;
    touch-action: none;
}

.fall-layer {
    inset: 0;
    position: absolute;
}

.falling-item {
    align-items: center;
    background: white;
    border: 2px solid var(--cream-2);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(49, 35, 29, 0.14);
    display: grid;
    gap: 4px;
    justify-items: center;
    min-height: 82px;
    padding: 8px;
    position: absolute;
    width: 92px;
}

.falling-item img {
    height: 36px;
    object-fit: contain;
    width: 48px;
}

.falling-item span {
    font-size: 0.76rem;
    font-weight: 800;
    text-align: center;
}

.falling-item.correct {
    border-color: rgba(46, 159, 100, 0.35);
}

.falling-item.wrong {
    border-color: rgba(217, 40, 40, 0.32);
}

.pot {
    bottom: 16px;
    height: 88px;
    position: absolute;
    touch-action: none;
    width: 138px;
    z-index: 5;
}

.pot-rim,
.pot-body {
    display: block;
    position: absolute;
}

.pot-rim {
    background: #4a5b68;
    border-radius: 999px;
    height: 28px;
    left: 0;
    top: 0;
    width: 138px;
}

.pot-body {
    align-items: center;
    background: #657b8d;
    border-radius: 0 0 22px 22px;
    color: white;
    display: flex;
    font-weight: 800;
    height: 68px;
    justify-content: center;
    left: 14px;
    top: 18px;
    width: 110px;
}

.pot.finished .pot-body {
    background: var(--green);
}

.player-form {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.player-form input,
.form-grid input,
.form-grid textarea {
    background: white;
    border: 1px solid rgba(159, 29, 29, 0.22);
    border-radius: 8px;
    color: var(--ink);
    min-height: 46px;
    padding: 12px;
    width: 100%;
}

.form-grid input:focus,
.form-grid textarea:focus,
.player-form input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(217, 40, 40, 0.12);
    outline: none;
}

.form-grid input[type="file"] {
    cursor: pointer;
}

.field-hint {
    color: var(--muted);
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    margin-top: 8px;
}

.image-preview {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-preview span {
    color: var(--deep-red);
    font-weight: 800;
}

.image-preview img {
    background: var(--cream);
    border: 1px solid rgba(159, 29, 29, 0.18);
    border-radius: 8px;
    height: 120px;
    object-fit: contain;
    padding: 12px;
    width: 180px;
}

.game-help {
    align-self: start;
    padding: 18px;
}

.result-layout {
    display: grid;
    min-height: 65vh;
    place-items: center;
}

.result-card {
    max-width: 720px;
    padding: 28px;
}

.score-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, 1fr);
    margin: 22px 0;
}

.score-grid div {
    background: var(--cream);
    border-radius: 8px;
    padding: 14px;
}

.score-grid span,
.score-grid strong {
    display: block;
}

.score-grid strong {
    color: var(--deep-red);
    font-size: 1.35rem;
}

.admin-page h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.admin-nav {
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.admin-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.table-wrap {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #f1d5bd;
    padding: 14px;
    text-align: left;
}

th {
    color: var(--deep-red);
}

.table-actions button {
    background: transparent;
    border: 0;
    color: var(--deep-red);
    cursor: pointer;
    font-weight: 700;
    padding: 0;
}

.admin-form,
.assignment-card {
    padding: 20px;
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, 1fr);
}

.form-grid label,
.player-form label {
    color: var(--deep-red);
    font-weight: 800;
}

.form-grid label {
    display: grid;
    gap: 8px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.error-box,
.notice {
    background: #fff;
    border-left: 5px solid var(--red);
    border-radius: 8px;
    margin: 14px 0;
    padding: 12px 16px;
}

.assignment-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, 1fr);
}

.checkbox-list {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.checkbox-list label {
    align-items: center;
    display: flex;
    gap: 8px;
}

@keyframes floatPlate {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@media (max-width: 900px) {
    .hero,
    .recipe-detail,
    .game-layout,
    .registration-layout,
    .card-grid,
    .assignment-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        align-items: start;
        gap: 24px;
        padding-bottom: 34px;
    }

    .hero-content {
        align-self: auto;
    }

    .hero-landing-art {
        grid-column: auto;
        grid-row: auto;
        max-width: 620px;
        order: 2;
    }

    .hero-actions {
        grid-column: auto;
        justify-content: center;
        margin-top: -4px;
        order: 3;
    }

    .registration-layout {
        gap: 26px;
        min-height: auto;
        padding-top: 44px;
    }

    .registration-form {
        align-self: stretch;
        min-height: auto;
    }

    .game-topbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-topbar > div:first-child {
        grid-column: 1 / -1;
    }

    .game-stage {
        height: 500px;
    }

    .pasta-page-intro {
        padding-bottom: 8px;
        padding-top: 32px;
    }

    .pasta-page-intro h1 {
        font-size: clamp(2rem, 6vw, 3rem);
        margin-bottom: 10px;
    }

    .pasta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-top: 12px;
    }

    .recipe-card {
        gap: 14px;
    }

    .recipe-card img {
        max-height: 210px;
    }
}

@media (max-width: 640px) {
    .admin-heading,
    .player-form {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header {
        align-items: center;
        flex-direction: row;
        gap: 12px;
        padding: 14px 18px;
    }

    .top-nav {
        justify-content: flex-end;
        margin-left: auto;
    }

    .hero {
        min-height: auto;
        padding-top: 30px;
    }

    .actions:not(.hero-actions) {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions {
        align-items: stretch;
        display: grid;
        gap: 12px;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .hero-actions .button {
        min-height: 50px;
    }

    .score-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .pasta-page-intro {
        padding-bottom: 4px;
        padding-top: 26px;
    }

    .pasta-page-intro h1 {
        font-size: clamp(1.9rem, 9vw, 2.5rem);
    }

    .pasta-page-intro p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .pasta-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding-top: 10px;
    }

    .recipe-card {
        gap: 14px;
        padding: 14px;
    }

    .recipe-card img {
        aspect-ratio: 16 / 10;
        max-height: 230px;
        padding: 10px;
    }

    .recipe-card h2 {
        font-size: 1.24rem;
    }

    .registration-layout {
        padding-bottom: 34px;
        padding-top: 34px;
    }

    .registration-preview {
        width: 100%;
    }

    .form-actions {
        display: grid;
        gap: 12px;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .game-topbar {
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-topbar > div {
        padding: 8px 10px;
    }

    .game-topbar strong {
        font-size: 0.9rem;
    }

    .game-stage {
        height: 460px;
    }
}
