/* Review-sample shell: account flow + grass exterior. Palette follows the
   accepted interior: cream plaster, honey wood, powder blue, coral accents. */
:root {
  --font: "PingFang SC", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  --display: ui-rounded, "SF Pro Rounded", "PingFang SC", sans-serif;
  --num: ui-rounded, "SF Pro Rounded", sans-serif;
  --cream: #f3e8d5;
  --panel: #fff9eb;
  --soft: #f0ead9;
  --line: #ded1ad;
  --ink: #655741;
  --ink-strong: #514932;
  --ink-soft: #8a8267;
  --coral: #d98968;
  --coral-deep: #aa654c;
  --coral-ink: #fffbe8;
  --blue: #7c9db7;
  --blue-deep: #5f7f98;
  --blue-soft: #e3edf3;
  --err: #a24f35;
  --err-bg: #fbe7dc;
  --panel-shadow: 0 4px 0 #c6bb97, 0 14px 34px #5149321c;
  --chip-shadow: 0 3px 0 #c6bb97, 0 5px 12px #51493218;
  --glass: #fff9ebf2;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --bar-h: calc(var(--safe-t) + 68px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  background: var(--cream); color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; display: block; }
:focus-visible { outline: 3px solid #7c9db7aa; outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px 24px; text-align: center; font-weight: 700; }
html[data-mode="world"], html[data-mode="world"] body { height: 100%; overflow: hidden; overscroll-behavior: none; }

/* ------------------------------------------------------------------ account */

.auth {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: linear-gradient(#dcecea 0, #eef0e0 34%, var(--cream) 62%);
}
.auth-scenery { position: relative; height: 150px; flex: none; overflow: hidden; pointer-events: none; }
.auth-scenery svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-main {
  flex: 1; display: flex; justify-content: center; align-items: flex-start;
  padding: 0 16px calc(var(--safe-b) + 28px);
  margin-top: -26px; position: relative; z-index: 1;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--panel); border: 1px solid #fffbe4; border-radius: 28px;
  box-shadow: var(--panel-shadow);
  padding: 20px 20px 22px;
  scroll-margin: 16px;
}
.auth-body { display: flex; flex-direction: column; gap: 14px; }
.auth-body form { display: flex; flex-direction: column; gap: 14px; }
.auth-title { margin: 2px 0 0; font-family: var(--display); font-size: 24px; font-weight: 900; letter-spacing: .03em; color: var(--ink-strong); outline: none; }
.auth-lead { margin: -4px 0 4px; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }
.auth-switch { margin: 0; text-align: center; font-size: 13.5px; color: var(--ink-soft); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 18px; background: var(--soft); }
.seg button { height: 38px; border-radius: 14px; font-weight: 800; font-size: 14.5px; color: var(--ink-soft); transition: background .2s, color .2s, box-shadow .2s; }
.seg button[aria-current="page"] { background: var(--blue); color: var(--coral-ink); box-shadow: 0 2px 0 var(--blue-deep); }

.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 10px 0 4px; margin: -4px 0 -6px -4px; border-radius: 12px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.back svg { width: 18px; height: 18px; }
.back:hover { background: var(--soft); }

.steps { list-style: none; margin: -2px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); text-align: center; }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 12px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; border-radius: 2px; background: var(--line); }
.steps li.done:not(:last-child)::after { background: var(--blue); }
.steps i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-family: var(--num); font-size: 13px; font-weight: 900; background: var(--soft); color: var(--ink-soft); }
.steps i svg { width: 15px; height: 15px; stroke-width: 2.6; }
.steps li.on { color: var(--ink-strong); }
.steps li.on i { background: var(--coral); color: var(--coral-ink); box-shadow: 0 2px 0 var(--coral-deep); }
.steps li.done i { background: var(--blue); color: var(--coral-ink); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 800; color: var(--ink-soft); letter-spacing: .02em; }
.field input {
  width: 100%; height: 52px; padding: 0 16px;
  border-radius: 16px; border: 2px solid transparent; background: var(--soft);
  font-size: 16px; font-weight: 700; color: var(--ink-strong);
  outline: none; transition: border-color .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: #b5aa8d; font-weight: 600; }
.field input:focus { border-color: var(--blue); background: #fffdf6; }
.field input[aria-invalid="true"] { border-color: var(--coral); background: #fff6ef; }
.field input[readonly] { opacity: .75; }
.field-err { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--err); line-height: 1.45; }
.field-err:empty { display: none; }
.field-hint { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.field-hint:empty { display: none; }
.row-end { display: flex; justify-content: flex-end; margin-top: -8px; }

.pw { position: relative; }
.pw input { padding-right: 54px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-soft); }
.pw-eye svg { width: 21px; height: 21px; }
.pw-eye:hover { background: #e7dfc9; }
.pw-eye[aria-pressed="true"] { color: var(--blue-deep); }

.code-input { font-family: var(--num) !important; font-size: 26px !important; font-weight: 900 !important; letter-spacing: .5em; text-align: center; padding-left: calc(16px + .5em) !important; font-variant-numeric: tabular-nums; }

.rule { display: flex; align-items: center; gap: 7px; margin: -6px 0 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.rule i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: transparent; transition: background .2s, color .2s; }
.rule i svg { width: 12px; height: 12px; stroke-width: 3; }
.rule.ok { color: var(--blue-deep); }
.rule.ok i { background: var(--blue); color: #fff; }
.rule.over { color: var(--err); }

.sent, .verified, .notice { display: flex; align-items: center; gap: 9px; margin: 0; padding: 11px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.sent { background: var(--soft); color: var(--ink); }
.sent svg { flex: none; width: 20px; height: 20px; color: var(--blue-deep); }
.verified, .notice { background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; }
.verified svg, .notice svg { flex: none; width: 18px; height: 18px; stroke-width: 2.6; }
.sent b, .verified b { font-weight: 800; color: var(--ink-strong); }

.form-err { display: none; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 11px 14px; border-radius: 14px; background: var(--err-bg); color: var(--err); font-size: 13.5px; font-weight: 700; line-height: 1.45; }
.form-err.show { display: flex; }
.form-err .link { color: var(--err); }

.btn-primary {
  height: 54px; border-radius: 18px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--coral); color: var(--coral-ink);
  font-family: var(--display); font-weight: 900; font-size: 17px; letter-spacing: .06em;
  box-shadow: 0 4px 0 var(--coral-deep);
  transition: transform .12s, box-shadow .12s, opacity .2s;
}
.btn-primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--coral-deep); }
.btn-primary:disabled { opacity: .78; }
.btn-quiet {
  height: 46px; border-radius: 16px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14.5px; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-quiet:disabled { color: var(--ink-soft); }
.btn-quiet:hover:not(:disabled) { background: var(--soft); }
.link { font-weight: 800; font-size: 13.5px; color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; padding: 4px 2px; }

.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
.auth-wait { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 0 24px; color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.auth-wait .spin { width: 26px; height: 26px; color: var(--coral); }
.auth-wait p { margin: 0; }

.who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--soft); min-width: 0; }
.who > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.who b { font-size: 16px; font-weight: 900; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 12.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--coral); color: var(--coral-ink); font-family: var(--display); font-weight: 900; font-size: 17px; box-shadow: 0 2px 0 var(--coral-deep); }
.pill-ok { font-style: normal; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--blue-soft); color: var(--blue-deep); font-size: 11px; font-weight: 800; white-space: nowrap; }

@media (min-width: 760px) {
  .auth { justify-content: center; }
  .auth-scenery { position: fixed; left: 0; right: 0; bottom: 0; height: 44vh; min-height: 260px; }
  .auth-main { align-items: center; margin-top: 0; padding: 48px 24px 18vh; }
  .auth-card { padding: 28px 32px 30px; }
  .auth-title { font-size: 27px; }
}
@media (min-width: 760px) and (max-height: 640px) {
  .auth-scenery { height: 30vh; min-height: 0; }
  .auth-main { padding-bottom: 10vh; }
}
@media (max-width: 360px) {
  .auth-card { padding: 18px 16px 20px; border-radius: 24px; }
  .steps span { font-size: 10.5px; }
}

/* ------------------------------------------------------------------ world shell */

.world { position: fixed; inset: 0; overflow: hidden; background: #cfe6e2; }
.viewport { position: absolute; inset: 0; }
.bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  height: var(--bar-h);
  padding: calc(var(--safe-t) + 12px) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.place {
  display: flex; align-items: center; gap: 8px; min-width: 0; height: 46px; padding: 0 16px;
  border-radius: 23px 23px 23px 8px; border: 1px solid #fffbe4;
  background: var(--glass); box-shadow: var(--chip-shadow);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.place b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--display); font-size: 17px; font-weight: 900; letter-spacing: .04em; color: var(--ink-strong); white-space: nowrap; }
.sample-badge { flex: none; font-size: 10.5px; line-height: 1; padding: 4px 7px; border-radius: 99px; background: #e7ddbd; color: #897b51; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
.bar-exit {
  flex: none; height: 46px; padding: 0 16px 0 12px; border-radius: 23px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--coral); color: var(--coral-ink); font-family: var(--display); font-weight: 900; font-size: 15px; letter-spacing: .05em;
  box-shadow: 0 3px 0 var(--coral-deep);
}
.bar-exit svg { width: 20px; height: 20px; stroke-width: 2.1; }
.bar-exit:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--coral-deep); }
.bar-exit:disabled { opacity: .6; }
.btn-secondary {
  height: 46px; padding: 0 16px; border-radius: 23px; border: 1px solid #fffbe4;
  background: var(--glass); box-shadow: var(--chip-shadow); white-space: nowrap;
  font-weight: 800; font-size: 14px; color: var(--ink-strong);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.scene-fail { position: absolute; inset: 0; display: grid; place-content: center; gap: 16px; padding: 24px; text-align: center; background: var(--cream); font-weight: 700; color: var(--ink-soft); }
.scene-fail p { margin: 0; }
.scene-fail .btn-primary { width: 160px; justify-self: center; }

/* account chip + popover */
.acct { position: relative; }
.acct-chip {
  height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 6px; border-radius: 23px;
  border: 1px solid #fffbe4; background: var(--glass); box-shadow: var(--chip-shadow);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.acct-chip .avatar { width: 34px; height: 34px; font-size: 15px; box-shadow: none; }
.acct-name { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 14px; color: var(--ink-strong); }
.acct-pop {
  position: absolute; right: 0; top: 56px; width: min(280px, calc(100vw - 28px));
  padding: 12px; border-radius: 22px; border: 1px solid #fffbe4;
  background: var(--panel); box-shadow: var(--panel-shadow);
  display: flex; flex-direction: column; gap: 10px;
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.3);
}
.acct-row { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 0 6px; font-size: 13px; color: var(--ink-soft); }
.acct-row b { font-family: var(--num); font-size: 15px; letter-spacing: .08em; color: var(--ink-strong); }
@media (max-width: 400px) {
  .acct-name { display: none; }
  .acct-chip { padding: 0 5px; width: 46px; justify-content: center; }
  .place { padding: 0 12px; }
  .place b { font-size: 15.5px; }
  .bar-exit { padding: 0 13px 0 10px; }
}
@media (max-width: 350px) {
  .world[data-area="inside"] .sample-badge { display: none; }
}

/* shared loading dots (scene styles live in study-hall/hall.css) */
.ld { display: flex; gap: 8px; }
.ld i { width: 11px; height: 11px; border-radius: 50%; background: var(--coral); animation: ld .9s ease-in-out infinite alternate; }
.ld i:nth-child(2) { animation-delay: .15s; } .ld i:nth-child(3) { animation-delay: .3s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ld { from { transform: translateY(3px); opacity: .5; } to { transform: translateY(-4px); opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; }
  .spin { animation: spin 1.6s linear infinite !important; }
}
