

:root {
  color-scheme: light;
  --floor: #efe8d8;
  --wood: #3b3a36;
  --wood-d: #22211f;
  --plank: #b0a898;
  --night: #c9bfa9;          
  --paper: #fffdf7;
  --paper-2: #f1ead9;
  --cream: #ffffff;
  --ink: #22211f;
  --ink-2: #5b574f;
  --ink-on: #23160e;
  --gold: #b3362f;
  --link: #b3362f;
  --title: #22211f;
  --go: #c8413b;             
  --go-ink: #fffdf7;
  --warn: #f3d27a;
  --bad: #f3b1a6;
  --bad-ink: #3a1410;
  --red: #c8413b;
  --ok-bg: #d8ecc6;
  --ok-line: #3d6b2e;
  --ok-ink: #24461a;
  --muted: #6f6a5f;
  --muted-2: #8d877a;
  --font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--floor); color: var(--ink); font-family: var(--font); }
body { font-size: 15px; }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


#app { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; container-type: inline-size;
  background: url(/a/bg.956a6da3a9.webp) top center / 100% auto no-repeat, var(--floor); }


.scr { flex: 1 0 auto; width: 100%; display: flex; flex-direction: column; gap: 16px; padding: calc(var(--safe-t) + 34px) 22px calc(var(--safe-b) + 24px); }
.scr.center { justify-content: center; }

@media (min-width: 560px) { .scr { max-width: 480px; margin-inline: auto; } }
.foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.center-row { display: flex; justify-content: center; }
.ver { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--link); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.link.plain { text-decoration: none; }
.back { align-self: flex-start; }
.tagline { font-size: 13px; letter-spacing: 1px; color: var(--muted); text-align: center; text-shadow: 0 1px 0 #f6f1e6; }
.page-title { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: 2px; color: var(--title); }


.sign-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.seal { display: block; flex: 0 0 auto; height: auto; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35)); }

.scr > .sign-wrap:first-child { margin-bottom: max(24px, calc(55cqw - 144px)); }
.scr > .topbar:first-child { margin-bottom: max(0px, calc(55cqw - 133px)); }


.card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--paper); color: var(--ink);
  border: 3px solid var(--wood-d); border-radius: 6px; box-shadow: 0 6px 0 var(--night); }
.card h1, .card h2 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: 1px; text-wrap: balance; }
.card p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.card p b { color: var(--ink); }
.note { padding: 12px 14px; background: var(--paper-2); border: 2px solid var(--plank); border-radius: 6px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.note b { display: block; color: var(--ink); }
.note.have-acct { display: flex; align-items: center; gap: 12px; }
.note.have-acct span { flex: 1; min-width: 0; }
.note.have-acct .btn { flex: none; margin: 0; }


.alert { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 3px solid var(--wood-d); border-radius: 6px; box-shadow: 0 4px 0 var(--night); color: var(--ink-on); }
.alert b { font-size: 16px; font-weight: 900; }
.alert span { font-size: 14px; line-height: 1.55; }
.alert.bad { background: var(--bad); color: var(--bad-ink); }
.alert.warn { background: var(--warn); }
.alert.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.alert .btn { align-self: flex-start; margin-top: 6px; min-height: 44px; padding: 0 16px; font-size: 16px; }
.count { font-variant-numeric: tabular-nums; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 16px; border: 3px solid var(--wood-d); border-radius: 6px;
  box-shadow: 0 5px 0 var(--night); background: var(--paper); color: var(--ink-on); font-size: 20px; font-weight: 900; letter-spacing: 3px; text-align: center; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--night); }
.btn:disabled { filter: grayscale(.7); opacity: .6; box-shadow: 0 2px 0 var(--night); transform: translateY(3px); }
.btn.go { background: var(--go); color: var(--go-ink); }
.btn.gold { background: var(--warn); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; letter-spacing: 1px; box-shadow: 0 3px 0 var(--night); }
.btn.small:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--night); }
.btn.lang { min-width: 84px; background: var(--paper); color: var(--ink); }
.card .btn { box-shadow: 0 5px 0 var(--wood-d); }


.spin { text-align: center; font-size: 16px; color: var(--muted); }
.spin::after { content: ""; display: inline-block; width: 1.2em; text-align: start; animation: dots 1.2s steps(4) infinite; }
.btn .spin { color: inherit; font-size: inherit; }
@keyframes dots { 0% { content: ""; } 25% { content: "·"; } 50% { content: "··"; } 75% { content: "···"; } }


form.card { gap: 14px; padding: 18px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 15px; font-weight: 800; }
.inbox { position: relative; display: flex; }
.inbox input { flex: 1; min-width: 0; height: 50px; padding: 0 12px; background: var(--cream); border: 3px solid var(--ink-2); border-radius: 4px; font-size: 17px; color: var(--ink); }
.inbox input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(179, 54, 47, .25); }
.inbox .eye { position: absolute; top: 3px; right: 3px; bottom: 3px; min-width: 56px; padding: 0 10px; border: 0; border-left: 2px solid var(--paper-2); border-radius: 0 2px 2px 0; background: var(--cream); color: var(--ink-2); font-size: 14px; font-weight: 800; }
.inbox input.has-eye { padding-right: 70px; }
.field .hint { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.field .err { display: none; font-size: 13.5px; font-weight: 800; line-height: 1.5; color: var(--red); }
.field.bad input { border-color: var(--red); }
.field.bad .err { display: block; }
.field.bad .hint { display: none; }


.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.who { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.who b { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 900; color: var(--ink); }
.who small { font-size: 12px; color: var(--muted); }

.sec { align-self: flex-start; margin: 4px 0 -4px; padding: 2px 10px; border-radius: 4px; background: rgba(247, 241, 228, .88);
  font-size: 14px; font-weight: 800; letter-spacing: 3px; color: var(--ink-2); }
.soon { display: flex; align-items: center; justify-content: center; min-height: 76px; padding: 12px; border: 3px dashed var(--plank); border-radius: 6px; font-size: 15px; letter-spacing: 1px; color: var(--muted); }
.menu { display: flex; flex-direction: column; background: var(--paper); border: 3px solid var(--wood-d); border-radius: 6px; overflow: hidden; }
.menu button { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; border: 0; border-bottom: 2px solid var(--paper-2); background: none; color: var(--ink); font-size: 16px; font-weight: 700; text-align: start; }
.menu button:last-child { border-bottom: 0; }
.menu button.exit { color: var(--gold); font-weight: 800; }
.menu i { font-style: normal; color: var(--muted); }

.privacy { gap: 16px; }
.privacy section { display: flex; flex-direction: column; gap: 4px; }
.privacy h2 { font-size: 16px; }
.privacy p { font-size: 14.5px; }


.gcard { position: relative; border-radius: 16px; padding: 9px 15px 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  --gc-frame: #6e4020; --gc-edge: #4a2810; --gc-bar: #f2b84a; --gc-barhi: #ffe28a;
  background: linear-gradient(90deg, var(--gc-edge) 0, var(--gc-frame) 9px, var(--gc-frame) calc(100% - 9px), var(--gc-edge) 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35), inset 0 0 0 2px #2e1707, inset 0 2px 0 3px rgba(255, 210, 140, .18); }
.gcard:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.gcard:active { transform: scale(.99); }
.gcard.busy { opacity: .75; pointer-events: none; }
.gcard .cov { position: relative; border-radius: 6px; aspect-ratio: 1200 / 614; background: #1a1410 center / cover no-repeat; display: grid; place-items: center;
  box-shadow: 0 0 0 2px #e6b04f, 0 0 0 4px #3a1e0a; }
.gcard .cov .gico { font-size: 48px; font-weight: 900; color: #e6b04f; }
.gcard .cov i { position: absolute; width: 14px; height: 14px; border: 3px solid #f2c460; }
.gcard .cov i.a { top: -5px; left: -5px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.gcard .cov i.b { top: -5px; right: -5px; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
.gcard .cov i.c { bottom: -5px; left: -5px; border-right: 0; border-top: 0; border-radius: 0 0 0 4px; }
.gcard .cov i.d { bottom: -5px; right: -5px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.gcard .lan { position: absolute; z-index: 2; top: 2px; width: 26px; image-rendering: pixelated; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .55)); pointer-events: none; }
.gcard .lan.l { left: -6px; }
.gcard .lan.r { right: -6px; }
.gcard .gfoot { display: flex; align-items: center; gap: 12px; padding: 12px 4px 14px; }
.gcard .tx { flex: 1; min-width: 0; }
.gcard .n { font-size: 19px; font-weight: 800; color: #ffd98a; letter-spacing: 1px; text-shadow: 0 2px 0 #2e1707; overflow-wrap: anywhere; }
.gcard .s { margin-top: 3px; font-size: 13px; line-height: 1.45; color: #e9cfa6; overflow-wrap: anywhere; }
.gcard .go { flex: none; padding: 7px 18px; border: 3px solid var(--gc-edge); border-radius: 12px; background: linear-gradient(180deg, var(--gc-barhi), var(--gc-bar)); box-shadow: 0 3px 0 #2e1707;
  color: var(--gc-edge); font-size: 16px; font-weight: 800; }

.gcard.locked { cursor: default; }
.gcard.locked:active { transform: none; }
.gcard.locked .cov { filter: grayscale(.85) brightness(.8); }
.gcard.locked .lan { filter: grayscale(.8) drop-shadow(0 3px 5px rgba(0, 0, 0, .55)); }
.gcard .nogo { flex: none; padding: 6px 12px; border: 2px dashed rgba(233, 207, 166, .55); border-radius: 12px; color: #e9cfa6; font-size: 14px; font-weight: 800; white-space: nowrap; }

.gcard.row { padding: 8px 12px 8px 10px; border-radius: 14px; }
.gcard.row .grow { display: flex; align-items: center; gap: 12px; }
.gcard.row .cov { flex: 0 0 104px; width: 104px; }
.gcard.row .cov i { width: 9px; height: 9px; border-width: 2px; }
.gcard.row .cov i.a { top: -4px; left: -4px; }
.gcard.row .cov i.b { top: -4px; right: -4px; }
.gcard.row .cov i.c { bottom: -4px; left: -4px; }
.gcard.row .cov i.d { bottom: -4px; right: -4px; }
.gcard.row .cov .gico { font-size: 26px; }
.gcard.row .n { font-size: 16px; }
.gcard.row .s { margin-top: 1px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard.row .go { padding: 6px 12px; font-size: 15px; }
.gcard.row .nogo { padding: 4px 8px; font-size: 12px; }
.gcard.row .lan { width: 16px; top: 0; }
.gcard.row .lan.l { left: -5px; }
.gcard.row .lan.r { right: -5px; }

.gcard.loadcard { cursor: default; padding-bottom: 16px; }
.gcard.loadcard:active { transform: none; }
.gcard.loadcard .gfoot { justify-content: center; padding-bottom: 10px; }
.gcard.loadcard .n { text-align: center; }
.gbar { height: 14px; margin: 0 4px; padding: 2px; border-radius: 8px; background: #2e1707; box-shadow: inset 0 0 0 2px #4a2810; }
.gbar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(180deg, var(--gc-barhi), var(--gc-bar)); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); animation: fill 1.6s ease-out forwards; }
@keyframes fill { to { width: 90%; } }


#splash { position: fixed; z-index: 30; inset: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7vw; padding-bottom: 8vh; background: #141c1e; animation: splashOut .8s ease 5.2s forwards; }
#splash img { width: min(64vw, 300px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .55));
  transform-origin: 50% 88%; animation: splashLogo 2.6s ease-in-out both; }
#splash b { font-weight: 900; font-size: clamp(26px, 10vw, 48px); line-height: 1.3; letter-spacing: .2em; text-indent: .2em; white-space: nowrap; color: #ffd98a;
  -webkit-text-stroke: .44em #17110d; paint-order: stroke fill; stroke-linejoin: round;
  text-shadow: .045em 0 0 #fff, -.045em 0 0 #fff, 0 .045em 0 #fff, 0 -.045em 0 #fff, .032em .032em 0 #fff, -.032em .032em 0 #fff, .032em -.032em 0 #fff, -.032em -.032em 0 #fff;
  animation: splashText .9s ease 2.1s both; }
#splash.out { animation: splashOut .35s ease forwards; }
@keyframes splashLogo {
  0% { opacity: 0; transform: scale(.3) rotate(-30deg); }
  14% { opacity: 1; transform: scale(1.14) rotate(26deg); }
  27% { transform: scale(.95) rotate(-22deg); }
  39% { transform: scale(1.05) rotate(18deg); }
  51% { transform: scale(.99) rotate(-14deg); }
  62% { transform: scale(1.01) rotate(10deg); }
  72% { transform: scale(1) rotate(-6.5deg); }
  81% { transform: rotate(4deg); }
  89% { transform: rotate(-2deg); }
  95% { transform: rotate(.8deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes splashText { from { opacity: 0; transform: translateY(12px); letter-spacing: .5em; } to { opacity: 1; transform: none; letter-spacing: .2em; } }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { #splash img, #splash b { animation: none; } }

#toast { position: fixed; z-index: 20; top: calc(var(--safe-t) + 22px); left: 50%; max-width: 330px; transform: translateX(-50%); padding: 10px 16px;
  background: var(--paper); color: var(--ink); border: 3px solid var(--wood-d); border-radius: 6px; box-shadow: 0 4px 0 var(--night);
  font-size: 15px; font-weight: 800; text-align: center; animation: pop .25s ease-out; }
@keyframes pop { from { transform: translate(-50%, -8px); opacity: 0; } }


.screen-info { position: fixed; z-index: 90; left: 8px; top: 8px; max-width: calc(100vw - 16px); padding: 4px 8px; border-radius: 4px;
  background: rgba(34, 33, 31, .85); color: #fffdf7; font: 12px/1.4 ui-monospace, Consolas, monospace; pointer-events: none; }


html.rot, html.rot body { height: 100%; overflow: hidden; }
html.rot #app, html.rot #splash { position: fixed; z-index: 60; top: 0; left: 0; inset: auto; width: var(--rot-w); height: var(--rot-h); min-height: 0;
  overflow-x: hidden; overflow-y: auto; transform-origin: 0 0; }
html.rot #splash { z-index: 70; }
html.rot.rot-l #app, html.rot.rot-l #splash { transform: rotate(-90deg) translateX(-100%); }
html.rot.rot-r #app, html.rot.rot-r #splash { transform: rotate(90deg) translateY(-100%); }
