/* Pyramid Solitaire: a night-sky card table filling the stage. The HUD, the tool bar, the coach line, the result card
   and the panels float over it as glass; the cards are DOM elements that game.js places and animates. */
.py { display: flex; flex-direction: column; color: #dfe9ff; --py-hud: 56px; --py-bar: 66px; --py-gold: #ffd166; --py-sand: #f2c46d; --py-cyan: #55d6ff; --py-mint: #7cf2b4;
  --py-line: #1c2b4a; --py-glass: rgba(9,15,34,0.84); --cw: 60px; --ch: 84px; --fs: 18px; }
.py [hidden] { display: none !important; }
.py-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.py-stage { position: relative; width: 100%; height: min(86vh, 800px); min-height: 500px; overflow: hidden; outline: none;
  background: radial-gradient(120% 80% at 50% 0%, #1b4669 0%, #0f2a48 42%, #081729 78%, #050d1a 100%);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
/* the sky over the table: faint stars and the outline of a great pyramid on the horizon */
.py-stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 78% 12%, rgba(255,255,255,.5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 64% 30%, rgba(255,255,255,.35) 0 .8px, transparent 1.4px),
    radial-gradient(circle at 30% 8%, rgba(255,255,255,.4) 0 .8px, transparent 1.4px),
    radial-gradient(circle at 90% 44%, rgba(255,255,255,.3) 0 .8px, transparent 1.4px),
    radial-gradient(circle at 6% 52%, rgba(255,255,255,.3) 0 .8px, transparent 1.4px),
    radial-gradient(rgba(255,255,255,.022) .8px, transparent 1px) 0 0 / 5px 5px; }
.py-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; pointer-events: none; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='xMidYMax slice'%3E%3Cpath d='M0 120L150 22L300 120Z' fill='%23f2c46d' fill-opacity='.05'/%3E%3Cpath d='M150 22L300 120H240Z' fill='%23000' fill-opacity='.12'/%3E%3Cpath d='M210 120L300 62L390 120Z' fill='%23f2c46d' fill-opacity='.035'/%3E%3Cpath d='M0 120L150 22L300 120' fill='none' stroke='%23f2c46d' stroke-opacity='.14'/%3E%3C/svg%3E") center bottom / cover no-repeat; }
@media (max-width: 600px) { .py-stage { height: auto; aspect-ratio: 3 / 4.5; max-height: 88vh; min-height: 480px; } }

/* the table: everything between the HUD and the tool bar */
.py-table { position: absolute; left: 0; right: 0; top: var(--py-hud); bottom: var(--py-bar); z-index: 1; outline: none; touch-action: none; }
.py-table:focus-visible { box-shadow: inset 0 0 0 1.5px rgba(85,214,255,.22); border-radius: 12px; }
.py-slots, .py-cards, .py-pops { position: absolute; inset: 0; }
.py-pops { pointer-events: none; z-index: 2000; }
.py-slot { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .1); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1); }
.py-slot.pyr { box-shadow: inset 0 0 0 1px rgba(242,196,109,.12); background: rgba(242,196,109,.025); }
.py-slot.waste { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.09); }
.py-slot.pile { box-shadow: inset 0 0 0 1.5px rgba(242,196,109,.16); display: grid; place-items: center; }
.py-slot.pile::after { content: ""; width: 44%; height: 34%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M20 3L37 27H3Z' fill='none' stroke='%23f2c46d' stroke-opacity='.4' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.py-slot b { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(223,233,255,.38); white-space: nowrap; }

/* the stock: a button over the stock's cards, with its count and the redeals left */
.py-stock { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); padding: 0; border: 0; border-radius: calc(var(--cw) * .1); background: transparent; cursor: pointer; z-index: 300; touch-action: none;
  color: rgba(255,255,255,.4); font: inherit; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14); }
.py-stock.has { box-shadow: none; }
.py-ico-wrap { display: contents; }
.py-stock .py-ico { width: calc(var(--cw) * .46); height: calc(var(--cw) * .46); fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: color .15s; }
.py-stock.has .py-ico { display: none; }
.py-stock.recycle { color: var(--py-cyan); box-shadow: inset 0 0 0 1.5px rgba(85,214,255,.55), 0 0 18px rgba(85,214,255,.18); }
.py-stock.done { cursor: default; }
.py-stock:focus-visible { outline: none; }
.py-stock.kb { box-shadow: 0 0 0 3px rgba(85,214,255,.95), 0 0 16px rgba(85,214,255,.5); }
.py-stock.hint { animation: py-pulse .9s ease-in-out infinite; }
.py-stock-n, .py-redeal { position: absolute; z-index: 2; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; box-sizing: border-box; pointer-events: none; }
.py-stock-n { right: -7px; bottom: -7px; background: #0b1328; color: #fff; border: 1px solid #2a3d63; }
.py-redeal { left: -7px; top: -7px; background: #0b1328; color: var(--py-cyan); border: 1px solid rgba(85,214,255,.45); display: inline-flex; align-items: center; gap: 2px; }
.py-redeal svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.py-redeal.none { color: #8aa3c4; border-color: #2a3d63; }

/* ---- cards ---- */
.py-c { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); will-change: transform; touch-action: none; cursor: default; }
.py-in { position: absolute; inset: 0; border-radius: calc(var(--cw) * .1); overflow: hidden; color: #171a22;
  background: linear-gradient(168deg, #ffffff 0%, #fbf9f3 58%, #f1ede2 100%);
  box-shadow: 0 0 0 .6px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.32), 0 3px 8px rgba(0,0,0,.18);
  transition: box-shadow .15s, filter .2s, transform .14s cubic-bezier(.3,1.4,.5,1); }
.py-c.red .py-in { color: #cc1f34; }
.py-in svg { display: block; fill: currentColor; }
.py-ix { position: absolute; left: calc(var(--cw) * .08); top: calc(var(--fs) * .14); display: flex; align-items: center; gap: calc(var(--fs) * .06); height: calc(var(--fs) * 1.06);
  font: 800 var(--fs)/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -0.04em; font-variant-numeric: lining-nums; white-space: nowrap; }
.py-ix .t { letter-spacing: -0.12em; margin-right: .06em; }
.py-ix svg { width: calc(var(--fs) * .84); height: calc(var(--fs) * .84); flex: none; }
.py-val { position: absolute; right: calc(var(--cw) * .07); top: calc(var(--fs) * .2); font: 800 calc(var(--fs) * .62)/1 system-ui, sans-serif; padding: 2px 4px; border-radius: 5px; background: rgba(23,26,34,.07); color: inherit; opacity: .8; font-variant-numeric: tabular-nums; display: none; }
.py-vals .py-val { display: block; }
.py-pip { position: absolute; left: 50%; top: 62%; width: calc(var(--cw) * .54); height: calc(var(--cw) * .54); transform: translate(-50%, -50%); }
.py-ace .py-pip { width: calc(var(--cw) * .7); height: calc(var(--cw) * .7); }
.py-ace .py-in::after { content: ""; position: absolute; left: 50%; top: 62%; width: calc(var(--cw) * .84); height: calc(var(--cw) * .84); transform: translate(-50%, -50%); border-radius: 50%; box-shadow: inset 0 0 0 1px currentColor; opacity: .22; }
.py-court { position: absolute; left: 12%; right: 12%; top: calc(var(--fs) * 1.36); bottom: 7%; border-radius: calc(var(--cw) * .07); background: linear-gradient(170deg, rgba(242,196,109,.2), rgba(242,196,109,.06)); box-shadow: inset 0 0 0 1px rgba(160,112,30,.4); }
.py-c.red .py-court { box-shadow: inset 0 0 0 1px rgba(204,31,52,.35); }
.py-court .py-emb { position: absolute; left: 50%; top: 42%; width: 70%; height: 58%; transform: translate(-50%, -50%); }
.py-court .py-cp { position: absolute; left: 50%; bottom: 6%; width: 26%; height: 22%; transform: translateX(-50%); opacity: .85; }
/* face down: the back, a triangle lattice in indigo with a gold pyramid under two stars */
.py-c.down .py-in { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 9L31 28H9Z' fill='none' stroke='%23f2c46d' stroke-width='1.7' stroke-linejoin='round'/%3E%3Cpath d='M20 9L24 28H31Z' fill='%23f2c46d' fill-opacity='.38'/%3E%3Ccircle cx='11' cy='10' r='1.2' fill='%23ffe9b8'/%3E%3Ccircle cx='30' cy='7' r='.9' fill='%23ffe9b8'/%3E%3C/svg%3E") center / 64% auto no-repeat,
    repeating-linear-gradient(60deg, rgba(255,255,255,.07) 0 1.2px, transparent 1.2px 8px), repeating-linear-gradient(-60deg, rgba(255,255,255,.07) 0 1.2px, transparent 1.2px 8px),
    radial-gradient(circle at 50% 40%, #2f47a8, #16226a 78%);
  box-shadow: 0 0 0 .6px rgba(0,0,0,.5), inset 0 0 0 calc(var(--cw) * .045) #f3efe4, inset 0 0 0 calc(var(--cw) * .062) rgba(0,0,0,.22), 0 1px 2px rgba(0,0,0,.32); }
.py-c.down .py-in > * { display: none; }
/* covered pyramid cards sit a little back; free cards are bright; the highlight shows cards that can go now */
.py-c.cov .py-in { filter: brightness(.86) saturate(.9); }
.py-c.cov .py-pip, .py-c.cov .py-court, .py-c.cov .py-val { visibility: hidden; }
.py-c.cov.py-ace .py-in::after { display: none; }
.py-c.free { cursor: pointer; }
.py-hl .py-c.can .py-in { box-shadow: 0 0 0 .6px rgba(0,0,0,.4), 0 0 0 2px rgba(85,214,255,.55), 0 0 12px rgba(85,214,255,.32), 0 3px 8px rgba(0,0,0,.2); }
.py .py-c.sel .py-in { transform: translateY(calc(var(--ch) * -.06)); box-shadow: 0 0 0 3px var(--py-gold), 0 0 18px rgba(255,209,102,.6), 0 8px 16px rgba(0,0,0,.35); }
.py .py-c.mate .py-in { box-shadow: 0 0 0 2.5px var(--py-mint), 0 0 16px rgba(124,242,180,.55), 0 3px 8px rgba(0,0,0,.2); }
.py .py-c.drop .py-in { box-shadow: 0 0 0 3.5px var(--py-mint), 0 0 22px rgba(124,242,180,.8); transform: scale(1.04); }
.py-c.hint .py-in { animation: py-pulse .9s ease-in-out infinite; }
.py-c.kb .py-in { outline: 2.5px dashed rgba(85,214,255,.95); outline-offset: 2px; }
.py-c.drag { cursor: grabbing; }
.py-c.drag .py-in { box-shadow: 0 0 0 .6px rgba(0,0,0,.3), 0 16px 30px rgba(0,0,0,.5); transform: scale(1.05) rotate(-2deg); }
.py-c.gone .py-in { filter: brightness(.9) saturate(.7); }
.py-c.bad .py-in { animation: py-shake .32s ease; }
@media (hover: hover) { .py-c.free:not(.sel):not(.drag):hover .py-in { transform: translateY(calc(var(--ch) * -.03)); } }
@keyframes py-pulse { 50% { box-shadow: 0 0 0 3px var(--py-gold), 0 0 22px 4px rgba(255,209,102,.65); } }
@keyframes py-shake { 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }

/* score pops and the row sweep */
.py-pop { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font: 900 15px/1 system-ui, sans-serif; color: #fff; text-shadow: 0 0 10px rgba(255,209,102,.9), 0 2px 4px rgba(0,0,0,.6); white-space: nowrap; animation: py-pop 1s ease-out forwards; }
.py-pop.big { font-size: 22px; color: var(--py-gold); }
.py-pop.row { color: var(--py-cyan); text-shadow: 0 0 10px rgba(85,214,255,.9), 0 2px 4px rgba(0,0,0,.6); }
@keyframes py-pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
.py-sweep { position: absolute; left: 0; height: 4px; border-radius: 4px; background: linear-gradient(90deg, transparent, rgba(85,214,255,.9), #fff, rgba(85,214,255,.9), transparent); box-shadow: 0 0 18px rgba(85,214,255,.8); animation: py-sweep .7s ease-out forwards; }
@keyframes py-sweep { from { opacity: 0; transform: scaleX(.1); } 30% { opacity: 1; } to { opacity: 0; transform: scaleX(1); } }
.py-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.py-fx.live { pointer-events: auto; cursor: pointer; }

/* HUD */
.py-hud { position: absolute; left: 0; right: 0; top: 0; height: var(--py-hud); display: flex; align-items: center; gap: 14px; padding: 0 8px 0 10px; z-index: 5; pointer-events: none; }
.py-hud > * { pointer-events: auto; }
.py-pz { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; height: 44px; padding: 2px 26px 2px 10px; border-radius: 12px;
  border: 1px solid var(--py-line); background: var(--py-glass); color: #fff; cursor: pointer; font: inherit; line-height: 1.05; touch-action: manipulation; text-align: left; transition: border-color .15s; max-width: 46vw; min-width: 96px; }
.py-pz-lv { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--py-sand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.py-pz-n { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.py-pz-dd { position: absolute; right: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: #8aa3c4; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .py-pz:hover { border-color: var(--py-cyan); } }
.py-pz:focus-visible { outline: 2px solid var(--py-cyan); outline-offset: 2px; }
.py-stat { display: flex; flex-direction: column; line-height: 1.05; flex: none; }
.py-k { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8aa3c4; }
.py-stat b { font-size: 21px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.py-score b { display: inline-block; transition: transform .16s cubic-bezier(.3,1.6,.5,1), color .16s; transform-origin: left center; }
.py-score b.pop { transform: scale(1.16); color: #ffe7a6; }
.py-time b { font-size: 17px; margin-top: 3px; color: #dfe9ff; }
.py-notimer .py-time, .py-noscore .py-score { display: none; }
.py-sp { flex: 1 1 auto; }
.py-tool { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--py-line); background: var(--py-glass);
  color: #c8d6f0; cursor: pointer; touch-action: manipulation; padding: 0; transition: border-color .15s, color .15s; }
.py-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.py-tool .spk { fill: currentColor; stroke: none; }
@media (hover: hover) { .py-tool:hover { border-color: var(--py-cyan); color: #fff; } }
.py-tool:focus-visible { outline: 2px solid var(--py-cyan); outline-offset: 2px; }
#py-sound .off { display: none; } #py-sound[aria-pressed="true"] { color: #62759a; } #py-sound[aria-pressed="true"] .on { display: none; } #py-sound[aria-pressed="true"] .off { display: inline; }
.py-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--py-gold); box-shadow: 0 0 8px var(--py-gold); }

/* the coach line: a first-game tip, a hint, or how far to undo */
.py-coach { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--py-hud) + 2px); z-index: 5; width: min(calc(100% - 16px), 560px); padding: 8px 34px 8px 12px; border-radius: 12px;
  background: rgba(8,14,32,.92); border: 1px solid rgba(85,214,255,.45); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(85,214,255,.12); font-size: 13.5px; line-height: 1.38; color: #dfe9ff; animation: py-drop .22s ease-out; }
@keyframes py-drop { from { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes py-rise { from { opacity: 0; transform: translate(-50%, 6px); } }
.py-coach b { color: var(--py-cyan); font-weight: 800; margin-right: 6px; }
.py-coach.hint { border-color: rgba(255,209,102,.6); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(255,209,102,.14); }
.py-coach.hint b { color: var(--py-gold); }
.py-coach.warn { border-color: rgba(255,159,107,.6); } .py-coach.warn b { color: #ffb38a; }
.py-coach small { display: block; color: #8aa3c4; font-size: 12px; margin-top: 2px; }
.py-coach-act:empty { display: none; }
.py-coach-act { display: flex; gap: 6px; margin-top: 7px; }
.py-coach-close { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #8aa3c4; font-size: 19px; line-height: 1; cursor: pointer; }
@media (hover: hover) { .py-coach-close:hover { color: #fff; background: rgba(255,255,255,.08); } }

/* the tool bar */
.py-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; height: calc(var(--py-bar) - 14px); z-index: 5; display: flex; gap: 6px; width: min(calc(100% - 12px), 480px); }
.py-btn { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px; border: 1px solid var(--py-line);
  background: rgba(9,15,34,.88); color: #d4def5; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; cursor: pointer; touch-action: manipulation; padding: 0 2px;
  transition: border-color .15s, color .15s, opacity .15s, background .15s, transform .08s; }
.py-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.py-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (hover: hover) { .py-btn:hover:not(:disabled) { border-color: var(--py-cyan); color: #fff; } }
.py-btn:active:not(:disabled) { transform: translateY(1px); }
.py-btn:focus-visible { outline: 2px solid var(--py-cyan); outline-offset: 2px; }
.py-btn:disabled { opacity: .36; cursor: default; }
.py-hint { color: #ffe3a3; }
@media (hover: hover) { .py-hint:hover:not(:disabled) { border-color: var(--py-gold); } }
.py-new.ready { background: var(--py-gold); color: #1a1200; border-color: var(--py-gold); box-shadow: 0 6px 22px rgba(255,209,102,.3); }
.py-btn .py-cost { position: absolute; top: 4px; right: 6px; font-size: 9.5px; font-weight: 800; color: #8aa3c4; letter-spacing: 0; }

/* short, wide stages (a phone on its side): the tool bar stands down the right-hand side */
.py-side .py-table { bottom: 8px; right: 86px; }
.py-side .py-bar { left: auto; right: 8px; top: calc(var(--py-hud) + 2px); bottom: 8px; transform: none; height: auto; width: 74px; flex-direction: column; }
.py-side .py-btn { font-size: 10.5px; gap: 1px; }
.py-side .py-toast { bottom: 14px; }
.py-side .py-coach { left: calc(50% - 39px); width: min(calc(100% - 110px), 560px); }

/* the result card: a strip over the bottom of the table */
.py-card { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 6; width: min(calc(100% - 16px), 470px); padding: 14px 14px 12px; border-radius: 18px;
  background: rgba(8,14,32,.94); border: 1px solid rgba(242,196,109,.4); box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 40px rgba(242,196,109,.12); animation: py-up .35s cubic-bezier(.2,.9,.25,1.1);
  max-height: calc(100% - var(--py-hud) - 20px); overflow: auto; overscroll-behavior: contain; touch-action: pan-y; }
@keyframes py-up { from { opacity: 0; transform: translate(-50%, 24px); } }
.py-card h2 { margin: 0; font-size: 22px; font-weight: 900; color: #fff; letter-spacing: .01em; text-transform: none; line-height: 1.15; text-shadow: 0 0 22px rgba(242,196,109,.5); }
.py-card > p, .py-card .py-sub { margin: 3px 0 0; font-size: 13px; color: #8aa3c4; line-height: 1.4; }
.py-card-top { display: flex; align-items: center; gap: 12px; }
.py-nw { white-space: nowrap; }
.py-card h3 { margin: 12px 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #8aa3c4; line-height: 1.3; }
.py-card .py-lb .py-fine { margin-top: 0 !important; }
/* the card's buttons stay in view while a long card (a daily with its board) scrolls under them */
.py-card .py-actions { position: sticky; bottom: -12px; z-index: 1; margin: 10px -14px -12px; padding: 10px 14px 12px; background: linear-gradient(rgba(8,14,32,0), rgba(8,14,32,.97) 12px); }
.py-card-top > div { flex: 1 1 auto; min-width: 0; }
.py-card-top > .py-total { flex: none; text-align: right; min-width: 0; }
.py-total span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #8aa3c4; }
.py-total b { display: block; white-space: nowrap; font-size: 30px; font-weight: 900; color: var(--py-gold); font-variant-numeric: tabular-nums; line-height: 1; text-shadow: 0 0 18px rgba(255,209,102,.45); }
.py-break { width: 100%; border-collapse: collapse; margin: 10px 0 2px; font-size: 13px; }
.py-break td { padding: 3px 2px; color: #bccbe6; border-bottom: 1px solid rgba(28,43,74,.7); }
.py-break td:last-child { text-align: right; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.py-break tr.neg td:last-child { color: #ffb38a; }
.py-break tr.sum td { border-bottom: 0; color: #fff; font-weight: 800; padding-top: 6px; }
.py-break tr.sum td:last-child { color: var(--py-gold); }
.py-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; vertical-align: middle; margin-left: 6px;
  color: #1a1200; background: linear-gradient(90deg, #ffd166, #fff1b8, #ffd166); background-size: 200% 100%; animation: py-shine 1.6s linear infinite; box-shadow: 0 0 18px rgba(255,209,102,.5); }
@keyframes py-shine { to { background-position: -200% 0; } }

/* panels */
.py-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 8; overflow: auto; touch-action: pan-y;
  background: radial-gradient(ellipse at center, rgba(4,7,18,.55), rgba(3,5,12,.88)); animation: py-fade .18s ease-out; }
.py-panel { position: relative; width: min(100%, 440px); margin: auto; padding: 20px 18px 18px; border: 1px solid var(--py-line); border-radius: 18px; text-align: left; outline: none;
  background: rgba(8,14,32,.96); box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(85,214,255,.05) inset; animation: py-in .26s cubic-bezier(.2,.9,.25,1.1); }
.py-panel.wide { width: min(100%, 580px); }
@keyframes py-in { from { opacity: 0; transform: scale(.95) translateY(8px); } }
@keyframes py-fade { from { opacity: 0; } }
.py-panel h2 { margin: 0 36px 12px 0; font-size: 20px; font-weight: 900; color: #fff; letter-spacing: .01em; text-transform: none; line-height: 1.25; }
.py-panel h3 { margin: 16px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #8aa3c4; }
.py-panel p, .py-panel li { font-size: 13.5px; line-height: 1.5; color: #bccbe6; }
.py-panel p { margin: 0 0 8px; }
.py-panel ul { margin: 0 0 8px; padding-left: 18px; }
.py-panel kbd { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 5px; border: 1px solid #2c3d66; background: #0b1328; color: #fff; font: 700 12px/1.6 system-ui, sans-serif; text-align: center; }
.py-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255,255,255,.07); color: #d4def5; cursor: pointer; padding: 0; z-index: 2; }
.py-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .py-x:hover { background: rgba(255,255,255,.14); color: #fff; } }
.py-x:focus-visible { outline: 2px solid var(--py-cyan); outline-offset: 2px; }
.py-fine { font-size: 12px !important; color: #6f88aa !important; margin: 8px 0 0 !important; }
.py-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.py-row { display: flex; gap: 8px; } .py-row > * { flex: 1 1 0; }
.py-b { font: inherit; font-weight: 700; font-size: 14.5px; padding: 10px 14px; min-height: 46px; border-radius: 12px; cursor: pointer; touch-action: manipulation; text-decoration: none;
  border: 1px solid var(--py-line); background: #0b1328; color: #dfe9ff; transition: background .15s, border-color .15s, transform .1s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (hover: hover) { .py-b:hover:not(:disabled) { border-color: var(--py-cyan); } }
.py-b:active:not(:disabled) { transform: translateY(1px); }
.py-b:disabled { opacity: .45; cursor: default; }
.py-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.py-b svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.py-b span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.py-b-primary { background: var(--py-gold); color: #1a1200; border-color: var(--py-gold); font-size: 15.5px; font-weight: 800; box-shadow: 0 6px 22px rgba(255,209,102,.25); }
@media (hover: hover) { .py-b-primary:hover:not(:disabled) { background: #ffe08a; border-color: #ffe08a; } }
.py-b-sm { min-height: 38px; padding: 6px 10px; font-size: 13px; }
.py-coach .py-b { min-height: 34px; padding: 4px 12px; font-size: 13px; }

/* the hub: every way to play */
.py-hubs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.py-hubc { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 96px; padding: 12px 12px 10px; border-radius: 15px; border: 1px solid var(--py-line);
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--hc) 20%, transparent), transparent 62%), #070d1f; color: #dfe9ff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color .15s, transform .1s; overflow: hidden; }
.py-hubc.big { grid-column: 1 / -1; min-height: 100px; }
.py-hubc svg { width: 28px; height: 28px; fill: none; stroke: var(--hc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 2px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hc) 60%, transparent)); }
.py-hubc b { font-size: 15.5px; color: #fff; }
.py-hubc small { font-size: 12px; color: #8aa3c4; line-height: 1.35; }
.py-hubc em { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--hc); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .py-hubc:hover { border-color: var(--hc); } }
.py-hubc:active { transform: translateY(1px); }
.py-hubc:focus-visible { outline: 2px solid var(--hc); outline-offset: 2px; }
.py-dealno { display: flex; gap: 8px; margin-top: 6px; }
.py-dealno input { flex: 1 1 auto; min-width: 0; min-height: 42px; background: #050a18; color: #fff; border: 1px solid #2a3d63; border-radius: 10px; padding: 0 12px; font: 800 16px system-ui, sans-serif; font-variant-numeric: tabular-nums; -webkit-user-select: text; user-select: text; }
.py-dealno input:focus { outline: none; border-color: var(--py-cyan); box-shadow: 0 0 0 3px rgba(85,214,255,.2); }
.py-dealno input::placeholder { font-weight: 600; font-size: 14px; color: #62759a; }
.py-dealno .py-b { min-height: 42px; flex: 0 0 auto; }

/* stats */
.py-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 4px; }
.py-stats.three { grid-template-columns: repeat(3, 1fr); }
.py-stats div { display: flex; flex-direction: column; justify-content: space-between; padding: 8px 4px; border-radius: 10px; background: #070d1f; border: 1px solid #15213d; text-align: center; min-width: 0; }
.py-stats span { display: block; font-size: 9.5px; line-height: 1.25; letter-spacing: .12em; text-transform: uppercase; color: #6f88aa; font-weight: 800; overflow-wrap: anywhere; }
.py-stats b { display: block; margin-top: 2px; font-size: 17px; color: #dfe9ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.py-stats .gold b { color: var(--py-gold); } .py-stats .ok b { color: var(--py-mint); } .py-stats .cy b { color: var(--py-cyan); }
.py-table2 { width: 100%; border-collapse: collapse; font-size: 13px; }
.py-table2 th, .py-table2 td { padding: 6px 4px; text-align: right; border-bottom: 1px solid #15213d; font-variant-numeric: tabular-nums; }
.py-table2 th:first-child, .py-table2 td:first-child { text-align: left; }
.py-table2 thead th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6f88aa; }
.py-table2 tbody th { color: #fff; font-weight: 700; }
.py-table2 td { color: #d4def5; }
.py-table2 td.pos { color: var(--py-mint); font-weight: 800; } .py-table2 td.neg { color: #ffb38a; font-weight: 800; }
.py-lb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.py-lb li { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: #070d1f; font-size: 13px; }
.py-lb li span { color: #6f88aa; font-weight: 800; font-variant-numeric: tabular-nums; }
.py-lb li b { color: #dfe9ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.py-lb li em { font-style: normal; color: var(--py-gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.py-lb li i { font-style: normal; color: #8aa3c4; font-variant-numeric: tabular-nums; font-size: 12px; }
.py-lb li.me { background: rgba(85,214,255,.12); box-shadow: inset 0 0 0 1px rgba(85,214,255,.4); }

/* calendar */
.py-cal-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.py-cal-head b { flex: 1 1 auto; text-align: center; color: #fff; font-size: 15px; }
.py-step { width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid #22345a; background: #0b1328; color: #dfe9ff; cursor: pointer; }
.py-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.py-step:disabled { opacity: .35; cursor: default; }
.py-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.py-cal-w { text-align: center; font-size: 10.5px; font-weight: 800; color: #6f88aa; padding: 2px 0; }
.py-cal-d { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1px solid #15213d; background: #070d1f; color: #d4def5; font: 700 13px system-ui, sans-serif; cursor: pointer; padding: 0; }
.py-cal-d.off { opacity: .28; cursor: default; }
.py-cal-d.ok { background: rgba(255,209,102,.13); border-color: rgba(255,209,102,.55); color: var(--py-gold); }
.py-cal-d.ok::after { content: ""; position: absolute; bottom: 4px; left: 50%; width: 10px; height: 6px; margin-left: -5px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M5 0L10 6H0Z' fill='%23ffd166'/%3E%3C/svg%3E") center / contain no-repeat; }
.py-cal-d.tried { border-color: rgba(138,163,196,.45); color: #8aa3c4; }
.py-cal-d.today { box-shadow: 0 0 0 2px var(--py-cyan), 0 0 14px rgba(85,214,255,.4); }
.py-cal-pad { aspect-ratio: 1; }
@media (hover: hover) { .py-cal-d:not(.off):hover { border-color: var(--py-cyan); } }
.py-cal-d:focus-visible { outline: 2px solid var(--py-cyan); outline-offset: 1px; }

/* settings, tabs, help */
.py-set { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #15213d; cursor: pointer; }
.py-set > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .py-set b { font-size: 14px; color: #fff; } .py-set small { font-size: 12px; color: #8aa3c4; line-height: 1.35; }
.py-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.py-sw { position: relative; width: 46px; height: 27px; flex: none; border-radius: 14px; border: 1px solid #22345a; background: #0b1328; transition: background .15s, border-color .15s; }
.py-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #62759a; transition: transform .15s, background .15s; }
.py-set input:checked + .py-sw { background: #3a2f10; border-color: var(--py-gold); }
.py-set input:checked + .py-sw::after { transform: translateX(19px); background: var(--py-gold); box-shadow: 0 0 10px rgba(255,209,102,.7); }
.py-set input:focus-visible + .py-sw { outline: 2px solid var(--py-cyan); outline-offset: 2px; }
.py-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #15213d; }
.py-opt > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .py-opt b { font-size: 14px; color: #fff; } .py-opt small { font-size: 12px; color: #8aa3c4; }
.py-seg { display: inline-flex; flex: none; margin-left: auto; gap: 3px; padding: 3px; border-radius: 11px; background: #070d1f; border: 1px solid var(--py-line); }
.py-seg button { min-height: 34px; min-width: 40px; border: 0; border-radius: 8px; background: transparent; color: #8aa3c4; font: 700 13px system-ui, sans-serif; padding: 0 10px; cursor: pointer; touch-action: manipulation; white-space: nowrap; }
.py-seg button[aria-checked="true"] { background: #1c2b4a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,209,102,.5); }
.py-seg button:disabled { opacity: .35; cursor: default; }
.py-seg button:focus-visible { outline: 2px solid var(--py-cyan); outline-offset: 1px; }
.py-note { font-size: 12px; color: #ffb38a; margin: 6px 0 0; min-height: 0; }
.py-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: #070d1f; border: 1px solid var(--py-line); margin: 0 0 12px; }
.py-tab { font: inherit; font-size: 13px; font-weight: 700; color: #8aa3c4; background: transparent; border: 0; border-radius: 9px; min-height: 38px; cursor: pointer; padding: 0 2px; white-space: nowrap; }
.py-tab[aria-selected="true"] { background: #1c2b4a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,209,102,.45); }
.py-tab:focus-visible { outline: 2px solid var(--py-cyan); outline-offset: 1px; }
.py-pairs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 8px 0 10px; }
.py-pairs div { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 10px; background: #070d1f; border: 1px solid #15213d; font: 800 14px/1.1 system-ui, sans-serif; color: #fff; font-variant-numeric: tabular-nums; }
.py-pairs div i { font-style: normal; font-size: 10px; color: #6f88aa; }
.py-pairs div.k { border-color: rgba(255,209,102,.45); color: var(--py-gold); }
.py-mini { display: flex; gap: 10px; align-items: center; margin: 4px 0 10px; }
.py-mini svg { width: 96px; height: 64px; flex: none; }

.py-toast { position: absolute; left: 50%; bottom: calc(var(--py-bar) + 10px); transform: translateX(-50%); z-index: 9; padding: 8px 16px; border-radius: 18px; background: #eef3fb; color: #07101f; font-size: 13px; font-weight: 800; line-height: 1.3; text-align: center; animation: py-rise .2s ease-out; pointer-events: none; width: max-content; max-width: calc(100% - 32px); box-sizing: border-box; text-wrap: balance; }
.py-banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 7; text-align: center; pointer-events: none; animation: py-banner 1.5s ease-out forwards; }
.py-banner b { display: block; font-size: clamp(24px, 6vw, 40px); font-weight: 900; color: #fff; text-shadow: 0 0 26px rgba(255,209,102,.8), 0 3px 8px rgba(0,0,0,.6); letter-spacing: .01em; white-space: nowrap; }
.py-banner span { display: inline-block; margin-top: 6px; padding: 3px 12px; border-radius: 999px; background: rgba(8,14,32,.8); box-shadow: 0 4px 14px rgba(0,0,0,.35); font-size: 15px; font-weight: 800; color: var(--py-gold); text-shadow: 0 2px 6px rgba(0,0,0,.6); }
@keyframes py-banner { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.8); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -56%) scale(1); } }
.py-loading { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(3,6,14,.45); color: #d4def5; font-size: 14px; pointer-events: none; }
.py-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,209,102,.2); border-top-color: var(--py-gold); animation: py-rot .9s linear infinite; }
@keyframes py-rot { to { transform: rotate(360deg); } }
.py-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.py-help { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.py-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .py-help .hint-kb { display: none; } .py-help .hint-touch { display: inline; } }
.stage .py-help { padding: 10px 14px 12px; }

/* narrow phones */
@media (max-width: 560px) { .py-hud { gap: 10px; } }
@media (max-width: 460px) {
  .py { --py-hud: 54px; --py-bar: 62px; }
  .py-hud { gap: 9px; padding-left: 8px; padding-right: 6px; }
  .py-pz { padding-right: 22px; padding-left: 8px; min-width: 0; }
  .py-pz-n { font-size: 15.5px; }
  .py-stat b { font-size: 19px; }
  .py-time b { font-size: 14px; }
  .py-tool { width: 36px; height: 36px; border-radius: 11px; }
  .py-btn { font-size: 10.5px; border-radius: 12px; }
  .py-panel { padding: 18px 14px 14px; }
  .py-stats b { font-size: 15px; }
  .py-tab { font-size: 12px; }
  .py-pop { font-size: 13px; } .py-pop.big { font-size: 18px; }
  .py-coach { font-size: 12.5px; padding: 6px 32px 7px 10px; line-height: 1.32; }
  .py-coach small { font-size: 11.5px; }
}
@media (max-width: 400px) { .py-time { display: none; } .py-opt { flex-wrap: wrap; } }
@media (max-width: 370px) { #py-sound { display: none; } }

/* full screen: the table takes every pixel */
.stage.is-immersive .stage-body > .py { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .py-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.stage.is-immersive .py-help { display: none; }
@media (prefers-reduced-motion: reduce) { .py-panel, .py-toast, .py-coach, .py-overlay, .py-card, .py-banner { animation: none; } .py-tag { animation: none; } .py-score b, .py-in { transition: none; } .py-c.hint .py-in, .py-stock.hint { animation: none; box-shadow: 0 0 0 3px var(--py-gold), 0 0 16px rgba(255,209,102,.6); } }
.py-calm .py-panel, .py-calm .py-toast, .py-calm .py-coach, .py-calm .py-overlay, .py-calm .py-card { animation: none; } .py-calm .py-in { transition: none; }
.py-calm .py-c.hint .py-in, .py-calm .py-stock.hint { animation: none; box-shadow: 0 0 0 3px var(--py-gold), 0 0 16px rgba(255,209,102,.6); }
