/* screens.css — one section per screen: home, scoreboard/play, winner,
   draw, history; plus screen-entry animation. */
/* ── home ── */
.hero { position: relative; padding: 18px 4px 6px; display: flex; align-items: flex-end; gap: 12px; }
.hero h1 { margin: 0; font-size: 34px; font-weight: 900; line-height: 1.05; letter-spacing: -.5px; }
.hero h1 span { color: var(--brass); }
.hero p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.hero .rack { width: 92px; height: 80px; flex-shrink: 0; margin-inline-start: auto; }
.resume { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); text-align: start; width: 100%;
  background: linear-gradient(135deg, var(--brass), #b98f3c); color: var(--rail); box-shadow: 0 10px 30px rgba(217, 178, 95, .25); }
.resume b { display: block; font-size: 16px; }
.resume small { font-size: 13px; opacity: .8; }
.resume .go { margin-inline-start: auto; font-size: 22px; }
.sect { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .3px; margin: 6px 4px -4px; }
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gcard { position: relative; overflow: hidden; text-align: start; padding: 16px 14px 14px; border-radius: var(--r-lg); min-height: 128px;
  background: linear-gradient(160deg, rgba(244,239,227,.09), rgba(244,239,227,.03)); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; transition: transform .2s var(--ease); }
.gcard:active { transform: scale(.97); }
.gcard b { font-size: 19px; font-weight: 900; }
.gcard small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.gcard .mini { position: absolute; top: 12px; inset-inline-end: 12px; width: 46px; height: 46px; }
.gcard div { display: flex; flex-direction: column; gap: 2px; }
/* an odd last card spans the row, laid out sideways */
.games .gcard:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 96px; flex-direction: row; align-items: center; gap: 12px; justify-content: flex-start; }
.games .gcard:last-child:nth-child(odd) .mini { position: static; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tool { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.tool svg { width: 22px; height: 22px; color: var(--brass); flex-shrink: 0; }
.foot { text-align: center; color: var(--muted); font-size: 12px; opacity: .7; margin-top: 8px; }

/* ── scoreboard ── */
.board { display: grid; gap: 8px; }
.board.two { grid-template-columns: 1fr 1fr; }
.pl { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 12px 14px; text-align: start; width: 100%;
  background: var(--glass); border: 1px solid var(--line); transition: border-color .3s, background .3s, transform .3s var(--ease); }
.pl.turn { border-color: rgba(217,178,95,.85); background: linear-gradient(160deg, rgba(217,178,95,.2), rgba(4,22,15,.35)); }
.pl.turn::before { content: ""; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--brass); }
.pl .nm { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.pl .nm em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--glass-2); color: var(--muted); flex-shrink: 0; }
.pl .nm em.g { background: var(--brass); color: var(--rail); }
.pl .sc { font-size: 46px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -1px; display: inline-block; }
.pl .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.pl .meta b { color: var(--ivory); font-weight: 700; }
.board:not(.two) .pl { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
.board:not(.two) .pl .sc { font-size: 38px; grid-row: 1 / span 2; grid-column: 2; }
.pl .frames { display: flex; gap: 4px; margin-top: 6px; }
.pl .frames i { width: 9px; height: 9px; border-radius: 50%; background: rgba(244,239,227,.15); }
.pl .frames i.w { background: var(--brass); box-shadow: 0 0 8px rgba(217,178,95,.7); }
.sc.bump { animation: bump .5s var(--spring); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.22); color: var(--brass); } 100% { transform: scale(1); } }
.float { position: fixed; z-index: 55; font-weight: 900; font-size: 26px; color: var(--brass); pointer-events: none; text-shadow: 0 2px 10px rgba(0,0,0,.5); }

.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: rgba(4,22,15,.3); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 6px; text-align: center; }
.stat b { display: block; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); }
.stat.hot b { color: var(--warn); }
.stat.red b { color: var(--bad); }

.breakline { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 4px; overflow-x: auto; scrollbar-width: none; }
.breakline::-webkit-scrollbar { display: none; }
.breakline .bl { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.breakline .bl b { color: var(--ivory); font-size: 16px; }
.pip { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; box-shadow: inset -3px -3px 5px rgba(0,0,0,.4), inset 2px 2px 4px rgba(255,255,255,.3); animation: pipIn .35s var(--spring); }
@keyframes pipIn { from { transform: scale(0) translateY(-10px); } }

/* ── winner ── */
.win { text-align: center; padding: 12px 0 4px; }
.trophy { width: 110px; height: 110px; margin: 0 auto; animation: drop .8s var(--spring); }
@keyframes drop { from { transform: translateY(-60px) scale(.4) rotate(-20deg); opacity: 0; } }
.win h2 { font-size: 28px !important; margin-top: 8px !important; }
.win .score { font-size: 40px; font-weight: 900; color: var(--brass); font-variant-numeric: tabular-nums; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 700; font-size: 12px; }
.tbl td:first-child, .tbl th:first-child { text-align: start; }
.tbl td b { font-variant-numeric: tabular-nums; }
.tblwrap { overflow-x: auto; }

/* ── draw (shuffle) ── */
.reveal { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.who-big { font-size: 26px; font-weight: 900; }
.who-big.small { font-size: 20px; }
.mystery.done { font-size: 60px; color: var(--good); border-color: rgba(95,211,141,.5); }
.bigball { width: 190px; height: 190px; max-width: 60vw; max-height: 60vw; border-radius: 50%; display: grid; place-items: center; --c: #c8202a;
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.6), transparent 20%), radial-gradient(circle at 60% 65%, var(--c), color-mix(in srgb, var(--c) 50%, #000) 95%);
  box-shadow: 0 24px 40px rgba(0,0,0,.45), inset -14px -18px 30px rgba(0,0,0,.4); animation: rollin .7s var(--spring); }
.bigball span { width: 44%; aspect-ratio: 1; border-radius: 50%; background: #fbf8f0; color: #111; display: grid; place-items: center; font: 900 46px system-ui, sans-serif; }
.bigball.stripe { background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.6), transparent 20%), linear-gradient(180deg, #f4efe3 0 24%, transparent 24% 76%, #f4efe3 76%), radial-gradient(circle at 60% 65%, var(--c), color-mix(in srgb, var(--c) 50%, #000) 95%); }
@keyframes rollin { from { transform: translateX(-120%) rotate(-360deg); opacity: 0; } }
.mystery { width: 190px; height: 190px; max-width: 60vw; max-height: 60vw; border-radius: 50%; border: 3px dashed rgba(244,239,227,.3); display: grid; place-items: center; font-size: 64px; font-weight: 900; color: rgba(244,239,227,.35); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); border-color: rgba(217,178,95,.6); } }
.progress { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.progress i { width: 10px; height: 10px; border-radius: 50%; background: rgba(244,239,227,.18); transition: background .3s; }
.progress i.on { background: var(--brass); }

/* ── history ── */
.hitem { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--line); }
.hitem .mini { width: 38px; height: 38px; flex-shrink: 0; }
.hitem div { flex: 1; min-width: 0; }
.hitem b { display: block; font-size: 15px; }
.hitem small { color: var(--muted); font-size: 12px; }
.hitem .res { font-weight: 900; font-size: 18px; color: var(--brass); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 14px; line-height: 1.9; }

/* screen entry */
.enter > * { animation: rise .45s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .04s; } .enter > *:nth-child(3) { animation-delay: .08s; }
.enter > *:nth-child(4) { animation-delay: .12s; } .enter > *:nth-child(5) { animation-delay: .16s; }
.enter > *:nth-child(6) { animation-delay: .2s; } .enter > *:nth-child(n+7) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }


/* ── setup / play layout wrappers (single column; see responsive.css) ── */
.setupgrid, .col-score, .col-pad { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.playgrid { display: flex; flex-direction: column; gap: 14px; }
.hlist { display: flex; flex-direction: column; gap: 8px; }
.hitem { text-align: start; width: 100%; }

/* ── how to play ── */
.learn-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin-inline: -2px; }
.learn-tabs::-webkit-scrollbar { display: none; }
.learn-tabs .chip { flex-shrink: 0; }
.lesson-intro { flex-direction: row; align-items: flex-start; gap: 14px; }
.lesson-intro p { margin: 0; line-height: 1.95; font-size: 15px; }
.lessons { display: flex; flex-direction: column; gap: 14px; }
.lesson h3 { margin: 0; font-size: 17px; font-weight: 900; color: var(--brass); }
details.lesson { gap: 0; }
details.lesson > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; padding: 2px 0; }
details.lesson > summary::-webkit-details-marker { display: none; }
details.lesson > summary i { width: 22px; height: 22px; color: var(--muted); transform: rotate(90deg); transition: transform .25s var(--ease); flex-shrink: 0; }
details.lesson > summary i svg { width: 22px; height: 22px; }
details.lesson[open] > summary i { transform: rotate(-90deg); }
.lesson-body { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
details.lesson[open] .lesson-body { animation: rise .3s var(--ease); }
.lesson-tools { display: flex; gap: 8px; justify-content: flex-end; }
.lesson-tools .chip { padding: 6px 12px; font-size: 13px; }
.rulestbl td { text-align: start !important; font-size: 13px; line-height: 1.8; vertical-align: top; }
.rulestbl td:last-child { color: var(--brass); font-weight: 700; min-width: 96px; }
.rulestbl th { text-align: start !important; }
.lesson .rules { color: var(--ivory); opacity: .9; font-size: 14px; line-height: 2; }
.figure { overflow-x: auto; }
.diagram { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; filter: drop-shadow(0 10px 20px rgba(0,0,0,.35)); }
.values { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.values > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.values .ball.mini { width: clamp(30px, 9vw, 42px); height: clamp(30px, 9vw, 42px); }
.values .ball.mini span { font-size: clamp(10px, 2.8vw, 13px); }
.cap { margin: 2px 0 6px; text-align: center; font-size: 12px; color: var(--muted); }
.app-howto { border-color: rgba(217,178,95,.4); }
