/*
  ブースめぐりの見た目。2026-10-29。
  テーマのお茶に合わせ、茶の緑と和紙の地。スタンプは朱の丸い判。
  書体は読み込まず、端末の書体を使う（会場の電波が弱くても速く出るように）。
*/
:root {
  --paper: #f6f3ea;     /* 和紙の地 */
  --sheet: #fffdf7;     /* 台紙の紙 */
  --ink: #1f2a1f;       /* 文字 */
  --ink-soft: #4f5a4c;  /* 補う文字（地の上で 4.5:1 以上） */
  --tea: #2f5d3a;       /* 深い茶の緑。押すところ */
  --tea-dark: #22452b;
  --tea-pale: #e4ecdb;  /* 若葉の淡い緑 */
  --line: #d9d2bf;      /* 罫 */
  --stamp: #b3341f;     /* 朱の判 */
  --stamp-pale: #f7e3dc;
  --ng-bg: #ecebe7;
  --ng-ink: #5c5c58;
  --ok: #2f5d3a;
  --demo: #7a4b00;
  --demo-bg: #fff1c9;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", "Meiryo", sans-serif;
  font-size: 16px; line-height: 1.7;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
a { color: var(--tea); }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }
/* 画面を切り替えたときに見出しへ移す読み上げ用のフォーカスには、枠を出さない */
[tabindex="-1"]:focus { outline: none; }
h1, h2 { line-height: 1.45; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 14px; color: var(--ink-soft); }

/* 上の帯 */
.top { position: -webkit-sticky; position: sticky; top: 0; z-index: 5; background: var(--tea); color: #fff; padding-top: env(safe-area-inset-top); }
.top .in { max-width: 560px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.top .title { font-weight: 700; letter-spacing: .08em; }
.top .count { font-weight: 700; background: rgba(255,255,255,.16); border-radius: 999px; padding: 2px 12px; font-variant-numeric: tabular-nums; }

main { max-width: 560px; margin: 0 auto; padding: 16px; }
.loading, .nojs { text-align: center; color: var(--ink-soft); padding-top: 30vh; }
.error { text-align: center; padding-top: 18vh; display: grid; gap: 12px; justify-items: center; }

.demo { background: var(--demo-bg); color: var(--demo); border: 1px dashed var(--demo); border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 700; margin-bottom: 12px; text-align: center; }
.notice { background: var(--sheet); border-left: 4px solid var(--stamp); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; font-size: 15px; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--tea);
  background: var(--tea); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:active { background: var(--tea-dark); }
.btn.sub { background: transparent; color: var(--tea); }
.btn.big { width: 100%; min-height: 56px; font-size: 17px; }

/* 判（スタンプ） */
.seal {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid var(--stamp); color: var(--stamp); background: var(--stamp-pale);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; transform: rotate(-8deg);
  box-shadow: inset 0 0 0 2px var(--stamp-pale), inset 0 0 0 3px var(--stamp);
}
.seal.small { width: 40px; height: 40px; font-size: 17px; border-width: 2px; }
.seal.big { width: 104px; height: 104px; font-size: 44px; border-width: 5px; }
.seal.pop { animation: pop .55s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pop {
  0% { transform: scale(2.2) rotate(-24deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1) rotate(-8deg); opacity: 1; }
}
.slot {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  border: 2px dashed var(--line); color: #a39d8d; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
}
.slot.open { border-color: var(--tea); color: var(--tea); border-style: dashed; }
.slot.small { width: 40px; height: 40px; font-size: 16px; }
.lock { width: 22px; height: 22px; }

/* 台紙 */
.h-card { font-size: 22px; margin: 4px 0 8px; }
.progress { display: grid; gap: 6px; margin-bottom: 14px; }
.progress .num { font-size: 15px; color: var(--ink-soft); }
.progress .num strong { font-size: 34px; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 2px; }
.progress .bar { height: 10px; border-radius: 999px; background: var(--tea-pale); overflow: hidden; }
.progress .fill { display: block; height: 100%; background: var(--tea); border-radius: 999px; }

.unlock { background: var(--sheet); border: 2px solid var(--tea); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.unlock-label { display: block; font-weight: 700; font-size: 17px; }
.unlock .help { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.unlock .row { display: flex; gap: 8px; }
.unlock input {
  flex: 1; min-width: 0; min-height: 52px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font: inherit; font-size: 26px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; padding: 4px 8px;
}
.unlock input:focus { border-color: var(--tea); outline: none; box-shadow: 0 0 0 3px var(--tea-pale); }
.unlock .btn { flex: none; min-width: 84px; }
.form-msg { min-height: 1.5em; margin-top: 6px; font-size: 15px; }
.form-msg.ng { color: var(--stamp); font-weight: 700; }

.next { display: grid; gap: 2px; background: var(--tea-pale); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; color: var(--ink); text-decoration: none; }
.next .lab { font-size: 13px; font-weight: 700; color: var(--tea); letter-spacing: .1em; }
.next .body { font-weight: 700; font-size: 17px; }
.next .sub { font-size: 14px; color: var(--ink-soft); }
.next .go { font-size: 15px; color: var(--tea); font-weight: 700; text-decoration: underline; }

.complete-band { display: flex; gap: 12px; align-items: center; background: var(--stamp-pale); border: 2px solid var(--stamp); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; color: var(--ink); font-weight: 700; text-decoration: none; }

.frames { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.frame {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 10px; align-items: center;
  min-height: 92px; padding: 10px; border-radius: 12px; background: var(--sheet); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; height: 100%;
}
.frame > .seal, .frame > .slot { grid-row: 1 / span 3; }
.frame .spot { font-size: 13px; color: var(--ink-soft); }
.frame .name { font-weight: 700; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.frame .state { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.frame.done { border-color: var(--stamp); }
.frame.done .state { color: var(--stamp); }
.frame.open { border: 2px solid var(--tea); }
.frame.open .state { color: var(--tea); }
.frame.locked { background: transparent; font: inherit; text-align: left; width: 100%; cursor: pointer; }
.first-howto { background: var(--sheet); border-radius: 12px; border: 1px solid var(--line); margin: 0 0 14px; padding: 10px 14px 10px 2em; display: grid; gap: 2px; }
.src a, .links a { display: inline-block; padding: 10px 0; }

.howto { background: var(--sheet); border-radius: 12px; border: 1px solid var(--line); padding: 4px 14px; }
.howto summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.howto ol { margin: 0 0 8px; padding-left: 1.3em; display: grid; gap: 4px; }
.howto .small { margin-bottom: 10px; }

/* 問題 */
.back { margin-bottom: 8px; }
.back a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.booth-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.booth-head .spot { font-size: 13px; color: var(--ink-soft); }
.booth-head .booth-name { font-weight: 700; font-size: 17px; }
.question { font-size: 20px; margin: 6px 0 14px; overflow-wrap: anywhere; }

.choices { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.choice {
  width: 100%; min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; text-align: left;
  padding: 12px 16px; border-radius: 12px; border: 2px solid var(--tea); background: var(--sheet); color: var(--ink);
  font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
}
.choice:active:not([disabled]) { background: var(--tea-pale); }
.choice .txt { overflow-wrap: anywhere; }
.choice .tag { font-size: 14px; font-weight: 700; padding: 0 8px; border-radius: 999px; }
.choice.ng { background: var(--ng-bg); border: 2px dashed #9b9a94; color: var(--ng-ink); cursor: not-allowed; }
.choice.ng .txt { text-decoration: line-through; }
.choice.ng .tag { background: #fff; color: var(--ng-ink); border: 1px solid #9b9a94; }
.choice.ok { background: var(--tea-pale); border: 3px solid var(--ok); color: var(--ink); }
.choice.ok .tag { background: var(--ok); color: #fff; }
.choice.rest { opacity: .55; border-style: solid; border-color: var(--line); }
.choice[disabled] { cursor: default; }

.hint { background: var(--sheet); border: 2px solid #c79a2e; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.lab { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--ink-soft); }
.hint .lab { color: #7a5a10; }

.result { background: var(--sheet); border: 2px solid var(--ok); border-radius: 14px; padding: 16px; display: grid; gap: 12px; }
.res-top { display: flex; gap: 14px; align-items: center; }
.res-top h2 { font-size: 22px; color: var(--ok); }
.res-sub { font-size: 14px; color: var(--ink-soft); }
.explain { font-size: 16px; }
.src ul { margin: 2px 0 0; padding-left: 1.2em; font-size: 14px; }
.talk { background: var(--tea-pale); border-radius: 10px; padding: 10px 12px; }
.talk .lab { color: var(--tea); }
.milestone { background: var(--stamp-pale); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-weight: 700; }
.acts { display: grid; gap: 8px; }

/* コンプリート */
.complete-top { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 18px 0 8px; }
.complete-top h1 { font-size: 28px; color: var(--stamp); }
.h2 { font-size: 18px; margin: 18px 0 8px; }
.learned { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.learned li { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; }
.l-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.links { padding-left: 1.2em; }
.complete-top + .h2 { margin-top: 8px; }
main > .acts { margin-top: 16px; }

/* 抽選 */
.lot { display: grid; gap: 4px; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; color: var(--ink); text-decoration: none; }
.lot .big { font-size: 22px; font-weight: 800; }
.lot .go { font-weight: 700; color: var(--tea); text-decoration: underline; }
.lot-ready { border: 2px solid var(--stamp); background: var(--stamp-pale); }
.lot-ready .lab { color: var(--stamp); }
.lot-win { border: 2px solid var(--stamp); background: #fff4c2; }
.lot-up { display: block; color: var(--ink); text-decoration: underline; }
.lot-now { font-size: 18px; margin: 6px 0 10px; }
.lot-now strong { font-size: 34px; color: var(--stamp); margin-left: 4px; }
.tiers { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.tiers li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--line); }
.tiers li strong { margin-left: auto; font-size: 18px; }
.tiers li.past { color: var(--ink-soft); }
.tiers li.here { border: 2px solid var(--stamp); background: var(--stamp-pale); }
.tiers .now { font-size: 12px; font-weight: 700; color: #fff; background: var(--stamp); border-radius: 999px; padding: 0 8px; }
.confirm { background: var(--sheet); border: 2px solid var(--stamp); border-radius: 12px; padding: 14px; display: grid; gap: 10px; margin-bottom: 12px; }
.cf-t { font-weight: 700; }
.drum { display: flex; justify-content: center; gap: 14px; padding: 40px 0; }
.drum span { width: 22px; height: 22px; border-radius: 50%; background: var(--stamp); animation: bounce .6s ease-in-out infinite alternate; }
.drum span:nth-child(2) { animation-delay: .2s; background: var(--tea); }
.drum span:nth-child(3) { animation-delay: .4s; background: #c79a2e; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-18px); } }
.win { position: relative; overflow: hidden; text-align: center; border: 3px solid var(--stamp); border-radius: 16px; background: #fff4c2; padding: 22px 14px; display: grid; gap: 8px; margin-bottom: 12px; }
.win h1 { font-size: 34px; color: var(--stamp); position: relative; }
.win .win-sub { font-weight: 700; position: relative; }
.win .clock { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; position: relative; }
.win .small { position: relative; }
.win .shine { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.75) 50%, transparent 70%); background-size: 250% 100%; animation: shine 2.4s linear infinite; }
.win.claimed { background: var(--sheet); border-color: var(--line); }
.win.claimed .shine { display: none; }
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.staff { width: 100%; margin-bottom: 12px; font-size: 14px; }
.survey { margin: 0 0 14px; }
.survey .btn { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .seal.pop { animation: none; }
  .drum span { animation: none; }
  .win .shine { animation: none; }
}
