/* ============================================================
   PointPoker — shared shell
   A card table after hours: emerald baize under frosted glass,
   ivory ink, one gold. Source Serif for the brand, the titles and the ranks;
   Geist for everything else, labels included.
   ============================================================ */

:root {
  --ink:         #f6efdc;
  --ink-2:       #d9cfb4;
  --ink-3:       #a0967e;
  --line:        rgba(214, 178, 94, .24);
  --line-strong: rgba(214, 178, 94, .55);
  --gold:        #e2bd5e;
  --gold-soft:   rgba(226, 189, 94, .16);
  --gold-ink:    #231704;
  --danger:      #ee7a67;

  --radius:      6px;

  /* Gold as metal, lit from above: a soft vertical fall, never bands. */
  --metal:       linear-gradient(180deg, #f3db93 0%, #e2bd5e 48%, #cfa449 52%, #b98c35 100%);
  /* every --metal stop mixed 10% toward white, as any hover is */
  --metal-hover: linear-gradient(180deg, #f4df9e 0%, #e5c46e 48%, #d4ad5b 52%, #c09849 100%);
  --metal-edge:  #8a6a24;

  --felt-bg:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 75% 65% at 50% 40%, #186e46 0%, #11603c 45%, #0a4129 85%, #072f1e 100%);

  /* Frosted glass over the felt. A top bar only ever covers bare felt; a
     panel, menu, dialog or notification can land on text, so its tint runs
     deep enough to read over. */
  --felt-glass:      rgba(4, 30, 19, .38);
  --button-glass:    rgba(4, 30, 19, .1);
  --felt-glass-deep: rgba(4, 30, 19, .8);
  --glass-blur:      blur(18px) saturate(160%);
  /* Inputs and outlined buttons take the tint alone: they sit on glass or
     bare felt already, and a blur nested inside a blur samples the page. */
  /* the gold hairline between parts, fading out at both ends */
  --fade-line:       rgba(214, 178, 94, .55);

  --font: "Geist", "Inter", system-ui, sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;

  --max: 1160px;
  --wrap: min(var(--max), 100% - 56px);
  /* A strip runs edge to edge, so it pads its content to the same column. */
  --gutter: max(28px, calc((100% - var(--max)) / 2));

  --ease-out:    cubic-bezier(.23, 1, .32, 1);
  /* overshoot — only where the motion carries momentum */
  --ease-pop:    cubic-bezier(.25, 1.3, .4, 1);

  --t-press: 130ms;
  --t-hover: 180ms;
  --t-enter: 200ms;
  --t-rise:  380ms;

  /* Hover changes colour only — nothing moves under the pointer. The one
     displacement left is the press, and reduced motion stands it down here. */
  --press: scale(.97);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Every size below is in rem, so this one number scales the whole interface.
   The felt tiles over this box, so it must fill the screen or show a seam. */
html { font-size: 110%; min-height: 100%; scrollbar-color: var(--line-strong) #072f1e; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--felt-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--gold); color: var(--gold-ink); }

img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }

/* the one focus mark for everything focusable, a field included */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------------------
   Strips — the bar at the top of each page
   ------------------------------------------------------------ */
.nav, .bar {
  background: var(--felt-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.nav, .bar { border-bottom: 1px solid var(--line); }
/* gold hairlines that fade out at the ends */
.nav, .bar { border-image: linear-gradient(90deg, transparent, var(--fade-line), transparent) 1; }

.nav {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 76px;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  flex: none;
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 44px; min-height: 44px; text-decoration: none; }
/* a struck gold coin */
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e2bd5e 40%, #a47a26 75%, #6e4f14);
  box-shadow:
    inset 0 0 0 2px rgba(110, 79, 20, .8),
    inset 0 0 0 4px #e8c974,
    inset 0 0 0 5px rgba(110, 79, 20, .55),
    0 2px 6px rgba(0, 0, 0, .5);
  transition: filter var(--t-hover) ease, transform var(--t-hover) var(--ease-out);
}
.brand-mark svg { width: 18px; height: 18px; fill: #3a2808; }
@media (hover: hover) and (pointer: fine) {
  .brand:hover .brand-mark { filter: brightness(1.08); }
}
.brand:active .brand-mark { transform: var(--press); transition-duration: var(--t-press); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.brand-name em { font-style: normal; color: var(--gold); }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t-hover) ease, transform var(--t-hover) var(--ease-out);
}
/* gold metal: a lit top edge, a darker rim, and a shadow that seats it */
.btn-primary {
  background: var(--metal);
  border-color: var(--metal-edge);
  color: var(--gold-ink);
  box-shadow: inset 0 1px 0 rgba(255, 248, 220, .55), 0 8px 18px -10px rgba(0, 0, 0, .9);
}
/* A button names its background --bg, so a hover can light it by 10%. */
.btn-line {
  --bg: var(--button-glass);
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink);
}
.btn-quiet { color: var(--ink-2); }
.btn-danger { --bg: #a3192b; background: var(--bg); color: #fff; }
.btn:disabled { opacity: .42; cursor: default; }
.btn-big { width: 100%; padding: 15px 24px; font-size: 0.9688rem; }
.btn-sm { padding: 8px 12px; font-size: 0.8125rem; gap: 8px; }
/* A hover mixes the button's own background 10% toward white and changes
   nothing else. Gold is a gradient, so it swaps to one lit the same way. */
@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover, .seg-btn:not(:has(:checked)):hover { background: color-mix(in srgb, var(--bg, transparent), white 10%); }
  .btn-primary:not(:disabled):hover { background: var(--metal-hover); }
}
/* the press is the one moment the user is watching, so it lands fastest */
.btn:not(:disabled):active { transform: var(--press); transition-duration: var(--t-press); }
.i-spark { width: 16px; height: 16px; fill: currentColor; }
/* the room's icons come from one inline sprite */
.i { width: 16px; height: 16px; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.arrow { display: inline-block; }

/* ------------------------------------------------------------
   Hero — everything above the fold
   ------------------------------------------------------------ */
.hero {
  position: relative;
  z-index: 2;
  width: var(--wrap);
  margin-inline: auto;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 442px);
  gap: clamp(40px, 5.5vw, 88px);
  align-items: center;
  padding: clamp(12px, 3vh, 40px) 0;
}
.display {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(2.5rem, 4.9vw, 3.875rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 0 0 20px;
  text-wrap: balance;
}
.hl { font-style: italic; color: var(--gold); white-space: nowrap; }
.lede {
  font-size: 1.0313rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 44ch;
}
.ticks {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 30px;
}
.ticks li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.d { width: 8px; height: 8px; transform: rotate(45deg); }
.d-gold    { background: var(--gold); }
.d-crimson { background: #c8233a; }
.d-ivory   { background: var(--ink); }

/* ------------------------------------------------------------
   Form — a framed panel, the same on the landing and the gate
   ------------------------------------------------------------ */
.panel {
  scroll-margin-top: 40px;
  padding: 26px 28px 22px;
  background: var(--felt-glass-deep);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 230, 160, .07), 0 24px 50px -28px #000;
}

.tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.tab {
  position: relative;
  padding: 2px 2px 13px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color var(--t-hover) ease;
}
.tab.is-active { color: var(--ink); }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--gold);
}
@media (hover: hover) and (pointer: fine) {
  .tab:hover { color: var(--ink-2); }
}

.pane { display: none; }
.pane.is-active { display: block; animation: pane-in var(--t-enter) var(--ease-out) both; }
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.field { display: block; margin-bottom: 17px; }
.label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 8px;
}

input {
  width: 100%;
  background: var(--felt-glass);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 15px;
  font-size: 0.9375rem;
  color: var(--ink);
  caret-color: var(--gold);
}
input::placeholder { color: var(--ink-3); }
input[aria-invalid="true"] { border-color: var(--danger); }
input[aria-invalid="true"]:focus-visible { outline-color: var(--danger); }

/* One row of options, ruled apart. The ends round themselves rather than
   the row clipping them, which would cut off a focused option's outline. */
.seg {
  display: grid;
  grid-auto-flow: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--button-glass);
}
.seg-btn {
  position: relative;
  padding: 9px 6px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  border-left: 1px solid var(--line);
  transition: background var(--t-hover) ease, transform var(--t-hover) var(--ease-out);
}
/* the real radio lies over its label, unseen, so clicks and arrow keys are native */
.seg-btn input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.seg-btn:first-child { border-left: 0; border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px); }
.seg-btn:last-child { border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0; }
.seg-btn:active { transform: var(--press); transition-duration: var(--t-press); }
/* a later option paints over an earlier one's outline, so focus lifts it */
.seg-btn:has(:focus-visible) { z-index: 1; outline: 3px solid var(--gold); outline-offset: 2px; }
.seg-btn:has(:checked) { background: var(--metal); color: var(--gold-ink); font-weight: 600; }

.panel .btn-big { margin-top: 4px; }
.panel-note {
  margin-top: 14px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.panel-note.is-error { color: var(--danger); font-weight: 600; animation: nudge .32s ease both; }
@keyframes nudge {
  0%, 100% { transform: none; }
  25%      { transform: translateX(-5px); }
  60%      { transform: translateX(5px); }
}

/* ------------------------------------------------------------
   Bottom strip — how it works, condensed
   ------------------------------------------------------------ */
.strip {
  position: relative;
  z-index: 2;
  width: var(--wrap);
  margin-inline: auto;
  flex: none;
  border-top: 1px solid;
  border-image: linear-gradient(90deg, transparent, var(--fade-line), transparent) 1;
  padding: 18px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 28px;
}
.steps {
  list-style: none;
  display: flex;
  gap: clamp(22px, 3vw, 40px);
  flex-wrap: wrap;
}
.steps li { display: flex; gap: 12px; align-items: baseline; }
.sn { font-size: 0.75rem; font-weight: 700; color: var(--gold); }
.steps h2 { display: inline; font-size: 0.875rem; font-weight: 650; }
.steps h2::after { content: " · "; color: var(--ink-3); font-weight: 400; }
.steps p { display: inline; font-size: 0.8125rem; color: var(--ink-2); }
.strip-note {
  font-size: 0.9062rem;
  font-weight: 500;
  color: var(--gold);
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Entrance motion
   ------------------------------------------------------------ */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
.hero-copy > * { animation: rise var(--t-rise) var(--ease-out) both; }
.hero-copy > *:nth-child(1) { animation-delay: .03s; }
.hero-copy > *:nth-child(2) { animation-delay: .09s; }
.hero-copy > *:nth-child(3) { animation-delay: .15s; }
.panel { animation: rise var(--t-rise) var(--ease-out) .14s both; }

/* ------------------------------------------------------------
   Reduced motion — gentler, not none. Colour and opacity still
   carry meaning, so only the displacement stands down.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  :root { --press: scale(1); }
  .hero-copy > *, .panel, .pane.is-active { animation-name: fade-in; }
  .panel-note.is-error { animation: none; }
}

/* The glass turns solid rather than thin out the contrast. */
@media (prefers-reduced-transparency: reduce) {
  :root { --felt-glass: #0a3522; --felt-glass-deep: #0a3522; --button-glass: #0a3522; --glass-blur: none; }
}

/* ------------------------------------------------------------
   Short viewports — keep everything above the fold
   ------------------------------------------------------------ */
@media (min-width: 1000px) and (max-height: 830px) {
  .nav { height: 64px; }
  .hero { padding: 8px 0; gap: clamp(32px, 4vw, 64px); }
  .display { font-size: clamp(2.25rem, 4.4vw, 3.25rem); margin: 0 0 16px; }
  .lede { font-size: 0.9688rem; }
  .ticks { margin-top: 22px; }
  .tabs { margin-bottom: 18px; }
  .tab { padding-bottom: 10px; }
  .field { margin-bottom: 13px; }
  input { padding: 10px 14px; }
  .btn-big { padding: 13px 22px; }
  .panel-note { margin-top: 11px; }
  .strip { padding: 13px 0 16px; }
}

/* ------------------------------------------------------------
   Small screens
   ------------------------------------------------------------ */
@media (max-width: 1000px) {
  body { min-height: 0; }
  .hero { grid-template-columns: 1fr; gap: 48px; align-items: start; padding: 36px 0 52px; }
  .panel { max-width: 520px; }
  .strip { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (max-width: 620px) {
  :root { --wrap: min(var(--max), 100% - 40px); --gutter: 20px; }
  .nav { height: 64px; }
  .display { font-size: clamp(2.0625rem, 9.5vw, 2.625rem); }
  .ticks { gap: 10px 20px; }

  /* expiration options stack vertically */
  .seg { grid-auto-flow: row; grid-template-columns: 1fr; }
  .seg-btn { padding: 11px 14px; text-align: left; border-left: 0; border-top: 1px solid var(--line); }
  .seg-btn:first-child { border-top: 0; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
  .seg-btn:last-child { border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
  .strip-note { white-space: normal; }
}
