:root {
  color-scheme: light;
  --paper: #fbf7f0;
  --card: #fffdf8;
  --ink: #261f1c;
  --muted: #695650;
  --line: #dfd0c0;
  --soft: #f3e9dd;
  --cinnabar: #a64035;
  --terracotta: #c24e42;
  --sage: #4a6b5d;
  --honey: #c98a3c;
  --plum: #6e5668;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.22; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }
h1[tabindex="-1"]:focus { outline: none; }
svg { display: block; width: 100%; height: auto; }
label { display: block; margin-bottom: 7px; font-size: .9rem; font-weight: 700; }
label > span { color: var(--muted); font-size: .76rem; font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; min-height: 47px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--card); color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #79665c; opacity: 1; }
input[readonly] { color: var(--muted); }
.button, .text-button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 14px; border: 1px solid transparent; border-radius: 9px;
  font-size: .89rem; font-weight: 700; line-height: 1.38; text-align: center; text-decoration: none;
}
.primary { background: var(--cinnabar); color: white; }
.primary:hover:not(:disabled) { background: #8c342e; }
.secondary { border-color: #d9c4b3; background: var(--card); color: var(--ink); }
.secondary:hover:not(:disabled) { background: var(--soft); }
.text-button { background: none; color: var(--cinnabar); }
.text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.icon-button { min-width: 44px; padding: 0; background: var(--soft); color: var(--ink); font-size: 1.4rem; }
.feedback { color: var(--cinnabar); font-size: .88rem; overflow-wrap: anywhere; }
.hint { color: var(--muted); font-size: .82rem; }
.eyebrow, .scene { color: var(--cinnabar); font-size: .75rem; font-weight: 700; letter-spacing: .11em; }

.guest-body {
  min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 10%, #e9dac9, #e2d1c1 48%, #ece0d5 100%);
}
.guest-shell {
  display: flex; flex-direction: column; max-width: 460px; min-height: 100vh; min-height: 100dvh;
  margin-inline: auto; background: var(--paper); box-shadow: 0 0 70px #4b2b251a;
}
.guest-shell main { flex: 1; }
.masthead {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 15px 23px 14px;
  padding-top: max(15px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line);
}
.wordmark { font: 700 1.08rem var(--serif); letter-spacing: .1em; text-decoration: none; }
.mast-sub { color: var(--cinnabar); font: 700 .65rem Georgia, serif; letter-spacing: .19em; }
.guest-footer {
  display: grid; grid-template-columns: auto; gap: 2px; padding: 17px 19px max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--muted); text-align: center; overflow-wrap: anywhere; font-size: .72rem;
}
.guest-footer > :first-child { color: var(--cinnabar); font-weight: 700; }
.landing-hero {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr;
  min-height: 342px; overflow: hidden; padding: 23px 23px 0; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 85% 56%, #eac5b9 0, #f2ded1 35%, #f4e8db 72%),
    var(--soft);
}
.landing-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .45;
  background-image: radial-gradient(#a7736238 .65px, transparent .85px); background-size: 5px 5px;
  mask-image: linear-gradient(130deg, transparent 0, black 70%);
}
.intro { z-index: 1; align-self: start; }
.intro h1 {
  margin-top: 11px; font-size: clamp(1.85rem, 8.1vw, 2.77rem); line-height: 1.19;
  font-weight: 800; letter-spacing: -.04em; white-space: nowrap;
}
.intro h1 span { color: var(--cinnabar); }
.landing-visual { position: absolute; inset: 102px 10px 21px 8px; pointer-events: none; }
.orbit {
  position: absolute; top: 10%; right: 5%; width: 58%; aspect-ratio: 1;
  border: 1px solid #ab74557a; border-radius: 50%;
  background: radial-gradient(ellipse at 36% 24%, #fffbecb0, #eec2b272 60%, #c5785b25 99%);
  box-shadow: inset 0 0 0 5px #fbf0dd66, inset 0 0 0 6px #be806638;
}
.landing-glass { position: absolute; filter: drop-shadow(0 9px 8px #5f302632); }
.front-glass { width: 60%; right: 3%; top: 3%; transform: rotate(7deg); }
.rear-glass { width: 49%; right: 38%; top: 4%; transform: rotate(-12deg); }
.art-star { position: absolute; color: #9f5842; font: 1.4rem Georgia, serif; }
.star-1 { right: 10%; top: 10%; }
.star-2 { right: 6%; top: 66%; font-size: .9rem; }
.star-3 { left: 9%; top: 53%; color: #9a713f; }
.hero-foot {
  z-index: 1; align-self: end; display: flex; justify-content: space-between; gap: 5px;
  height: 37px; align-items: center; padding: 0 1px; border-top: 1px solid #bd957c77;
  color: #634b42; font-size: .73rem; font-weight: 700; letter-spacing: .025em;
}
.entry { padding: 17px 23px 16px; }
.entry-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px;
  margin-bottom: 15px; color: var(--muted); font-size: .76rem;
}
.quota-badge { padding: 4px 8px; border-radius: 4px; background: #e9eee4; color: #355849; font-weight: 700; }
.entry form, .dialog form { display: grid; gap: 8px; }
.entry form label, .dialog form label { margin-bottom: 0; }
.entry .primary { margin-top: 4px; min-height: 48px; }
.entry-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 13px; margin-top: 5px; }
.entry-links .text-button { padding-inline: 0; font-size: .79rem; }
.notice { margin: 14px 18px; padding: 13px 15px; border: 1px solid #ddc0b3; border-radius: 12px; background: #f7e8e0; }
.notice > strong { color: var(--cinnabar); }
.notice p { margin-top: 4px; font-size: .88rem; overflow-wrap: anywhere; }
.inner-view { padding: 16px 17px 24px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.quiz-top .eyebrow { letter-spacing: .025em; }
.quiz-top button { flex-shrink: 0; padding-inline: 3px; font-size: .74rem; }
.progress-line { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.progress-line span { flex-shrink: 0; color: var(--muted); font: 700 .75rem Georgia, serif; letter-spacing: .08em; }
progress { display: block; appearance: none; width: 100%; height: 8px; border: none; border-radius: 20px; background: #eddfd2; overflow: hidden; }
progress::-webkit-progress-bar { background: #eddfd2; }
progress::-webkit-progress-value { background: var(--terracotta); border-radius: 20px; }
progress::-moz-progress-bar { background: var(--terracotta); border-radius: 20px; }
.question-card { padding: clamp(14px, 4.4vw, 21px); border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.question-card h1 { margin: 7px 0 17px; font-size: clamp(1.17rem, 5.3vw, 1.5rem); line-height: 1.5; }
.options { display: grid; gap: 9px; }
.option {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px;
  width: 100%; min-height: 53px; padding: 8px 10px; border: 1px solid #e3d6c9; border-radius: 10px;
  background: #fbf7f1; color: var(--ink); text-align: left; font-size: .94rem; line-height: 1.42;
  transition: background .15s, border-color .15s;
}
.option:hover:not(:disabled) { border-color: #b77d68; }
.option[aria-pressed="true"] { border-color: var(--cinnabar); background: #f5dfd5; }
.option-letter {
  display: grid; place-items: center; min-height: 28px; border: 1px solid var(--line); border-radius: 50%;
  color: var(--cinnabar); font: 700 .77rem Georgia, serif;
}
.option[aria-pressed="true"] .option-letter { border-color: var(--cinnabar); background: var(--cinnabar); color: white; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: start; justify-content: space-between; margin-top: 12px; }
#quiz-error { margin-top: 10px; }

.result-hero {
  --hero-bg: #efe2d9; padding: 13px 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(155deg, var(--card) 8%, var(--hero-bg) 84%); text-align: center;
}
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.result-top strong { color: var(--cinnabar); font-family: Georgia, serif; font-size: 1.16rem; }
.result-hero h1 { margin-block: 4px; font-size: clamp(1.7rem, 7.2vw, 2.38rem); letter-spacing: -.04em; }
.coaster {
  position: relative; isolation: isolate; width: 66%; max-width: 226px; aspect-ratio: 1; margin: 8px auto 3px;
}
.coaster::before {
  content: ""; position: absolute; inset: 6%; z-index: -1; border: 1px dashed var(--drink-accent); border-radius: 50%;
  background: radial-gradient(ellipse at 36% 27%, var(--card), var(--drink-bg) 70%);
  box-shadow: inset 0 0 0 4px #fffdf853;
}
.coaster svg { position: absolute; inset: 0; filter: drop-shadow(0 6px 6px #432c2322); }
.english { color: var(--muted); font: italic .94rem/1.4 Georgia, serif; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; list-style: none; margin: 10px 0 7px; padding: 0; }
.tags li { padding: 3px 8px; border: 1px solid #b9957d70; border-radius: 25px; color: var(--ink); background: #fffdf88a; font-size: .72rem; }
.byline { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.tasting-quote {
  display: flex; align-items: center; gap: 10px; margin: 11px 0; padding: 12px 14px; border-radius: 10px;
  color: #fff0dc; background: var(--ink); font: 700 .99rem/1.55 var(--serif);
}
.tasting-quote span { color: #edbd78; }
.result-actions { display: grid; gap: 7px; }
.panel { margin-top: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.panel h2 { margin-bottom: 10px; font-size: 1.29rem; }
.panel p { margin-block: 6px; }
.panel .text-button { padding-inline: 0; }
.invite-panel { background: #f6e7dd; border-color: #dcbcaa; }
.invite-panel p { color: var(--muted); font-size: .88rem; }
.invite-panel label { margin-top: 11px; overflow-wrap: anywhere; }
.invite-panel input { font-size: 1rem; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.inline-actions > * { flex: 1 0 125px; }
.meters { display: grid; gap: 12px; }
.meter-label, .meter-scale { display: flex; justify-content: space-between; gap: 8px; }
.meter-label { font-weight: 700; font-size: .87rem; }
.meter-label strong { color: var(--cinnabar); }
.meter-rail { height: 8px; overflow: hidden; margin-top: 4px; border-radius: 20px; background: #ede2d5; }
.meter-rail span { display: block; height: 100%; border-radius: inherit; background: var(--terracotta); }
.meter:nth-child(3n+2) .meter-rail span { background: var(--sage); }
.meter:nth-child(3n) .meter-rail span { background: var(--plum); }
.meter-scale { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.base-notes { color: var(--sage); font-weight: 700; font-size: .88rem; }
.stages { display: grid; gap: 7px; margin: 13px 0; }
.stages > div { padding: 8px 10px; border-left: 2px solid #c99068; background: #f8eee4; }
.stages dt, .signature strong { color: var(--cinnabar); font-weight: 700; font-size: .9rem; }
.stages dd { margin: 2px 0 0; font-size: .89rem; }
.signature { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.signature p { margin-top: 3px; }
.return-link { display: flex; margin-top: 10px; }
.dual-hero { --hero-bg: #ece1d0; }
.dual-art { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 2px 0 12px; }
.dual-recipe { display: grid; grid-template-rows: auto auto auto; align-content: start; justify-items: center; gap: 2px; overflow-wrap: anywhere; }
.dual-recipe .coaster { width: 100%; margin-bottom: 2px; }
.dual-recipe span { color: var(--muted); font-size: .77rem; }
.dual-recipe strong { font: 700 clamp(.86rem, 3.5vw, 1.1rem)/1.25 var(--serif); }
.ampersand {
  position: absolute; top: 35%; left: 50%; display: grid; place-items: center; transform: translate(-50%, -50%);
  width: 35px; height: 35px; border-radius: 50%; color: #f5cc8d; background: var(--ink); box-shadow: 0 0 0 4px #e8bd826e;
  font: 700 1.22rem Georgia, serif;
}

.dialog {
  width: min(calc(100% - 24px), 432px); max-height: min(92vh, 840px); max-height: min(92dvh, 840px);
  padding: 13px 15px 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); color: var(--ink);
  box-shadow: 0 12px 50px #2c1a1645; overscroll-behavior: contain;
}
.dialog::backdrop { background: #2a1c17a8; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.dialog-head h2 { font-size: clamp(1.14rem, 5vw, 1.38rem); }
.dialog form .primary { margin-top: 4px; }
.poster-dialog img {
  display: block; width: auto; max-width: 100%; height: auto; max-height: 59dvh; aspect-ratio: 3 / 4;
  margin: 0 auto; border: 1px solid var(--line); object-fit: contain; user-select: auto; -webkit-touch-callout: default;
}
.poster-dialog p { margin: 9px 0 7px; text-align: center; }
.poster-dialog a { display: flex; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gallery-item { padding: 4px 2px 7px; border: 1px solid var(--line); border-radius: 8px; text-align: center; background: #f7f1e9; }
.gallery-item.unlocked { border-color: var(--cinnabar); background: var(--drink-bg); }
.gallery-item svg { width: 100%; margin: 0 auto; }
.gallery-item.locked svg { filter: saturate(0) contrast(.64); opacity: .45; }
.gallery-item strong, .gallery-item small { display: block; overflow-wrap: anywhere; }
.gallery-item strong { font-size: .72rem; }
.gallery-item small { color: var(--muted); font-size: .64rem; }

.admin-body { min-height: 100vh; background: #f2ece3; }
.admin-shell { width: min(100% - 28px, 1190px); margin: 0 auto; padding-bottom: 35px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 20px 0 16px; border-bottom: 1px solid var(--line); }
.admin-head h1 { font-size: clamp(1.4rem, 5vw, 2.2rem); }
.admin-head a { color: var(--cinnabar); }
.admin-head .eyebrow { margin-bottom: 5px; }
.admin-login { max-width: 450px; margin: min(12vh, 80px) auto 0; }
.admin-login form { display: grid; gap: 8px; }
.admin-login label { margin-bottom: 0; }
.admin-login .primary { margin-top: 7px; }
.admin-status { margin-top: 9px; }
.admin-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.kpi { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); box-shadow: inset 0 3px var(--sage); }
.kpi:nth-child(odd) { box-shadow: inset 0 3px var(--terracotta); }
.kpi strong { display: block; font: 700 clamp(1.35rem, 3vw, 2.4rem)/1.1 Georgia, serif; color: var(--ink); }
.kpi span, .kpi small { display: block; color: var(--muted); font-size: .81rem; }
.kpi span { margin-bottom: 8px; font-weight: 700; }
.kpi small { margin-top: 4px; }
.admin-controls, .admin-activity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; align-items: start; }
.admin-panel { padding: 16px; }
.admin-panel p { margin: 0; }
.admin-panel h2 { font-size: 1.4rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .wide > .button { min-width: 112px; }
.switch-row { display: flex; align-items: center; min-height: 46px; gap: 8px; margin: 0; }
.switch-row input { appearance: none; flex: 0 0 36px; width: 36px; min-height: 22px; height: 22px; margin: 0; padding: 0; border-radius: 20px; background: #e8ded3; cursor: pointer; }
.switch-row input::before { content: ""; display: block; width: 15px; height: 15px; margin: 2.5px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 1px #9f8a7d45; }
.switch-row input:checked { border-color: var(--sage); background: var(--sage); }
.switch-row input:checked::before { transform: translateX(14px); }
.admin-panel textarea { min-height: 110px; resize: vertical; font: .88rem/1.5 Consolas, monospace; }
.admin-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 11px; }
.admin-filter .search { flex: 2 0 165px; }
.admin-filter .filter { flex: 1 0 115px; }
.admin-filter button { min-height: 47px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.table-wrap:focus-visible { outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .83rem; }
th, td { padding: 8px 9px; border-bottom: 1px solid #eee3d8; vertical-align: middle; white-space: nowrap; }
th { background: #f2e9de; color: var(--muted); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #faf5ec; }
td.note-cell { white-space: normal; overflow-wrap: anywhere; min-width: 112px; max-width: 230px; }
.code-text { font: 700 .92rem Consolas, monospace; }
.status-tag { display: inline-block; padding: 2px 6px; border-radius: 5px; color: #355849; background: #e7ede5; font-size: .74rem; font-weight: 700; }
.status-tag.inactive { color: #8b392e; background: #f5e4dc; }
.table-actions { display: flex; gap: 4px; }
.table-actions button { min-height: 32px; padding: 4px 6px; font-size: .75rem; }
.table-summary { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.admin-panel .feedback, .admin-panel .hint { margin-block: 6px; }
@media (max-width: 730px) {
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-controls, .admin-activity { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (min-width: 397px) {
  .landing-hero { min-height: 383px; }
  .landing-visual { inset: 111px 10px 27px 8px; }
}
@media (max-width: 350px) {
  .landing-hero { min-height: 310px; }
  .entry, .landing-hero, .masthead { padding-inline: 16px; }
  .landing-visual { inset: 100px 9px 20px; }
  .inner-view { padding-inline: 12px; }
  .entry-links { gap: 0 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
