/* pokerAceTrainer, screen-print style: flat spot colours, ink outlines, hard offset shadows.
   The ruler (pot, bet and call to scale) is the centre of every explanation. */
@font-face { font-family: Brico; font-weight: 500; font-display: swap; src: url(/static/fonts/brico-500.woff2) format("woff2"); }
@font-face { font-family: Brico; font-weight: 800; font-display: swap; src: url(/static/fonts/brico-800.woff2) format("woff2"); }

:root {
  --paper: #f2ead8; --white: #fffdf6; --ink: #17140f; --blue: #2346c4; --blue-deep: #1a359a;
  --red: #ee4d2e; --sun: #f6b81f; --good: #0b7a4b; --bad: #c4321c; --pot: #d9d2bf; --bet: #a89f8a;
  /* four-colour deck: the suits stay apart on a projector */
  --spade: #17140f; --heart: #d02a1e; --diamond: #1557c0; --club: #0e7a3c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--paper) radial-gradient(rgba(23, 20, 15, .09) .8px, transparent 1px) 0 0 / 5px 5px;
  color: var(--ink); font: 500 17px/1.45 Brico, system-ui, sans-serif; font-variant-numeric: tabular-nums; min-height: 100vh;
}
a { color: inherit; }
h1 { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 20px; }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
h3 { font-size: 16px; font-weight: 800; }
main { max-width: 1160px; margin: 0 auto; padding: 4px 20px 40px; }

.top { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; max-width: 1160px; margin: 0 auto; padding: 12px 20px; }
.logo { font-weight: 800; font-size: 23px; letter-spacing: -.03em; text-decoration: none; margin-right: auto; }
.logo span { background: var(--red); color: var(--white); padding: 1px 7px 3px; display: inline-block; transform: rotate(-3deg); margin: 0 2px; }
nav { display: flex; gap: 8px; }
nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 8px; font-weight: 800; text-decoration: none; }
nav a[aria-current] { box-shadow: inset 0 -5px 0 var(--sun); }

/* buttons and fields */
button, .next {
  font: 800 24px Brico, system-ui, sans-serif; color: var(--ink); background: var(--white); cursor: pointer;
  border: 3px solid var(--ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--ink); min-height:44px; padding: 12px 18px;
}
button:active, .next:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
:focus-visible { outline: 4px solid var(--diamond); outline-offset: 3px; }
button.call { background: var(--red); color: var(--white); }
.actions { display: flex; gap: 16px; padding-right: 5px; }
.actions button { flex: 1; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
label span { display: block; font-weight: 800; font-size: 15px; margin-bottom: 4px; }
input { width: 100%; min-height: 48px; font: 800 22px Brico, system-ui, sans-serif; color: var(--ink); background: var(--white); border: 3px solid var(--ink); border-radius: 10px; padding: 6px 12px; }
input::placeholder { font-weight: 500; opacity: .4; }
.silent { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; box-shadow: none; pointer-events: none; }
.error { background: var(--bad); color: var(--white); font-weight: 800; border: 3px solid var(--ink); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }

/* level choice */
.levels { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.levels a { flex: 1 1 100px; max-width: 220px; min-height: 52px; display: grid; align-content: center; text-align: center; text-decoration: none; font-weight: 800; line-height: 1.15; background: var(--white); border: 3px solid var(--ink); border-radius: 10px; padding: 6px 10px; }
.levels a small { font-weight: 500; font-size: 12px; }
.levels a[aria-current], .levels a:hover { background: var(--sun); box-shadow: 3px 3px 0 var(--ink); }

/* cards */
.hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.card { --w: 72px; position: relative; display: inline-block; flex: none; width: var(--w); height: calc(var(--w) * 1.42); background: var(--white); border: 2.5px solid var(--ink); border-radius: 9px; box-shadow: 4px 4px 0 rgba(23, 20, 15, .85); animation: deal .35s cubic-bezier(.2, 1.4, .4, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
.card b, .key b { position: absolute; top: 3%; left: 9%; font-weight: 800; font-size: calc(var(--w) * .45); line-height: 1.1; letter-spacing: -.06em; }
.card svg, .key svg { position: absolute; fill: currentColor; }
.card .mini { width: 22%; left: 11%; top: 43%; }
.card .pip { width: 56%; right: 8%; bottom: 7%; }
.suit-s { color: var(--spade); } .suit-h { color: var(--heart); } .suit-d { color: var(--diamond); } .suit-c { color: var(--club); }
.card.tiny { --w: 36px; border-width: 1.5px; border-radius: 5px; box-shadow: 2px 2px 0 var(--ink); animation-delay: calc(var(--i, 0) * 30ms); }
.card.small { --w: 54px; }
.card.large { --w: 92px; }
.card.tiny .mini { display: none; }
.card.tiny .pip { width: 62%; right: 19%; }
.card.back { background: var(--red) repeating-linear-gradient(45deg, transparent 0 5px, rgba(255, 253, 246, .35) 5px 7px); box-shadow: inset 0 0 0 3px var(--white), 4px 4px 0 rgba(23, 20, 15, .85); }
.card.slot { background: transparent; border: 2px dashed rgba(242, 234, 216, .5); box-shadow: none; animation: none; }
@keyframes deal { from { transform: translateY(-22px) rotate(-9deg); opacity: 0; } }

/* the table */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.table { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; gap: 18px; background: var(--blue); border: 3px solid var(--ink); border-radius: 160px; box-shadow: 8px 8px 0 var(--ink); padding: 28px 14px 24px; margin-right: 8px; }
.table::before { content: ""; position: absolute; inset: 12px; border: 2px dashed rgba(242, 234, 216, .45); border-radius: 150px; z-index: -1; }
.table::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(var(--blue-deep) 2.2px, transparent 2.6px) 0 0 / 11px 11px; -webkit-mask: linear-gradient(115deg, #000, transparent 45%, transparent 60%, #000); mask: linear-gradient(115deg, #000, transparent 45%, transparent 60%, #000); }
.seat { display: grid; justify-items: center; gap: 8px; }
.who { color: var(--paper); font-weight: 800; font-size: 15px; }
.range { background: var(--white); border: 2.5px solid var(--ink); border-radius: 8px; padding: 3px 12px 5px; font-weight: 800; text-align: center; max-width: 100%; rotate: -1deg; }
.table .seat:last-child .card:nth-child(1) { rotate: -5deg; }
.table .seat:last-child .card:nth-child(2) { rotate: 5deg; }
.ticket { display: flex; background: var(--sun); border: 3px solid var(--ink); border-radius: 8px; box-shadow: 4px 4px 0 var(--ink); rotate: -1.2deg; }
.ticket div { padding: 4px 22px 7px; text-align: center; }
.ticket div + div { border-left: 3px dashed var(--ink); }
.ticket small { display: block; font-weight: 800; font-size: 12px; }
.ticket strong { font-size: 32px; font-weight: 800; line-height: 1; }

/* beside the table */
.side { display: grid; gap: 18px; min-width: 0; }
.play:has(.feedback) .answer, .play:has(.feedback) .before { display: none; }
.assumptions { list-style: none; font-size: 14px; opacity: .75; }

/* the ruler */
.ruler { background: var(--white); border: 3px solid var(--ink); border-radius: 12px; padding: 14px; box-shadow: 5px 5px 0 var(--ink); margin-right: 5px; }
.ruler h2 { margin-bottom: 12px; }
.parts { display: flex; height: 26px; border: 2.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.parts span { flex-basis: 0; min-width: 0; }
.parts span + span { box-shadow: inset 2.5px 0 0 var(--ink); }
.parts .pot, .partlabels .pot { --part: var(--pot); } .parts .bet, .partlabels .bet { --part: var(--bet); } .parts .call, .partlabels .call { --part: var(--sun); }
.parts span { background: var(--part); }
.partlabels { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 8px 0 4px; }
.partlabels span { display: grid; grid-template-columns: auto auto; column-gap: 7px; align-items: center; }
.partlabels span::before { content: ""; grid-row: span 2; width: 14px; height: 100%; background: var(--part); border: 2px solid var(--ink); border-radius: 3px; }
.partlabels small { font-size: 12px; font-weight: 800; line-height: 1.2; }
.partlabels strong { font-size: 26px; font-weight: 800; line-height: 1.1; }
.scale { position: relative; height: 24px; font-size: 12px; margin: 0 2.5px; }
.scale i { position: absolute; top: 0; font-style: normal; translate: -50% 0; }
.scale i::before { content: ""; display: block; width: 2px; height: 6px; background: var(--ink); margin: 0 auto; }
.scale i:first-child { translate: 0; } .scale i:first-child::before { margin: 0; }
.scale i:last-child { translate: -100% 0; } .scale i:last-child::before { margin: 0 0 0 auto; }
.meter { position: relative; height: 48px; margin-top: 6px; border: 2.5px solid var(--ink); border-radius: 6px; background: repeating-linear-gradient(90deg, var(--paper) 0 calc(10% - 2px), var(--white) calc(10% - 2px) 10%); }
.meter .fill { position: absolute; inset: 0 auto 0 0; background: var(--good); animation: grow .8s cubic-bezier(.2, .8, .2, 1) backwards; }
.meter.short .fill { background: var(--bad); }
@keyframes grow { from { width: 0; } }
.meter .won { position: absolute; right: 8px; top: 7px; background: var(--white); border: 2px solid var(--ink); border-radius: 5px; padding: 0 8px 2px; font-weight: 800; z-index: 2; }
.meter .need { position: absolute; top: -9px; bottom: -9px; width: 5px; margin-left: -2.5px; background: var(--ink); }
.meter .guess { position: absolute; bottom: -13px; margin-left: -9px; border: 9px solid transparent; border-top-width: 0; border-bottom: 13px solid var(--diamond); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 16px; font-weight: 800; font-size: 14px; }
.key-need::before { content: "┃ "; }
.key-guess::before { content: "▲ "; color: var(--diamond); }

/* feedback and results */
.feedback, .analysis { display: grid; gap: 18px; }
.analysis { margin-top: 28px; }
.sticker { justify-self: start; color: var(--white); background: var(--good); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 8px 16px 11px; font-size: 24px; font-weight: 800; line-height: 1.15; rotate: -2deg; animation: slap .3s cubic-bezier(.2, 1.6, .4, 1); }
.sticker.bad { background: var(--bad); }
@keyframes slap { from { scale: 1.6; opacity: 0; } }
.next { display: block; text-align: center; text-decoration: none; background: var(--sun); margin-right: 5px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; }
.facts p { border-top: 3px solid var(--ink); padding-top: 6px; font-weight: 800; }
.formula { background: var(--white); border: 2px dashed var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 15px; overflow-wrap: anywhere; }
.outcards .hand, .outs .hand { justify-content: flex-start; margin-top: 8px; }
.outs { display: grid; gap: 8px; margin-top: 18px; font-weight: 800; }

/* analyse: zones and tap grid */
.analyse { display: grid; gap: 16px; }
.analyse .fields { margin: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.zones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.zone { display: grid; gap: 10px; align-content: start; }
.zone button { font-size: 18px; padding: 8px 4px; box-shadow: none; }
.zone button[aria-pressed="true"] { background: var(--sun); box-shadow: 4px 4px 0 var(--ink); }
.zone .card { --w: 38px; }
.zone .card .mini { display: none; }
.grid { display: grid; gap: 6px; background: var(--blue); border: 3px solid var(--ink); border-radius: 14px; padding: 10px; }
.grid .row { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; }
.key { --w: 40px; position: relative; height: 62px; min-width: 0; padding: 0; border-width: 2px; border-radius: 7px; box-shadow: 2px 2px 0 var(--ink); }
.key b { font-size: 21px; }
.key .mini { display: none; }
.key .pip { width: 52%; max-width: 24px; right: 12%; bottom: 8%; }
.key:disabled { opacity: .28; box-shadow: none; cursor: default; transform: translate(2px, 2px); }

/* players and profile */
.players { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 26px; }
.players li { background: var(--white); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink); padding: 14px 14px 0; }
.playerhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.playerhead strong { font-size: 24px; font-weight: 800; overflow-wrap: anywhere; }
.playerhead a { min-height: 44px; display: inline-flex; align-items: center; }
.newplayer { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; max-width: 480px; }
.newplayer label { flex: 1 1 220px; }
.streak { display: inline-block; background: var(--sun); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 4px 4px 0 var(--ink); padding: 8px 18px; font-size: 26px; font-weight: 800; margin-bottom: 20px; }
.stats { list-style: none; display: grid; gap: 10px; margin-bottom: 24px; max-width: 520px; }
.stats li { border-top: 3px solid var(--ink); padding-top: 6px; font-weight: 800; }

/* the practice table */
.scorebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-bottom: 16px; font-weight: 800; }
.scorebar a { display: inline-flex; align-items: center; min-height: 44px; }
.scorebar .language { margin-left: auto; }
.opponents { display: flex; flex-wrap: wrap; justify-content: center; align-items: start; gap: 8px 22px; }
.opponents .card.small { --w: 46px; }
.table .opponents .seat:last-child .card { rotate: 0deg; }
.table .hero .card:nth-child(1) { rotate: -5deg; }
.table .hero .card:nth-child(2) { rotate: 5deg; }
.dealer { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: var(--white); color: var(--ink); border: 2px solid var(--ink); font-size: 12px; }
.tag { background: var(--ink); color: var(--paper); border-radius: 6px; padding: 0 8px 2px; font-size: 13px; font-weight: 800; }
.winner .card { box-shadow: 0 0 0 4px var(--sun), 4px 4px 0 4px rgba(23, 20, 15, .85); }
.winner .who { background: var(--sun); color: var(--ink); border-radius: 6px; padding: 1px 8px 3px; }
/* after an answer the dealt cards stay; the new ones arrive one by one */
.spot.ran .now .card, .spot.ran .hero .card { animation: none; }
.spot.ran .later .card { animation-duration: .45s; animation-delay: calc((var(--i) - 2) * .7s); }
.spot.ran .opponents .card { animation-delay: .2s; }
.ask h2 { margin-bottom: 8px; }
.actions .tool { display: flex; flex: 1; }
.answer .actions { flex-wrap: wrap; }
.answer .actions button { flex: 1 1 120px; }
button.raise, button.bet { background: var(--sun); }
button.check { background: var(--good); color: var(--white); }
kbd { font: 500 13px Brico, system-ui, sans-serif; opacity: .65; margin-left: 8px; }
.tools { display: flex; flex-wrap: wrap; gap: 4px 16px; }
button.quiet { background: transparent; border: 0; box-shadow: none; font-size: 16px; text-decoration: underline; padding: 8px 0; }
.sticker.info { background: var(--blue); }
.note { font-size: 14px; opacity: .8; }
.pos { color: var(--good); } .neg { color: var(--bad); }
.runout p + p { margin-top: 4px; }
.meter .need.second { background: repeating-linear-gradient(var(--ink) 0 6px, transparent 6px 9px); }
.key-second::before { content: "┆ "; }
.why, .panel { background: var(--white); border: 3px solid var(--ink); border-radius: 12px; padding: 4px 14px; }
.why[open], .panel[open] { padding-bottom: 14px; }
summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; }
summary::before { content: "+"; font-size: 22px; width: 16px; }
details[open] > summary::before { content: "−"; }
.why ol { padding-left: 20px; display: grid; gap: 10px; margin-bottom: 14px; }
.values { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 10px; }
.values th, .values td { border-top: 2px solid var(--ink); padding: 6px 4px; text-align: left; }
.values td { text-align: right; font-weight: 800; }
.values thead th { font-size: 12px; }
.values tr.best { background: var(--sun); }
.values tr.best .pos, .values tr.best .neg { color: var(--ink); }
.chart { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 1px; margin: 10px 0; }
.chart span { display: grid; place-items: center; aspect-ratio: 1; font-size: clamp(7px, 1.9vw, 10px); font-weight: 800; background: var(--paper); border-radius: 2px; overflow: hidden; }
.chart span.fold { opacity: .55; }
.chart span.open { background: var(--blue); color: var(--white); }
.chart span.own { background: var(--red); color: var(--white); opacity: 1; outline: 2px solid var(--ink); }
.settings { display: grid; gap: 12px; }
fieldset { border: 0; display: flex; flex-wrap: wrap; gap: 6px; }
legend { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
fieldset label { position: relative; }
fieldset input { position: absolute; opacity: 0; width: 1px; min-height: 0; }
fieldset span { display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0 14px; border: 2.5px solid var(--ink); border-radius: 9px; background: var(--white); cursor: pointer; }
fieldset input:checked + span { background: var(--sun); box-shadow: 3px 3px 0 var(--ink); }
fieldset input:focus-visible + span { outline: 4px solid var(--diamond); outline-offset: 2px; }
.summary { max-width: 640px; display: grid; gap: 18px; }
.grades { list-style: none; display: grid; gap: 8px; }
.grades li { border-top: 2px solid var(--ink); padding-top: 6px; }
.players .practice { display: flex; align-items: center; justify-content: center; min-height: 52px; margin-bottom: 10px; font-weight: 800; text-decoration: none; background: var(--red); color: var(--white); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); }

/* sign-in and the member's start page */
.accountforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; align-items: start; }
.accountforms form { display: grid; gap: 14px; padding: 18px; box-shadow: 5px 5px 0 var(--ink); }
.accountforms h1 { margin: 0; }
.consent { display: flex; gap: 10px; align-items: start; font-size: 15px; }
.consent input { width: 24px; min-height: 24px; height: 24px; flex: none; accent-color: var(--blue); }
.signin .sticker { margin-bottom: 18px; font-size: 18px; rotate: -1deg; }
.members { display: grid; gap: 16px; max-width: 460px; }
.members .practice { display: flex; align-items: center; justify-content: center; min-height: 64px; font-size: 20px; font-weight: 800; text-decoration: none; background: var(--red); color: var(--white); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--ink); }
.members form { border-top: 3px solid var(--ink); padding-top: 12px; display: grid; gap: 10px; justify-items: start; overflow-wrap: anywhere; }

footer { max-width: 1160px; margin: 0 auto; padding: 0 20px 24px; display: flex; gap: 20px; font-size: 14px; }
footer a { display: inline-flex; align-items: center; min-height: 44px; }
.legal { max-width: 70ch; display: grid; gap: 12px; }
.legal h2 { margin-top: 14px; }

.keys { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 10px; font-size: 15px; }
.keys input { width: 22px; min-height: 22px; height: 22px; flex: none; accent-color: var(--blue); }

@media (hover: none) { kbd { display: none; } }

@media (max-width: 860px) {
  .columns { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .top { padding: 8px 14px; }
  .logo { font-size: 20px; }
  main { padding: 4px 14px 32px; }
  .table { border-radius: 70px; padding: 20px 6px 18px; gap: 12px; }
  .table::before { border-radius: 62px; }
  .table .hand { gap: 6px; }
  .table .card.medium { --w: 52px; }
  .table .card.small { --w: 44px; }
  .table .card.large { --w: 74px; }
}
@media (max-width: 560px) {
  .grid { gap: 4px; padding: 5px; }
  .grid .row { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .grid .row + .row { border-top: 2px dashed rgba(242, 234, 216, .5); padding-top: 4px; }
  .key { height: 52px; }
  .key b { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
