:root {
    color-scheme: light;
    --paper: #f8f6ef;
    --card: #fffdf8;
    --ink: #213b31;
    --muted: #5d6a60;
    --forest: #163d31;
    --evergreen: #204d3d;
    --red: #ac3f32;
    --red-hover: #933327;
    --border: #e5dfd3;
    --mint: #e2ece2;
    --cream: #faeccc;
    --radius: 22px;
    --shadow: 0 18px 55px #2837270c;
    font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
    font-synthesis: none;
    line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; color: var(--ink); background: var(--paper); }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: default; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; overflow-wrap: anywhere; }
h1, h2 { font-family: "Playfair Display", Georgia, serif; font-weight: 700; }
h1 { font-size: clamp(2.35rem, 5vw, 3.85rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); letter-spacing: -.03em; }
h3 { font-size: 1.13rem; }
p { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid #a54829; outline-offset: 3px; }
.skip-link { position: fixed; top: .5rem; left: .5rem; transform: translateY(-200%); z-index: 5; background: var(--card); padding: .65rem 1rem; border-radius: .5rem; }
.skip-link:focus { transform: none; }

.topbar { border-bottom: 1px solid var(--border); background: #fffdf8dc; }
.topbar-inner, .shell, .footer { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.topbar-inner { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 1.24rem; text-decoration: none; white-space: nowrap; }
.logo-icon { flex: 0 0 auto; display: inline-grid; place-items: center; background: var(--forest); color: #fcdf9b; width: 35px; height: 35px; border-radius: 10px; }
.logo-icon i { width: 15px; height: 12px; border: 1.5px solid currentColor; border-top-width: 3px; position: relative; margin-top: 4px; border-radius: 2px; }
.logo-icon i::before { content: ""; position: absolute; top: -8px; left: 2px; width: 4px; height: 6px; border: 1px solid currentColor; border-radius: 60% 70% 0 70%; transform: rotate(-24deg); box-shadow: 5px 2px 0 -1px currentColor; }
.logo-icon i::after { content: ""; position: absolute; top: -3px; bottom: 0; left: 5px; border-left: 1.5px solid currentColor; }
.topbar nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.nav-link { display: block; text-decoration: none; border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.nav-link:hover, .nav-link[aria-current] { background: var(--mint); color: var(--forest); }
.shell { flex: 1 0 auto; padding-block: 44px 54px; }
.footer { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; padding-block: 17px 20px; }

.login-shell { display: grid; align-items: center; padding-block: clamp(30px, 7vw, 95px); }
.login-card { display: grid; grid-template-columns: 1.06fr 1fr; min-height: 546px; border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; background: var(--card); border: 1px solid var(--border); }
.login-visual, .player-hero { isolation: isolate; position: relative; overflow: hidden; background: radial-gradient(ellipse at 68% 70%, #34644b, var(--forest) 64%); color: #fff8e9; }
.login-visual { padding: clamp(28px, 5vw, 57px); display: flex; align-items: start; }
.login-visual::before, .player-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55; background-image: radial-gradient(circle, #f6d88a60 1px, transparent 1.5px); background-size: 29px 29px; mask-image: linear-gradient(130deg, #0009, transparent 40%, black); }
.visual-copy { z-index: 1; position: relative; }
.visual-kicker { color: #fae3ad; font-size: .78rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.visual-copy p { font-family: "Playfair Display", Georgia, serif; font-size: clamp(4rem, 7.9vw, 7.6rem); letter-spacing: -.075em; line-height: .86; margin-block: 30px 0; }
.visual-copy em { color: #f5d88f; font-weight: normal; }
.login-panel { display: grid; align-items: center; padding: clamp(26px, 5.2vw, 70px); }
.login-body { width: min(100%, 380px); margin-inline: auto; }
.login-body h1 { font-size: clamp(2.3rem, 4vw, 3.3rem); margin-bottom: .7rem; }
.login-body > .muted { margin-bottom: 1.65rem; max-width: 30ch; }
.login-body .form-help { margin-top: 1.2rem; }
.password-field { position: relative; }
.password-field input { padding-right: 97px; }
.password-field .text-button { position: absolute; inset: 0 12px 0 auto; padding: 0 4px; }
.text-button { border: 0; background: transparent; color: var(--forest); font-weight: 700; font-size: .8rem; }
.text-button:hover { text-decoration: underline; }
.login-button { width: 100%; justify-content: space-between !important; margin-top: .85rem; }

.gift-art { position: absolute; pointer-events: none; width: 380px; height: 275px; right: 0; bottom: 0; }
.gift { position: absolute; display: block; border-radius: 8px; background: linear-gradient(90deg, transparent 40%, var(--ribbon) 40% 56%, transparent 56%), linear-gradient(148deg, var(--gift-top), var(--gift-bottom)); width: var(--box-width); height: var(--box-height); box-shadow: 12px 19px 33px #081d1a60, inset 0 -9px 12px #37170822; transform: rotate(var(--rotation)); }
.gift i { position: absolute; inset: -5px -7px auto; height: 26%; border-radius: 6px; background: linear-gradient(90deg, transparent 41%, var(--ribbon) 41% 55.5%, transparent 55.5%), linear-gradient(90deg, var(--gift-top), var(--gift-bottom)); box-shadow: 0 4px 9px #37170840; }
.gift::before, .gift::after { content: ""; position: absolute; z-index: 1; width: 22%; height: 27%; top: -24%; border: 8px solid var(--ribbon); }
.gift::before { left: 29%; border-radius: 65% 70% 14% 66%; transform: rotate(22deg); }
.gift::after { left: 49%; border-radius: 70% 65% 66% 14%; transform: rotate(-28deg); }
.gift-large { --gift-top: #dd6c50; --gift-bottom: #a33832; --ribbon: #f4d48c; --rotation: -12deg; --box-width: 156px; --box-height: 129px; right: 94px; bottom: 38px; }
.gift-small { --gift-top: #f9dfa4; --gift-bottom: #c58f48; --ribbon: #884735; --rotation: 16deg; --box-width: 112px; --box-height: 90px; right: 24px; bottom: 56px; }
.spark { position: absolute; color: #f6d98f; line-height: 1; }
.spark-a { right: 86px; bottom: 205px; font-size: 45px; }
.spark-b { right: 253px; bottom: 155px; font-size: 39px; }
.spark-c { right: 36px; bottom: 179px; font-size: 19px; }
.spark-d { right: 23px; bottom: 32px; font-size: 26px; }
.spark-e { right: 279px; bottom: 68px; font-size: 20px; }
.spark-f { right: 183px; bottom: 236px; font-size: 19px; }

.player-hero { min-height: 225px; display: flex; align-items: center; border-radius: var(--radius); margin-bottom: 35px; }
.hero-copy { padding: clamp(25px, 5vw, 52px); width: min(72%, 720px); z-index: 1; }
.hero-copy p { margin-top: 1rem; color: #f3e9cf; max-width: 60ch; }
.player-hero .gift-art { transform-origin: right bottom; transform: scale(.78); right: 17px; }
.hero-meta { color: #f8d78d; font-weight: 700; margin-bottom: 9px; font-size: .87rem; }
.hero-image { position: absolute; inset: 0 0 0 auto; height: 100%; width: 45%; object-fit: cover; mask-image: linear-gradient(to right, transparent, black 66%); opacity: .82; }
.game-hero { min-height: 205px; margin-bottom: 24px; }
.section-heading { display: flex; align-items: center; gap: 11px; margin: 0 0 16px; }
.section-heading.compact { margin-bottom: 12px; }
.count { border-radius: 999px; display: inline-grid; place-items: center; min-width: 30px; min-height: 30px; padding-inline: 7px; font-weight: 700; font-size: .83rem; background: var(--mint); color: var(--forest); }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius); box-shadow: 0 8px 25px #263a2507; min-width: 0; }
.padded { padding: clamp(20px, 3vw, 30px); }
.padded h2 + p, .page-heading h1 + p, .padded p + form { margin-top: .65rem; }
.padded .form-stack { margin-top: 1rem; }
.game-card { display: flex; flex-direction: column; overflow: hidden; }
.game-thumb { display: block; position: relative; height: 155px; overflow: hidden; background: radial-gradient(ellipse at 72% 76%, #3c6e55, var(--forest)); }
.game-card:nth-child(3n+2) .game-thumb { background: radial-gradient(ellipse at 72% 76%, #a54f3c, #6e2f28); }
.game-card:nth-child(3n+3) .game-thumb { background: radial-gradient(ellipse at 72% 76%, #a17b48, #645334); }
.game-thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-thumb .gift-art { transform-origin: right bottom; transform: scale(.6); right: 17%; }
.game-card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.game-card h3 { margin: 10px 0 7px; font-size: 1.24rem; }
.game-card h3 a { text-decoration: none; }
.game-card h3 a:hover { text-decoration: underline; }
.game-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .86rem; margin-top: auto; padding-top: 16px; }
.excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.status { align-self: flex-start; flex: 0 0 auto; border-radius: 99px; padding: .24rem .7rem; font-size: .75rem; font-weight: 700; }
.status-live { background: var(--cream); color: #6c451c; }
.status-done { background: var(--mint); color: var(--forest); }
.status-draft { background: #ece9e2; color: #564d41; }
.empty { grid-column: 1 / -1; text-align: center; padding: clamp(28px, 7vw, 75px); display: grid; justify-items: center; gap: 12px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; min-width: 0; }
.narrow { max-width: 665px; }
.draw-card { background: linear-gradient(135deg, #fff8e8, var(--card) 65%); }
.draw-card h2 { margin-top: 10px; }
.draw-card form { margin-top: 17px !important; }
.draw-card > .person { margin-top: 17px; }
.recipient-wishes { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 16px; }
.recipient-wishes h3 { margin-bottom: 8px; }
.gift-list { margin: 0; padding: 0 0 0 1.25rem; }
.gift-list li { padding: 4px; overflow-wrap: anywhere; }
.gift-list li::marker { color: var(--red); }
.person { display: flex; align-items: flex-start; gap: 12px; }
.person strong { overflow-wrap: anywhere; }
.person p { margin-top: 3px; font-size: .9rem; }
.avatar { flex: 0 0 auto; display: inline-grid; place-items: center; height: 42px; width: 42px; overflow: hidden; border-radius: 50%; color: var(--forest); background: var(--mint); font-size: .83rem; font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-large { width: 65px; height: 65px; font-size: 1.06rem; }
.profile-person { align-items: center; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.people-list { list-style: none; padding: 0; margin: 12px 0 0; }
.people-list .person { border-bottom: 1px solid var(--border); padding: 12px 0; }
.people-list .person:last-child { border-bottom: 0; padding-bottom: 0; }
.self-label { margin-left: .35rem; color: var(--muted); font-size: .78rem; }
.multiline { white-space: pre-wrap; }

.back-link { display: inline-block; margin-bottom: 14px; font-size: .88rem; font-weight: 700; text-decoration: none; }
.back-link:hover, .arrow-link:hover { text-decoration: underline; }
.arrow-link { white-space: nowrap; font-weight: 700; text-decoration: none; }
.page-heading { margin-bottom: 25px; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.muted { color: var(--muted); }
.optional { color: var(--muted); font-size: .8rem; font-weight: 400; margin-left: .25rem; }
.form-stack { display: grid; gap: 8px; }
.form-stack > label:not(:first-child) { margin-top: 7px; }
label { font-size: .91rem; font-weight: 700; }
input:not([type="checkbox"]), textarea { width: 100%; min-width: 0; padding: 10px 12px; min-height: 46px; background: #fffefa; color: var(--ink); border: 1px solid #cfcabd; border-radius: 9px; }
input::placeholder, textarea::placeholder { color: #68746b; opacity: 1; }
input[type="file"] { font-size: .88rem; }
input::file-selector-button { font: inherit; cursor: pointer; border: 0; background: var(--mint); color: var(--forest); padding: 4px 8px; border-radius: 5px; margin-right: 10px; }
input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--forest); }
textarea { resize: vertical; }
.form-help { color: var(--muted); font-size: .82rem; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 7px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: .65rem 1rem; min-height: 44px; border-radius: 9px; font-size: .9rem; font-weight: 750; text-align: center; text-decoration: none; border: 1px solid transparent; }
.button-primary { background: var(--red); color: white; }
.button-primary:hover:not(:disabled) { background: var(--red-hover); }
.button-light { background: var(--card); color: var(--forest); border-color: #d7d4c7; }
.button-light:hover:not(:disabled) { background: var(--mint); }
.button-icon { font-size: 1.3rem; padding: 0; flex: 0 0 44px; }
.wish-rows { display: grid; gap: 8px; }
.wish-row { display: flex; align-items: stretch; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; }
.notice { background: var(--mint); color: var(--forest); border: 1px solid #c9dbcc; border-radius: 12px; padding: 12px 15px; margin-bottom: 17px; }
.notice p { margin-top: 5px; }
.notice ul { margin: 0; padding-left: 1.2rem; }
.notice-error { background: #fcece5; color: #842c23; border-color: #eac9be; }

.admin-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 16px 19px; display: flex; align-items: center; justify-content: space-between; gap: 9px; text-decoration: none; }
.stat span { color: var(--muted); font-weight: 650; }
.stat strong { font-size: 1.5rem; }
a.stat:hover { border-color: var(--forest); }
.list-card { overflow: hidden; }
.list-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 15px; min-height: 76px; padding: 12px 19px; text-decoration: none; }
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row:hover { background: #f4f4ea; }
.list-row:focus-visible { outline-offset: -3px; }
.list-title { display: flex; align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere; }
.list-title .muted { display: block; font-size: .82rem; }
.list-count { font-size: .85rem; white-space: nowrap; }
.search-form { display: flex; gap: 8px; max-width: 590px; margin-bottom: 18px; }
.preview-cover { max-height: 145px; width: 100%; object-fit: cover; border-radius: 9px; }
.checkbox-list { max-height: 310px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 2px 10px; }
.checkbox-list .check { min-height: 44px; font-weight: 600; padding-block: 6px; overflow-wrap: anywhere; }
.checkbox-list .check + .check { border-top: 1px solid var(--border); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }

@media (max-width: 820px) {
    .topbar-inner, .shell, .footer { width: calc(100% - 40px); }
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-card { min-height: 485px; }
    .login-visual .gift-art { transform-origin: right bottom; transform: scale(.82); right: -8px; }
}

@media (max-width: 650px) {
    .topbar-inner, .shell, .footer { width: calc(100% - 28px); }
    .topbar-inner { min-height: 62px; flex-wrap: wrap; padding-block: 10px; }
    .topbar nav { gap: 2px; }
    .nav-link { font-size: .85rem; padding: 7px 9px; }
    .shell { padding-block: 24px 34px; }
    .login-card { grid-template-columns: 1fr; }
    .login-visual { min-height: 220px; padding: 25px; }
    .visual-copy p { font-size: clamp(3rem, 11vw, 5.25rem); margin-top: 16px; }
    .visual-kicker { font-size: .66rem; }
    .login-visual .gift-art { transform: scale(.59); right: -1px; bottom: -5px; }
    .login-panel { padding: 25px; }
    .login-body { width: 100%; }
    .hero-copy { width: 100%; padding-right: 24px; }
    .player-hero { min-height: 160px; margin-bottom: 22px; }
    .player-hero .gift-art { opacity: .22; right: 0; transform: scale(.59); }
    .hero-image { opacity: .35; width: 68%; }
    .detail-grid, .game-grid { grid-template-columns: minmax(0, 1fr); }
    .game-thumb .gift-art { right: 23%; }
    .split { align-items: flex-start; flex-wrap: wrap; }
    .list-row { padding: 11px; gap: 7px; }
    .list-title { gap: 8px; }
    .list-title .logo-icon, .list-title .avatar { width: 32px; height: 32px; }
    .footer { flex-wrap: wrap; gap: 6px 18px; }
}

@media (prefers-reduced-motion: no-preference) {
    .button, .nav-link { transition: background-color 140ms ease; }
}

