/* The free Pokémon TCG game (/play-tcg/): the front door (deck picker, about), and the table, a full-screen playmat.
   Sizes on the table come from fit() in table.js: --u Active card width, --b your Bench, --ob their Bench, --hc hand. */

:root {
  --tt-ink: #070a1c;
  --tt-mat: #0d1230;
  --tt-mat-2: #141a44;
  --tt-line: rgba(140, 160, 255, 0.14);
  --tt-glass: rgba(10, 14, 38, 0.72);
  --tt-gold: #f5c542;
  --tt-gold-2: #ffdf7e;
  --tt-hp: #46d38a;
  --tt-hp-mid: #f5b342;
  --tt-hp-low: #ff5a5a;
  --tt-dmg: #ff6b57;
  --tt-you: #f5c542;
  --tt-them: #7aa2ff;
  --tt-ease: cubic-bezier(.2, .9, .3, 1);
  --tt-pop: cubic-bezier(.2, 1.5, .4, 1);
}

/* ---------- Front door ---------- */
.pt-hero { position: relative; overflow: hidden; padding: 40px 0 28px; }
.pt-hero::before {
  content: ''; position: absolute; inset: -20% -10% auto; height: 520px; pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 70% 30%, rgba(122, 162, 255, .18), transparent 70%),
    radial-gradient(ellipse 40% 50% at 20% 20%, rgba(245, 197, 66, .14), transparent 70%);
}
.pt-hero .wrap { position: relative; }
.pt-eyebrow { display: inline-flex; gap: 8px; align-items: center; font: 600 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--tt-gold); }
.pt-eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tt-hp); box-shadow: 0 0 0 4px rgba(70, 211, 138, .18); }
.pt-hero h1 { font-family: var(--pixel); font-size: clamp(32px, 6vw, 56px); line-height: 1.04; margin: 14px 0 12px; letter-spacing: -.01em; max-width: 14ch; }
.pt-hero h1 em { font-style: normal; color: var(--tt-gold); }
.pt-lead { color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); max-width: 56ch; margin: 0 0 22px; }
.pt-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; color: var(--text); font-size: 14px; }
.pt-facts li { display: flex; gap: 8px; align-items: center; }
.pt-facts li::before { content: '✓'; color: var(--tt-hp); font-weight: 700; }

.pt-picker { padding: 8px 0 40px; }
.pt-continue {
  display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(245, 197, 66, .16), rgba(245, 197, 66, .04)); border: 1px solid rgba(245, 197, 66, .35);
}
.pt-continue b { display: block; font-family: var(--pixel); font-size: 18px; }
.pt-continue span { color: var(--muted); font-size: 14px; }
.pt-continue .pt-btn { margin-left: auto; }
.pt-step { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.pt-step h2 { font-family: var(--pixel); font-size: 22px; margin: 0; }
.pt-step span { color: var(--muted); font-size: 14px; }
.pt-decks {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 172px); gap: 12px; overflow-x: auto; padding: 4px 2px 14px;
  scroll-snap-type: x mandatory; scrollbar-width: thin; margin: 0 -16px 22px; padding-left: 16px; padding-right: 16px;
}
.pt-deck {
  position: relative; scroll-snap-align: start; border: 0; padding: 0; text-align: left; color: var(--text); cursor: pointer;
  border-radius: 16px; background: var(--card); overflow: hidden; aspect-ratio: 3 / 4.1;
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px rgba(0, 0, 0, .35); transition: transform .2s var(--tt-ease), box-shadow .2s;
}
.pt-deck:hover { transform: translateY(-3px); }
.pt-deck[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--tt-gold), 0 14px 30px rgba(245, 197, 66, .25); }
.pt-deck-art { position: absolute; inset: 0; background-size: 180%; background-position: 50% 22%; filter: saturate(1.1); }
.pt-deck::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 13, 34, 0) 35%, rgba(10, 13, 34, .92) 78%); }
.pt-deck-txt { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1; }
.pt-deck-txt b { display: block; font-family: var(--pixel); font-size: 17px; line-height: 1.15; }
.pt-deck-txt small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.pt-deck .pt-share { position: absolute; top: 10px; left: 10px; z-index: 1; font: 700 11px/1 var(--body); padding: 5px 8px; border-radius: 99px; background: rgba(7, 10, 28, .78); color: var(--tt-gold); }
.pt-deck .pt-tick { position: absolute; top: 10px; right: 10px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tt-gold); color: #1a1500; font-weight: 800; transform: scale(0); transition: transform .25s var(--tt-pop); }
.pt-deck[aria-pressed='true'] .pt-tick { transform: scale(1); }
.pt-deck-random .pt-deck-art { background: radial-gradient(circle at 50% 40%, #2b3378, #141a44 70%); display: grid; place-items: center; font-size: 54px; }
.pt-deck-random .pt-deck-art::before { content: '?'; font-family: var(--pixel); font-size: 72px; color: rgba(245, 197, 66, .9); text-shadow: 0 6px 30px rgba(245, 197, 66, .35); }
.pt-deck-own .pt-deck-art { background: linear-gradient(160deg, #2a2f5c, #171c42); }
.pt-go { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.pt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer; text-decoration: none;
  font: 700 18px/1 var(--pixel); color: #1d1600; background: linear-gradient(180deg, #ffd766, #f5b92e); border-radius: 14px;
  padding: 16px 30px; box-shadow: 0 2px 0 #b98712, 0 12px 26px rgba(245, 185, 46, .28); transition: transform .15s, box-shadow .15s;
}
.pt-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 #b98712, 0 16px 30px rgba(245, 185, 46, .34); }
.pt-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #b98712, 0 6px 14px rgba(245, 185, 46, .3); }
.pt-btn.ghost { color: var(--text); background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line); }
.pt-btn.sm { font-size: 15px; padding: 11px 18px; border-radius: 12px; }
.pt-vs { color: var(--muted); font-size: 14px; }
.pt-vs b { color: var(--text); }

.pt-about { padding: 34px 0 10px; border-top: 1px solid var(--line); }
.pt-about h2 { font-family: var(--pixel); font-size: 26px; margin: 0 0 14px; }
.pt-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 26px; }
.pt-col { padding: 18px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.pt-col h3 { margin: 0 0 6px; font-size: 17px; }
.pt-col p { margin: 0; color: var(--muted); font-size: 15px; }
.pt-col .ico { font-size: 22px; display: block; margin-bottom: 8px; }
.pt-faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.pt-faq summary { cursor: pointer; font-weight: 600; }
.pt-faq p { color: var(--muted); margin: 8px 0 0; }

/* ---------- The table ---------- */
body.tt-on { overflow: hidden; }
body.tt-on > :not(.tt):not(script):not(dialog) { visibility: hidden; }
.tt {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; color: var(--text); overflow: hidden; overflow: clip; /* clip: a focused card can't scroll the table */
  background: var(--tt-ink); font-family: var(--body); user-select: none; -webkit-user-select: none; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.tt-mat {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 38% at 50% 50%, rgba(245, 197, 66, .07), transparent 70%),
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(122, 162, 255, .16), transparent 70%),
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(245, 197, 66, .10), transparent 70%),
    linear-gradient(180deg, #10163d 0%, var(--tt-mat) 48%, var(--tt-mat) 52%, #121638 100%);
}
.tt-mat::before {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(160, 180, 255, .09) 1px, transparent 1.2px); background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 85%);
}
.tt-mat::after { /* the centre line of the mat */
  content: ''; position: absolute; left: 6%; right: 6%; top: var(--mid, 50%); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 197, 66, .35), transparent);
}

/* Top bar */
.tt-bar { position: relative; z-index: 6; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 8px; flex: none; }
.tt-ib {
  width: 38px; height: 38px; border-radius: 12px; border: 0; display: grid; place-items: center; cursor: pointer; color: var(--text);
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); font-size: 17px; flex: none;
}
.tt-ib:disabled { opacity: .35; cursor: default; }
.tt-ib svg { width: 19px; height: 19px; }
.tt-who { flex: 1; min-width: 0; text-align: center; line-height: 1.1; }
.tt-who b { display: block; font-family: var(--pixel); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-who small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* A side of the table */
.tt-board { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: safe center; gap: var(--gap, 8px); min-height: 0; }
.tt-side { display: flex; flex-direction: column; align-items: center; gap: var(--gap, 8px); padding: 0; } /* site.css pads every section */
.tt-them { flex-direction: column; }
.tt-you { flex-direction: column-reverse; }
.tt-front { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; padding: 0 10px; gap: 10px; }
.tt-bench { display: flex; justify-content: center; gap: calc(var(--b) * .1); min-height: calc(var(--b) * 1.4 + 14px); }
.tt-them .tt-bench { gap: calc(var(--ob) * .1); min-height: calc(var(--ob) * 1.4 + 12px); }
.tt-slot { position: relative; width: var(--b); height: calc(var(--b) * 1.4); border-radius: calc(var(--b) * .07); flex: none; }
.tt-them .tt-slot { width: var(--ob); height: calc(var(--ob) * 1.4); }
.tt-slot.vacant { box-shadow: inset 0 0 0 1px rgba(140, 160, 255, .09); background: rgba(120, 140, 255, .025); }
.tt-activeslot { position: relative; width: var(--u); height: calc(var(--u) * 1.4); border-radius: calc(var(--u) * .06); }
.tt-activeslot.vacant { box-shadow: inset 0 0 0 1px var(--tt-line); background: rgba(120, 140, 255, .04); }
.tt-activeslot::before { /* a soft spotlight under the Active Pokémon */
  content: ''; position: absolute; inset: -18% -30%; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(245, 197, 66, .13), transparent);
}
.tt-them .tt-activeslot::before { background: radial-gradient(closest-side, rgba(122, 162, 255, .16), transparent); }

/* Prize cards (left) and deck + discard pile (right) beside the Active Spot */
.tt-prizes { justify-self: end; display: grid; grid-template-columns: repeat(2, calc(var(--p) * 1)); gap: 4px; }
.tt-prize { width: var(--p); height: calc(var(--p) * 1.4); border-radius: 4px; }
.tt-prize.gone { opacity: 0; transform: scale(.6); }
.tt-piles { justify-self: start; display: flex; flex-direction: column; gap: 8px; }
.tt-pile { position: relative; width: calc(var(--p) * 1.35); height: calc(var(--p) * 1.35 * 1.4); border-radius: 6px; cursor: pointer; border: 0; padding: 0; background: none; }
.tt-pile.deck .tt-back { position: absolute; inset: 0; }
.tt-pile.deck .tt-back:nth-child(2) { transform: translate(-2px, -2px); }
.tt-pile.deck .tt-back:nth-child(3) { transform: translate(-4px, -4px); }
.tt-pile.discard { box-shadow: inset 0 0 0 1px var(--tt-line); }
.tt-pile.discard img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; opacity: .85; }
.tt-pile b {
  position: absolute; right: -6px; bottom: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center;
  font: 700 11.5px/1 var(--body); background: #0b0f26; color: var(--text); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); z-index: 2;
}
.tt-them .tt-prizes { order: 3; justify-self: start; }
.tt-them .tt-piles { order: 1; justify-self: end; flex-direction: column-reverse; }
.tt-them .tt-activeslot { order: 2; }

/* Our own card back (not the official one): navy, gold frame, the PlayerBase mark. */
.tt-back {
  display: block; width: 100%; height: 100%; border-radius: inherit;
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 197, 66, .55) 0 9%, transparent 9.5%),
    radial-gradient(circle at 50% 50%, #0d1130 0 15%, transparent 15.5%),
    radial-gradient(circle at 50% 50%, rgba(245, 197, 66, .8) 0 17%, transparent 17.5%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .035) 0 3px, transparent 3px 8px),
    linear-gradient(160deg, #2b3277, #151a45 60%, #0f1336);
  box-shadow: inset 0 0 0 2px rgba(245, 197, 66, .75), inset 0 0 0 4px #0f1336, 0 2px 6px rgba(0, 0, 0, .4);
}

/* Their hand: a little fan of backs under the top bar */
.tt-theirhand { display: flex; justify-content: center; height: 22px; margin-top: -4px; }
.tt-theirhand i { width: 16px; height: 22px; margin: 0 -4px; border-radius: 3px; display: block; transform: rotate(var(--r)) translateY(var(--y)); }
.tt-theirhand i .tt-back { border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .7), 0 1px 3px rgba(0, 0, 0, .5); }

/* A Pokémon in play */
.mon { position: absolute; inset: 0; cursor: pointer; transform-origin: 50% 50%; }
.mon-card {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: #1b2050;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .06); transition: transform .45s var(--tt-ease), filter .3s;
}
.tt-slot .mon, .tt-activeslot .mon { border-radius: inherit; }
.mon-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mon-card .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 6px; text-align: center; font: 700 11px/1.2 var(--body); }
.mon.ex .mon-card { box-shadow: 0 6px 14px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 223, 126, .35); }
/* Special Conditions turn the card, as on a real table: Asleep left, Paralyzed right, Confused upside down. */
.mon.asleep .mon-card { transform: rotate(-90deg) scale(.72); }
.mon.paralyzed .mon-card { transform: rotate(90deg) scale(.72); }
.mon.confused .mon-card { transform: rotate(180deg); }
.mon-hp {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 0;
  min-width: 54%; height: 19px; padding: 0 7px; border-radius: 99px; background: rgba(6, 9, 26, .92); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 3px 8px rgba(0, 0, 0, .4);
  overflow: hidden;
}
.mon-hp i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(70, 211, 138, .45), rgba(70, 211, 138, .25)); transition: width .6s var(--tt-ease); }
.mon-hp b { position: relative; margin: 0 auto; font: 800 12px/1 var(--body); color: #e9fff3; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.mon-hp b small { font-weight: 600; opacity: .55; font-size: 10px; }
.mon.mid .mon-hp i { background: linear-gradient(90deg, rgba(245, 179, 66, .55), rgba(245, 179, 66, .3)); }
.mon.low .mon-hp i { background: linear-gradient(90deg, rgba(255, 90, 90, .6), rgba(255, 90, 90, .35)); }
.mon.low .mon-hp b { color: #ffe1e1; }
.tt-slot .mon-hp, .tt-them .mon-hp { height: 17px; bottom: -8px; padding: 0 5px; }
.tt-slot .mon-hp b { font-size: 11px; }
.tt-slot .mon-hp b small { display: none; }
.mon-dmg {
  position: absolute; top: 8%; right: -7px; z-index: 3; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center;
  font: 800 12.5px/1 var(--body); color: #fff; background: radial-gradient(circle at 35% 30%, #ff8a6a, #e03c2c); box-shadow: 0 0 0 2px #2a0d0b, 0 3px 8px rgba(0, 0, 0, .5);
}
.tt-slot .mon-dmg { min-width: 22px; height: 22px; font-size: 10.5px; right: -6px; }
.mon-energy { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; flex-wrap: wrap-reverse; justify-content: center; gap: 2px; width: 112%; z-index: 2; pointer-events: none; }
.tt-slot .mon-energy { bottom: 10px; }
.mon-tool { position: absolute; left: -6px; top: 26%; z-index: 3; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: #f0f2ff; color: #1a1f4a; font-size: 12px; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.mon-tool svg { width: 14px; height: 14px; }
.mon-cond { position: absolute; left: -5px; top: -7px; z-index: 3; display: flex; flex-direction: column; gap: 2px; }
.mon-cond em { font: 800 9px/1 var(--body); font-style: normal; letter-spacing: .04em; padding: 4px 5px; border-radius: 6px; color: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .4); }
.mon.pick .mon-card { box-shadow: 0 0 0 3px var(--tt-gold), 0 0 26px rgba(245, 197, 66, .55); animation: tt-pulse 1.3s ease-in-out infinite; }
.mon.picked .mon-card { box-shadow: 0 0 0 4px #fff, 0 0 30px rgba(255, 255, 255, .6); animation: none; }
.mon.drop .mon-card { box-shadow: 0 0 0 4px var(--tt-hp), 0 0 32px rgba(70, 211, 138, .6); }
.mon.sel .mon-card { box-shadow: 0 0 0 3px #fff, 0 10px 26px rgba(0, 0, 0, .5); }
.mon .tt-add { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; pointer-events: none; }
.mon .tt-add b { font: 800 18px/1 var(--pixel); padding: 7px 10px; border-radius: 12px; background: rgba(224, 60, 44, .95); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
@keyframes tt-pulse { 50% { box-shadow: 0 0 0 3px var(--tt-gold-2), 0 0 34px rgba(245, 197, 66, .8); } }

/* Energy icons: our own glyphs in each type's colour */
.en { width: var(--en, 16px); height: var(--en, 16px); border-radius: 50%; display: inline-grid; place-items: center; flex: none; box-shadow: 0 0 0 1.5px rgba(6, 9, 26, .9), 0 1px 3px rgba(0, 0, 0, .5); }
.en svg { width: 64%; height: 64%; }
.tt-slot .en { --en: 13px; }
.tt-them .tt-slot .en { --en: 12px; }

/* The middle line: Stadium, turn, speed */
.tt-mid { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 0 10px; min-height: 34px; }
.tt-stadium { grid-column: 1; justify-self: start; display: flex; align-items: center; gap: 8px; max-width: 100%; border: 0; background: none; color: inherit; padding: 0; cursor: pointer; min-width: 0; }
.tt-stadium img { width: 26px; height: 36px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); flex: none; }
.tt-stadium span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; line-height: 1.15; }
.tt-turn {
  grid-column: 2; display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; font: 700 13px/1 var(--pixel); white-space: nowrap;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); color: var(--muted); transition: all .35s;
}
.tt-turn i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tt[data-phase='you'] .tt-turn { color: #241b00; background: linear-gradient(180deg, #ffd766, #f5b92e); box-shadow: 0 6px 20px rgba(245, 185, 46, .35); }
.tt[data-phase='them'] .tt-turn { color: #dfe7ff; background: rgba(122, 162, 255, .18); box-shadow: inset 0 0 0 1px rgba(122, 162, 255, .4); }
.tt[data-phase='them'] .tt-turn i { animation: tt-blink 1s ease-in-out infinite; }
@keyframes tt-blink { 50% { opacity: .25; } }
.tt-ff { grid-column: 3; justify-self: end; height: 32px; padding: 0 12px; border-radius: 99px; border: 0; cursor: pointer; font: 700 12.5px/1 var(--body); color: var(--text); background: rgba(122, 162, 255, .16); box-shadow: inset 0 0 0 1px rgba(122, 162, 255, .35); display: inline-flex; align-items: center; gap: 6px; }
.tt-ff[aria-pressed='true'] { background: rgba(122, 162, 255, .35); }

/* Your hand */
.tt-handzone { position: relative; z-index: 5; flex: none; height: var(--hz); }
.tt-hand { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; }
.hc {
  touch-action: none; position: absolute; bottom: calc(var(--hz) - var(--hc) * 1.4 - 2px); left: 0; width: var(--hc); height: calc(var(--hc) * 1.4); border-radius: calc(var(--hc) * .055);
  border: 0; padding: 0; cursor: pointer; background: #1b2050; transform-origin: 50% 120%;
  transition: transform .32s var(--tt-ease), filter .25s, box-shadow .25s; box-shadow: 0 -2px 12px rgba(0, 0, 0, .45);
}
.hc img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; pointer-events: none; }
.hc .noimg { position: absolute; inset: 0; display: grid; place-items: center; font: 700 11px/1.2 var(--body); color: var(--text); padding: 6px; }
.tt[data-phase='you'] .hc:not(.can) { filter: brightness(.55) saturate(.6); }
.tt[data-phase='you'] .hc.can { box-shadow: 0 0 0 2px rgba(245, 197, 66, .85), 0 -2px 16px rgba(245, 197, 66, .35); }
.hc.on { z-index: 50; filter: none !important; box-shadow: 0 0 0 3px var(--tt-gold-2), 0 0 24px rgba(245, 197, 66, .55), 0 10px 30px rgba(0, 0, 0, .6) !important; }
.hc.dragging { opacity: .25; }
.hc em { position: absolute; top: 4px; left: 4px; font: 800 11px/1 var(--body); font-style: normal; padding: 3px 5px; border-radius: 5px; background: rgba(0, 0, 0, .75); color: var(--tt-gold); }
.tt-ghost { position: fixed; z-index: 400; pointer-events: none; border-radius: 8px; box-shadow: 0 20px 40px rgba(0, 0, 0, .6), 0 0 0 2px var(--tt-gold); transform: translate(-50%, -60%) rotate(-3deg) scale(1.08); }
.tt-ghost img { width: 100%; height: 100%; border-radius: 8px; display: block; }
.tt-benchdrop { position: absolute; z-index: 1; border-radius: 14px; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(70, 211, 138, .7); background: rgba(70, 211, 138, .08); opacity: 0; transition: opacity .2s; }
.tt-benchdrop.on { opacity: 1; }

/* The bar above the hand: what's happening, what to do */
.tt-act { position: relative; z-index: 6; flex: none; height: 52px; }
.tt-act-in { position: absolute; top: 0; left: 0; right: 0; min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 4px 10px; }
/* Many buttons on a narrow screen: message on its own line, buttons under it, on a panel over the top of the hand */
.tt-act.stack .tt-act-in {
  flex-wrap: wrap; row-gap: 8px; padding: 8px 10px 10px; border-radius: 0 0 16px 16px;
  background: rgba(14, 19, 50, .97); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 16px 30px rgba(0, 0, 0, .55);
}
.tt-act.busy .tt-acts { opacity: .3; pointer-events: none; transition: opacity .2s .12s; }
.tt-act.stack .tt-msg { flex: 1 0 100%; }
.tt-act.stack .tt-acts { flex: 1 0 100%; flex-wrap: nowrap; }
.tt-act.stack .tt-b { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
@media (max-width: 360px) {
  .tt-b { height: 38px; padding: 0 12px; font-size: 13.5px; }
  .tt-act.stack .tt-acts { gap: 4px; }
  .tt-act.stack .tt-b { padding: 0 6px; font-size: 12.5px; }
  .tt-act.stack .tt-msg small { display: none; } /* the smallest phones: the title says what to do */
}
.tt-msg { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.3; color: var(--text); }
.tt-msg b { font-family: var(--pixel); font-weight: 600; }
.tt-msg small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 12px; }
.tt-msg .tt-thumb { float: left; width: 30px; height: 42px; object-fit: cover; border-radius: 4px; margin: 1px 9px 0 0; box-shadow: 0 0 0 2px var(--tt-gold), 0 4px 10px rgba(0, 0, 0, .5); }
.tt-acts { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.tt-b {
  height: 40px; padding: 0 16px; border-radius: 12px; border: 0; cursor: pointer; white-space: nowrap; font: 700 14.5px/1 var(--pixel);
  color: var(--text); background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); display: inline-flex; align-items: center; gap: 7px;
}
.tt-b.go { color: #231a00; background: linear-gradient(180deg, #ffd766, #f5b92e); box-shadow: 0 2px 0 #b98712, 0 8px 18px rgba(245, 185, 46, .3); }
.tt-b.atk { color: #fff; background: linear-gradient(180deg, #ff7a5c, #e2452f); box-shadow: 0 2px 0 #8d2213, 0 8px 18px rgba(226, 69, 47, .35); }
.tt-b:disabled { opacity: .4; cursor: default; }
.tt-b .en { --en: 15px; }

/* Bottom sheet (attacks, searches, choices) */
.tt-sheet-bg { position: absolute; inset: 0; z-index: 60; background: rgba(4, 6, 18, .55); opacity: 0; transition: opacity .25s; }
.tt-sheet-bg.on { opacity: 1; }
.tt-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 86%; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1a2052, #11163a); border-radius: 22px 22px 0 0; box-shadow: 0 -20px 50px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .1);
  transform: translateY(105%); transition: transform .32s var(--tt-ease); padding-bottom: env(safe-area-inset-bottom);
}
.tt-sheet.on { transform: none; }
.tt-sheet.peek { transform: translateY(calc(100% - 64px)); }
@media (min-width: 900px) {
  .tt-sheet { left: 50%; right: auto; width: min(720px, 92vw); bottom: 50%; border-radius: 22px; transform: translate(-50%, 60%) scale(.96); opacity: 0; transition: transform .28s var(--tt-ease), opacity .2s; }
  .tt-sheet.on { transform: translate(-50%, 50%); opacity: 1; }
}
.tt-sh-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 10px; }
.tt-sh-head img { width: 42px; height: 58px; border-radius: 5px; object-fit: cover; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); flex: none; }
.tt-sh-head h3 { margin: 0; font-family: var(--pixel); font-size: 18px; line-height: 1.15; }
.tt-sh-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.tt-sh-head .tt-ib { margin-left: auto; align-self: flex-start; }
.tt-sh-body { overflow: auto; padding: 4px 16px 12px; flex: 1; overscroll-behavior: contain; }
.tt-sh-foot { display: flex; align-items: center; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.tt-sh-foot .tt-count { color: var(--muted); font-size: 13px; margin-right: auto; }
.tt-sh-foot .tt-count b { color: var(--text); }
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
@media (min-width: 900px) { .tt-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } }
.tt-gc { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 7px; aspect-ratio: 5 / 7; transition: transform .15s; }
.tt-gc img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; display: block; box-shadow: 0 4px 10px rgba(0, 0, 0, .45); }
.tt-gc .noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; padding: 4px; border-radius: 7px; background: #232a63; }
.tt-gc.no { cursor: default; }
.tt-gc.no img { filter: grayscale(.85) brightness(.45); }
.tt-gc.on img { box-shadow: 0 0 0 3px var(--tt-gold), 0 8px 20px rgba(245, 197, 66, .35); }
.tt-gc.on { transform: translateY(-3px); }
.tt-gc .tt-n { position: absolute; right: -5px; top: -5px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; font: 800 11.5px/1 var(--body); background: #0b0f26; color: var(--text); box-shadow: 0 0 0 1px rgba(255, 255, 255, .2); }
.tt-gc.on .tt-n { background: var(--tt-gold); color: #1d1600; }
.tt-gc .tt-sug { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); font: 700 9.5px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; border-radius: 99px; background: rgba(70, 211, 138, .95); color: #052414; white-space: nowrap; }
.tt-sec { margin: 4px 0 10px; color: var(--muted); font: 600 12px/1 var(--body); text-transform: uppercase; letter-spacing: .07em; }

/* Rows in the Pokémon sheet: attacks, Abilities, retreat */
.tt-move { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-bottom: 8px; border: 0; border-radius: 14px; text-align: left; cursor: pointer; color: var(--text); background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
.tt-move:disabled { cursor: default; opacity: .55; }
.tt-move.ok { background: linear-gradient(90deg, rgba(255, 122, 92, .16), rgba(255, 122, 92, .04)); box-shadow: inset 0 0 0 1px rgba(255, 122, 92, .45); }
.tt-move.ab.ok { background: linear-gradient(90deg, rgba(122, 162, 255, .18), rgba(122, 162, 255, .04)); box-shadow: inset 0 0 0 1px rgba(122, 162, 255, .45); }
.tt-move .cost { display: flex; gap: 3px; flex: none; min-width: 52px; }
.tt-move .cost .en { --en: 19px; }
.tt-move .txt { flex: 1; min-width: 0; }
.tt-move .txt b { display: block; font-family: var(--pixel); font-size: 16px; }
.tt-move .txt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.tt-move .dmg { font: 800 22px/1 var(--pixel); flex: none; }
.tt-move .why { display: block; color: #ffb3a6; font-size: 12px; margin-top: 4px; }
.tt-tag { display: inline-block; font: 700 10px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; padding: 3px 6px; border-radius: 5px; background: #e2452f; color: #fff; margin-right: 6px; vertical-align: 2px; }
.tt-tag.ab { background: #4f6fe0; }

/* Zoom: a card big */
.tt-zoom { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(4, 6, 18, .78); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; padding: 20px; }
.tt-zoom.on { opacity: 1; }
.tt-zoom img { width: min(82vw, 380px, calc((100vh - 120px) / 1.4)); aspect-ratio: 5 / 7; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); transform: scale(.9); transition: transform .3s var(--tt-pop); }
.tt-zoom.on img { transform: none; }
.tt-zoom p { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 14px; }

/* Effects layer */
.tt-fx { position: absolute; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.tt-float { position: absolute; font: 800 26px/1 var(--pixel); color: #fff; text-shadow: 0 2px 0 #7a1b0f, 0 0 18px rgba(255, 90, 60, .8); white-space: nowrap; }
.tt-float.big { font-size: 38px; }
.tt-float.heal { color: #b9ffd8; text-shadow: 0 2px 0 #0b5a33, 0 0 14px rgba(70, 211, 138, .8); }
.tt-float.ko { font-size: 34px; color: var(--tt-gold-2); text-shadow: 0 3px 0 #6b4c00, 0 0 22px rgba(245, 197, 66, .9); }
.tt-banner {
  position: absolute; left: 50%; top: var(--mid, 50%); padding: 12px 26px; border-radius: 16px; font: 700 24px/1 var(--pixel); white-space: nowrap;
  color: #241b00; background: linear-gradient(180deg, #ffd766, #f5b92e); box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}
.tt-banner.them { color: #eaf0ff; background: linear-gradient(180deg, #5a74d6, #3c53b0); }
.tt-banner.atk { font-size: 20px; color: #fff; background: linear-gradient(180deg, #ff7a5c, #d93a25); }
.tt-reveal { position: absolute; left: 50%; top: 42%; width: min(46vw, 210px); aspect-ratio: 5 / 7; border-radius: 12px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .7), 0 0 0 2px rgba(255, 255, 255, .15); }
.tt-reveal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tt-reveal-cap { position: absolute; left: 50%; top: calc(42% + min(46vw, 210px) * .7 + 14px); transform: translateX(-50%); font: 700 14px/1.2 var(--pixel); color: var(--text); background: rgba(6, 9, 26, .85); padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.tt-ghostmon { position: absolute; z-index: 5; }
.tt-coin {
  position: absolute; left: 50%; top: var(--mid, 50%); width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  display: grid; place-items: center; font: 800 15px/1 var(--pixel); color: #3a2a00;
  background: radial-gradient(circle at 35% 30%, #fff4c4, #f5c542 45%, #b9860f); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .35), 0 12px 30px rgba(0, 0, 0, .5);
}
.tt-coin.tails { color: #e8ecff; background: radial-gradient(circle at 35% 30%, #e6ebff, #8a96c8 45%, #4c5788); }
.tt-confetti { position: absolute; left: 50%; top: 40%; width: 9px; height: 14px; border-radius: 2px; }
.tt-flyer { position: absolute; border-radius: 6px; overflow: hidden; box-shadow: 0 10px 24px rgba(0, 0, 0, .5); }
.tt-flyer img, .tt-flyer .tt-back { width: 100%; height: 100%; display: block; object-fit: cover; }

/* Setup overlay (choose your Active / Bench) and dealing */
.tt-setup { position: absolute; inset: 46px 0 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; text-align: center; background: radial-gradient(ellipse at 50% 40%, rgba(16, 22, 60, .82), rgba(5, 7, 20, .96)); backdrop-filter: blur(3px); }
.tt-setup h2 { font-family: var(--pixel); font-size: 24px; margin: 0 0 6px; }
.tt-setup p { color: var(--muted); margin: 0 0 18px; font-size: 14px; max-width: 42ch; }
.tt-setup .tt-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 640px; }
.tt-setup .tt-gc { width: clamp(76px, 22vw, 120px); }
.tt-setup .tt-chosen { display: flex; gap: 8px; justify-content: center; min-height: 60px; margin: 16px 0 6px; }
.tt-setup .tt-chosen img { width: 42px; border-radius: 4px; }
.tt-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tt-loading .bar { width: 200px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.tt-loading .bar i { display: block; height: 100%; width: 0; background: var(--tt-gold); transition: width .2s; }

/* End of the game */
.tt-end { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 18px; text-align: center; background: radial-gradient(ellipse at 50% 30%, rgba(70, 52, 0, .55), rgba(5, 7, 20, .97) 72%), rgba(5, 7, 20, .82); backdrop-filter: blur(8px) saturate(.7); opacity: 0; transition: opacity .4s; }
.tt-end.lose { background: radial-gradient(ellipse at 50% 30%, rgba(30, 44, 110, .5), rgba(5, 7, 20, .97) 72%), rgba(5, 7, 20, .84); }
.tt-end.on { opacity: 1; }
.tt-end h2 { margin: 0; font: 700 clamp(44px, 12vw, 72px)/1 var(--pixel); letter-spacing: -.01em; color: var(--tt-gold-2); text-shadow: 0 6px 40px rgba(245, 197, 66, .45); }
.tt-end.lose h2 { color: #c9d5ff; text-shadow: 0 6px 40px rgba(122, 162, 255, .35); }
.tt-end .sub { color: var(--muted); margin: 8px 0 22px; }
.tt-stats { display: grid; grid-template-columns: repeat(2, minmax(120px, 160px)); gap: 10px; margin-bottom: 20px; }
.tt-stat { padding: 14px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.tt-stat b { display: block; font: 700 24px/1 var(--pixel); }
.tt-stat span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.tt-mvp { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; text-align: left; }
.tt-mvp img { width: 56px; border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
.tt-mvp b { display: block; font-family: var(--pixel); }
.tt-mvp span { color: var(--muted); font-size: 13px; }
.tt-end .tt-acts { justify-content: center; }

/* Play-by-play drawer */
.tt-log { position: absolute; top: 46px; right: 0; bottom: 0; width: min(340px, 88vw); z-index: 70; background: #0c1030; box-shadow: -20px 0 50px rgba(0, 0, 0, .5); transform: translateX(105%); transition: transform .3s var(--tt-ease); display: flex; flex-direction: column; }
.tt-log.on { transform: none; }
.tt-log h3 { margin: 0; padding: 14px 16px; font-family: var(--pixel); font-size: 17px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.tt-log ol { list-style: none; margin: 0; padding: 8px 16px 20px; overflow: auto; flex: 1; font-size: 13px; line-height: 1.45; }
.tt-log li { padding: 3px 0; color: var(--muted); }
.tt-log li.you { color: #ffe7a3; }
.tt-log li.turn { margin-top: 10px; color: var(--text); font-weight: 700; font-family: var(--pixel); }

/* Wide screens: more room, bigger cards, the play-by-play always open on the right */
@media (min-width: 1100px) and (min-height: 640px) {
  .tt-log { top: 46px; transform: none; width: 300px; background: rgba(9, 12, 34, .75); box-shadow: inset 1px 0 0 rgba(255, 255, 255, .06); }
  .tt.has-log .tt-board, .tt.has-log .tt-mid, .tt.has-log .tt-act, .tt.has-log .tt-handzone { margin-right: 300px; }
  .tt.has-log [data-log] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tt *, .tt *::before, .tt *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* A picture that didn't load: the card's name on a card-shaped tile */
.tt .noimg:not(:empty) { position: absolute; inset: 0; display: grid; place-items: center; padding: 6px; text-align: center; font: 700 11px/1.25 var(--body); color: var(--text); border-radius: inherit; background: linear-gradient(160deg, #2b3277, #171c45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }

/* Landscape screens: each side is one row (Prize cards, Active, Bench, deck and discard pile), so the cards can be
   about twice as big as in a stack. fit() in table.js sets .wide. */
.tt.wide .tt-side { flex-direction: row; justify-content: center; align-items: center; gap: calc(var(--u) * .14); }
.tt.wide .tt-front { display: contents; }
.tt.wide .tt-side .tt-prizes { order: 1; }
.tt.wide .tt-side .tt-activeslot { order: 2; margin-right: calc(var(--u) * .1); }
.tt.wide .tt-side .tt-bench { order: 3; min-height: 0; }
.tt.wide .tt-side .tt-piles { order: 4; flex-direction: column; }
.tt.wide .tt-them .tt-bench { gap: calc(var(--b) * .1); }
.tt.wide .tt-them .tt-slot { width: var(--b); height: calc(var(--b) * 1.4); }
.tt.wide .tt-theirhand { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); margin: 0; }
.tt.wide .tt-board { padding-top: 26px; }
.tt.wide .tt-mid { max-width: calc(var(--u) * 5.6 + 200px); margin: 0 auto; width: 100%; }

/* A closer look on hover (mouse): the card big, beside the pointer */
.tt-peek { position: absolute; z-index: 75; width: 260px; aspect-ratio: 5 / 7; border-radius: 13px; overflow: hidden; pointer-events: none; box-shadow: 0 24px 60px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .12); opacity: 0; transform: scale(.96); transition: opacity .15s, transform .15s; }
.tt-peek.on { opacity: 1; transform: none; }
.tt-peek img { width: 100%; height: 100%; object-fit: cover; display: block; }
