/* ==========================================================================
   SPLASH Arcade — Duel
   Builds on splash-tokens.css and splash.css. No inline styles anywhere.
   ========================================================================== */

/* ---- Layout ---------------------------------------------------------------- */
.duel__play { padding: 0 var(--gutter); }
.duel__intro { padding-top: 18px; }
.duel__heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.duel__title { font: 800 30px/1.1 var(--font-display); }
.duel__block { font: var(--type-proof); color: var(--splash-text-2); white-space: nowrap; }
.duel__sub { margin-top: 4px; font: 400 15px/1.45 var(--font-body); color: var(--splash-text-2); }
.duel__h2 { font: 800 20px/1.2 var(--font-display); }

/* ---- The coin's home: a slice of the same pool ----------------------------- */
.arena {
  --water-top: 64%;
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 20px;
  background-color: var(--splash-wall);
  background-image:
    linear-gradient(var(--splash-tile-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--splash-tile-line) 1px, transparent 1px);
  background-size: var(--pool-tile) var(--pool-tile);
}
.arena__water { position: absolute; left: 0; right: 0; top: var(--water-top); bottom: 0; background: linear-gradient(180deg, var(--splash-water-surface), var(--splash-water)); }
.arena__surface { position: absolute; left: 0; right: 0; top: calc(var(--water-top) - 7px); height: 14px; overflow: hidden; }
.arena__surface svg { width: calc(100% + 65px); height: 14px; animation: pool-sway var(--dur-sway) linear infinite; }
.arena__wave-fill { fill: var(--splash-water-surface); }
.arena__wave-line { fill: none; stroke: var(--splash-foam); stroke-width: 2; }

.arena__shadow {
  position: absolute; left: 33%; width: 34%; top: calc(var(--water-top) + 1.5%); height: 4%;
  border-radius: 50%;
  background: rgba(5, 40, 60, .35);
  animation: coin-shadow 3.2s ease-in-out infinite;
}
@keyframes coin-shadow { 50% { transform: scaleX(.86); opacity: .7; } }

.arena__ring {
  position: absolute; left: 8%; width: 84%; top: calc(var(--water-top) - 5%); height: 10%;
  border: 2.5px solid var(--splash-foam);
  border-radius: 50%;
  opacity: 0;
}
.arena__ring--late { left: 17%; width: 66%; top: calc(var(--water-top) - 3.5%); height: 7%; border-width: 2px; }
.arena__ring.is-rippling { animation: arena-ring 1100ms ease-out forwards; }
.arena__ring--late.is-rippling { animation-delay: 200ms; }
@keyframes arena-ring { 0% { transform: scale(.45); opacity: .95; } 100% { transform: scale(1.12); opacity: 0; } }

/* The coin. At rest it hovers just above the water. */
.coin {
  position: absolute; left: 26.5%; top: 9.5%;
  width: 47%;
  aspect-ratio: 168 / 176;
  perspective: 900px;
  animation: coin-hover 3.2s ease-in-out infinite;
}
@keyframes coin-hover { 50% { transform: translateY(-3.5%); } }
.coin__spin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.coin__face { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.coin__face--waves { transform: rotateX(180deg); }
.coin__rim { fill: #0B6F85; }
.coin__disc { fill: #2FC6DA; }
.coin__ring { fill: none; stroke: #1CA2BA; stroke-width: 3; opacity: .7; }
.coin__glyph { fill: #0A2E3F; }
.coin__waves { fill: none; stroke: #0A2E3F; stroke-width: 7; stroke-linecap: round; }
.coin__shine { fill: #FFFFFF; opacity: .42; }

/* Flip: tumble up, fall, land on the water, settle, show the face */
.arena.is-flipping .coin,
.arena.is-landed .coin,
.arena.is-flipping .arena__shadow,
.arena.is-landed .arena__shadow { animation: none; }
.arena.is-flipping .arena__shadow,
.arena.is-landed .arena__shadow { opacity: 0; }
.arena.is-flipping .coin__spin { animation: coin-tumble var(--dur-tumble) cubic-bezier(.25, .6, .3, 1) forwards; }
@keyframes coin-tumble {
  0%   { transform: translateY(0) rotateX(0deg); }
  42%  { transform: translateY(-48%) rotateX(calc(var(--turn) * .55)); }
  84%  { transform: translateY(21%) rotateX(var(--turn)); }
  92%  { transform: translateY(16%) rotateX(var(--turn)); }
  100% { transform: translateY(19%) rotateX(var(--turn)); }
}
.arena.is-landed .coin__spin { transform: translateY(19%); }
.arena.is-landed.shows-waves .coin__spin { transform: translateY(19%) rotateX(180deg); }
.arena:not(.is-flipping):not(.is-landed).shows-waves .coin__spin { transform: rotateX(180deg); }
/* The water laps over the bottom of a landed coin */
.arena.is-landed .arena__water { z-index: 1; opacity: .9; }
.arena.is-landed .arena__surface { z-index: 1; }

.arena__caption {
  position: absolute; left: 6%; right: 6%; top: calc(var(--water-top) + 7%);
  z-index: 2;
  text-align: center;
  color: var(--splash-ink);
}
.arena__title { font: 800 20px/1.2 var(--font-display); }
.arena__text { margin-top: 4px; font: 500 14px/1.4 var(--font-body); }
.arena__retry { margin-top: 10px; color: var(--splash-ink); border-color: var(--splash-ink); }
.arena.is-landed .arena__title { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-family: var(--font-body); font-weight: 700; }

/* ---- The result, after a flip ----------------------------------------------- */
.result { padding-top: 20px; }
.result__label { color: var(--splash-win); }
.result__amount { margin-top: 4px; font: 800 60px/1 var(--font-display); color: var(--splash-win); }
.result__amount small { font-size: 24px; }
.result.is-lost .result__label,
.result.is-lost .result__amount { color: var(--splash-loss); }
.result__text { margin-top: 10px; font: 400 15px/1.5 var(--font-body); }
.result__list { margin-top: 16px; padding: 14px 0; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--splash-divider); border-bottom: 1px solid var(--splash-divider); }
.result__list div { display: flex; justify-content: space-between; gap: 12px; }
.result__list dt { font-size: 13.5px; color: var(--splash-text-2); }
.result__list dd { font: 600 13px var(--font-proof); text-align: right; }
.result__back { width: 100%; margin-top: 14px; min-height: 48px; }

/* ---- Put a stake up ------------------------------------------------------------ */
.putup { padding-top: 24px; }
.stakes { margin: 12px 0 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm); }
.stake {
  position: relative;
  min-height: 88px;
  padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 2px solid #2B4C64;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
}
.stake input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.stake__n { font: 800 22px/1 var(--font-display); }
.stake__unit { font: 700 9.5px var(--font-body); letter-spacing: .14em; color: var(--splash-text-2); }
.stake__say { font: 400 11.5px/1.2 var(--font-body); color: var(--splash-text-2); }
.stake.is-on { border-color: var(--mode-duel); background: rgba(255, 140, 115, .14); }
.stake.is-on .stake__unit { color: #FFB3A1; }
.stake.is-on .stake__say { color: #FFD3C8; }
.stake:focus-within { outline: 3px solid var(--splash-foam); outline-offset: 2px; }

.field__label { display: block; margin-top: 18px; font: 600 13.5px var(--font-body); }
.field__label span { font-weight: 400; color: var(--splash-text-2); }
.field__row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.field__row .field__label { margin-top: 0; }
.field__count { font: var(--type-proof); color: var(--splash-text-2); }
.field__count.is-over { color: #FFB3A1; }
.field {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 6px;
  padding: 0 14px;
  border: 1.5px solid #2B4C64;
  border-radius: var(--radius-note);
  background: var(--splash-deck-raised);
  color: var(--splash-text);
  font: 500 14px var(--font-proof);
}
.field--text { font: 400 15px var(--font-body); }
.field::placeholder { color: #7D9FAE; }
.field:focus { outline: none; border-color: var(--mode-duel); box-shadow: 0 0 0 3px rgba(255, 140, 115, .25); }
.field.is-invalid { border-color: var(--mode-duel); }
.field__error { margin-top: 6px; font: 400 13px/1.4 var(--font-body); color: #FFB3A1; }

.btn-primary--duel { background: var(--mode-duel); box-shadow: 0 5px 0 var(--mode-duel-press); }
.btn-primary--duel:active { box-shadow: 0 2px 0 var(--mode-duel-press); }
.putup .btn-primary { margin-top: 18px; }

/* ---- The boards ------------------------------------------------------------------ */
.board { padding: 26px var(--gutter) 0; }
.board:first-child { margin-top: 24px; border-top: 0; }
.board__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.board__count { font-size: 13px; color: var(--splash-text-2); }
.board__sub { margin-top: 4px; font-size: 14px; color: var(--splash-text-2); }
.board__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.board__empty { margin-top: 10px; padding: 14px; border: 1px dashed #2B4C64; border-radius: var(--radius-note); font-size: 14px; color: var(--splash-text-2); }

/* EACH ENTRY GETS ITS OWN SURFACE. This used to be `padding: 16px 0` with a
   bottom divider and `:last-child { border-bottom: 0 }`, which honoured the
   token file's "no cards: the pool, the deck and lane ropes do the grouping".
   The intent was right and the result was not: the ONLY grouping was the
   divider BETWEEN items, so a list of one -- the normal state of a quiet
   testnet table -- had no boundary at all. The offer, its quote, its block
   number and its button just ran into the heading above them.

   Worse, `.board__empty` already draws a dashed box, so "nobody has put one
   up yet" looked MORE contained than a real 50 GNOT offer. Flagged by the
   owner on the live site, 2026-10-08: "there are no borders here, it's just
   a splurge of text."

   This is deliberately a soft surface and not a hard card: a hairline, a
   barely-there fill and a radius that matches .board__empty's, so entries
   read as grouped without the page turning into a stack of tiles. The accent
   treatment below still belongs to .item--for-you alone, which is the one
   that genuinely needs to shout. */
.item {
  padding: 14px;
  border: 1px solid var(--splash-divider);
  border-radius: var(--radius-note);
  background: rgba(255, 255, 255, .025);
}
.item--for-you { border: 2px solid var(--mode-duel); border-radius: 16px; background: rgba(255, 140, 115, .08); }
.item__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.item__line { margin-top: 8px; font: 400 15px/1.4 var(--font-body); }
.item__top .item__line { margin-top: 0; }
.item__addr { font: 600 14px var(--font-proof); }
.item__stake { font: 800 17px var(--font-display); }
.item__big { margin-top: 2px; font: 800 26px/1.1 var(--font-display); }
.item__say { margin-top: 4px; font-size: 15px; color: #FFD3C8; overflow-wrap: anywhere; }
.item__meta { margin-top: 4px; font: 500 11.5px/1.5 var(--font-proof); color: var(--splash-text-2); }
.item__note { margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--splash-text-2); }
.item__actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.item__win { font-size: 13px; color: var(--splash-text-2); }
.item__aside { font-size: 13px; color: var(--splash-text-2); white-space: nowrap; }
.item--settled { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.item__net { font: 800 20px var(--font-display); }
.item__net--won { color: var(--splash-win); }
.item__net--lost { color: var(--splash-loss); }

.btn-take {
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: 22px;
  border: 2px solid var(--mode-duel);
  background: transparent;
  color: #FFB3A1;
  font: 800 15px var(--font-display);
}
.btn-take--solid { background: var(--mode-duel); color: var(--splash-ink); box-shadow: 0 4px 0 var(--mode-duel-press); }
.btn-take--settle { border-color: var(--splash-cyan); background: var(--splash-cyan); color: var(--splash-ink); }
.btn-take:disabled { opacity: .5; }

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font: 800 10.5px/1.3 var(--font-body);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.tag--for-you { background: var(--mode-duel); color: var(--splash-ink); }
.tag--yours { box-shadow: inset 0 0 0 1.5px var(--splash-cyan); color: var(--splash-cyan-text); }
.tag--waiting { background: #1A3A52; color: #CFE0E8; }
.tag--settle { background: var(--splash-cyan); color: var(--splash-ink); }
.tag--unsettled { box-shadow: inset 0 0 0 1.5px var(--splash-loss); color: #CFE0E8; }
.tag--won { background: var(--splash-win); color: var(--splash-ink); }
.tag--lost { background: var(--splash-loss); color: var(--splash-ink); }

.how { padding: 26px var(--gutter) 8px; }
.how p { margin-top: 8px; font: 400 14.5px/1.55 var(--font-body); color: var(--splash-text-2); }
.how strong { color: var(--splash-text); }

/* ---- Before the realm answers ------------------------------------------------------ */
body.is-loading .putup,
body.is-offline .putup,
body.is-loading .duel__boards,
body.is-offline .duel__boards { opacity: .45; pointer-events: none; }
body.is-offline .arena__caption { top: calc(var(--water-top) + 4%); color: var(--splash-ink); }
body.is-offline .arena__shadow,
body.is-loading .arena__shadow { display: none; }

/* ---- 600px and up ------------------------------------------------------------------- */
@media (min-width: 600px) {
  .duel { max-width: 680px; margin: 0 auto; }
  .arena { margin-left: auto; margin-right: auto; }
}

/* ---- 1024px and up: the coin and your stake stay put while the boards scroll -------- */
@media (min-width: 1024px) {
  .duel {
    max-width: 1200px;
    padding: 0 var(--gutter);
    display: grid;
    grid-template-columns: 440px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
  }
  .duel__play { position: sticky; top: 16px; padding: 0; }
  .arena { margin-left: 0; }
  .board, .how { padding-left: 0; padding-right: 0; }
  .board:first-child { margin-top: 0; padding-top: 18px; }
  .duel__h2 { font-size: 24px; }
}

/* --- The room -------------------------------------------------------------
   Messages are arbitrary text from strangers, stored forever. The layout has
   to survive a 280-byte run of unbroken characters with no spaces, which is
   exactly what somebody will paste first -- hence overflow-wrap and the
   min-width:0 on the flex child. Without those this panel is the widest
   element on the site, which is how the compat banner broke the phone layout
   once already. */
.room__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

/* Same surface as .item, one notch lighter -- a room message is a smaller
   unit than an offer and should not compete with it. Sharing the hairline
   and the radius is what keeps the two lists reading as one page. */
.room__msg {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .5rem;
  align-items: baseline;
  padding: .5rem .65rem;
  border: 1px solid var(--splash-divider);
  border-radius: var(--radius-note);
  background: rgba(255, 255, 255, .02);
}
.room__msg--mine { background: rgba(94, 214, 255, .10); }

.room__who {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: .78rem;
  opacity: .75;
  white-space: nowrap;
}
.room__text {
  min-width: 0;                 /* without this the grid child refuses to shrink */
  overflow-wrap: anywhere;      /* a 280-char word must wrap, not widen the page */
  word-break: break-word;
}
.room__block {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: .7rem;
  opacity: .45;
  white-space: nowrap;
}

.room__say { margin-top: .75rem; }
.room__row { display: flex; gap: .5rem; }
.room__input { flex: 1 1 auto; min-width: 0; }
.room__send { flex: 0 0 auto; }
.room__meta {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin: .35rem 0 0;
  font-size: .75rem;
  opacity: .6;
}

@media (max-width: 520px) {
  .room__msg { grid-template-columns: auto 1fr; }
  .room__block { grid-column: 2; justify-self: end; }
}

/* --- The next flip --------------------------------------------------------
   The shared settlement moment, given the weight the mechanic deserves. The
   contract buckets every duel accepted in the same five minutes onto ONE
   drand round, on purpose, so a dozen coins land together — and the page used
   to render that as a dozen unrelated rows with private countdowns. This is
   the event. */
.flight {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--splash-divider);
  border-radius: var(--radius-note);
  background: rgba(255, 255, 255, .03);
  text-align: center;
}
.flight.is-mine {
  border-color: var(--mode-duel);
  background: rgba(255, 140, 115, .09);
}
.flight__kicker {
  margin: 0;
  font: 700 11px/1 var(--font-proof);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--splash-text-2);
}
.flight__clock {
  margin: 4px 0 2px;
  font: 800 40px/1 var(--font-display);
  font-variant-numeric: tabular-nums;   /* so the digits stop jittering */
}
.flight__what { margin: 0; font-size: 14px; line-height: 1.45; }
.flight__after { margin: 6px 0 0; font-size: 12.5px; color: var(--splash-text-2); }

@media (max-width: 520px) { .flight__clock { font-size: 34px; } }

/* The join deadline — the call to action, so it carries the accent rather
   than sitting grey with the supporting text. */
.flight__join {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--splash-divider);
  font: 600 13.5px/1.45 var(--font-body);
  color: var(--mode-duel);
}
