/* TagTeam Logic (Ping-Pong edition) — the TagTeam "night table" (same family as Words TagTeam,
   /tagteam/style.css): a lapis card with fine grain, the word grid set into a brass-framed board
   that leans back a touch, thick ivory tiles with stacked edges, brass and glass buttons.
   Logic's own accent is the EMERALD CIRCUIT: faint traces etched into the table, the lives shown
   as little emerald LEDs, solved groups as jewel bars. Layout basics come from
   /shared/cb-arcade.css (linked first).

   Two-player identity, shared with every TagTeam game: Player A is BLUE, Player B is ORANGE —
   the turn plate, the tiles you're selecting, the hand-off card and the "who found it" coin.

   Colour-blind safety: a selected tile also sinks into the board and wears a tick; solved
   groups print their category; a spent life is a dark empty socket, not just another colour. */

:root {
  --pa: #2463eb; --pa-soft: #dbe7ff; --pa-ink: #1d4fc4;
  --pb: #e85d04; --pb-soft: #ffe8d6; --pb-ink: #b44700;
}
.tl-body {
  --ink: #e9edf8; --ink-2: #b7c0dc; --ink-3: #7f8bb0;
  --table-1: #1f3a5c; --table-2: #0f1d36; --table-3: #08111f;
  --grout: #08121f; --well-1: #16294a; --well-2: #10203b;
  --brass-hi: #fbe7ae; --brass-1: #e8c472; --brass-2: #c4943f; --brass-3: #8a6224; --brass-4: #5e4116;
  --iv-hi: #fffdf6; --iv-1: #fbf1db; --iv-2: #f0dfba; --iv-s1: #e3c993; --iv-s2: #c9a365; --iv-s3: #9a7442;
  --tile-ink: #24180c;
  --ok-hi: #4fdba5; --ok: #1d9b69; --ok-lo: #137a52; --ok-e1: #0f6a46; --ok-e2: #0b5638; --ok-e3: #07402a;
  --mb-hi: #ffe596; --mb: #f2b42c; --mb-lo: #d99412; --mb-e1: #b97c0e; --mb-e2: #96620a; --mb-e3: #6c4605; --mb-ink: #2a1a04;
  --sa-hi: #8fb4ff; --sa: #3d6fe0; --sa-lo: #2a52b8; --sa-e1: #1f3f92; --sa-e2: #18306f; --sa-e3: #10214d;
  --am-hi: #c9a4ff; --am: #7c4fd6; --am-lo: #5d36ad; --am-e1: #4a2a8c; --am-e2: #391f6c; --am-e3: #26144a;
  --off-hi: #4d5876; --off: #3a435c; --off-lo: #2d3549; --off-e1: #232a3d; --off-e2: #1a2030; --off-ink: #9aa4c2;
  --pa-j: #5b8dff; --pa-j2: #2f5fd6; --pb-j: #ff8a3d; --pb-j2: #d4570c;
  --led: #3ff0a8;
  --cbx-body: 'Montserrat', system-ui, sans-serif; --cbx-display: 'Montserrat', system-ui, sans-serif;
}
body.tl-body { --cbx-accent: #1d9b69; overscroll-behavior-y: none; }
html, body { overflow-x: clip; }
.hidden { display: none !important; }

/* ---------- hero ---------- */
.tt-container { width: 100%; }   /* body is a flex column (site.css): auto margins would shrink-wrap it */
.cbx-title .a { color: var(--pa); }
.cbx-title .b { color: var(--pb); }
.cbx-title em { color: #12805a; }
body:has(#play:not(.hidden)) .tt-header .cbx-sub,
body:has(#play:not(.hidden)) .tt-header .cbx-kicker,
body:has(#play:not(.hidden)) .tt-header .cbx-mascot { display: none; }
body:has(#play:not(.hidden)) .tt-header { margin-bottom: 10px; }
body:has(#play:not(.hidden)) .tt-header .cbx-title { font-size: 26px; margin: 0; }
/* phones: the whole screen goes to the board while a game is on */
@media (max-width: 600px) {
  body:has(#play:not(.hidden)) .cb-header,
  body:has(#play:not(.hidden)) .tt-header { display: none; }
  body:has(#play:not(.hidden)) .tt-container { padding-top: 8px; }
}

/* ---------- the table: setup card and play card ---------- */
.cbx-card.tl-play, .cbx-card#setup {
  color: var(--ink); isolation: isolate; border: 1px solid rgba(255, 255, 255, .07); border-top: 1px solid rgba(255, 255, 255, .07);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(63, 240, 168, .16), transparent 60%),
    radial-gradient(90% 50% at 50% 112%, rgba(232, 196, 114, .10), transparent 60%),
    /* the circuit: thin emerald traces and solder pads etched into the lapis */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke='%233ff0a8' stroke-opacity='.075' stroke-width='1.4'%3E%3Cpath d='M0 30h46l18 18h50l14-14h52M20 180v-40l22-22h40M180 96h-38l-16 16v68M96 0v22l-14 14H40M0 140h28l14 14v26'/%3E%3Cg fill='%233ff0a8' fill-opacity='.09' stroke='none'%3E%3Ccircle cx='64' cy='48' r='3'/%3E%3Ccircle cx='128' cy='34' r='3'/%3E%3Ccircle cx='82' cy='118' r='3'/%3E%3Ccircle cx='142' cy='96' r='3'/%3E%3Ccircle cx='40' cy='36' r='3'/%3E%3Ccircle cx='42' cy='154' r='3'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 180px 180px,
    linear-gradient(180deg, var(--table-1), var(--table-2) 48%, var(--table-3));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 34px 70px -28px rgba(9, 15, 34, .75), 0 10px 24px -12px rgba(9, 15, 34, .5);
}
.cbx-card.tl-play::before, .cbx-card#setup::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cbx-card.tl-play p, .cbx-card#setup p { color: inherit; }
.cbx-card#setup h2, .tl-done h2 { color: #fff; }
.cbx-full { --cbx-full-pad: 6px; }

/* brass primary, glass secondary — on the table and in the pop-ups */
.tl-play .cbx-btn:not(.alt), #setup .cbx-btn, .relay-content .cbx-btn, .tl-pop .cbx-btn {
  background: linear-gradient(180deg, var(--brass-hi), var(--brass-1) 40%, var(--brass-2)); color: #2b1b05; border: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 3px 0 var(--brass-3), 0 5px 0 var(--brass-4), 0 12px 22px -8px rgba(232, 196, 114, .5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4); font-weight: 800;
}
.tl-play .cbx-btn.alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05)); color: var(--ink); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 rgba(0, 0, 0, .35); font-weight: 800;
}
.tl-play .cbx-btn:active, #setup .cbx-btn:active, .relay-content .cbx-btn:active, .tl-pop .cbx-btn:active { transform: translateY(3px); }
.tl-play .cbx-btn:not(.alt):active, #setup .cbx-btn:active, .relay-content .cbx-btn:active, .tl-pop .cbx-btn:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 var(--brass-3), 0 2px 0 var(--brass-4); }
.tl-play .cbx-btn.alt:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 0 rgba(0, 0, 0, .35); }

/* ---------- setup ---------- */
#setup h2 { margin-bottom: 12px; }
.tt-names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (max-width: 480px) { .tt-names { grid-template-columns: 1fr; } }
.tt-name { display: grid; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ink); }
.tt-name .lab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tt-name .lab i, .tl-turn i, .tl-by {
  font-style: normal; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  color: #fff; font: 900 13px/1 var(--cbx-body); text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .35);
}
.tt-name .lab small { font-weight: 600; color: var(--ink-3); font-size: 12px; }
.tt-name.a .lab i, .tl-turn.a i, .by-a .tl-by { background: radial-gradient(circle at 35% 30%, #9dbcff, var(--pa-j) 45%, var(--pa-j2)); }
.tt-name.b .lab i, .tl-turn.b i, .by-b .tl-by { background: radial-gradient(circle at 35% 30%, #ffc196, var(--pb-j) 45%, var(--pb-j2)); }
.tt-name input {
  width: 100%; min-height: 50px; padding: 11px 14px; border-radius: 14px; border: 1.5px solid rgba(255, 255, 255, .14);
  background: linear-gradient(180deg, rgba(5, 10, 26, .55), rgba(20, 30, 60, .45)); color: #fff; font: 700 17px var(--cbx-body); outline: none;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45);
}
.tt-name input::placeholder { color: var(--ink-3); }
.tt-name.a input { border-color: color-mix(in srgb, var(--pa-j) 45%, transparent); }
.tt-name.b input { border-color: color-mix(in srgb, var(--pb-j) 45%, transparent); }
.tt-name.a input:focus { border-color: var(--pa-j); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45), 0 0 0 4px rgba(91, 141, 255, .25); }
.tt-name.b input:focus { border-color: var(--pb-j); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45), 0 0 0 4px rgba(255, 138, 61, .25); }
.tl-note { text-align: center; color: var(--ink-2) !important; }
/* return visit (already played today) */
.tl-done { text-align: center; padding: 6px 0; }
#setup .tl-done .cbx-kicker { color: var(--brass-1); }
.tl-done h2 { font-size: 21px; }
.tl-done-ic { font-size: 46px; margin: 10px 0 4px; }
.tl-done .cbx-note { color: var(--ink-2) !important; }
.tl-done .cbx-btn { margin-top: 12px; }

/* ---------- play ---------- */
.tl-play { padding: 14px 12px 14px; scroll-margin-top: 8px; }
@media (min-width: 601px) { .tl-play { padding: 18px 20px 20px; scroll-margin-top: 70px; } }
.roles { display: flex; justify-content: center; margin: 0 0 8px; }
/* the turn plate: whose go it is, lit in their colour */
.tl-turn {
  --j: var(--pa-j);
  position: relative; display: inline-flex; align-items: center; gap: 9px; max-width: 100%; padding: 6px 16px 6px 7px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--j) 75%, transparent); color: #fff; font: 800 15.5px var(--cbx-body);
  background: linear-gradient(180deg, color-mix(in srgb, var(--j) 18%, transparent), rgba(255, 255, 255, .03));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--j) 30%, transparent), 0 8px 22px -8px color-mix(in srgb, var(--j) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tl-turn.b { --j: var(--pb-j); }
.tl-turn::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 34%; height: 2px; margin-left: -17%; border-radius: 99px;
  background: var(--j); box-shadow: 0 0 10px var(--j); animation: tl-breathe 2.2s ease-in-out infinite; }
@keyframes tl-breathe { 50% { opacity: .35; } }
/* game over: the roles line is plain text (DECOYS AVOIDED / ARCHIVE MODE) */
.roles:not(:has(.tl-turn)) { font: 800 12px var(--cbx-body); letter-spacing: .16em; color: var(--brass-1); }

.hud { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 2px 2px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
#mistakes { display: inline-flex; align-items: center; gap: 8px; }
/* lives: emerald LEDs on the board; a spent one is a dark, empty socket */
.tl-dots { display: inline-flex; gap: 6px; }
.tl-dots i { width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #d6fff0, var(--led) 40%, #0f9a63);
  box-shadow: 0 0 0 2px #0a1626, 0 0 0 3px rgba(232, 196, 114, .45), 0 0 10px rgba(63, 240, 168, .65); }
.tl-dots i.used { background: radial-gradient(circle at 50% 40%, #050b16, #0d1a2c); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .8), 0 0 0 2px #0a1626, 0 0 0 3px rgba(232, 196, 114, .25); }
#mistakes.shake { animation: cbx-shake .4s ease; }

/* ---------- the board: stage (perspective) > brass frame (leans back) > grout > tiles ---------- */
.tl-stage { perspective: 1100px; perspective-origin: 50% 100%; padding: 6px 0 10px; }
.tl-frame {
  position: relative; padding: 7px; border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 18%),
    conic-gradient(from 210deg at 30% 20%, var(--brass-2), var(--brass-hi), var(--brass-1), var(--brass-3), var(--brass-2), var(--brass-1), var(--brass-2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(0, 0, 0, .25),
    0 2px 0 var(--brass-3), 0 4px 0 var(--brass-4), 0 7px 0 #3e2a0c, 0 8px 1px rgba(0, 0, 0, .4),
    0 26px 36px -10px rgba(0, 0, 0, .7), 0 50px 70px -30px rgba(0, 0, 0, .55);
  transform: rotateX(var(--tilt, 6deg)); transform-origin: 50% 0%;
  animation: tl-settle .8s cubic-bezier(.2, .9, .25, 1) backwards;
}
@keyframes tl-settle { from { transform: rotateX(32deg) translateY(26px) scale(.94); opacity: 0; } }
@media (max-width: 600px) { .tl-frame { --tilt: 3.5deg; padding: 6px; border-radius: 17px; } }

#grid {
  --gap: 7px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); width: 100%; container-type: inline-size;
  padding: 8px 8px 11px; border-radius: 13px; background: var(--grout);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(0, 0, 0, .6);
}
@media (max-width: 600px) { #grid { --gap: 6px; padding: 6px 6px 9px; border-radius: 11px; } }
#grid.read-only { pointer-events: none; }
#grid.read-only .tile { filter: saturate(.6) brightness(.8); }

/* a word: a thick ivory tile. On phones it grows with the screen height so 5 rows + the
   buttons fill the view without scrolling (iPhone SE up) */
.tile {
  --e1: var(--iv-s1); --e2: var(--iv-s2); --e3: var(--iv-s3);
  position: relative; min-width: 0; min-height: clamp(58px, calc((100svh - 300px) / 5), 88px); padding: 4px 3px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  font: 800 clamp(9.5px, (25cqi - 11px) / (var(--len, 6) * .82), 17px)/1.12 var(--cbx-body); letter-spacing: -.02em; color: var(--tile-ink); text-transform: uppercase;
  overflow-wrap: anywhere; hyphens: manual;
  background: linear-gradient(170deg, var(--iv-hi) 0%, var(--iv-1) 38%, var(--iv-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(0, 0, 0, .12),
    0 1px 0 var(--e1), 0 2px 0 var(--e2), 0 3px 0 var(--e3), 0 4px 0 var(--e3), 0 6px 7px rgba(0, 0, 0, .55);
  transition: translate .12s cubic-bezier(.3, 1.4, .5, 1), box-shadow .12s, background .15s, color .15s;
  animation: tl-pop .38s cubic-bezier(.3, 1.5, .5, 1) backwards; animation-delay: calc(.25s + var(--i, 0) * 22ms);
}
@supports not (height: 100svh) { .tile { min-height: clamp(58px, calc((100vh - 300px) / 5), 88px); } }
@media (min-width: 601px) { .tile { min-height: 76px; border-radius: 13px; } }
.tile:nth-child(4n+2) { --i: 1; } .tile:nth-child(4n+3) { --i: 2; } .tile:nth-child(4n+4) { --i: 3; }
.tile:nth-child(n+5) { --i: 4; } .tile:nth-child(n+9) { --i: 6; } .tile:nth-child(n+13) { --i: 8; } .tile:nth-child(n+17) { --i: 10; }
@keyframes tl-pop { 0% { translate: 0 -10px; opacity: 0; } 60% { opacity: 1; } 100% { translate: 0 0; } }
/* re-renders (every tap) shouldn't replay the deal: only the first paint animates */
#grid.dealt .tile { animation: none; }
#grid.dealt .group-banner:not(.new) { animation: none; }
.tile.nope { animation: cbx-shake .4s ease !important; }
@media (hover: hover) { .tile:hover { translate: 0 -2px; } }
.tile:active { translate: 0 2px; }
/* selected: the tile sinks into the board and turns the player's jewel, with a tick */
.tile.selected {
  --e1: var(--who2); --e2: color-mix(in srgb, var(--who2) 70%, #000); --e3: color-mix(in srgb, var(--who2) 50%, #000);
  translate: 0 2px; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  background: radial-gradient(130% 95% at 30% 12%, color-mix(in srgb, var(--who) 55%, #fff), var(--who) 50%, var(--who2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .2), 0 1px 0 var(--e1), 0 2px 0 var(--e3), 0 3px 4px rgba(0, 0, 0, .5),
    0 0 14px -2px var(--who);
}
.tile.selected.just { animation: tl-press .22s cubic-bezier(.3, 1.4, .5, 1); }
.tile.selected.a { --who: var(--pa-j); --who2: var(--pa-j2); }
.tile.selected.b { --who: var(--pb-j); --who2: var(--pb-j2); }
.tile.selected::after {
  content: ''; position: absolute; right: 5px; top: 5px; width: 13px; height: 13px; border-radius: 50%; background: rgba(255, 255, 255, .92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23142040' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
@keyframes tl-press { 0% { translate: 0 0; } 50% { translate: 0 4px; } 100% { translate: 0 2px; } }

/* solved groups: jewel bars with the same stacked edge. Lightness steps gold > emerald >
   sapphire > amethyst, and the category is printed on the bar */
.group-banner {
  --e1: var(--ok-e1); --e2: var(--ok-e2); --e3: var(--ok-e3);
  grid-column: 1 / -1; position: relative; display: grid; place-content: center; gap: 2px; min-height: 58px; padding: 9px 44px 10px;
  border-radius: 12px; text-align: center; color: #fff; font-weight: 600; font-size: 13px; line-height: 1.3; text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
  background: radial-gradient(130% 120% at 30% 0%, var(--ok-hi), var(--ok) 50%, var(--ok-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .15),
    0 1px 0 var(--e1), 0 2px 0 var(--e2), 0 3px 0 var(--e3), 0 4px 0 var(--e3), 0 6px 7px rgba(0, 0, 0, .55);
  animation: tl-land .5s cubic-bezier(.3, 1.4, .5, 1) backwards;
}
.group-banner br { display: none; }
.group-banner strong { font: 900 14.5px/1.15 var(--cbx-body); text-transform: uppercase; letter-spacing: .03em; }
.group-banner small { font: 600 12.5px/1.3 var(--cbx-body); opacity: .92; }
.difficulty-easy { --e1: var(--mb-e1); --e2: var(--mb-e2); --e3: var(--mb-e3); color: var(--mb-ink); text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  background: radial-gradient(130% 120% at 30% 0%, var(--mb-hi), var(--mb) 52%, var(--mb-lo)); }
.difficulty-hard { --e1: var(--sa-e1); --e2: var(--sa-e2); --e3: var(--sa-e3); background: radial-gradient(130% 120% at 30% 0%, var(--sa-hi), var(--sa) 50%, var(--sa-lo)); }
.difficulty-tricky { --e1: var(--am-e1); --e2: var(--am-e2); --e3: var(--am-e3); background: radial-gradient(130% 120% at 30% 0%, var(--am-hi), var(--am) 50%, var(--am-lo)); }
.tl-by { position: absolute; left: 10px; top: 50%; translate: 0 -50%; }
/* a group nobody found: graphite, sunk lower, marked "missed" */
.group-banner.by-miss { --e1: var(--off-e1); --e2: var(--off-e2); --e3: var(--off-e2); color: var(--off-ink); text-shadow: 0 -1px 0 rgba(0, 0, 0, .4);
  background: linear-gradient(170deg, var(--off-hi), var(--off) 45%, var(--off-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 0 var(--e1), 0 2px 0 var(--e2), 0 3px 4px rgba(0, 0, 0, .5), inset 0 0 0 1.5px rgba(255, 255, 255, .08); }
.group-banner.by-miss strong { color: #dfe5f5; }
.group-banner.by-miss strong::after { content: ' · missed'; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--off-ink); }
@keyframes tl-land { from { transform: rotateX(-80deg) translateY(-8px); opacity: 0; } 50% { opacity: 1; } to { transform: none; opacity: 1; } }

.actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.actions .cbx-btn { min-height: 52px; }
.msg { min-height: 20px; margin: 10px 0 0; text-align: center; font-weight: 800; font-size: 14.5px; color: var(--ink); }
.tl-play[data-turn="a"] .msg { color: #a9c3ff; }
.tl-play[data-turn="b"] .msg { color: #ffc193; }
.win-area { display: grid; gap: 10px; margin-top: 12px; }
.tl-play[data-turn="over"] .hud, .tl-play[data-turn="over"] .actions { display: none; }
.tl-play[data-turn="over"] .roles { margin-top: 2px; }

/* ---------- end screen (top of the play card) ---------- */
.tl-result { margin: -2px 0 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.tl-play .tl-result .cbx-kicker { color: var(--brass-1); }
.tl-play .tl-result .cbx-big { color: #fff; font-family: var(--cbx-body); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.tl-play .tl-result .cbx-big small { color: var(--ink-3); }
.tl-play .tl-result .cbx-verdict { color: #fff; font-size: 18px; font-weight: 800; }
.tl-result .tl-res-share { margin-top: 12px; }
.tl-result .cbx-chips > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-weight: 700;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 255, 255, .09); }
.tl-result .cbx-chips b { color: #fff; }
.tl-result .cbx-chips > .a { border-color: rgba(91, 141, 255, .45); } .tl-result .cbx-chips > .b { border-color: rgba(255, 138, 61, .45); }
.tl-result .cbx-chips > .a b { color: var(--pa-j); } .tl-result .cbx-chips > .b b { color: var(--pb-j); }

/* ---------- hand-off card + "not a match" pop-up: small night tables of their own ---------- */
.relay-modal, .tl-pop-overlay {
  position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(5, 9, 22, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: tl-fade .2s ease;
}
.relay-modal.hidden { display: none !important; }
.tl-pop-overlay { z-index: 2000; }
.relay-content, .tl-pop {
  --who: var(--brass-1); --who2: var(--brass-2);
  position: relative; isolation: isolate; width: 100%; max-width: 420px; padding: 24px 18px 14px; border-radius: 22px; color: var(--ink); text-align: center;
  background: radial-gradient(120% 70% at 50% -10%, rgba(63, 240, 168, .16), transparent 60%), linear-gradient(180deg, var(--table-1), var(--table-2) 60%, var(--table-3));
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 4px rgba(232, 196, 114, .14), 0 30px 70px rgba(0, 0, 0, .55);
  animation: tl-rise .38s cubic-bezier(.2, 1.3, .4, 1);
}
.relay-content::before, .tl-pop::before { content: ''; position: absolute; left: 22px; right: 22px; top: 0; height: 4px; border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, var(--who2), var(--who), var(--who2)); box-shadow: 0 0 16px var(--who); }
.relay-modal[data-who="a"] .relay-content { --who: var(--pa-j); --who2: var(--pa-j2); }
.relay-modal[data-who="b"] .relay-content { --who: var(--pb-j); --who2: var(--pb-j2); }
.relay-content h2, .tl-pop h3 { margin: 0 0 6px; font: 900 25px/1.1 var(--cbx-display); letter-spacing: -.01em; color: #fff; }
.relay-content p, .tl-pop p { margin: 0 0 16px; font-weight: 600; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.tl-ghost { margin-top: 6px; min-height: 44px; width: 100%; border: 0; background: none; cursor: pointer; font: 700 15px var(--cbx-body); color: var(--ink-3); text-decoration: underline; text-decoration-color: rgba(232, 196, 114, .5); text-underline-offset: 4px; }
.tl-ghost:hover { color: var(--brass-hi); }
.tl-pop { --who: #ff6b5e; --who2: #b8322a; }
.tl-pop h3 { color: #ffb4ac; }
.tl-pop-left { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 16px; padding: 10px; border-radius: 14px; font-weight: 800; color: #fff;
  background: var(--grout); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .06); }

/* ---------- reading card, more games, footer ---------- */
.seo-content { margin-top: 18px; }
.seo-content h2 { font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.seo-content h3 { font-size: 18px; font-weight: 900; }
.seo-content p, .seo-content li { font-weight: 600; }
.seo-content strong { color: var(--cbx-ink); font-weight: 800; }
.tl-copy { margin: 18px 0 0; padding-top: 12px; border-top: 2px solid var(--cbx-soft); text-align: center; font-size: 13.5px; color: var(--cbx-muted) !important; }
.tl-footer { margin-top: 18px; padding: 16px; text-align: center; font-weight: 700; font-size: 13.5px; color: var(--cbx-muted); }
.tl-footer a { color: var(--cbx-ink-2); }

/* Montserrat throughout TagTeam: heavy for tiles, titles and buttons, lighter for running text */
.cbx-title { font-family: 'Montserrat', system-ui, sans-serif; font-weight: 900; letter-spacing: -.03em; }
.cbx-sub, .cbx-card p { font-weight: 600; }
.cbx-kicker { font-weight: 800; letter-spacing: .16em; }
.cbx-card h2 { font-weight: 900; letter-spacing: -.02em; }

@keyframes tl-rise { from { transform: translateY(22px) scale(.96) rotateX(8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tl-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .tl-frame, .tile, .tile.selected, .group-banner, .relay-content, .tl-pop, .relay-modal, .tl-pop-overlay, .tl-turn::after { animation: none; }
  .tile { transition: none; }
}
