/* The blog (straddleapp.net/blog/): the index and the Hand of the day posts. Built on the site's own
   tokens (../tokens.css) and Inter. The top bar is always the home page's black with its green glow;
   the page under it is the home page's black too (dark only). Each post design adds its own styles on top of these. */

/* Dark only (the owner's call): the home page's black, near-black cards with a 1px #262626 edge, mint accents. */
:root {
  --bg: #000; --surface: #0d0d0d; --surface2: #141414; --text: #fff; --text2: rgba(255, 255, 255, .8); --text3: rgba(255, 255, 255, .6);
  --rule: #262626; --acc: #7FE3B8; --acc-ink: #03140D; --best-bg: rgba(14, 124, 90, .28); --best-edge: #7FE3B8;
  --ok-bg: rgba(224, 154, 21, .18); --ok-edge: var(--amber); --ok-text: var(--gold); --bad: #FF8A7A; --bad-bg: rgba(255, 78, 58, .14);
  --red-suit: var(--chip-deep); --shadow: 0 0 0 1px #262626; --glow: 20, 149, 107; --wrap: 720px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; overflow-x: clip; }
a { color: var(--acc); }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---- The top bar: the wordmark home, the blog, and the gold beta button ---- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(0, 0, 0, .86); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08); color: #fff; }
.topbar .in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 14px; }
.topbar .home { display: flex; align-items: center; line-height: 0; }
.topbar .home img { width: 104px; height: auto; }
.topbar nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar nav a { color: rgba(255, 255, 255, .82); text-decoration: none; font-size: 15px; font-weight: 700; padding: 10px 10px; border-radius: 10px; }
.topbar nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.topbar nav a[aria-current="page"] { color: #fff; }
.topbar nav a.beta { background: var(--gold); color: var(--gold-ink); padding: 9px 14px; margin-left: 6px; }
.topbar nav a.beta:hover { filter: brightness(1.05); background: var(--gold); }
.topbar nav a { white-space: nowrap; }
@media (max-width: 420px) { .topbar nav a.hide-sm { display: none; } }
@media (max-width: 400px) {
  .topbar .in { gap: 8px; padding: 0 12px; }
  .topbar .home img { width: 86px; }
  .topbar nav { gap: 0; }
  .topbar nav a { font-size: 14px; padding: 8px 7px; }
  .topbar nav a.beta { padding: 8px 11px; margin-left: 4px; }
}

/* ---- Cards drawn as the app draws them (.vd-card) ---- */
.pc { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none; width: 32px; height: 44.8px; border-radius: 7px;
  background: #fff; color: var(--ink); line-height: 1; box-shadow: 0 2px 2.5px rgba(0, 0, 0, .3); vertical-align: middle; }
.pc b { font-size: 14px; font-weight: 800; letter-spacing: -.02em; }
.pc i { font-size: 15px; font-style: normal; margin-top: -1px; }
.pc.r { color: var(--suit-red); }
.pc.sm { width: 23px; height: 32.2px; border-radius: 5px; }
.pc.sm b { font-size: 11px; } .pc.sm i { font-size: 11px; }
.pc.lg { width: 44px; height: 61.6px; border-radius: 9px; }
.pc.lg b { font-size: 19px; } .pc.lg i { font-size: 21px; }
.pc.xl { width: 56px; height: 78.4px; border-radius: 11px; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.pc.xl b { font-size: 25px; } .pc.xl i { font-size: 27px; }
.pc.back { background: linear-gradient(135deg, var(--card-back-top), var(--card-back-bottom)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 2px 2.5px rgba(0, 0, 0, .3); }
.pc.dim { opacity: .35; }
.cards { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle; }
/* Inline cards in running text: a small chip, suit coloured. */
.c { display: inline-block; padding: 0 4px; border-radius: 5px; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--rule); font-weight: 800; white-space: nowrap; font-size: .94em; line-height: 1.45; }
.c.r { color: #FF7A6B; }

/* ---- Pills and labels ---- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(var(--glow), .22); }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--rule);
  font-size: 12.5px; font-weight: 700; color: var(--text2); white-space: nowrap; }
.tag.type { color: var(--text); }

/* ---- "Play this hand": the home page's white pill with the green play disc ---- */
.play { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 0 26px 0 9px; border: 0; border-radius: 999px;
  background: #fff; color: var(--felt-deep); font: inherit; font-size: 17px; font-weight: 800; letter-spacing: -.01em; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 #BFD0C7, 0 14px 30px rgba(0, 0, 0, .22); transition: transform .12s, box-shadow .12s; }
.play .ico { flex: none; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--felt); color: #fff; }
.play .ico svg { width: 15px; height: 15px; margin-left: 2px; fill: currentColor; }
.play:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #BFD0C7, 0 18px 36px rgba(0, 0, 0, .26); }
.play:active { transform: translateY(3px); box-shadow: 0 1px 0 #BFD0C7, 0 6px 14px rgba(0, 0, 0, .2); }
.play:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
/* A green version for light surfaces. */
.play.green { background: var(--felt); color: #fff; box-shadow: 0 4px 0 var(--felt-deep); }
.play.green .ico { background: rgba(255, 255, 255, .18); }
.play.green:hover { box-shadow: 0 6px 0 var(--felt-deep); }
@media (prefers-reduced-motion: reduce) { .play, .play:hover, .play:active { transition: none; transform: none; } }
.play-note { font-size: 13.5px; color: var(--text3); margin: 10px 0 0; }

/* ---- Graded lines, as the Why tab shows them ---- */
.line { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--rule);
  font-size: 15px; font-weight: 700; }
.line + .line { margin-top: 8px; }
.line .ev { margin-left: auto; font-size: 13.5px; font-weight: 800; color: var(--bad); font-variant-numeric: tabular-nums; white-space: nowrap; }
.line .ok { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--acc); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.line .ok svg { width: 13px; height: 13px; }
.line.best { background: var(--best-bg); box-shadow: inset 0 0 0 1.5px var(--best-edge); }
.line.okay { background: var(--ok-bg); box-shadow: inset 0 0 0 1.5px var(--ok-edge); }
.line.okay .ev { color: var(--ok-text); }

/* ---- Spoiler cover: the answer stays hidden until the reader makes a call or asks to see it ---- */
.reveal-cover { position: relative; }
.reveal-cover > .hide { filter: blur(9px); user-select: none; pointer-events: none; transition: filter .35s; }
.reveal-cover.open > .hide { filter: none; user-select: auto; pointer-events: auto; }
.reveal-cover .gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 16px; z-index: 2; }
.reveal-cover.open .gate { display: none; }
/* Closed, the cover shows only the top of the answer, fading out, with the question near its top. */
.reveal-cover:not(.open) > .hide { max-height: 460px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); }
.reveal-cover .gate { justify-content: flex-start; padding-top: 72px; }
.gate .pick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.gate button, .btn { min-height: 46px; padding: 0 18px; border-radius: 12px; border: 0; font: inherit; font-size: 15.5px; font-weight: 800; cursor: pointer;
  background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--rule), 0 3px 0 var(--rule); }
.gate button:hover, .btn:hover { box-shadow: inset 0 0 0 1.5px var(--acc), 0 3px 0 var(--rule); }
.gate button:focus-visible, .btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.gate .skip { background: none; box-shadow: none; color: var(--text2); text-decoration: underline; min-height: 40px; font-weight: 700; }
.gate .q { font-weight: 800; font-size: 17px; }

/* ---- Footer, as the home page has it ---- */
footer.site { padding: 36px 16px 48px; text-align: center; font-size: 14px; color: var(--text3); border-top: 1px solid var(--rule); margin-top: 56px; }
footer.site a { color: var(--acc); font-weight: 600; margin: 0 8px; }
footer.site .fine { max-width: 560px; margin: 0 auto 12px; }

/* ---- "Play this hand": the hand in a window over the page (the home page's .hand-modal, blog.js) ---- */
.hand-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: max(64px, calc(env(safe-area-inset-top) + 56px)) 12px max(20px, env(safe-area-inset-bottom)); }
.hand-modal[hidden] { display: none; }
.hand-modal .backdrop { position: absolute; inset: 0; background: rgba(2, 10, 7, .82); animation: hm-fade .2s both; }
.hand-modal .window { position: relative; width: min(390px, 100%); height: min(760px, 100%); animation: hm-rise .25s cubic-bezier(.2, .9, .2, 1) both; }
.hand-modal iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 36px; background: var(--night);
  box-shadow: 0 0 0 8px rgba(7, 17, 13, .6), 0 0 0 9px rgba(255, 255, 255, .06), 0 30px 80px rgba(0, 0, 0, .5); }
.hand-modal .close { position: absolute; top: -54px; right: 0; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; }
.hand-modal .close:hover { background: rgba(255, 255, 255, .28); }
.hand-modal .close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@keyframes hm-fade { from { opacity: 0; } }
@keyframes hm-rise { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { .hand-modal .backdrop, .hand-modal .window { animation: none; } }

/* ---- Tags: links to the blog index filtered by that tag ---- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
a.tag, button.tag { text-decoration: none; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; border: 0; }
a.tag { display: inline-flex; }
a.tag:hover, button.tag:hover { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--acc); }
a.tag:focus-visible, button.tag:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.tag[aria-pressed="true"], .tag[aria-current="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
