/* ==========================================================================
   join.css: INNER CIRCLE · APPLY, the plain guest book (no effects).
   Lazy-loaded with join.js the first time the room opens. It must look
   finished on its own; apply-room.css layers the effects on top.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&display=swap");

#room {
  --font-ink: "Caveat", "Segoe Script", cursive;
  --paper-hi: #1e171a;
  --paper: #171215;
  --paper-lo: #110d10;
  --rule: rgba(255, 255, 255, 0.045);
  --field-line: rgba(255, 255, 255, 0.16);
}
body[data-room="join"] .room-body { display: flex; flex-direction: column; }
.apply-room { position: relative; flex: 1 0 auto; display: flex; flex-direction: column; min-height: 100%; }
.apply-room [hidden] { display: none !important; }
.apply-room .sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ------------------------------ the guest book ------------------------------ */
.ar-stage { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 0 10px; }
.ledger {
  --margin-x: 58px;
  position: relative; width: min(760px, 100%); margin: 0 auto;
  padding: 30px 40px 26px calc(var(--margin-x) + 26px);
  border-radius: 8px 12px 10px 14px;
  background:
    radial-gradient(140% 110% at 50% 45%, transparent 62%, rgba(0, 0, 0, 0.32) 100%),
    radial-gradient(120% 70% at 50% 0%, rgba(255, 236, 214, 0.05), transparent 60%),
    linear-gradient(90deg, transparent calc(var(--margin-x) - 1px), rgba(224, 21, 42, 0.6) calc(var(--margin-x) - 1px) var(--margin-x), transparent var(--margin-x) calc(var(--margin-x) + 4px), rgba(224, 21, 42, 0.22) calc(var(--margin-x) + 4px) calc(var(--margin-x) + 5px), transparent calc(var(--margin-x) + 5px)),
    repeating-linear-gradient(180deg, transparent 0 33px, var(--rule) 33px 34px),
    linear-gradient(180deg, var(--paper-hi) 0%, var(--paper) 50%, var(--paper-lo) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    4px 5px 0 -1px #120e11, 4px 5px 0 0 rgba(255, 255, 255, 0.05),
    8px 10px 0 -2px #0e0b0d, 8px 10px 0 -1px rgba(255, 255, 255, 0.035),
    0 40px 90px -30px rgba(0, 0, 0, 0.95), inset 0 0 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.ledger-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.ledger-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: 0.12em; color: var(--ink); }
.ledger-date { margin: 0; font-family: var(--font-ink); font-size: 21px; color: var(--ink-dim); }
.ledger-lede { margin: 8px 0 22px; font-size: 16px; line-height: 1.5; color: #c9c6d3; max-width: 56ch; }

.ledger-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; }
.f-name, .f-note, .f-games { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); }
.field .opt { font-weight: 400; letter-spacing: 0.08em; text-transform: none; color: var(--ink-faint); margin-left: 6px; font-size: 12px; }
.field input, .field textarea, .key-form input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  font: 400 16px/1.45 var(--font-body); color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--field-line); border-radius: var(--rad);
  caret-color: var(--blood-bright);
  -webkit-appearance: none; appearance: none;
  transition: border-color 200ms ease, box-shadow 250ms ease, background 200ms ease, text-shadow 1s ease, color 1s ease;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); opacity: 1; }
.field input:focus, .field textarea:focus, .key-form input:focus {
  outline: none; background: rgba(255, 59, 74, 0.05);
  border-color: var(--blood-bright);
  box-shadow: 0 0 0 2px rgba(255, 59, 74, 0.55), 0 12px 24px -16px rgba(255, 59, 74, 0.9);
}
/* the trap: off-screen, never seen or focused by real people, always sent empty */
.field-trap { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.ledger-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 18px; flex-wrap: wrap; }
.ledger-fine { margin: 0; font-size: 13px; color: var(--ink-dim); max-width: 34ch; line-height: 1.45; }
.seal {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px;
  font: 700 15px var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: #fff;
  background: linear-gradient(120deg, var(--blood-bright), var(--blood-deep)); border: 0; border-radius: 12px; cursor: pointer;
}
.seal[disabled] { cursor: progress; opacity: 0.75; }
.seal-ring, .seal-wax, .seal-hint { display: none; }
.ledger-error { margin: 14px 0 0; color: var(--blood-bright); font-weight: 500; font-size: 15px; }
.ledger-error:empty { display: none; }

.ar-answer { text-align: center; padding: 40px 0; }
.ar-answer-kicker { margin: 0 0 14px; font-family: var(--font-pixel); font-size: 17px; letter-spacing: 0.24em; color: var(--blood-bright); }
.ar-ink { margin: 0 auto; max-width: 18ch; font-family: var(--font-ink); font-weight: 600; font-size: clamp(34px, 4.6vw, 58px); line-height: 1.12; color: #f4efe9; }
.ar-sign { margin: 10px 0 0; font-family: var(--font-ink); font-size: 24px; color: var(--ink-dim); }
.ar-answer-links { margin: 26px 0 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 10px; color: var(--ink-faint); }
.ar-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; background: none; border: 0; cursor: pointer; font: 500 14px var(--font-body); letter-spacing: 0.08em; color: var(--ink-dim); text-decoration: underline; text-decoration-color: rgba(255, 59, 74, 0.5); text-underline-offset: 5px; }
.ar-link:hover, .ar-link:focus-visible { color: var(--ink); outline: none; text-decoration-color: var(--blood-bright); }

/* ------------------------------ house key (plain <details>) ------------------------------ */
.ar-foot { margin-top: 22px; display: flex; justify-content: center; }
.house-key { display: flex; flex-direction: column; align-items: center; width: min(420px, 100%); }
.house-key summary { cursor: pointer; color: var(--ink-dim); list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; }
.house-key summary::-webkit-details-marker { display: none; }
.kh-plate, .kh-key { width: 26px; height: 26px; }
.kh-key { display: none; }
.kh-label { font-family: var(--font-pixel); font-size: 16px; letter-spacing: 0.16em; text-transform: uppercase; }
.key-form, .key-list { display: grid; gap: 8px; margin-top: 10px; width: 100%; }
.key-form label { font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); }
.key-btn, .key-done { min-height: 44px; border-radius: 10px; border: 1px solid rgba(255, 59, 74, 0.5); background: rgba(255, 59, 74, 0.08); color: var(--ink); font: 600 14px var(--font-body); letter-spacing: 0.1em; cursor: pointer; padding: 0 16px; }
.key-btn:hover, .key-btn:focus-visible, .key-done:hover, .key-done:focus-visible { background: rgba(255, 59, 74, 0.18); outline: none; border-color: var(--blood-bright); }
.key-btn[disabled], .key-done[disabled] { opacity: 0.6; cursor: progress; }
.key-status { margin: 0; font-size: 13px; color: var(--ink-dim); min-height: 1em; }
.key-kicker { margin: 0; font-family: var(--font-pixel); font-size: 15px; letter-spacing: 0.22em; color: var(--blood-bright); }
.key-count { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: 0.12em; color: var(--ink); }
.key-empty { margin: 0; font-size: 14px; color: var(--ink-dim); }
.key-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.key-items li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; background: rgba(255, 255, 255, 0.03); overflow-wrap: anywhere; }
.key-items b { font-weight: 600; color: var(--ink); }
.key-items span { font-size: 13px; color: var(--ink-dim); }
.key-items p { margin: 4px 0 6px; font-size: 14px; color: #c9c6d3; }
.key-items .key-done { justify-self: start; margin-top: 4px; }

/* ------------------------------ small screens ------------------------------ */
@media (max-width: 640px) {
  body[data-room="join"] .room-head { flex-direction: row; align-items: flex-end; flex-wrap: nowrap; gap: 10px; }
  body[data-room="join"] .room-brand { flex: 1; min-width: 0; }
  body[data-room="join"] .room-title { font-size: 30px; }
  .ledger { --margin-x: 18px; padding: 22px 16px 22px 30px; }
  .ledger-fields { grid-template-columns: 1fr; gap: 14px; }
  .ledger-foot { flex-direction: column-reverse; align-items: center; text-align: center; }
  .ledger-fine { max-width: none; }
}
@media (max-width: 380px) {
  body[data-room="join"] .room-title { font-size: 26px; }
  body[data-room="join"] .room-back { padding: 9px 10px; font-size: 14px; letter-spacing: 0.06em; }
  .ledger { padding: 20px 12px 20px 26px; }
}

/* no-JS note (the fragment is only ever mounted by script, so this is a safety line) */
.ledger-nojs { margin: 0 0 12px; font-size: 14px; color: var(--blood-bright); }

/* STAINS:CSS: copied verbatim from the Web Designer's mock (base.css). Positions work without JS. */
/* ---- blood stains (decorative, static, no JS needed) ----
   A pointer-events:none layer under the text. Shapes are inline SVG in index.html; the
   filters/gradients live in the hidden .stain-defs block (feTurbulence + feDisplacementMap). */
.stain-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ledger > :not(.stains) { position: relative; z-index: 1; }
.stains { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.stain { position: absolute; display: block; overflow: visible; }
.stain .soak { mix-blend-mode: multiply; }                       /* paper darkened where blood soaked in */
.stain-splat-d { top: -20px; right: -20px; width: 480px; height: 170px; }     /* viewBox is 1:1 with ledger px */
.stain-splat-p { display: none; top: -16px; right: -18px; width: 190px; height: 146px; }
.stain-edge { left: 0; right: 0; bottom: 0; width: 100%; height: 40px; }
.stain-drag { right: -26px; top: 190px; width: 70px; height: 330px; }
.stain-drip { top: -2px; width: 24px; height: auto; }
.stain-drip-1 { left: 14px; }
.stain-drip-2 { left: 36px; }
.stain-drip-3 { left: auto; right: 6px; top: 70px; }
/* the bleed drop sits ON the 8th ruled line (rules repeat every 34px from the paper's top edge) */
.stain-bleed { left: -4px; top: calc(34px * 8 - 0.5px - 13.1px); width: 70px; height: 26.25px; }
.stain-thumb { left: -16px; bottom: -34px; width: 98px; aspect-ratio: 120 / 150; transform: rotate(26deg); }
.stain-finger { left: -40px; bottom: 104px; width: 80px; aspect-ratio: 120 / 150; transform: rotate(78deg); opacity: .92; }
/* a dark halo behind ledger text so stains never eat into contrast */
.ledger-title, .ledger-date, .ledger-lede, .ledger-fine, .field label, .field input, .field textarea {
  text-shadow: 0 0 6px rgba(14, 9, 11, 0.95), 0 1px 2px rgba(0, 0, 0, 0.8);
}
@media (min-width: 641px) and (max-width: 900px) {
  .stain-splat-d { transform: scale(.78); transform-origin: top right; }
  .ledger-date { flex-basis: 100%; }   /* keep the date under the title, clear of the corner splatter */
  .ledger-lede { max-width: 26em; }
}
@media (max-width: 640px) {
  .stain-splat-d { display: none; }
  .stain-splat-p { display: block; }
  .stain-edge { height: 32px; }
  .stain-drag { right: -30px; top: 250px; width: 52px; height: 245px; }
  .stain-drip { width: 17px; }
  .stain-drip-1 { left: -1px; }
  .stain-drip-2 { left: 13px; }
  .stain-drip-3 { right: -3px; top: 38px; }
  .stain-bleed { left: -2px; width: 34px; height: 12.75px; top: calc(34px * 8 - 0.5px - 6.4px); }
  .stain-thumb { left: -32px; bottom: -36px; width: 74px; }
  .stain-finger { left: -34px; bottom: 74px; width: 60px; }
}
/*/STAINS:CSS*/
    
    /* field at fault (app.js adds .is-bad / .is-shake): only that one field goes red */
    .field.is-bad label { color: var(--blood-bright); }
    .field.is-bad input, .field.is-bad textarea { border-color: var(--blood-bright); box-shadow: 0 0 0 3px rgba(255, 59, 74, 0.22); }
    @media (prefers-reduced-motion: no-preference) {
      .field.is-shake { animation: fieldShake 380ms cubic-bezier(.36,.07,.19,.97); }
    }
    @keyframes fieldShake { 10%, 90% { translate: -2px 0; } 20%, 80% { translate: 3px 0; } 30%, 50%, 70% { translate: -5px 0; } 40%, 60% { translate: 5px 0; } }


/* ---------------- applyfix: plan picker · submit error line · field reasons ---------------- */
.f-plan { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.f-plan .pk-legend { padding: 0; margin: 0 0 4px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; letter-spacing: 0.2em; color: #c1121f; }
.pk-row { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box;
  padding: 10px 14px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; background: rgba(0, 0, 0, 0.22);
  color: var(--ink); cursor: pointer; font: 500 15px/1.2 var(--font-body); -webkit-tap-highlight-color: transparent; }
.pk-row input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.pk-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.45); box-sizing: border-box; }
.pk-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-save { flex: none; }
.pk-price { flex: none; margin-left: auto; padding-left: 4px; white-space: nowrap; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.pk-later .pk-name { color: var(--ink-faint, rgba(244, 239, 233, 0.5)); }
.pk-row:has(input:checked), .pk-row.is-on { border-color: #c1121f; }
.pk-row:has(input:checked) .pk-dot, .pk-row.is-on .pk-dot { border-color: #c1121f; background: #c1121f; box-shadow: inset 0 0 0 3px #1a0d0f; }
.pk-row:has(input:focus-visible) { outline: 2px solid #c1121f; outline-offset: 2px; }
#ledger .ledger-error, .ar-fx #ledger .ledger-error {
  display: block; margin: 16px 0 12px; padding: 10px 12px; border-radius: 0;
  font: 400 14px/1.45 var(--font-body); color: #f4efe9;
  border-left: 2px solid #c1121f; background: rgba(193, 18, 31, 0.12);
}
.ar-fx #ledger .ledger-error::before { content: none; display: none; }
#ledger .ledger-error:empty { display: none; }
.field-msg { margin: 2px 0 0; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.4; color: var(--ink-dim, rgba(244, 239, 233, 0.62)); }
.field-msg:empty { display: none; }
#ledger .field.is-bad input, #ledger .field.is-bad textarea { outline: 2px solid #c1121f; outline-offset: 0; border-color: #c1121f; }
.field .pk-row { font: 500 15px/1.2 var(--font-body); letter-spacing: 0.01em; text-transform: none; color: var(--ink); }
.field .pk-row .pk-price { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 0.02em; }
.field .pk-row .pk-save { letter-spacing: 0.2em; font-size: 11px; }
.field .pk-later .pk-name { color: var(--ink-faint, rgba(244, 239, 233, 0.5)); }

/* legal-20261020: optional SMS consent under the phone field */
.sms-ok { min-width: 0; }
.sms-box { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--ink-dim); cursor: pointer; overflow-wrap: anywhere; }
.sms-box input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #c1121f; cursor: pointer; }
.sms-box input:focus-visible { outline: 2px solid #c1121f; outline-offset: 2px; }
.sms-box a { color: #ffb3b8; }

/* cloud-gaming 20261021: Coming soon rows (All in one for new signups, Cloud Gaming): dimmed, dashed, not selectable */
.pk-row.pk-soon { cursor: not-allowed; border-style: dashed; border-color: rgba(176,107,255,.35); flex-wrap: wrap; }
.pk-row.pk-soon .pk-dot { opacity: .3; border-style: dashed; }
.pk-row.pk-soon .pk-name, .pk-row.pk-soon .pk-price { opacity: .6; }
.field .pk-row .pk-soon-pill { color: #f1e4ff; background: #2a0f45; border-color: #b06bff; letter-spacing: .12em; }
.pk-fine { margin: 2px 0 0; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; color: rgba(245,236,220,.45); text-align: center; overflow-wrap: anywhere; }

/* nexttile-20261029: locked "All in one" next-gen teaser (no plan, no price, no radio) */
.plan-next{position:relative;border:1px dashed rgba(139,92,246,.6);border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:8px;background:rgba(139,92,246,.06);animation:nextglow 4.5s ease-in-out infinite}
.plan-next .nx-tag{align-self:flex-start;font:600 10px/1 ui-monospace,Menlo,Consolas,monospace;letter-spacing:.12em;color:#c4b5fd;border:1px solid rgba(139,92,246,.7);border-radius:4px;padding:4px 6px}
.plan-next .nx-name{font-weight:700;color:var(--ink-hi,#fff);opacity:.85}
.plan-next .nx-chip{align-self:flex-start;font-size:12px;color:#ddd6fe;background:rgba(139,92,246,.18);border:1px solid rgba(139,92,246,.45);border-radius:999px;padding:3px 10px}
.plan-next .nx-list{font:12px/1.4 ui-monospace,Menlo,Consolas,monospace;color:rgba(221,214,254,.8)}
.plan-next .nx-notify{align-self:flex-start;color:#c4b5fd;font-size:13px;text-decoration:underline;text-underline-offset:3px}
@keyframes nextglow{0%,100%{box-shadow:0 0 6px rgba(139,92,246,.22)}50%{box-shadow:0 0 22px rgba(139,92,246,.55)}}
@media (prefers-reduced-motion: reduce){.plan-next{animation:none;box-shadow:0 0 12px rgba(139,92,246,.35)}}

/* joinui-20261029T015129Z: fields stay inside the card at 360px (padding unchanged) */
.ledger input, .ledger textarea, .ledger select, .key-form input { box-sizing: border-box; max-width: 100%; }

/* pkwrap: Cloud Gaming price breaks after "/ 30 days" */
.pk-row.pk-soon .pk-price { text-align: right; }
.pk-pp { white-space: nowrap; }
.pk-pp2 { display: block; }
