/* DailyFlip: bold & playful on navy. Mobile-first. */

:root {
  --bg1: #1c2f78;
  --bg2: #0a1536;
  --glow: #2f4db3;
  --ink: #0f1a3d;
  --ink-soft: #4a5578;
  --accent: #3d6bff;
  --accent-d: #1f45c9;
  --white: #ffffff;
  --yellow: #ffc93c;
  --yellow-d: #d98e00;
  --coral: #ff6b4a;
  --coral-d: #c4401f;
  --mint: #3ee6a3;
  --rose: #ff5c86;
  --sky: #7fd7ff;
  --tint: #eef2ff;
  --tint-2: #f6f8ff;
  --line: #dbe3ff;
  --muted-2: #a9b6e0;
  --on-bg: rgba(255, 255, 255, .78);
  --shade: rgba(2, 8, 32, .35);

  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;

  --c1: #ffe9a3; --c2: #e3a21a; --c3: #9a5c00; --cink: #7a4300;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg2); }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--white);
  font: 700 16px/1.45 var(--body);
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.07) 1.5px, transparent 0) 0 0 / 24px 24px,
    radial-gradient(1000px 700px at 50% -10%, var(--glow) 0%, transparent 65%),
    linear-gradient(180deg, var(--bg1), var(--bg2) 75%);
  background-color: var(--bg2);
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; border: 0; background: none; }
input { font: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 13px 20px; border-radius: 16px; font: 900 16px var(--body); text-decoration: none;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:active { transform: translateY(4px); }
.btn:disabled { filter: grayscale(.6) opacity(.6); cursor: default; transform: none; }
.btn-yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 5px 0 var(--yellow-d); }
.btn-yellow:active { box-shadow: 0 1px 0 var(--yellow-d); }
.btn-coral { background: var(--coral); color: var(--white); box-shadow: 0 5px 0 var(--coral-d); }
.btn-coral:active { box-shadow: 0 1px 0 var(--coral-d); }
.btn-blue { background: var(--accent); color: var(--white); box-shadow: 0 5px 0 var(--accent-d); }
.btn-blue:active { box-shadow: 0 1px 0 var(--accent-d); }
.btn-white { background: var(--tint); color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.btn-white:active { box-shadow: 0 1px 0 var(--line); }
.link-btn { color: var(--on-bg); text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; font-weight: 800; font-size: 14px; }
.card .link-btn, .dlg .link-btn { color: var(--ink-soft); }

/* ---------- header ---------- */
.top {
  max-width: 1120px; margin: 0 auto; padding: 14px 16px 6px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.logo { display: flex; align-items: center; gap: 8px; font: 400 26px/1 var(--display); text-decoration: none; letter-spacing: .01em; }
.logo-coin { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--yellow) 45%, var(--yellow-d)); box-shadow: inset 0 0 0 3px #b56b00; }
.daypill {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px;
  background: rgba(255,255,255,.12); font-size: 12px; font-weight: 800; white-space: nowrap;
}
.daypill .dot { opacity: .5; }
.daypill b { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 4px 16px 24px; }
.play-col { max-width: 540px; margin: 0 auto; }
.side-col { display: grid; gap: 18px; margin: 40px auto 0; max-width: 540px; }

.modes {
  display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; margin-top: 8px;
  background: var(--shade); border-radius: 99px;
}
.modes button { padding: 9px 6px; border-radius: 99px; font-weight: 900; font-size: 14px; color: var(--on-bg); white-space: nowrap; }
.modes button[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.modes .new { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: var(--coral); color: #fff; font-size: 10px; vertical-align: 2px; }

.twist { text-align: center; padding: 16px 4px 4px; }
.twist h1 { font: 400 clamp(32px, 9vw, 46px)/1 var(--display); margin: 0; text-shadow: 0 4px 0 rgba(0, 6, 30, .45); letter-spacing: .01em; }
.twist p { margin: 8px auto 0; max-width: 36ch; color: var(--on-bg); font-size: 15px; }
.help { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 13px; font-weight: 900; vertical-align: 1px; margin-left: 2px; }

/* ---------- game ---------- */
.game { padding-top: 8px; }
.stats { display: flex; justify-content: space-between; align-items: flex-end; }
.stat-label { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--on-bg); }
.stack { position: relative; font: 400 clamp(48px, 14vw, 68px)/1 var(--display); font-variant-numeric: tabular-nums; }
.stack.up #bank { color: var(--mint); }
.stack.down #bank { color: var(--rose); }
#bank { transition: color .35s; }
.delta { position: absolute; left: 100%; top: 4px; margin-left: 10px; white-space: nowrap; font: 400 24px var(--display); opacity: 0; pointer-events: none; }
.delta.w { color: var(--mint); }
.delta.l { color: var(--rose); }
.delta.go { animation: rise 1s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; transform: translateY(16px) scale(.8); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-26px) scale(1); } }
.right { text-align: right; }
.left { font: 400 clamp(28px, 8vw, 34px)/1 var(--display); font-variant-numeric: tabular-nums; }
.left.hot { color: var(--rose); animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.progress { height: 8px; margin-top: 10px; border-radius: 99px; background: var(--shade); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--yellow); transition: width .3s; }
.live-rank { text-align: center; margin-top: 8px; font-size: 14px; color: var(--on-bg); min-height: 20px; }
.live-rank b { color: var(--yellow); }

/* big coin: size scales with both width and height so it fits short screens */
.coin-stage { display: grid; justify-items: center; --coin: clamp(120px, min(46vw, 27vh), 210px); }
.coin-wrap { position: relative; width: 100%; height: calc(var(--coin) + 60px); display: grid; place-items: center; perspective: 1000px; }
.coin { width: var(--coin); aspect-ratio: 1; position: relative; transform-style: preserve-3d; }
.face {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: grid; place-content: center; justify-items: center; text-align: center; gap: 2px; color: var(--cink);
  filter: drop-shadow(0 0 28px rgba(255, 214, 120, .25));
}
.face.tails { transform: rotateY(180deg); }
.face-emb { position: relative; z-index: 3; width: calc(var(--coin) * .34); }
.face-emb .emb-svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 1px 0 rgba(255,255,255,.45)) drop-shadow(0 -1px 0 rgba(0,0,0,.25)); }
.word { position: relative; z-index: 3; font: 400 calc(var(--coin) * .085) var(--display); letter-spacing: .18em; padding-left: .18em; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.rim { position: relative; z-index: 3; font: 900 9px var(--body); letter-spacing: .12em; text-transform: uppercase; opacity: .8; max-width: 110px; }
.face .coinx { position: absolute; inset: 0; --s: var(--coin); }
.face.custom-face .face-emb { width: 74%; }
.face.custom-face .word { display: none; }
.shadow { position: absolute; bottom: 10px; width: 46%; height: 16px; border-radius: 50%; background: rgba(0, 4, 20, .55); filter: blur(6px); }
.coin-wrap.toss .coin { animation: toss var(--dur, 900ms) cubic-bezier(.3,.6,.3,1); }
.coin-wrap.toss .shadow { animation: shrink var(--dur, 900ms) ease-in-out; }
@keyframes toss { 0% { translate: 0 0; } 45% { translate: 0 calc(var(--coin) * -.4); } 100% { translate: 0 0; } }
@keyframes shrink { 0%,100% { transform: scale(1); opacity: 1; } 45% { transform: scale(.45); opacity: .35; } }
.coin-wrap.idle .coin { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -8px; } }
.result-line { min-height: 28px; font: 400 22px var(--display); text-align: center; letter-spacing: .01em; }
.result-line.win { color: var(--mint); }
.result-line.lose { color: var(--rose); }
.result-line.hint { font: 800 15px var(--body); color: var(--on-bg); }

/* flip history: one chip per flip, newest on the right */
.flip-history {
  display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; max-width: 100%;
  margin: 6px auto 0; padding: 4px 2px 6px; justify-content: safe center;
}
.flip-history.overflow { -webkit-mask: linear-gradient(90deg, transparent, #000 24px); mask: linear-gradient(90deg, transparent, #000 24px); }
.flip-history::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  font: 400 14px/1 var(--display); color: var(--ink); background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.fchip.w { background: var(--mint); }
.fchip.l { background: var(--rose); color: #fff; }
.fchip:last-child { outline: 2px solid var(--yellow); outline-offset: 2px; }
.flips-label { margin-top: 16px; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.done-flips { flex-wrap: wrap; justify-content: center; overflow: visible; -webkit-mask: none; mask: none; }
.done-flips .fchip { box-shadow: 0 2px 0 var(--line); }
.done-flips .fchip.w { background: #bff5dd; }
.done-flips .fchip.l { background: #ffd3dd; color: var(--ink); }
.done-flips .fchip:last-child { outline: none; }
.co-star { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--yellow); font-size: 28px; color: var(--ink); }

/* bet: slider + stepper */
.controls { margin-top: 10px; }
.bet-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.bet-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--on-bg); margin-bottom: 6px; }
.bet-label #bet-pct { color: var(--yellow); letter-spacing: 0; text-transform: none; font-size: 13px; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; margin: 0; cursor: pointer;
  --fill: 10%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 12px; border-radius: 99px;
  background: linear-gradient(90deg, var(--yellow) 0 var(--fill), rgba(255,255,255,.18) var(--fill) 100%);
}
input[type=range]::-moz-range-track { height: 12px; border-radius: 99px; background: rgba(255,255,255,.18); }
input[type=range]::-moz-range-progress { height: 12px; border-radius: 99px; background: var(--yellow); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; margin-top: -9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6d6, var(--yellow) 50%, var(--yellow-d)); border: 3px solid #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,.25), 0 0 0 4px rgba(255,201,60,.25);
}
input[type=range]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff;
  background: radial-gradient(circle at 35% 30%, #fff6d6, var(--yellow) 50%, var(--yellow-d));
}
.stepper { display: flex; height: 46px; border-radius: 14px; overflow: hidden; background: var(--white); color: var(--ink); box-shadow: 0 4px 0 var(--line); }
.stepper button { width: 40px; font-size: 22px; font-weight: 900; color: var(--ink); }
.stepper button:active { background: var(--tint); }
.stepper input { width: 70px; border: 0; background: none; text-align: center; font: 400 24px var(--display); color: var(--ink); -moz-appearance: textfield; padding: 0; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.calls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.call {
  display: grid; justify-items: center; padding: 14px 8px 12px; border-radius: 20px;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.call.heads { background: var(--yellow); color: var(--ink); box-shadow: 0 7px 0 var(--yellow-d), 0 12px 24px rgba(0,4,24,.35); }
.call.tails { background: var(--coral); color: var(--white); box-shadow: 0 7px 0 var(--coral-d), 0 12px 24px rgba(0,4,24,.35); }
.call:hover { filter: brightness(1.05); }
.call:active { transform: translateY(6px); }
.call.heads:active { box-shadow: 0 1px 0 var(--yellow-d); }
.call.tails:active { box-shadow: 0 1px 0 var(--coral-d); }
.call:disabled { filter: saturate(.5) opacity(.7); cursor: default; }
.call-name { font: 400 clamp(26px, 8vw, 32px)/1.05 var(--display); letter-spacing: .02em; }
.call-meta { font-size: 12px; font-weight: 900; opacity: .75; }
.under { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; min-height: 30px; }
.mode-tag { font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--on-bg); }
.mode-tag.ranked { color: var(--yellow); }

.chart { display: block; width: 100%; height: 56px; margin-top: 8px; border-radius: 12px; background: var(--shade); }
.chart:empty { display: none; }
.ch-base { stroke: rgba(255,255,255,.35); stroke-dasharray: 4 5; stroke-width: 1; }
.ch-you { fill: none; stroke: var(--yellow); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--yellow); opacity: .12; }
.ch-bot { fill: none; stroke: var(--sky); stroke-width: 2; stroke-dasharray: 6 6; opacity: .9; }
.chart.down .ch-you { stroke: var(--rose); }
.chart.down .ch-area { fill: var(--rose); }

/* ---------- cards ---------- */
.card { background: var(--white); color: var(--ink); border-radius: 24px; padding: 20px; box-shadow: 0 8px 0 rgba(0,4,24,.35); }
.card h2 { font: 400 26px/1.1 var(--display); margin: 0 0 6px; letter-spacing: .01em; }
.card p { margin: 0 0 12px; color: var(--ink-soft); font-size: 15px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.pill-soft { padding: 4px 10px; border-radius: 99px; background: var(--tint); color: var(--ink-soft); font-size: 12px; font-weight: 900; white-space: nowrap; }

/* ---------- result ---------- */
.done { margin-top: 12px; text-align: center; }
.done .chart { background: var(--tint); height: 90px; margin-top: 14px; }
.done .ch-base { stroke: var(--muted-2); }
.done .ch-you { stroke: var(--accent); }
.done .ch-area { fill: var(--accent); }
.done .ch-bot { stroke: var(--coral); }
.done .chart.down .ch-you { stroke: var(--rose); }
.done-kicker { display: inline-block; padding: 5px 12px; border-radius: 99px; background: var(--tint); color: var(--accent-d); font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.done-reason { font: 400 30px/1.1 var(--display); margin: 12px 0 0; }
.done-score { display: flex; justify-content: center; align-items: baseline; gap: 10px; margin: 4px 0; }
.done-score .from { font: 400 26px var(--display); color: var(--muted-2); }
.done-score .final { font: 400 clamp(72px, 22vw, 104px)/1 var(--display); color: var(--accent); }
.done-score .final.bust { color: var(--rose); }
.done-score .final.lg { font-size: clamp(52px, 15vw, 84px); }
.done-score .final.xl { font-size: clamp(40px, 11vw, 64px); }
.call-meta.boost { opacity: 1; color: inherit; font-weight: 900; text-shadow: 0 0 10px rgba(255, 255, 255, .55); }
.call-meta.cut { opacity: .6; }
.done-meta { font-size: 17px; }
.done-meta b { color: var(--coral); }
.legend { display: flex; justify-content: center; gap: 16px; margin-top: 6px; font-size: 12px; font-weight: 900; color: var(--ink-soft); }
.legend .you { color: var(--accent); }
.legend .bot { color: var(--coral); }
.verdict { margin: 14px 0 0; padding: 12px 14px; border-radius: 16px; background: #fff4d6; font-size: 15px; }
.verdict a { color: var(--accent-d); }
.share-block { margin: 22px -6px 0; padding: 20px 16px 18px; border-radius: 24px; background: linear-gradient(180deg, #fff6dc 0%, #fff 70%); box-shadow: inset 0 0 0 2px #ffe7a6; }
.share-head { text-align: center; margin-bottom: 14px; }
.card .share-head h3 { font: 400 28px/1.05 var(--display); margin: 0; }
.card .share-head p { margin: 6px 0 0; font-size: 15px; font-weight: 800; color: var(--ink-soft); }
.share-stage { position: relative; }
.share-stage::after { content: ''; position: absolute; inset: auto 8% -10px; height: 24px; border-radius: 50%; background: rgba(15, 26, 61, .25); filter: blur(10px); z-index: 0; }
.share-preview { position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 16px; background: #13245e; transform: rotate(-1.2deg); box-shadow: 0 10px 24px rgba(15, 26, 61, .28); }
.share-bubble { position: relative; margin: 22px 0 14px auto; max-width: 92%; padding: 12px 14px 10px; border-radius: 20px 20px 6px 20px; background: #2f7bff; color: #fff; box-shadow: 0 3px 0 #1d5ed6; }
.share-bubble pre { margin: 0; text-align: left; font: 800 13.5px/1.45 var(--body, 'Nunito'), system-ui, sans-serif; white-space: pre-wrap; word-break: break-word; }
.share-bubble .share-link { display: block; text-align: left; margin-top: 6px; font-size: 12.5px; font-weight: 900; text-decoration: underline; opacity: .9; }
.share-main { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; font-size: 19px; }
.share-main svg { width: 22px; height: 22px; flex: none; }
.share-main .reward { font-style: normal; font-size: 13px; font-weight: 900; background: var(--ink); color: var(--yellow); padding: 3px 9px; border-radius: 99px; }
.share-apps { display: flex; justify-content: space-between; gap: 4px; margin-top: 16px; }
.share-app { flex: 1; display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--ink-soft); font-size: 12px; font-weight: 900; }
.share-app .ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; transition: transform .12s; }
.share-app:active .ic { transform: scale(.92); }
@media (hover: hover) { .share-app:hover .ic { transform: translateY(-2px); } }
.share-app svg { width: 24px; height: 24px; }
.ic-sms { background: #34c759; color: #fff; }
.ic-wa { background: #25d366; color: #fff; }
.ic-x { background: #0f1419; color: #fff; }
.ic-fb { background: #1877f2; color: #fff; }
.ic-plain { background: var(--tint-2); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.share-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.share-actions .btn { padding: 11px 6px; font-size: 14px; white-space: nowrap; }
.share-actions .btn.main { grid-column: 1 / -1; font-size: 18px; padding: 15px; }
.name-label { display: block; text-align: left; margin-top: 18px; font-size: 13px; font-weight: 900; color: var(--ink-soft); }
.name-form { display: flex; gap: 8px; margin-top: 6px; }
.name-form input, .email-form input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--tint-2); color: var(--ink); font-weight: 800;
}
.name-form input:focus, .email-form input:focus { border-color: var(--accent); outline: none; }
.name-form .btn { white-space: nowrap; }
.next-actions { display: grid; gap: 12px; margin: 16px 0 6px; }
.next-actions .btn { padding: 15px; font-size: 17px; }

/* ---------- side cards ---------- */
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; font-size: 15px; }
.board li:nth-child(odd) { background: var(--tint-2); }
.board .rk { font: 400 18px var(--display); color: var(--muted-2); text-align: center; }
.board li:nth-child(1) .rk { color: #e0a400; }
.board li:nth-child(2) .rk { color: #8f9bb0; }
.board li:nth-child(3) .rk { color: #c87a4a; }
.board .nm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.board .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .sc { font: 400 20px var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.board .sc.locked { font-size: 15px; opacity: .55; }
.board-lock { margin: 10px 0 0; text-align: center; font-size: 13.5px; font-weight: 800; color: var(--ink-soft); }
.board li.me { background: #fff1c9; box-shadow: inset 0 0 0 2px var(--yellow); }
.board .live { font-size: 10px; font-weight: 900; color: #fff; background: var(--coral); padding: 1px 6px; border-radius: 99px; }
.board .star { color: #e0a400; }
.board .gap { display: block; text-align: center; color: var(--muted-2); background: none !important; padding: 0; }
.board .empty { text-align: center; color: var(--ink-soft); padding: 14px 0; margin: 0; }
.shop-teaser { display: flex; gap: 6px; margin: 4px 0 16px; flex-wrap: wrap; }
.email-form { display: flex; gap: 8px; }
.email-form .btn { flex: none; }
.email-card .fine { margin: 10px 0 0; font-size: 12px; }

.sponsor { display: block; max-width: 540px; margin: 0 auto 16px; padding: 10px 16px; text-align: center; border-radius: 99px; background: var(--shade); font-size: 13px; color: var(--on-bg); text-decoration: none; }
.sponsor b { color: var(--yellow); }

.foot { max-width: 720px; margin: 0 auto; padding: 8px 16px 40px; text-align: center; color: rgba(255,255,255,.6); font-size: 13px; font-weight: 700; }
.foot p { margin: 6px 0; }
.foot a { color: rgba(255,255,255,.85); }

/* ---------- coins (shared by big coin faces and small coins) ---------- */
.coinx {
  --s: 24px; position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.85), rgba(255,255,255,0) 30%),
    conic-gradient(from 210deg, var(--c1), var(--c2) 22%, var(--c1) 45%, var(--c2) 70%, var(--c1));
  box-shadow: 0 calc(var(--s) * .04) 0 var(--c3), inset 0 calc(var(--s) * -.06) calc(var(--s) * .1) rgba(0,0,0,.2);
}
/* reeded edge */
.coinx::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: 0;
  background: repeating-conic-gradient(var(--c3) 0 2.5deg, var(--c2) 2.5deg 5deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 86%, #000 87%);
          mask: radial-gradient(circle closest-side, transparent 86%, #000 87%);
}
/* raised inner rim */
.coinx > i.rimline { position: absolute; inset: 15%; border-radius: 50%; z-index: 1; box-shadow: inset 0 0 0 max(1px, calc(var(--s) * .018)) var(--c3), 0 0 0 max(1px, calc(var(--s) * .012)) rgba(255,255,255,.45); }
.coinx-emb { position: relative; z-index: 2; width: 44%; display: grid; }
.coinx-emb .emb-svg { width: 100%; height: auto; filter: drop-shadow(0 1px 0 rgba(255,255,255,.4)); }
.coinx-img { position: absolute; inset: 15%; width: 70%; height: 70%; border-radius: 50%; object-fit: cover; z-index: 2; box-shadow: 0 0 0 2px var(--c3); }

.finish-chip { background: radial-gradient(circle closest-side, var(--c1) 0 62%, transparent 63%), repeating-conic-gradient(var(--c2) 0 22.5deg, #fff 22.5deg 45deg); }
.finish-chip::before { background: repeating-conic-gradient(var(--c3) 0 11.25deg, var(--c2) 11.25deg 22.5deg); }
.finish-neon { background: radial-gradient(circle at 50% 40%, var(--c1), var(--c2) 70%); }
.finish-neon > i.rimline { box-shadow: inset 0 0 0 2px var(--c3), 0 0 8px var(--c3), inset 0 0 8px var(--c3); }
.finish-neon .emb-svg { filter: drop-shadow(0 0 4px var(--cink)) drop-shadow(0 0 10px var(--cink)); }
.finish-galaxy {
  background:
    radial-gradient(circle at 30% 30%, rgba(140,92,255,.6), transparent 45%),
    radial-gradient(circle at 72% 68%, rgba(255,92,200,.45), transparent 45%),
    radial-gradient(circle at 60% 25%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 25% 65%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 80% 45%, #fff 0 .8px, transparent 1.3px),
    radial-gradient(circle at 45% 82%, #fff 0 .8px, transparent 1.3px),
    var(--c2);
}
.finish-aurora {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.9), transparent 22%),
    conic-gradient(from 0deg, #3ee6a3, #3d9bff, #9b5cff, #ff5cc8, #ffc93c, #3ee6a3);
}
.finish-aurora::before { background: repeating-conic-gradient(#0b0630 0 2.5deg, #ffd36b 2.5deg 5deg); }
.finish-aurora > i.rimline { box-shadow: inset 0 0 0 max(1px, calc(var(--s) * .022)) #ffd36b, 0 0 calc(var(--s) * .08) rgba(255,255,255,.6); }
.finish-aurora .emb-svg { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 8px #9b5cff); }
.finish-galaxy::before { background: repeating-conic-gradient(var(--c3) 0 2.5deg, #4b3aa8 2.5deg 5deg); }

/* animated finishes (on .coinx) */
.fx-aurora::after, .fx-gleam::after, .fx-sparkle::after, .fx-holo::after, .fx-molten::after, .fx-twinkle::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 3; }
.fx-gleam::after { background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%) -200% 0 / 300% 100% no-repeat; animation: gleam 3s ease-in-out infinite; }
.fx-sparkle::after {
  background: radial-gradient(circle at 30% 30%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 68% 40%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 45% 72%, #fff 0 1.5px, transparent 2.5px),
    linear-gradient(115deg, transparent 35%, rgba(255,255,255,.8) 50%, transparent 65%) -200% 0 / 300% 100% no-repeat;
  animation: gleam 2.6s ease-in-out infinite, twinkle 1.2s steps(2) infinite;
}
.fx-holo::after { background: conic-gradient(from 0deg, #ff7ad9, #7afcff, #b6ff7a, #ffe97a, #ff7ad9); mix-blend-mode: color; opacity: .8; animation: spin 4s linear infinite; }
.fx-molten::after { background: radial-gradient(circle at 30% 70%, rgba(255,240,150,.95), transparent 40%), radial-gradient(circle at 70% 30%, rgba(255,90,20,.85), transparent 45%); mix-blend-mode: overlay; animation: lava 2.6s ease-in-out infinite alternate; }
.fx-aurora::after {
  background:
    radial-gradient(circle at 28% 32%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 70% 64%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 62% 26%, #fff 0 1px, transparent 2px),
    conic-gradient(from 0deg, rgba(62,230,163,.7), rgba(61,155,255,.7), rgba(155,92,255,.7), rgba(255,92,200,.7), rgba(62,230,163,.7));
  mix-blend-mode: hue; animation: spin 5s linear infinite, twinkle 1.4s ease-in-out infinite;
}
.coinx.fx-aurora { animation: auroraGlow 3s ease-in-out infinite alternate; }
@keyframes auroraGlow { from { filter: saturate(1) brightness(1); } to { filter: saturate(1.4) brightness(1.12); } }
.tier-head.grail span:first-child { background: linear-gradient(90deg, #3ee6a3, #3d9bff, #9b5cff, #ff5cc8, #ffc93c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fx-twinkle::after { background: radial-gradient(circle at 38% 42%, #fff 0 1.2px, transparent 2px), radial-gradient(circle at 66% 30%, #fff 0 1px, transparent 1.8px), radial-gradient(circle at 58% 74%, #fff 0 1.2px, transparent 2px); animation: twinkle 1.6s ease-in-out infinite; }
@keyframes gleam { 0%, 40% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes twinkle { 50% { opacity: .3; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes lava { from { transform: rotate(0) scale(1); } to { transform: rotate(40deg) scale(1.15); } }

/* ---------- dialogs ---------- */
.dlg {
  width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 24px; border: 0; border-radius: 28px;
  background: var(--white); color: var(--ink); box-shadow: 0 10px 0 rgba(0,4,24,.35);
}
.dlg::backdrop { background: rgba(2, 8, 32, .7); backdrop-filter: blur(3px); }
.dlg h2 { font: 400 30px/1.1 var(--display); margin: 0 0 10px; }
.dlg p { color: var(--ink-soft); }
.fine { color: var(--ink-soft); font-size: 13px; }
.howto { padding-left: 22px; margin: 0; }
.howto li { margin: 10px 0; color: var(--ink-soft); }
.howto b { color: var(--ink); }
.price { margin: 0 0 10px; }
.price span { font: 400 42px var(--display); color: var(--accent); margin-right: 6px; }
.perks { list-style: none; padding: 0; margin: 0 0 10px; }
.perks li { padding: 8px 0; font-weight: 800; }
.perks li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 50%; background: var(--mint); color: var(--ink); font-size: 13px; }
.dlg-actions { display: grid; gap: 8px; margin-top: 18px; justify-items: center; }
.dlg-actions .btn { width: 100%; }

.dlg-shop { width: min(640px, calc(100% - 16px)); padding: 0; overflow: hidden; flex-direction: column; }
.dlg-shop[open] { display: flex; }
.shop-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.shop-head h2 { margin: 0; }
.close-x { width: 38px; height: 38px; border-radius: 50%; background: var(--tint); font-size: 24px; line-height: 1; color: var(--ink); }
.shop-preview { display: flex; align-items: center; gap: 16px; margin: 12px 20px 0; padding: 14px; border-radius: 20px; background: linear-gradient(135deg, var(--bg1), var(--bg2)); color: #fff; }
.shop-preview .fine { color: rgba(255,255,255,.75); margin: 2px 0 0; }
.shop-name { font: 400 24px var(--display); }
.skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 20px 8px; overflow-y: auto; }
.shop-fine { margin: 0; padding: 10px 20px 18px; border-top: 1px solid var(--line); }
.tier-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 0; font: 400 19px var(--display); }
.tier-head .tier-price { color: var(--accent); font-size: 17px; }
.tier-head.mythic span:first-child { background: linear-gradient(90deg, #ff7ad9, #7a5cff, #3ee6a3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skin { display: grid; justify-items: center; gap: 6px; padding: 14px 4px 10px; border-radius: 18px; background: var(--tint-2); border: 2px solid transparent; font-weight: 800; font-size: 13px; color: var(--ink); transition: transform .1s; }
.skin:hover { transform: translateY(-2px); }
.skin[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); }
.skin .tag { font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 99px; background: var(--yellow); color: var(--ink); }
.skin .tag.on { background: var(--mint); }
.skin .tag.use { background: var(--line); }
.skin.wide { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; justify-items: start; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; }
.skin.wide small { display: block; color: var(--ink-soft); font-weight: 700; }

.custom-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 4px; }
.custom-side { display: grid; justify-items: center; gap: 10px; padding: 14px 10px; border-radius: 20px; background: var(--tint-2); }
.custom-side-label { font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.upload-btn { width: 100%; padding: 10px; }

/* ---------- head-to-head ---------- */
.duel-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 12px 14px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,107,74,.95), rgba(255,92,134,.95)); box-shadow: 0 5px 0 var(--coral-d);
}
.duel-banner .link-btn { color: #fff; font-size: 13px; }
.duel-vs { display: flex; align-items: center; gap: 12px; }
.duel-icon { font-size: 30px; line-height: 1; }
.duel-kicker { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.duel-title { font: 400 22px/1.1 var(--display); }
.duel-title b { font-weight: 400; color: var(--yellow); }
.h2h { margin: 14px 0 4px; padding: 14px; border-radius: 20px; background: var(--tint); }
.h2h.win { background: #dcfbef; }
.h2h.loss { background: #ffe6ea; }
.h2h-head { font: 400 24px/1.1 var(--display); margin-bottom: 10px; }
.h2h-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.h2h-side { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.h2h-name { font-weight: 900; font-size: 14px; color: var(--ink-soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-score { font: 400 34px/1 var(--display); color: var(--ink); }
.h2h.win .h2h-side.me .h2h-score, .h2h.loss .h2h-side:not(.me) .h2h-score { color: #0f9d63; }
.h2h-vs { font: 400 18px var(--display); color: var(--muted-2); }
.share-note { margin: 18px 0 0; padding: 0 12px; line-height: 1.5; text-align: center; }
.share-block h3, .friend-block h3 { font: 400 22px/1.1 var(--display); margin: 0 0 10px; text-align: center; }
.friend-block { margin-top: 24px; padding: 22px 20px 20px; border-radius: 22px; background: #fff1ec; }
.friend-block h3 { margin-bottom: 14px; }
.card .friend-block .share-note, .card .share-block .share-note { margin: 16px auto 0; padding: 0; max-width: 32ch; font-size: 14px; line-height: 1.45; }
.tier-badge { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 10px; }
.tier-badge span { padding: 5px 12px; border-radius: 99px; background: var(--tint); font-weight: 900; font-size: 14px; color: var(--ink); }
.tier-badge span:first-child { background: var(--yellow); }
.friend-block .btn { width: 100%; }
.socials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.socials .btn, .share-actions .btn { padding: 11px 6px; font-size: 14px; white-space: nowrap; }
.btn-x { background: #0f1419; color: #fff; box-shadow: 0 5px 0 #000; }
.btn-fb { background: #1877f2; color: #fff; box-shadow: 0 5px 0 #0b52b0; }
.btn-wa { background: #25d366; color: #0b3b1f; box-shadow: 0 5px 0 #179c49; }
.share-actions.two { grid-template-columns: 1fr 1fr; }
.match-table { list-style: none; margin: 12px 0 0; padding: 0; text-align: left; }
.match-table li { display: grid; grid-template-columns: 22px auto 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; }
.match-table li:nth-child(odd) { background: var(--tint-2); }
.match-table li.me { background: #fff1c9; box-shadow: inset 0 0 0 2px var(--yellow); }
.match-table .who { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-table .sc { font: 400 22px var(--display); color: var(--accent); }
.match-table .rk { font-weight: 900; font-size: 13px; color: var(--ink-soft); text-align: right; }
.match-table li.gap { display: block; text-align: center; color: var(--ink-soft); background: none; padding: 2px; }
.card .match-more { margin: 10px 0 0; text-align: center; }
.match-table .wait { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.my-matches { display: grid; gap: 6px; margin: 0 0 14px; }
.my-matches:empty { display: none; }
.my-match { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--tint-2); text-decoration: none; color: var(--ink); font-size: 14px; }
.my-match small { display: block; color: var(--ink-soft); font-weight: 700; }
.my-match .st { font-size: 12px; font-weight: 900; padding: 3px 9px; border-radius: 99px; background: var(--line); white-space: nowrap; }
.my-match .st.go { background: var(--coral); color: #fff; }
.my-match .st.win { background: var(--mint); }
.match-card .btn { width: 100%; }
.match-link { display: flex; gap: 8px; margin: 14px 0 4px; }
.match-link input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--tint-2); color: var(--ink); font-weight: 800; font-size: 14px; }
.checkout-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--tint-2); }
.co-name { font: 400 22px var(--display); }
.checkout-item .fine { margin: 2px 0 0; }
.co-price { font: 400 24px var(--display); color: var(--accent); }
.test-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff4d6; font-size: 14px; }
.challengers { margin-top: 16px; text-align: left; }
.challengers h3 { font: 400 22px var(--display); margin: 0 0 6px; text-align: center; }

/* custom coin bits */
.face-img { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--c3), 0 0 0 6px rgba(255,255,255,.35); }
.coin-plus { position: relative; display: inline-grid; place-items: center; }
.coin-plus b { position: absolute; font: 400 34px var(--display); color: var(--cink, #7a4300); }
.shop-buy { display: flex; margin-top: 8px; padding: 9px 14px; font-size: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 70; max-width: calc(100% - 32px);
  translate: -50% 20px; opacity: 0; pointer-events: none; transition: opacity .2s, translate .2s;
  padding: 12px 18px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 6px 0 rgba(0,0,0,.3);
}
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- shared run page ---------- */
.run-main { max-width: 560px; margin: 0 auto; padding: 8px 16px 32px; }
.rp-player { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.rp-name { font: 400 28px var(--display); }
.run-tagline { text-align: center; color: var(--on-bg); margin: 4px 0 14px; }

/* ---------- small phones ---------- */
@media (max-width: 360px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .logo { font-size: 22px; }
  .daypill { font-size: 11px; padding: 6px 10px; }
  .modes button { font-size: 13px; }
  .stepper button { width: 32px; }
  .stepper input { width: 56px; font-size: 21px; }
  .skins { grid-template-columns: repeat(2, 1fr); }
  .share-actions .btn { font-size: 13px; }
}

/* ---------- tablets: side cards in two columns under the game ---------- */
@media (min-width: 720px) {
  .top { padding: 20px 24px 8px; }
  .wrap { padding: 4px 24px 32px; }
  .side-col { max-width: 900px; grid-template-columns: repeat(2, 1fr); align-items: start; margin-top: 56px; }
  .board-card { grid-row: span 3; }
}

/* ---------- desktop: game and board side by side ---------- */
@media (min-width: 1040px) {
  .wrap { display: grid; grid-template-columns: minmax(0, 560px) 360px; justify-content: center; gap: 48px; align-items: start; }
  .play-col { margin: 0; max-width: none; }
  .side-col { grid-template-columns: 1fr; margin: 8px 0 0; max-width: none; position: sticky; top: 16px; }
  .board-card { grid-row: auto; }
  .sponsor { max-width: 968px; }
}

/* short landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
  .coin-stage { --coin: 110px; }
  .twist p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}


/* more runs dialog */
.runs-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.runs-list li { display: flex; align-items: center; gap: 12px; background: var(--tint-2); border-radius: 14px; padding: 10px 12px; }
.runs-list .r-ic { font-size: 22px; width: 28px; text-align: center; flex: none; }
.runs-list .r-tx { flex: 1; display: grid; gap: 2px; text-align: left; }
.runs-list .r-tx small { color: var(--ink-soft); font-weight: 700; font-size: 12.5px; line-height: 1.35; }
.runs-list .r-ok { font-weight: 900; color: #1f9d55; white-space: nowrap; }
.runs-list .r-get { font-weight: 900; color: var(--ink-soft); white-space: nowrap; font-size: 13px; }
.runs-list .r-btn { padding: 8px 14px; font-size: 14px; }
.runs-sub { width: 100%; margin-top: 4px; }
