:root {
  color-scheme: dark;
  --date: #211711;
  --surface: #2d2018;
  --ink: #fff4df;
  --muted: #d0bfaa;
  --gold: #d9aa59;
  --line: #70543c;
  font: 16px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--date);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  min-height: 100svh;
  margin: 0;
  padding: clamp(1.5rem, 4vw, 4rem) 1.25rem;
  display: grid;
  align-items: center;
  background: radial-gradient(ellipse at 10% 0%, #61432b 0, transparent 48%), linear-gradient(130deg, #30251c, #211711 68%, #152c25);
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a, .text-button { color: #f4deb0; text-underline-offset: .2em; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:where(button, a, input, [tabindex]):focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.entry-shell {
  width: min(100%, 62rem);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  overflow: hidden;
  background: var(--date);
  border: 1px solid #70533b;
  border-radius: 1.4rem;
  box-shadow: 0 1.5rem 5rem #130c0880;
}
.entry-brand {
  position: relative;
  isolation: isolate;
  grid-row: 1 / -1;
  display: flex;
  align-items: flex-end;
  padding: clamp(2rem, 4vw, 3.5rem);
  background: #173c34;
}
.entry-scene { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 48%; }
.entry-brand::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(0deg, #101813 0%, #17231ba6 26%, transparent 55%), linear-gradient(130deg, #4527113d, transparent 55%);
}
.entry-lockup { display: grid; justify-items: start; gap: .6rem; max-width: 100%; }
.entry-lockup img { display: block; width: min(100%, 18rem); height: auto; }
.entry-descriptor { color: #f4deb0; font-size: .83rem; font-weight: 600; letter-spacing: .17em; }
.entry-panel { align-self: center; min-width: 0; padding: 2rem clamp(1.25rem, 4vw, 3.25rem) 0; }
.entry-panel h1 { margin: 0; color: #fff4df; font: 500 clamp(2rem, 3.5vw, 2.8rem)/1.15 Georgia, serif; letter-spacing: -.035em; }
.entry-status, .session-hint, .test-notice, .field-hint { color: var(--muted); }
.entry-status { margin: .45rem 0 1.35rem; font-size: .92rem; }
.field-label { display: block; margin: .94rem 0 .36rem; font-size: .84rem; color: #f4deb0; font-weight: 600; }
.entry-panel input:not([type=checkbox]) {
  width: 100%; height: 2.9rem; padding: 0 .85rem; color: var(--ink);
  background: #17130f; border: 1px solid var(--line); border-radius: .55rem;
}
.entry-panel input::placeholder { color: #bba68f; opacity: 1; }
.field-hint { margin: .33rem 0 0; font-size: .76rem; }
.password-field { position: relative; }
.password-field input { padding-right: 3rem !important; }
.password-field button { position: absolute; right: 0; inset-block: 0; width: 2.85rem; border: 0; color: #d6c0a3; background: transparent; }
.password-field svg { width: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; }
.remember { display: flex; align-items: center; gap: .6rem; width: fit-content; min-height: 2.75rem; margin-block: .25rem .45rem; font-size: .84rem; }
.remember input { width: 1.07rem; height: 1.07rem; margin: 0; accent-color: var(--gold); }
.gloss-button, .entry-providers button {
  width: 100%; min-height: 2.8rem; padding: .55rem .8rem; border: 1px solid #e0bc78; border-radius: .55rem;
  font-size: .92rem; font-weight: 650; color: #271b10; background: linear-gradient(150deg, #f4deb0, #d9aa59);
}
.gloss-button:hover:not(:disabled) { background: #f3d599; }
.guest-button, .entry-providers button { color: var(--ink); background: #30241c; border-color: var(--line); }
.guest-button { margin-top: .55rem; }
.guest-button:hover:not(:disabled), .entry-providers button:hover:not(:disabled) { background: #463221; border-color: var(--gold); }
.gloss-button:disabled, .entry-providers button:disabled { background: #2d2620; color: #baa998; border-color: #574938; }
.entry-providers { display: grid; gap: .42rem; }
.entry-divider { display: flex; gap: .7rem; align-items: center; margin: .5rem 0 .15rem; color: var(--muted); font-size: .76rem; }
.entry-divider::before, .entry-divider::after { content: ""; flex: 1; height: 1px; background: #5a4636; }
.entry-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .65rem; margin: .6rem 0; font-size: .84rem; }
.entry-links a, .text-button { min-height: 2.75rem; display: inline-flex; align-items: center; }
.entry-links > span { color: #9a7c5e; }
.test-notice, .entry-footer { text-align: center; font-size: .76rem; }
.test-notice { margin: 0; }
.entry-footer { grid-column: 2; padding: .25rem 1rem 1.2rem; }
.text-button { padding: .45rem; border: 0; background: transparent; font-size: inherit; }
.text-button:hover { text-decoration: underline; }
.current-session { padding: .5rem 0; }
.current-session > .text-button { display: flex; margin: auto; }
.session-hint { font-size: .82rem; }
.entry-error { border: 1px solid #bf8174; border-radius: .55rem; padding: .7rem; color: #ffddd0; background: #542c24; }
body.is-loading { overflow: hidden; }
.loading-screen {
  position: fixed; inset: 0; z-index: 20; padding: 1.5rem; display: flex; gap: .65rem;
  flex-direction: column; align-items: center; justify-content: center; text-align: center;
  color: #f4deb0; background: radial-gradient(ellipse at 50% 38%, #4d3925, #211711 64%);
}
.loading-wordmark { width: min(13rem, 65vw); }
.loading-suit { display: block; width: 3.2rem; height: auto; }
.loading-screen > p { margin: .4rem; }
@media (prefers-reduced-motion: no-preference) {
  .loading-suit.is-moving { animation: suit-turn 1.2s ease-in-out infinite; }
  @keyframes suit-turn { 0%, 40%, 100% { transform: perspective(360px) rotateY(0); } 65% { transform: perspective(360px) rotateY(70deg) rotateZ(9deg); } }
}
dialog { width: min(38rem, calc(100% - 1.5rem)); max-height: calc(100svh - 2rem); margin: auto; padding: 0; background: #2d2119; border: 1px solid var(--line); border-radius: .85rem; color: var(--ink); }
dialog::backdrop { background: #100d09cb; }
dialog[open] { display: flex; flex-direction: column; }
.policy-heading, .policy-actions { display: flex; align-items: center; gap: .8rem; padding: 1rem; flex-shrink: 0; }
.policy-icon { color: #e4ba75; font-size: 1.8rem; }
.policy-heading p { font-size: .65rem; color: var(--muted); letter-spacing: .1em; margin: 0; }
.policy-heading h2 { font-size: 1.1rem; margin: .2rem 0 0; }
#policy-instruction { margin: 0 1rem 1rem; color: var(--muted); font-size: .84rem; }
.policy-scroll { overflow: auto; overscroll-behavior: contain; min-height: 0; height: 52svh; padding: 1rem 1.25rem; background: #fbf4e6; color: #33281e; font: 1rem/1.62 Georgia, serif; }
.policy-scroll h3 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
.policy-date { font: .78rem/1.45 system-ui, sans-serif; }
.policy-read-status { margin: 0; padding: .65rem 1rem; background: #e5ba72; color: #382715; font-size: .81rem; }
.policy-back { min-height: 2.8rem; padding: .45rem .85rem; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: .55rem; }
#policy-error { margin: .5rem 1rem; }
.entry-panel .river-validation-message { color: #ffc2a6; font-size: .84rem; }
.return-panel { width: min(30rem, 100%); margin: auto; }
.return-panel img { width: 11rem; }
@media (max-width: 700px) {
  body { padding: 0; background: var(--date); align-items: start; }
  .entry-shell { display: block; border: 0; border-radius: 0; max-width: 34rem; box-shadow: none; }
  .entry-brand { min-height: clamp(8rem, 24svh, 13rem); padding: 1.2rem max(1.3rem, env(safe-area-inset-left)); }
  .entry-scene { object-position: 50% 48%; }
  .entry-brand::after { background: linear-gradient(0deg, #192219e8, #19201939 63%, transparent); }
  .entry-lockup { gap: .32rem; }
  .entry-lockup img { width: 10rem; }
  .entry-descriptor { font-size: .69rem; }
  .entry-panel { padding: 1.25rem max(1.3rem, env(safe-area-inset-right)) 0 max(1.3rem, env(safe-area-inset-left)); }
  .entry-status { margin-bottom: .7rem; }
  .entry-footer { padding-bottom: max(.9rem, env(safe-area-inset-bottom)); }
  .return-panel { padding: 2rem 1.25rem; }
}
#provider-status { display: block; color: var(--muted); font-size: .78rem; line-height: 1.45; }
#provider-status:empty { display: none; }
