/* ==========================================================================
   NIDDAK - the site's own layer
   Loaded after style.css on every page. It carries what the site is organised
   around: the navigation rail, the footer in three groups, the Read shown in
   three moments, the breakdown of a duel, and the Arena, Ladder, Rivals,
   Store and Support pages. Tokens come from style.css; nothing is redefined.
   Published under a name made from this file's own bytes.
   ========================================================================== */

/* ---- header: the rail ---------------------------------------------------
   Arena, Ladder, Rivals, Rules, Store, on screen at every width. On a phone
   the rail takes its own row under the wordmark and scrolls inside itself if
   a language ever needs more room than the screen has; the page never does. */
.duel-head .head-inner{ flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); }
.rail{ display: flex; gap: var(--sp-1); margin-inline-start: auto; }
.rail a{
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 .95rem; border-radius: 999px; white-space: nowrap;
  color: var(--ink-dim); font-size: var(--fs-sm); font-weight: 700;
}
.rail a[aria-current="page"]{ color: var(--gold-ink); background: var(--gold); }
@media (hover: hover){ .rail a:not([aria-current="page"]):hover{ color: var(--gold-bright); background: var(--hairline); } }
.rail a:focus-visible{ outline: 2px solid var(--gold-bright); outline-offset: 2px; }
@media (max-width: 900px){
  .duel-head .head-inner{ min-height: 0; padding-block-start: var(--sp-2); }
  .duel-head .head-actions{ margin-inline-start: auto; }
  .rail{
    order: 3; flex: 0 0 100%; margin-inline: 0; gap: 0;
    padding-block: var(--sp-1); border-top: 1px solid var(--hairline);
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .rail::-webkit-scrollbar{ display: none; }
  .rail a{ flex: 1 0 auto; justify-content: center; padding: 0 .6rem; }
  /* Two rows of sticky header: an anchor has to clear both. */
  section[id]{ scroll-margin-block-start: 132px; }
}

/* ---- footer: three groups ------------------------------------------------ */
.duel-foot .foot-cols{
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-8);
  padding-bottom: var(--sp-6); border-bottom: 1px solid var(--hairline);
}
.foot-col{ display: grid; gap: 0; align-content: start; justify-items: start; }
.foot-col h2{
  margin-bottom: var(--sp-2); font-size: var(--fs-xs); font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold-bright);
}
[dir="rtl"] .foot-col h2{ letter-spacing: 0; }
.foot-col a{
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink-dim); font-size: var(--fs-sm);
}
@media (hover: hover){ .foot-col a:hover{ color: var(--gold-bright); } }
@media (max-width: 640px){
  .duel-foot .foot-cols{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6); }
}

/* ---- footer: the planned card schemes -------------------------------------
   The last row of the footer, under a rule of its own: the caption on the
   leading side and the four scheme marks on the trailing side, drawn bare in
   the footer's ink with no badge around them. No purchase can be made yet, so
   the caption is part of the row and never drops away from the marks. On a
   phone the caption sits above them. The artwork is under /assets/pay/. */
.foot-pay{
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-3) var(--sp-8); min-width: 0;
  padding-top: var(--sp-4); border-top: 1px solid var(--hairline);
}
.foot-pay__note{ margin: 0; max-width: 46ch; font-size: var(--fs-xs); color: var(--ink-faint); }
.foot-pay__row{
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4);
  margin: 0; padding: 0; list-style: none;
}
.foot-pay__scheme{ display: block; flex: none; margin: 0; padding: 0; line-height: 0; color: var(--ink-dim); }
.foot-pay__scheme svg{ display: block; width: 48px; height: 31px; overflow: visible; }
.foot-pay__name{
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (max-width: 640px){
  .foot-pay{ flex-direction: column; align-items: flex-start; }
}

/* ---- inner pages --------------------------------------------------------- */
.page-head{
  padding-block: var(--sp-16) var(--sp-10);
  background:
    radial-gradient(120% 90% at 50% 0%, #d4a24e1c 0%, transparent 62%),
    var(--bg-1);
  border-bottom: 1px solid var(--hairline);
}
.page-head h1{ margin-top: var(--sp-2); font-size: clamp(2.2rem, 5vw + .6rem, 3.6rem); font-weight: 900; }
.page .band{ padding-block: var(--sp-16); }
.page-cta{ margin-top: var(--sp-8); }
.sub-h{ margin-top: var(--sp-12); }
.honest{ padding-inline-start: var(--sp-4); border-inline-start: 3px solid var(--gold-dim); }
.first-steps{ margin-top: var(--sp-6); }
@media (max-width: 640px){
  .page-head{ padding-block: var(--sp-10) var(--sp-8); }
  .page .band{ padding-block: var(--sp-12); }
  .page-cta .btn{ width: 100%; }
}

/* ---- the Read, in three moments ------------------------------------------
   Three small boards. The lanes run left flank, Throne, right flank in both
   languages, as the board itself does; only the words inside them turn. */
.rd-beats{ list-style: none; margin: var(--sp-10) 0 0; padding: 0; display: grid; gap: var(--sp-6); }
@media (min-width: 900px){ .rd-beats{ grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rd-beat{
  display: grid; gap: var(--sp-3); align-content: start;
  padding: var(--sp-6); border-radius: var(--radius-lg);
  background: var(--panel); border: 1px solid var(--hairline);
}
.rd-beat:last-child{ border-color: var(--gold-dim); box-shadow: 0 0 0 1px #d4a24e33, var(--shadow-lg); }
.rd-step{
  width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--gold-dim); color: var(--gold-bright); font-weight: 800; font-size: var(--fs-sm);
}
.rd-beat h3{ font-size: var(--fs-lg); font-weight: 800; }
.rd-beat p{ margin: 0; font-size: var(--fs-sm); color: var(--ink-dim); }
.rd-board{
  display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: var(--sp-2);
  margin-top: var(--sp-2); direction: ltr; align-self: end;
}
.rd-lane{
  display: grid; gap: 6px; justify-items: center; align-content: start; text-align: center; min-width: 0;
  padding: var(--sp-3) 6px; border-radius: var(--radius);
  background: var(--bg-1); border: 1px solid var(--hairline);
}
[dir="rtl"] .rd-lane{ direction: rtl; }
.rd-lane.is-throne{ border-color: var(--hairline-hi); }
.rd-lane.is-called{ border-color: var(--gold); box-shadow: 0 0 0 2px #d4a24e40; }
.rd-name{
  display: flex; align-items: center; min-height: 2.5em;
  font-size: .75rem; font-weight: 700; line-height: 1.2; color: var(--ink-faint);
}
.rd-side{
  position: relative; display: grid; gap: 2px; justify-items: center;
  width: 100%; padding: 6px 2px; border-radius: 10px;
}
.rd-side i{ font-style: normal; font-size: .6875rem; font-weight: 700; color: var(--ink-faint); }
.rd-side b{ font-size: var(--fs-xl); font-weight: 900; line-height: 1.1; color: var(--ink); }
.rd-rival{ background: #e4572e14; }
.rd-you{ background: #d4a24e14; }
.rd-side em{
  position: absolute; top: -9px; inset-inline-end: -2px;
  padding: 1px 7px; border-radius: 999px; font-style: normal; font-size: .75rem; font-weight: 800;
  background: var(--gold); color: var(--gold-ink);
}
.rd-lane.is-you .rd-you{ background: #d4a24e33; box-shadow: inset 0 0 0 1px var(--gold-dim); }
.rd-lane.is-you .rd-you b{ color: var(--gold-bright); }
.rd-lane.is-rival .rd-rival{ background: #e4572e30; box-shadow: inset 0 0 0 1px #e4572e88; }
.rd-call{ font-size: .6875rem; font-weight: 800; color: var(--gold-bright); }
.rd-outcome{ margin-top: var(--sp-8); max-width: 70ch; font-size: var(--fs-md); color: var(--ink-dim); }
.rd-outcome strong{ color: var(--ink); }
.read-film{ margin-top: var(--sp-12); max-width: 780px; margin-inline: auto; }

/* ---- the breakdown of a duel --------------------------------------------- */
.bd-grid{ display: grid; gap: var(--sp-12); align-items: center; }
@media (min-width: 960px){ .bd-grid{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-16); } }
.bd-points{ margin-top: var(--sp-8); }
.bd-sample{ margin: 0; min-width: 0; }
.bd-card{
  display: grid; gap: var(--sp-3); padding: var(--sp-6); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--gold-dim); box-shadow: var(--shadow-lg);
}
.bd-card p{ margin: 0; }
.bd-head{ display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); font-size: var(--fs-lg); }
.bd-result{ padding: 2px 10px; border-radius: 6px; background: #d4a24e2b; color: var(--gold-bright); font-size: var(--fs-xs); font-weight: 800; }
.bd-sub{ font-size: var(--fs-xs); color: var(--ink-faint); }
.bd-turn{
  display: grid; gap: 4px; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
  background: var(--bg-1); font-size: var(--fs-sm); color: var(--ink-dim);
}
.bd-turn b{ font-size: var(--fs-xs); color: var(--ink); }
.bd-rows{ display: grid; gap: 4px; }
.bd-row{
  display: grid; grid-template-columns: 4.8em minmax(0, 1fr); gap: 4px var(--sp-2); align-items: center;
  padding: 4px 6px; border-radius: 10px; border: 1px solid transparent;
}
.bd-row.is-turn{ border-color: var(--gold-dim); background: #d4a24e12; }
.bd-n{ font-size: .75rem; font-weight: 800; color: var(--ink-dim); }
.bd-lanes{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; direction: ltr; }
.bd-names .bd-lanes span{ font-size: .6875rem; font-weight: 700; color: var(--ink-faint); text-align: center; line-height: 1.2; }
.bd-lane{
  min-height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid var(--hairline); font-size: .75rem; font-weight: 800;
}
.bd-y{ background: #d4a24e2b; color: var(--gold-bright); border-color: #d4a24e66; }
.bd-r{ background: #e4572e24; color: #ff8a5c; border-color: #e4572e55; }
.bd-t{ background: var(--bg-2); color: var(--ink-faint); }
.bd-notes{ grid-column: 2; font-size: .75rem; color: var(--ink-dim); line-height: 1.35; }
.bd-reads{ font-size: var(--fs-xs); color: var(--ink-dim); }
.bd-sample figcaption{ margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--ink-faint); text-align: center; }
@media (max-width: 640px){ .bd-card{ padding: var(--sp-4); } }

/* ---- rivals --------------------------------------------------------------- */
.rival-strip{
  list-style: none; margin: var(--sp-8) 0 0; padding: 0;
  display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.rival-strip li{
  display: grid; gap: 4px; padding: var(--sp-4); border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--hairline);
}
.rival-strip strong{ font-weight: 800; color: var(--gold-bright); }
.rival-strip span{ font-size: var(--fs-sm); color: var(--ink-dim); }
.rv-grid{
  display: grid; gap: var(--sp-4); margin-top: var(--sp-8);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.rv-card{
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--sp-4); align-items: start;
  padding: var(--sp-4); border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--hairline);
}
.rv-card img{
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: top;
  border: 1.5px solid var(--gold-dim); background: var(--bg-2);
}
.rv-card h3{ font-size: var(--fs-lg); font-weight: 800; }
.rv-card p{ margin: 6px 0 0; font-size: var(--fs-sm); color: var(--ink-dim); }
.rv-card .rv-profile{ margin-top: 2px; font-size: var(--fs-xs); font-weight: 800; color: var(--gold-bright); }
.rv-card .rv-open{ font-size: var(--fs-xs); color: var(--ink-faint); }
.tier-list{ list-style: none; margin: var(--sp-6) 0 0; padding: 0; display: grid; gap: var(--sp-2); }
.tier-list li{
  display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--hairline);
  font-size: var(--fs-sm); color: var(--ink-dim);
}
.tier-n{ font-weight: 800; color: var(--gold-bright); }

/* ---- store ----------------------------------------------------------------- */
.st-status{
  padding: var(--sp-6); border-radius: var(--radius-lg);
  border: 1px solid var(--gold-dim); background: #d4a24e12;
}
.st-status h2{ font-size: var(--fs-xl); }
.st-status p{ margin: var(--sp-3) 0 0; color: var(--ink-dim); }
.st-grid{
  display: grid; gap: var(--sp-8) var(--sp-6); margin-top: var(--sp-8);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.st-group h3{ font-size: var(--fs-md); font-weight: 800; color: var(--gold-bright); }
.st-group ul{ list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: grid; gap: var(--sp-2); }
.st-group li{
  display: grid; gap: 2px; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--hairline);
}
.st-group li span{ font-size: var(--fs-sm); color: var(--ink-dim); }

/* ---- support --------------------------------------------------------------- */
.q-group{ margin-top: var(--sp-10); }
.q-group h3{ font-size: var(--fs-lg); font-weight: 800; color: var(--gold-bright); }
.contact-line{ margin-top: var(--sp-4); font-size: var(--fs-lg); }
.contact-line a{ color: var(--gold-bright); }
.contact-id{ margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--ink-dim); }
