/* Juntos — Rummy de fichas */
:root {
  --tl-red: #D3263A;
  --tl-blue: #1F5FD6;
  --tl-orange: #138A3E; /* green: the ▲ suit (was orange, too close to the gold skin and the coral UI) */
  --tl-black: #23243A;
  --tl-ivory: #FFFDF5;
  --tl-ivory-2: #F4EBD6;
  --tl-felt-1: #23936A;
  --tl-felt-2: #156A4B;
  --tl-felt-3: #0F523A;
  --tl-wood-1: #CF9157;
  --tl-wood-2: #A96A35;
  --tl-wood-3: #87521F;
  --tl-bad: #FF5468;
  --tl-brand: #E8505B;
  --tl-brand-2: #C0392B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tl-felt-1: #1C7A58;
    --tl-felt-2: #115139;
    --tl-felt-3: #0B3B29;
    --tl-wood-1: #A87043;
    --tl-wood-2: #82502A;
    --tl-wood-3: #643B1B;
  }
}
:root[data-theme="dark"] {
  --tl-felt-1: #1C7A58;
  --tl-felt-2: #115139;
  --tl-felt-3: #0B3B29;
  --tl-wood-1: #A87043;
  --tl-wood-2: #82502A;
  --tl-wood-3: #643B1B;
}

/* ------------------------------------------------------------ topbar extras */
.tl-tb { display: inline-flex; gap: 6px; flex: none; }
.tl-tb .ndj-topbar__btn { flex: none; }

/* ------------------------------------------------------------ shared bits */
.tl-narrow { max-width: 560px; margin: 0 auto; }
.tl-h1 { font-size: clamp(1.5rem, 6vw, 2rem); font-weight: 700; }
.tl-entry-rules { width: 100%; margin-top: 4px; }
.tl-iconbtn {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--fg-2); cursor: pointer;
}
.tl-iconbtn:hover { color: var(--fg); }

/* segmented control */
.tl-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); flex: none; }
.tl-seg__btn {
  min-height: 34px; padding: 4px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--fg-2);
  font: 600 .9rem var(--font-display); cursor: pointer; white-space: nowrap;
}
.tl-seg__btn.is-on { background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------ settings chips */
.tl-settings { display: flex; flex-direction: column; gap: 14px; }
.tl-settings .ndj-section-title { margin-bottom: 0; }
.tl-settings__row { display: flex; flex-direction: column; gap: 8px; }
.tl-settings__label { font: 600 .95rem var(--font-display); color: var(--fg-2); }
/* even grids: 4 clock choices in a row; game length as 3 + 2 */
.tl-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tl-chips--goal { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tl-chips--goal > :nth-child(-n+3) { grid-column: span 2; }
.tl-chips--goal > :nth-child(n+4) { grid-column: span 3; }
.tl-chips--wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tl-chipbtn {
  min-height: 46px; padding: 6px 6px; border-radius: 14px; border: 2px solid var(--line); background: var(--card-2);
  color: var(--fg); font: 600 .96rem/1.15 var(--font-display); cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  text-align: center; overflow-wrap: anywhere;
}
.tl-chipbtn.is-on { background: linear-gradient(135deg, var(--tl-brand), #FF8A5B); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(232, 80, 91, .3); }
.tl-chipbtn:disabled { cursor: default; }
.tl-chipbtn:disabled:not(.is-on) { opacity: .55; }

/* ------------------------------------------------------------ local setup */
.tl-setup__hero { display: flex; align-items: center; gap: 14px; }
.tl-setup__hero .muted { margin-top: 4px; }
.tl-setup__list { display: flex; flex-direction: column; gap: 10px; }
.tl-setup__row { display: flex; align-items: center; gap: 8px; }
.tl-setup__row .ndj-avatar { width: 36px; height: 36px; font-size: 1rem; }
.tl-setup__name { min-height: 48px; padding: 8px 12px; font-size: 1rem; flex: 1 1 auto; min-width: 0; }
.tl-setup__name:disabled { opacity: 1; color: var(--fg-2); background: var(--bg-2); }
.tl-seg--kind .tl-seg__btn { padding: 4px 9px; font-size: .84rem; min-height: 38px; }
.tl-botav { background: linear-gradient(135deg, #6C63FF, #A855F7) !important; }
.tl-botav .ndj-ic { width: 20px; height: 20px; color: #fff; }
.tl-resume { display: flex; flex-direction: column; gap: 14px; text-align: center; }

/* ------------------------------------------------------------ tiles */
.tl {
  --w: var(--tw, 40px);
  position: relative; flex: none;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--w) * .05);
  width: var(--w); height: calc(var(--w) * 1.3);
  margin: 0; padding: 0; border: 0;
  border-radius: calc(var(--w) * .17);
  background: linear-gradient(180deg, var(--tl-ivory) 0%, var(--tl-ivory-2) 100%);
  box-shadow: inset 0 calc(var(--w) * -.07) 0 rgba(120, 88, 40, .2), inset 0 1px 0 #fff, 0 1px 1px rgba(0, 0, 0, .22), 0 3px 8px rgba(30, 20, 5, .16);
  color: var(--tc, var(--tl-black));
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: translate .16s ease, box-shadow .16s ease;
}
.tl:not(:disabled):not(.tl--static) { touch-action: none; }
.tl:disabled { cursor: default; }
.tl--c0 { --tc: var(--tl-red); }
.tl--c1 { --tc: var(--tl-blue); }
.tl--c2 { --tc: var(--tl-orange); }
.tl--c3 { --tc: var(--tl-black); }
.tl__n { font-size: calc(var(--w) * .56); letter-spacing: -.04em; margin-top: calc(var(--w) * .04); }
/* a small shape under the number tells the colors apart for color-blind players */
.tl__m { width: calc(var(--w) * .2); height: calc(var(--w) * .2); background: currentColor; opacity: .9; }
.tl--c0 .tl__m { border-radius: 50%; }
.tl--c1 .tl__m { border-radius: 2px; transform: scale(.88); }
.tl--c2 .tl__m { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tl--c3 .tl__m { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transform: scale(1.12); }
.tl--joker { --tc: var(--tl-red); }
.tl--jb { --tc: var(--tl-black); }
.tl__joker { width: 86%; height: auto; }
.tl.is-sel {
  translate: 0 -6px;
  box-shadow: 0 0 0 3px #FFD23F, 0 10px 18px rgba(0, 0, 0, .28), inset 0 calc(var(--w) * -.07) 0 rgba(120, 88, 40, .2);
}
.tl.is-added::after {
  content: ""; position: absolute; left: 50%; bottom: calc(var(--w) * -.16); width: calc(var(--w) * .3); height: 3px;
  translate: -50% 0; border-radius: 3px; background: #FFD23F;
}
.tl.is-fresh { box-shadow: 0 0 0 2.5px rgba(255, 210, 63, .95), 0 3px 8px rgba(30, 20, 5, .2); }
.tl.is-drawn::before {
  content: ""; position: absolute; top: calc(var(--w) * -.1); right: calc(var(--w) * -.1); width: calc(var(--w) * .3); height: calc(var(--w) * .3);
  border-radius: 50%; background: var(--teal); border: 2px solid var(--card);
}
.tl:focus-visible { outline: 3px solid #FFD23F; outline-offset: 2px; }
.tl--static { cursor: default; }
.tl--mini { --w: 24px; box-shadow: inset 0 -2px 0 rgba(120, 88, 40, .2), 0 1px 2px rgba(0, 0, 0, .2); }
.tl--ex { --w: 34px; }
.tl-glyph {
  display: inline-block; width: 10px; height: 13px; border-radius: 2.5px; margin-right: 1px;
  background: linear-gradient(180deg, var(--tl-ivory), var(--tl-ivory-2)); box-shadow: inset 0 -1.5px 0 rgba(120, 88, 40, .25), 0 0 0 1px rgba(0, 0, 0, .14);
}

/* flying copies for animations and the face-down tile that travels to other players */
.tl-ghost { position: fixed; z-index: 120; margin: 0; pointer-events: none; transform-origin: 0 0; }
.tl-back {
  border-radius: 5px; background: linear-gradient(135deg, var(--tl-brand), var(--tl-brand-2));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), 0 3px 8px rgba(0, 0, 0, .25);
}
.tl-drag { position: fixed; left: 0; top: 0; z-index: 460; pointer-events: none; display: grid; }
.tl-drag > .tl { grid-area: 1 / 1; box-shadow: 0 0 0 3px #FFD23F, 0 14px 26px rgba(0, 0, 0, .35); }
.tl-drag > .tl:nth-child(2) { translate: 5px 4px; z-index: -1; }
.tl-drag > .tl:nth-child(3) { translate: 10px 8px; z-index: -2; }
.tl-drag__n {
  position: absolute; top: -10px; right: -12px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  display: grid; place-items: center; background: var(--tl-brand); color: #fff; font: 700 .85rem var(--font-display);
}

/* ------------------------------------------------------------ play screen */
.ndj-app.tl-app { max-width: 1040px; padding-block: 10px 10px; }
.tl-play {
  display: flex; flex-direction: column; gap: 10px;
  height: calc(100dvh - var(--tl-top, 60px) - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  min-height: 600px;
}

/* players strip */
.tl-players { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px 2px 4px; margin: -3px -2px -4px; flex: none; scroll-behavior: smooth; }
.tl-players::-webkit-scrollbar { display: none; }
.tl-chip {
  position: relative; flex: 1 1 0; min-width: 86px; max-width: 230px;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 5px;
  border-radius: 16px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s, opacity .2s;
}
.tl-chip .ndj-avatar { width: 30px; height: 30px; font-size: .9rem; }
.tl-chip__main { display: flex; flex-direction: column; min-width: 0; }
.tl-chip__name { display: block; font-weight: 800; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-chip__name .tl-chip__bot { vertical-align: -2px; margin-left: 3px; }
.tl-chip__score { display: none; }
.tl-chip__bot { width: 15px; height: 15px; color: var(--purple); flex: none; }
.tl-chip__meta { display: flex; align-items: center; gap: 4px; font: 600 .85rem var(--font-display); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.tl-chip__sep { opacity: .5; }
.tl-chip.is-turn { border-color: var(--tl-brand); box-shadow: 0 0 0 4px rgba(232, 80, 91, .16), var(--shadow-sm); }
.tl-chip__turn {
  position: absolute; top: -6px; right: -4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--tl-brand); border: 2.5px solid var(--card); animation: tl-ping 1.4s ease-in-out infinite;
}
.tl-chip.is-me .tl-chip__name { color: var(--tl-brand); }
.tl-chip.is-away { opacity: .55; border-style: dashed; }
.tl-chip--pool {
  flex: 0 0 auto; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; padding: 5px 10px 4px 6px;
  position: sticky; left: 0; z-index: 2; background: var(--card-2);
}
.tl-chip__poollabel { font: 800 .62rem var(--font-body); letter-spacing: .03em; text-transform: uppercase; color: var(--fg-2); }
.tl-poolart { position: relative; width: 36px; height: 30px; flex: none; }
.tl-poolart__n {
  position: absolute; right: -8px; bottom: -3px; min-width: 24px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--fg); color: var(--card); font: 700 .8rem/19px var(--font-display); text-align: center; font-variant-numeric: tabular-nums;
}
.tl-poolart i {
  position: absolute; width: 21px; height: 27px; border-radius: 4px;
  background: linear-gradient(135deg, var(--tl-brand), var(--tl-brand-2));
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .25);
}
.tl-poolart i { width: 18px; height: 24px; }
.tl-poolart i:nth-child(1) { left: 0; top: 5px; transform: rotate(-9deg); }
.tl-poolart i:nth-child(2) { left: 5px; top: 2px; }
.tl-poolart i:nth-child(3) { left: 10px; top: 0; transform: rotate(8deg); }

/* status banner */
.tl-banner {
  position: relative; flex: none; display: flex; align-items: center; gap: 10px; min-height: 62px;
  padding: 10px 12px 12px 16px; border-radius: 18px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.tl-banner__main { flex: 1 1 auto; min-width: 0; }
.tl-banner__title { font: 700 1.14rem/1.2 var(--font-display); }
.tl-banner__sub { font-size: .93rem; line-height: 1.32; color: var(--fg-2); margin-top: 2px; }
.tl-banner__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.tl-banner--me { background: linear-gradient(135deg, var(--tl-brand) 0%, #FF7F50 100%); border-color: transparent; color: #fff; box-shadow: 0 10px 24px rgba(232, 80, 91, .28); }
.tl-banner--me .tl-banner__sub { color: rgba(255, 255, 255, .94); }
.tl-banner--away { background: color-mix(in srgb, var(--orange) 16%, var(--card)); border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.tl-banner--watch { background: color-mix(in srgb, var(--purple) 12%, var(--card)); }
.tl-banner--end { background: color-mix(in srgb, var(--green) 14%, var(--card)); }
.tl-banner__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0, 0, 0, .08); }
.tl-banner__bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--teal)); transform-origin: left; transition: transform .25s linear; }
.tl-banner--me .tl-banner__bar { background: rgba(255, 255, 255, .25); }
.tl-banner--me .tl-banner__bar > i { background: #fff; }
.tl-banner__bar.is-low > i { background: var(--yellow); }
.tl-clock { display: inline-flex; align-items: center; gap: 4px; font: 700 1.05rem var(--font-display); font-variant-numeric: tabular-nums; }
.tl-clock .ndj-ic { width: 18px; height: 18px; }
.tl-clock.is-low { color: var(--tl-bad); animation: tl-pulse 1s ease-in-out infinite; }
.tl-banner--me .tl-clock.is-low { color: #FFF2A8; }
.tl-pill {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 12px; border-radius: 999px;
  border: 0; cursor: pointer; font: 600 .9rem var(--font-display); white-space: nowrap;
  background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm);
}
.tl-pill .ndj-ic { width: 18px; height: 18px; }
.tl-banner--me .tl-pill { background: rgba(255, 255, 255, .22); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); }
.tl-skip { background: var(--orange); color: #fff; }

/* the table (felt) */
.tl-board {
  position: relative; flex: 1 1 0; min-height: 150px; overflow: auto; overscroll-behavior: contain;
  padding: 12px; border-radius: 22px;
  background:
    radial-gradient(130% 90% at 50% 0%, var(--tl-felt-1) 0%, var(--tl-felt-2) 62%, var(--tl-felt-3) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .14), inset 0 -12px 30px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(0, 0, 0, .12), var(--shadow-sm);
  color: #fff;
}
.tl-sets { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-start; gap: 10px 10px; --tw: 34px; }
.tl-set {
  position: relative; display: inline-flex; flex-direction: column; gap: 3px; max-width: 100%;
  padding: 6px; border-radius: 13px; background: rgba(255, 255, 255, .10); border: 2px solid rgba(255, 255, 255, .06);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.tl-set__tiles { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.tl-set.is-bad { border-color: var(--tl-bad); background: rgba(255, 84, 104, .18); }
.tl-set__why { font: 700 .74rem/1.2 var(--font-body); color: #FFE1E5; padding: 4px 2px 0; max-width: 220px; }
.tl-set.is-target { border-style: dashed; border-color: rgba(255, 255, 255, .55); cursor: pointer; }
.tl-set.is-target:hover, .tl-set.is-over { background: rgba(255, 255, 255, .2); border-color: #FFD23F; }
.tl-set.is-locked { opacity: .78; }
.tl-set.is-flash, .tl-newset.is-flash, .tl-act.is-flash { animation: tl-flash 1.1s ease-in-out 2; }
.tl-set__add {
  display: inline-grid; place-items: center; width: var(--tw); height: calc(var(--tw) * 1.3); flex: none;
  border-radius: calc(var(--tw) * .17); border: 2px dashed rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .14);
  color: #fff; cursor: pointer; padding: 0;
}
.tl-set__add .ndj-ic { width: 18px; height: 18px; }
.tl-newset {
  display: inline-flex; align-items: center; min-height: calc(var(--tw) * 1.3 + 16px); padding: 8px 14px; border-radius: 13px;
  border: 2px dashed rgba(255, 255, 255, .32); color: rgba(255, 255, 255, .7);
  font: 600 .88rem var(--font-display); text-align: left;
}
.tl-newset.is-ready { display: none; border-color: rgba(255, 210, 63, .7); color: rgba(255, 255, 255, .9); }
.is-dragging .tl-newset.is-ready { display: inline-flex; }
.tl-newset.is-over { background: rgba(255, 210, 63, .28); border-color: #FFD23F; color: #fff; }
.tl-empty, .tl-note { width: 100%; text-align: center; color: rgba(255, 255, 255, .82); font-weight: 700; font-size: .95rem; padding: 18px 8px; }
.tl-note { padding: 4px 8px 0; font-size: .85rem; font-weight: 600; text-align: left; color: rgba(255, 255, 255, .78); }

/* the toolbar that follows your selection (sticks to the bottom of the table) */
.tl-selbar {
  position: sticky; bottom: -12px; z-index: 5; margin: 10px -12px -12px;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px;
  background: rgba(8, 36, 26, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, .12); border-radius: 0 0 22px 22px;
}
.tl-board.has-selbar { padding-bottom: 0; }
.tl-selbar__n { flex: 1 1 auto; min-width: 0; font: 600 .9rem var(--font-display); color: rgba(255, 255, 255, .92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-selbar__n b { font-size: 1rem; color: #fff; }
.tl-selbar__btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 12px; border: 0;
  font: 700 .95rem var(--font-display); cursor: pointer; white-space: nowrap; flex: none;
}
.tl-selbar__btn .ndj-ic { width: 18px; height: 18px; }
.tl-selbar__new { background: #FFD23F; color: #3A2A1A; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.tl-selbar__new.is-over { background: #fff; }
.tl-selbar__rack { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4); }
.tl-selbar__rack.is-over { background: rgba(255, 255, 255, .35); }
.tl-selbar__x {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none;
  background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
}
.tl-selbar__x .ndj-ic { width: 18px; height: 18px; }

/* while dragging: every target grows and lights up */
.is-dragging .tl-set[data-drop] { border-style: dashed; border-color: rgba(255, 255, 255, .55); }
.is-dragging .tl-set[data-drop].is-over { background: rgba(255, 210, 63, .28); border-color: #FFD23F; box-shadow: 0 0 0 4px rgba(255, 210, 63, .25); }
.is-dragging .tl-rack { box-shadow: inset 0 0 0 3px rgba(255, 210, 63, .55), 0 8px 22px rgba(70, 40, 10, .22); }
.is-dragging .tl-rack.is-over { box-shadow: inset 0 0 0 3px #FFD23F, 0 8px 22px rgba(70, 40, 10, .22); }
.is-dragging .tl-set .tl.is-sel { opacity: .45; }
.is-dragging .tl-rack .tl.is-sel { display: none; }
.tl--slot {
  background: rgba(255, 255, 255, .22); border: 2px dashed #FFD23F; box-shadow: none; cursor: default;
}

/* your turn: compact header, more table and rack */
.tl-play.is-focus .tl-players { padding: 2px 2px 3px; margin: -2px -2px -3px; gap: 6px; }
.tl-play.is-focus .tl-chip { min-width: 0; padding: 3px 7px 3px 4px; border-radius: 12px; gap: 5px; }
.tl-play.is-focus .tl-chip .ndj-avatar { width: 24px; height: 24px; font-size: .78rem; }
.tl-play.is-focus .tl-chip__name { font-size: .82rem; }
.tl-play.is-focus .tl-chip__meta { font-size: .78rem; }
.tl-play.is-focus .tl-chip__score { display: none; }
.tl-play.is-focus .tl-chip--pool { flex-direction: row; gap: 6px; padding: 3px 9px 3px 6px; }
.tl-play.is-focus .tl-poolart { width: 28px; height: 24px; }
.tl-play.is-focus .tl-poolart i { width: 14px; height: 19px; }
.tl-play.is-focus .tl-poolart__n { right: -7px; bottom: -4px; min-width: 20px; height: 17px; font-size: .72rem; line-height: 17px; }
.tl-play.is-focus .tl-chip__poollabel { display: none; }
.tl-play.is-focus .tl-banner { min-height: 48px; padding: 7px 10px 9px 14px; border-radius: 15px; }
.tl-play.is-focus .tl-banner__title { font-size: 1rem; }
.tl-play.is-focus .tl-clock { font-size: .95rem; }
.tl-play.is-focus .tl-banner__sub { font-size: .86rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.tl-play.is-focus .tl-pill { min-height: 32px; padding: 3px 10px; font-size: .84rem; }
.tl-play.is-focus .tl-dock__head { min-height: 34px; }
.tl-play.is-focus .tl-dock__title { font-size: .92rem; }
.tl-play.is-focus .tl-seg__btn { min-height: 30px; padding: 3px 10px; font-size: .84rem; }
.tl-play.is-focus .tl-sets { --tw: 38px; }
@media (max-width: 420px) {
  .tl-play.is-focus .tl-chip__name { max-width: 72px; }
}

/* your rack */
.tl-dock { flex: none; display: flex; flex-direction: column; gap: 8px; }
.tl-dock__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.tl-dock__title { font: 700 1rem var(--font-display); white-space: nowrap; }
.tl-dock__count { color: var(--fg-2); font-weight: 600; }
.tl-dock__msg { padding: 16px; border-radius: 16px; background: var(--bg-2); color: var(--fg-2); font-weight: 700; text-align: center; }
.tl-return { background: #FFD23F; color: #3A2A1A; border: 0; min-height: 38px; }
.tl-rack {
  --tw: 44px;
  display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 7px 5px;
  min-height: calc(var(--tw) * 1.3 * var(--rows, 2) + 7px * (var(--rows, 2) - 1) + 26px);
  padding: 12px 8px 14px; border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, var(--tl-wood-1) 0%, var(--tl-wood-2) 62%, var(--tl-wood-3) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .28), inset 0 -7px 0 rgba(0, 0, 0, .2), 0 8px 22px rgba(70, 40, 10, .22);
  transition: box-shadow .15s;
}
.tl-rack.is-over { box-shadow: inset 0 0 0 3px #FFD23F, 0 8px 22px rgba(70, 40, 10, .22); }
.tl-rack:empty::before { content: ""; }
.tl-actions { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
.tl-act { min-height: 52px; padding: 8px 8px; font-size: .96rem; line-height: 1.1; gap: 6px; text-align: center; }
.tl-act .ndj-ic { width: 20px; height: 20px; }
.tl-act-done { position: relative; }
/* the glow breathes by fading a static shadow (opacity runs on the compositor; animating box-shadow repaints every frame) */
.tl-act-done.is-ready::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: 0 8px 28px rgba(255, 107, 107, .65), 0 0 0 4px rgba(255, 159, 67, .3); animation: tl-pulse 1.6s ease-in-out infinite; }

/* ------------------------------------------------------------ end of round */
.tl-overlay {
  position: fixed; inset: 0; z-index: 140; display: flex; align-items: flex-end; justify-content: center;
  padding: 12px 12px 0; background: rgba(15, 15, 35, .5); animation: ndj-fade .25s ease both;
}
.tl-sheet {
  width: min(560px, 100%); max-height: calc(100dvh - 30px); overflow: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg); animation: tl-up .4s cubic-bezier(.2, .8, .2, 1) both;
}
.tl-sheet__hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 6px; }
.tl-sheet__trophy {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--orange)); box-shadow: 0 10px 24px rgba(247, 183, 49, .4);
}
.tl-sheet__trophy .ndj-ic { width: 34px; height: 34px; }
.tl-sheet__hero.is-me .tl-sheet__trophy { animation: tl-bounce 1.2s ease-in-out infinite; }
.tl-sheet__title { font-size: 1.6rem; font-weight: 700; }
.tl-sheet__sub { color: var(--fg-2); }
.tl-sheet__h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 1rem; color: var(--fg-2); margin: 16px 0 8px; }
.tl-sheet__goal { font: 600 .85rem var(--font-body); }
.tl-results, .tl-totals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tl-result { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.tl-result.is-win { background: color-mix(in srgb, var(--green) 14%, var(--card)); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.tl-result__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tl-result__name { font-weight: 800; overflow-wrap: anywhere; }
.tl-result__tiles { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.tl-result__note { color: var(--fg-2); font-size: .88rem; }
.tl-result__pts { font: 700 1.25rem var(--font-display); font-variant-numeric: tabular-nums; }
.tl-result__pts.is-plus { color: #16A05A; }
.tl-result__pts.is-minus { color: var(--tl-bad); }
.tl-total { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg-2); }
.tl-total.is-first { background: color-mix(in srgb, var(--gold) 22%, var(--card)); }
.tl-total__pos { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--card); font: 700 .9rem var(--font-display); }
.tl-total__name { flex: 1 1 auto; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.tl-total__pts { font: 700 1.1rem var(--font-display); font-variant-numeric: tabular-nums; }
.tl-sheet__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); padding: 10px 0 calc(18px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to bottom, transparent, var(--card) 14px); z-index: 2; }
.tl-showres { position: fixed; z-index: 130; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------ pass the phone */
.tl-privacy {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(120% 80% at 50% 0%, #3A2470 0%, #1B1636 70%); animation: ndj-fade .25s ease both;
}
.tl-privacy__box { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: #fff; }
.tl-privacy__box .ndj-avatar--lg { width: 84px; height: 84px; font-size: 2.2rem; box-shadow: 0 0 0 6px rgba(255, 255, 255, .14); }
.tl-privacy__kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; color: rgba(255, 255, 255, .7); }
.tl-privacy__title { font-size: 1.9rem; font-weight: 700; }
.tl-privacy__last { color: rgba(255, 255, 255, .82); min-height: 1.5em; }
.tl-reveal { margin-top: 10px; }
.tl-reveal:disabled { opacity: .75; }

/* ------------------------------------------------------------ modals & rules */
.tl-modal__box { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.tl-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tl-modal__head .ndj-modal__title { margin: 0; }
.tl-modal__x { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--fg); cursor: pointer; flex: none; }
.tl-modal__x .ndj-ic { width: 18px; height: 18px; }
.tl-modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.tl-invite.ndj-share { box-shadow: none; border: 0; padding: 0; }
.tl-rules { display: flex; flex-direction: column; gap: 14px; }
.tl-rules__lead { font-weight: 700; }
.tl-rules__sets { display: flex; flex-direction: column; gap: 10px; }
.tl-rules__set {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: radial-gradient(140% 120% at 0% 0%, var(--tl-felt-1), var(--tl-felt-2)); color: #fff;
}
.tl-rules__set p { font-size: .92rem; line-height: 1.35; }
.tl-example { display: inline-flex; gap: 3px; flex: none; }
.tl-rules__list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--fg); }
.tl-rules__list li { line-height: 1.45; }
.tl-rulescard { padding: 0; overflow: hidden; }
.tl-rulescard > summary {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; list-style: none;
  font: 600 1.1rem var(--font-display);
}
.tl-rulescard > summary::-webkit-details-marker { display: none; }
.tl-rulescard > summary::after { content: "+"; margin-left: auto; font: 700 1.4rem var(--font-display); color: var(--fg-2); transition: transform .2s; }
.tl-rulescard[open] > summary::after { transform: rotate(45deg); }
.tl-rulescard > summary .ndj-ic { color: var(--tl-brand); width: 22px; height: 22px; }
.tl-rulescard > .tl-rules { padding: 0 20px 20px; }

/* ------------------------------------------------------------ bigger screens */
@media (min-width: 560px) {
  .tl-chip { gap: 8px; padding: 6px 10px 6px 6px; }
  .tl-chip .ndj-avatar { width: 34px; height: 34px; font-size: .95rem; }
  .tl-chip__score { display: inline; }
  .tl-chip__score .tl-chip__sep { margin: 0 4px; }
}
@media (min-width: 760px) {
  .tl-sets { --tw: 40px; gap: 12px; }
  .tl-banner__title { font-size: 1.25rem; }
  .tl-chip:not(.tl-chip--pool) { min-width: 120px; }
  .tl-actions { grid-template-columns: 1fr 1fr 1.4fr; max-width: 640px; width: 100%; margin: 0 auto; }
  .tl-rules__set p { font-size: .98rem; }
}
@media (max-width: 370px) {
  .tl-act { font-size: .88rem; padding: 6px; }
  .tl-act .ndj-ic { display: none; }
  .tl-seg__btn { padding: 4px 9px; }
}

/* ------------------------------------------------------------ animations */
@keyframes tl-ping { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes tl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes tl-glow { 0%, 100% { box-shadow: 0 8px 20px rgba(255, 107, 107, .35), inset 0 -3px 0 rgba(0, 0, 0, .12); } 50% { box-shadow: 0 8px 28px rgba(255, 107, 107, .65), 0 0 0 4px rgba(255, 159, 67, .3), inset 0 -3px 0 rgba(0, 0, 0, .12); } }
@keyframes tl-flash { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 4px #FFD23F, 0 0 24px rgba(255, 210, 63, .7); } }
@keyframes tl-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tl-bounce { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) {
  .tl, .tl-set, .tl-chip { transition: none; }
}

/* ============================================================ refinement pass: same identity, more finish */
/* status banner: darker coral→orange so the white copy clears AA, hairline + inner highlight */
.tl-banner { border-radius: 20px; box-shadow: 0 14px 28px -22px rgba(43, 45, 66, .5), inset 0 1px 0 rgba(255, 255, 255, .8); }
.tl-banner--me {
  background: linear-gradient(135deg, #D23F4C 0%, #DB5530 100%);
  box-shadow: 0 16px 30px -18px rgba(210, 63, 76, .65), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .1);
}
.tl-banner--me .tl-banner__sub { color: #fff; }
.tl-banner--me .tl-pill { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .25); }
.tl-pill { border: 1px solid rgba(43, 45, 66, .07); box-shadow: 0 6px 14px -10px rgba(43, 45, 66, .45), inset 0 1px 0 rgba(255, 255, 255, .8); }
.tl-banner--me .tl-pill { border-color: transparent; }
.tl-skip { background: linear-gradient(180deg, #E47A22, #CC6410); color: #fff; border-color: transparent; }

/* player chips */
.tl-chip { border: 1px solid rgba(43, 45, 66, .07); border-radius: 16px; box-shadow: 0 12px 22px -18px rgba(43, 45, 66, .55), inset 0 1px 0 rgba(255, 255, 255, .8); }
.tl-chip.is-turn { border-color: color-mix(in srgb, var(--tl-brand) 80%, transparent); box-shadow: 0 0 0 3px rgba(232, 80, 91, .16), 0 12px 22px -16px rgba(232, 80, 91, .55), inset 0 1px 0 rgba(255, 255, 255, .8); }
.tl-chip.is-me .tl-chip__name { color: var(--tl-brand-2); }
:root[data-theme="dark"] .tl-chip.is-me .tl-chip__name { color: #FF8A93; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-chip.is-me .tl-chip__name { color: #FF8A93; } }
.tl-poolart__n { box-shadow: 0 0 0 2px var(--card); }

/* the felt table: finer vignette + hairline */
.tl-board {
  border-radius: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 55%),
    radial-gradient(130% 90% at 50% 0%, var(--tl-felt-1) 0%, var(--tl-felt-2) 62%, var(--tl-felt-3) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -14px 32px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(0, 0, 0, .14), 0 18px 34px -26px rgba(43, 45, 66, .55);
}
.tl-set { border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .07)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 6px 12px -8px rgba(0, 0, 0, .35); }
.tl-set.is-bad { border-color: var(--tl-bad); background: rgba(255, 84, 104, .2); }
.tl-set__why { color: #FFE9EC; }
.tl-set.is-target, .is-dragging .tl-set[data-drop] { border-width: 1.5px; }
.tl-newset, .tl-empty { color: rgba(255, 255, 255, .85); }
.tl-newset { border-width: 1.5px; border-radius: 14px; }

/* tiles: more tactile */
.tl {
  background: linear-gradient(180deg, #FFFEF9 0%, var(--tl-ivory) 35%, var(--tl-ivory-2) 100%);
  box-shadow: inset 0 calc(var(--w) * -.07) 0 rgba(120, 88, 40, .22), inset 0 1px 0 #fff, inset 0 0 0 1px rgba(120, 88, 40, .1), 0 1px 1px rgba(0, 0, 0, .2), 0 4px 8px -2px rgba(30, 20, 5, .22);
}
.tl.is-sel { box-shadow: 0 0 0 3px #FFD23F, 0 12px 18px -6px rgba(0, 0, 0, .35), inset 0 calc(var(--w) * -.07) 0 rgba(120, 88, 40, .22); }

/* the wooden rack */
.tl-rack {
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 2px, rgba(0, 0, 0, .025) 2px 5px),
    linear-gradient(180deg, var(--tl-wood-1) 0%, var(--tl-wood-2) 62%, var(--tl-wood-3) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 -7px 0 rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(60, 30, 5, .25), 0 18px 30px -20px rgba(70, 40, 10, .6);
}
.tl-rack.is-over { box-shadow: inset 0 0 0 3px #FFD23F, 0 18px 30px -20px rgba(70, 40, 10, .6); }
.is-dragging .tl-rack { box-shadow: inset 0 0 0 3px rgba(255, 210, 63, .55), 0 18px 30px -20px rgba(70, 40, 10, .6); }
.is-dragging .tl-rack.is-over { box-shadow: inset 0 0 0 3px #FFD23F, 0 18px 30px -20px rgba(70, 40, 10, .6); }

/* dock header, segmented control, selection bar */
.tl-seg { border-color: rgba(43, 45, 66, .07); box-shadow: inset 0 1px 2px rgba(43, 45, 66, .06); }
.tl-seg__btn.is-on { box-shadow: 0 4px 10px -6px rgba(43, 45, 66, .5), inset 0 1px 0 rgba(255, 255, 255, .8); }
.tl-selbar { background: rgba(8, 36, 26, .9); backdrop-filter: none; -webkit-backdrop-filter: none; }
.tl-selbar__new { background: linear-gradient(180deg, #FFDB5C, #F5C21F); box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
.tl-return { background: linear-gradient(180deg, #FFDB5C, #F5C21F); }
.tl-iconbtn, .tl-modal__x { border-width: 1px; border-color: rgba(43, 45, 66, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8); }
.tl-act { min-height: 52px; }

/* end-of-round sheet */
.tl-sheet { border-radius: 28px 28px 0 0; box-shadow: 0 -24px 48px -24px rgba(43, 45, 66, .45), inset 0 1px 0 rgba(255, 255, 255, .8); }
.tl-sheet__trophy { box-shadow: 0 16px 28px -14px rgba(247, 183, 49, .7), inset 0 1px 0 rgba(255, 255, 255, .4); }
.tl-result { border-color: rgba(43, 45, 66, .07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.tl-result__pts.is-plus { color: #0E7C42; }
.tl-total { border: 1px solid rgba(43, 45, 66, .06); }
.tl-total.is-first { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.tl-rules__set { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 10px 18px -14px rgba(15, 82, 58, .7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-result__pts.is-plus { color: #4ADE80; } }
:root[data-theme="dark"] .tl-result__pts.is-plus { color: #4ADE80; }

/* short phones (360x640): the whole turn, buttons included, fits above the fold */
@media (max-height: 700px) {
  .tl-play { min-height: 0; gap: 7px; }
  .tl-board { min-height: 84px; padding: 9px; }
  .tl-dock { gap: 6px; }
  .tl-dock__head { min-height: 30px; }
  .tl-rack { padding: 9px 6px 11px; gap: 6px 4px; }
  .tl-act { min-height: 48px; }
  .tl-play.is-focus .tl-banner__sub { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-chip__turn, .tl-clock.is-low, .tl-act-done.is-ready::after, .tl-sheet__hero.is-me .tl-sheet__trophy { animation: none; }
}

/* family night scoreboard inside the results sheet */
.tl-fam { margin: 16px 0 4px; }

/* ============================================================ round 7: the Juntos promo palette (coral→orange hero, cream, navy, white pills), a table anyone can read */
:root {
  --tl-brand: #FF6B4A;
  --tl-brand-2: #FF9A3C;
  --tl-hero: linear-gradient(145deg, #FF6B4A 0%, #FF9A3C 100%);
  --tl-navy: radial-gradient(circle at 30% 18%, #3A3D5C 0%, #1F2137 78%);
  --tl-ink: #2B2D42;
  --tl-hl: #FFB300;
  /* tile inks: vivid, AA-ish on ivory for large bold numerals; the shapes below them carry the color for color-blind players */
  --tl-red: #D91E48;
  --tl-blue: #1F5FE0;
  --tl-orange: #128C3C;
  --tl-black: #1F2137;
  --tl-bad: #E0294A;
  --tl-edge: rgba(43, 45, 66, .08);
  --tl-pill-sh: 0 8px 18px -10px rgba(43, 45, 66, .45), 0 1px 0 rgba(255, 255, 255, .9) inset;
}
body {
  background: radial-gradient(900px 480px at 100% -5%, rgba(255, 154, 60, .16), transparent 62%), radial-gradient(800px 480px at -10% 8%, rgba(255, 107, 74, .12), transparent 60%), linear-gradient(180deg, #FFF7F0 0%, #FFE9DA 100%);
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background: radial-gradient(circle at 30% 0%, #3A3D5C 0%, #1F2137 72%); background-attachment: fixed; }
}
:root[data-theme="dark"] body { background: radial-gradient(circle at 30% 0%, #3A3D5C 0%, #1F2137 72%); background-attachment: fixed; }
html { --ndj-toast-bottom: 96px; }   /* the shared toasts sit above the buttons, never on them */

/* buttons: the hero gradient with a gentle top sheen and a coral glow */

.ndj-card, .ndj-share { border-radius: 24px; }
.tl-chipbtn { background: #fff; border: 1.5px solid rgba(43, 45, 66, .1); border-radius: 15px; box-shadow: var(--tl-pill-sh); min-height: 48px; }
:root[data-theme="dark"] .tl-chipbtn { background: var(--card-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-chipbtn { background: var(--card-2); } }
.tl-chipbtn.is-on { background: var(--tl-hero); border-color: transparent; color: #fff; text-shadow: 0 1px 2px rgba(160, 40, 10, .35); box-shadow: 0 10px 18px -8px rgba(255, 107, 74, .75), inset 0 1px 0 rgba(255, 255, 255, .5); }

/* ---- tiles: ivory, tactile, bigger numerals and shapes */
.tl {
  height: calc(var(--w) * 1.34); border-radius: calc(var(--w) * .2); gap: calc(var(--w) * .035);
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF6 38%, #F7ECD9 100%);
  box-shadow: inset 0 calc(var(--w) * -.08) 0 rgba(150, 105, 50, .22), inset 0 1.5px 0 #fff, inset 0 0 0 1px rgba(150, 105, 50, .16), 0 1px 1px rgba(20, 20, 40, .28), 0 6px 10px -4px rgba(20, 20, 40, .4);
}
.tl__n { font-size: calc(var(--w) * .6); margin-top: calc(var(--w) * .02); }
.tl__m { width: calc(var(--w) * .25); height: calc(var(--w) * .25); opacity: 1; }
.tl--c1 .tl__m { transform: scale(.86); }
.tl--c3 .tl__m { transform: scale(1.18); }
.tl.is-sel { translate: 0 -6px; box-shadow: 0 0 0 3px var(--tl-hl), 0 0 0 6px rgba(255, 179, 0, .38), 0 14px 18px -6px rgba(0, 0, 0, .45), inset 0 calc(var(--w) * -.08) 0 rgba(150, 105, 50, .22); }
.tl.is-fresh { box-shadow: 0 0 0 2.5px rgba(255, 179, 0, .95), 0 6px 10px -4px rgba(20, 20, 40, .4); }
/* easy help: a tile that already works glows (a soft breathing ring, not just a color) */
.tl.is-help::before { content: ""; position: absolute; inset: -3px; border-radius: calc(var(--w) * .26); pointer-events: none; box-shadow: 0 0 0 2.5px var(--tl-hl), 0 0 14px 2px rgba(255, 179, 0, .7); animation: tl-pulse 1.8s ease-in-out infinite; }
.tl.is-help.is-sel::before { display: none; }
.tl-glyph { background: linear-gradient(180deg, #fff, #F7ECD9); }
.tl-drag > .tl { box-shadow: 0 0 0 3px var(--tl-hl), 0 16px 26px -8px rgba(0, 0, 0, .5); }
.tl-back { background: var(--tl-hero); }

/* ---- the players strip: white pills, a coral ring on whose turn it is */
.tl-chip { min-height: 50px; border-radius: 18px; background: #fff; border: 1px solid var(--tl-edge); box-shadow: 0 10px 18px -14px rgba(43, 45, 66, .55), 0 1px 0 rgba(255, 255, 255, .9) inset; }
:root[data-theme="dark"] .tl-chip { background: var(--card); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-chip { background: var(--card); } }
.tl-chip.is-turn { border-color: var(--tl-brand); box-shadow: 0 0 0 3px rgba(255, 107, 74, .25), 0 12px 20px -12px rgba(255, 107, 74, .8); }
.tl-chip.is-me .tl-chip__name { color: #D2381C; }
:root[data-theme="dark"] .tl-chip.is-me .tl-chip__name { color: #FF9A80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-chip.is-me .tl-chip__name { color: #FF9A80; } }
.tl-chip__turn { background: var(--tl-hero); }
.tl-chip__name { font-size: .95rem; }
.tl-chip__meta { font-size: .88rem; }
.tl-poolart i, .tl-poolart i { background: var(--tl-hero); }

/* ---- the instruction banner: big title, one plain line in a white pill */
.tl-banner {
  gap: 12px; min-height: 76px; padding: 10px 14px 12px 12px; border-radius: 22px;
  background: #fff; border: 1px solid var(--tl-edge); border-left: 7px solid #3A3D5C;
  box-shadow: 0 14px 24px -18px rgba(43, 45, 66, .5), inset 0 1px 0 rgba(255, 255, 255, .9);
}
:root[data-theme="dark"] .tl-banner { background: var(--card); border-left-color: #8B8FC7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-banner { background: var(--card); border-left-color: #8B8FC7; } }
.tl-banner__icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #3A3D5C; background: color-mix(in srgb, #3A3D5C 12%, transparent); }
:root[data-theme="dark"] .tl-banner__icon { color: #C9CCF5; background: rgba(255, 255, 255, .1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-banner__icon { color: #C9CCF5; background: rgba(255, 255, 255, .1); } }
.tl-banner__icon .ndj-ic { width: 26px; height: 26px; }
.tl-banner__title { font-size: clamp(1.2rem, 5.6vw, 1.55rem); line-height: 1.1; }
.tl-banner__sub { font-size: .95rem; line-height: 1.3; margin-top: 4px; }
.tl-banner--watch { background: color-mix(in srgb, var(--purple) 10%, #fff); border-left-color: var(--purple); }
.tl-banner--away { background: color-mix(in srgb, var(--orange) 16%, #fff); border-left-color: var(--orange); }
.tl-banner--end { background: color-mix(in srgb, var(--gold) 20%, #fff); border-left-color: var(--gold); }
:root[data-theme="dark"] .tl-banner--watch, :root[data-theme="dark"] .tl-banner--away, :root[data-theme="dark"] .tl-banner--end { background: var(--card); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-banner--watch, :root:not([data-theme="light"]) .tl-banner--away, :root:not([data-theme="light"]) .tl-banner--end { background: var(--card); } }
.tl-banner--me {
  color: #fff; background: var(--tl-hero); border: 0;
  box-shadow: 0 18px 30px -14px rgba(255, 107, 74, .8), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(190, 55, 20, .18);
}
.tl-banner--me::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46%; background: linear-gradient(rgba(255, 255, 255, .26), rgba(255, 255, 255, 0)); pointer-events: none; }
.tl-banner--me .tl-banner__title { color: #fff; text-shadow: 0 2px 3px rgba(160, 40, 10, .4); }
.tl-banner--me .tl-banner__sub { display: inline-block; margin-top: 6px; padding: 3px 12px; border-radius: 14px; background: #fff; color: var(--tl-ink); font-weight: 700; text-shadow: none; box-shadow: 0 4px 10px -6px rgba(160, 40, 10, .7); }
.tl-banner--me .tl-banner__icon { color: #E04A2C; background: #fff; box-shadow: 0 6px 12px -6px rgba(160, 40, 10, .7); }
.tl-banner--me.is-warn { background: linear-gradient(145deg, #E0294A 0%, #FF6B4A 100%); }
.tl-banner--me.is-warn .tl-banner__sub { background: #FFF0F2; color: #8A1230; }
.tl-banner--me.is-warn .tl-banner__icon { color: #C81D3E; animation: tl-wiggle .5s ease-in-out 2; }
.tl-banner--me.is-good .tl-banner__icon { color: #0E9F5B; }
.tl-banner--me .tl-clock { color: var(--tl-ink); background: #fff; padding: 2px 12px; border-radius: 999px; box-shadow: 0 4px 10px -6px rgba(160, 40, 10, .7); }
.tl-banner--me .tl-clock.is-low { color: #B3200F; }
.tl-banner--me .tl-banner__bar { background: rgba(255, 255, 255, .3); }
.tl-banner--me .tl-banner__bar > i { background: #fff; }
.tl-banner__side { align-self: flex-start; }
.tl-meter { display: block; height: 9px; margin-top: 8px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .38); box-shadow: inset 0 1px 2px rgba(160, 40, 10, .25); }
.tl-meter > i { display: block; height: 100%; border-radius: inherit; background: #fff; transform-origin: left; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.tl-meter.is-full > i { background: #FFE66D; }
.tl-pill { min-height: 44px; border-radius: 999px; }
.tl-skip { background: #fff; color: #A8420A; border: 1px solid rgba(43, 45, 66, .1); }

/* ---- the table: deep navy felt in a coral rim */
.tl-boardwrap { position: relative; flex: 1 1 0; min-height: 150px; display: flex; flex-direction: column; }
.tl-board {
  flex: 1 1 auto; min-height: 0; border: 4px solid transparent; border-radius: 26px; padding: 10px;
  background:
    radial-gradient(120% 70% at 50% -12%, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 55%) padding-box,
    radial-gradient(circle at 30% 18%, #3A3D5C 0%, #1F2137 82%) padding-box,
    linear-gradient(180deg, #FFB49A 0%, #FF6B4A 48%, #E8483A 100%) border-box;
  box-shadow: inset 0 10px 24px rgba(8, 10, 30, .45), 0 18px 28px -20px rgba(232, 72, 58, .75), 0 3px 6px -2px rgba(43, 45, 66, .4);
  color: #fff;
}
.tl-sets { --tw: 36px; gap: 10px; }
.tl-set { padding: 7px; border-radius: 16px; background: rgba(255, 255, 255, .09); border: 1.5px solid rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.tl-set.is-bad { border-color: var(--tl-bad); background: rgba(224, 41, 74, .22); }
.tl-set__why { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; max-width: 100%; margin-top: 4px; padding: 2px 10px 2px 6px; border-radius: 999px; background: var(--tl-bad); color: #fff; font: 700 .8rem/1.25 var(--font-body); }
.tl-set__why .ndj-ic { width: 14px; height: 14px; flex: none; }
.tl-set__tag { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: 4px; padding: 2px 10px 2px 6px; border-radius: 999px; background: #fff; color: var(--tl-ink); font: 700 .8rem/1.25 var(--font-body); }
.tl-set__tag .ndj-ic { width: 14px; height: 14px; color: #0E9F5B; }
.tl-set__tag b { color: #C2410C; font-family: var(--font-display); }
.tl-set.is-target { border-color: rgba(255, 255, 255, .5); }
.tl-set.is-fit { border-style: solid; border-color: var(--tl-hl); background: rgba(255, 179, 0, .18); box-shadow: 0 0 0 4px rgba(255, 179, 0, .28), 0 0 18px rgba(255, 179, 0, .35); }
.tl-set__add { width: var(--tw); height: calc(var(--tw) * 1.34); border: 2px dashed rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .14); }
.tl-set__add.is-fit { border: 0; background: linear-gradient(180deg, #FFD36B, var(--tl-hl)); color: #3A2A00; box-shadow: 0 8px 14px -6px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .6); animation: tl-pulse 1.4s ease-in-out infinite; }
.tl-set__add .ndj-ic { width: 20px; height: 20px; }
.tl-newset { border-radius: 16px; border-color: rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .88); font-size: .95rem; }
.tl-empty, .tl-note { color: rgba(255, 255, 255, .88); }
.tl-note { font-size: .88rem; }
.tl-selbar { background: rgba(20, 22, 44, .94); border-top: 1px solid rgba(255, 255, 255, .14); border-radius: 0 0 20px 20px; }
.tl-selbar__n { font-size: .95rem; }
.tl-selbar__btn { min-height: 46px; border-radius: 14px; }
.tl-selbar__new { background: linear-gradient(180deg, #FFD36B, var(--tl-hl)); color: #3A2A00; }
.tl-selbar__new.is-valid { box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 0 18px 2px rgba(255, 179, 0, .8); animation: tl-pulse 1.3s ease-in-out infinite; }
.tl-selbar__x { width: 44px; height: 44px; }
.tl--slot { background: rgba(255, 255, 255, .2); border: 2px dashed var(--tl-hl); }

/* ---- quick captions: a pill over the bottom of the table that never catches a tap */
.tl-quip {
  position: absolute; left: 50%; bottom: 14px; translate: -50% 0; z-index: 9; max-width: 92%; display: flex; align-items: center; gap: 8px;
  padding: 8px 18px 8px 10px; border-radius: 999px; pointer-events: none; color: #fff; background: var(--tl-hero); text-shadow: 0 2px 3px rgba(160, 40, 10, .38);
  box-shadow: 0 14px 24px -12px rgba(150, 50, 20, .8), inset 0 1px 0 rgba(255, 255, 255, .45);
  font: 800 clamp(.98rem, 4.4vw, 1.2rem)/1.15 var(--font-display); animation: tl-quip 2.9s ease both;
}
.tl-quip__e { font-size: 1.7rem; line-height: 1; font-style: normal; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; animation: tl-emojipop .6s cubic-bezier(.2, 1.8, .4, 1) both; text-shadow: none; }

/* ---- your rack: a navy tray; on your turn its rim lights up coral */
.tl-dock { gap: 8px; }
.tl-dock__title { font-size: 1.08rem; }
.tl-seg { padding: 3px; border-radius: 14px; background: #fff; border: 1px solid var(--tl-edge); box-shadow: inset 0 1px 2px rgba(43, 45, 66, .06); }
:root[data-theme="dark"] .tl-seg { background: var(--card-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-seg { background: var(--card-2); } }
.tl-seg__btn { min-height: 42px; padding: 4px 13px; border-radius: 11px; font-size: .95rem; display: inline-flex; align-items: center; gap: 6px; }
.tl-seg__btn .ndj-ic { width: 18px; height: 18px; }
.tl-seg__btn.is-on { background: var(--tl-hero); color: #fff; text-shadow: 0 1px 2px rgba(160, 40, 10, .35); box-shadow: 0 6px 12px -6px rgba(255, 107, 74, .8), inset 0 1px 0 rgba(255, 255, 255, .5); }
.tl-rack {
  border: 4px solid transparent; border-radius: 24px; padding: 10px 6px 12px;
  background:
    radial-gradient(ellipse at 38% 22%, #4A4E7A 0%, #1F2137 100%) padding-box,
    linear-gradient(180deg, #7A7EA6, #43476E) border-box;
  box-shadow: inset 0 10px 24px rgba(8, 10, 30, .5), inset 0 -1px 0 rgba(255, 255, 255, .12), 0 18px 28px -20px rgba(31, 33, 55, .85);
}
.tl-dock.is-mine .tl-rack {
  background:
    radial-gradient(ellipse at 38% 22%, #4A4E7A 0%, #1F2137 100%) padding-box,
    linear-gradient(180deg, #FFB49A 0%, #FF6B4A 48%, #E8483A 100%) border-box;
  box-shadow: inset 0 10px 24px rgba(8, 10, 30, .5), 0 0 0 3px rgba(255, 154, 60, .35), 0 16px 26px -12px rgba(255, 107, 74, .75);
}
.tl-rack.is-over, .tl-dock.is-mine .tl-rack.is-over { box-shadow: inset 0 0 0 3px var(--tl-hl), 0 16px 26px -12px rgba(255, 107, 74, .75); }
.is-dragging .tl-rack { box-shadow: inset 0 0 0 3px rgba(255, 179, 0, .6), 0 16px 26px -12px rgba(255, 107, 74, .75); }
.is-dragging .tl-rack.is-over { box-shadow: inset 0 0 0 3px var(--tl-hl), 0 16px 26px -12px rgba(255, 107, 74, .75); }
.tl-dock__msg { border-radius: 18px; background: #fff; box-shadow: var(--tl-pill-sh); }
:root[data-theme="dark"] .tl-dock__msg { background: var(--card); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-dock__msg { background: var(--card); } }
.tl-return { background: linear-gradient(180deg, #FFD36B, var(--tl-hl)); }

/* ---- the four buttons: big, with the icon above the word */
.tl-actions { grid-template-columns: 1fr 1fr 1fr 1.55fr; gap: 8px; }
.tl-act { flex-direction: column; min-height: 60px; padding: 6px 4px; gap: 3px; font: 700 .86rem/1.1 var(--font-display); border-radius: 18px; overflow: visible; }
.tl-act .ndj-ic { width: 24px; height: 24px; display: block; }
.tl-act-done { font-size: .98rem; }
.tl-act:disabled { opacity: .5; }
.tl-act-done:disabled { opacity: 1; background: #F3D9CF; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); text-shadow: none; }
:root[data-theme="dark"] .tl-act-done:disabled { background: #5A4A58; color: #C8BFD0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-act-done:disabled { background: #5A4A58; color: #C8BFD0; } }
.tl-act-done.is-ready::after { box-shadow: 0 10px 28px rgba(255, 107, 74, .75), 0 0 0 4px rgba(255, 179, 0, .4); }
.tl-act-draw { position: relative; }
.tl-act-draw.is-nudge { box-shadow: 0 0 0 3px var(--tl-hl), 0 10px 20px -8px rgba(255, 179, 0, .8); }
.tl-act-hint .ndj-ic { color: #E8890C; }

/* ---- switches and "your helps" */
.tl-prefs { display: flex; flex-direction: column; gap: 10px; }
.tl-prefscard .ndj-section-title { margin-bottom: 10px; }
.tl-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 62px; padding: 8px 14px; border-radius: 16px; border: 1px solid var(--tl-edge); background: #fff; box-shadow: var(--tl-pill-sh); text-align: left; cursor: pointer; color: var(--fg); }
:root[data-theme="dark"] .tl-switch { background: var(--card-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-switch { background: var(--card-2); } }
.tl-switch__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tl-switch__t { font: 700 1rem var(--font-display); }
.tl-switch__h { font-size: .84rem; line-height: 1.25; color: var(--fg-2); }
.tl-switch__sw { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: #C9C6D6; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .22); transition: background .2s; }
.tl-switch__sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s; }
.tl-switch.is-on .tl-switch__sw { background: var(--tl-hero); }
.tl-switch.is-on .tl-switch__sw::after { transform: translateX(20px); }
.tl-help__more { font: 700 1.05rem var(--font-display); margin: 20px 0 10px; color: var(--fg-2); }
.tl-helpwrap { display: flex; flex-direction: column; }

/* ---- the first-time guide */
.tl-guide { display: flex; flex-direction: column; gap: 12px; }
.tl-guide__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tl-guide__step { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 18px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--tl-edge); }
.tl-guide__n { position: absolute; left: -4px; top: -4px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: #2B2D42; font: 800 .8rem var(--font-display); box-shadow: 0 2px 5px rgba(0, 0, 0, .25); }
.tl-guide__ic { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; color: #fff; background: var(--tl-hero); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 14px -8px rgba(255, 107, 74, .8); }
.tl-guide__ic .ndj-ic { width: 30px; height: 30px; }
.tl-guide__ic--num { font: 700 1.6rem var(--font-display); text-shadow: 0 2px 3px rgba(160, 40, 10, .35); }
.tl-guide__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tl-guide__txt strong { font: 700 1.1rem/1.15 var(--font-display); }
.tl-guide__txt > span { font-size: .95rem; line-height: 1.3; color: var(--fg-2); }
.tl-guide__ex { display: inline-flex; margin-top: 6px; padding: 6px; border-radius: 12px; background: radial-gradient(circle at 30% 18%, #3A3D5C 0%, #1F2137 90%); width: fit-content; }
.tl-guide__exs { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-guide__win { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--gold) 26%, var(--card)); font: 700 1rem/1.25 var(--font-display); }
.tl-guide__win .ndj-ic { width: 28px; height: 28px; flex: none; color: #B07A00; }
.tl-guide__ok { width: 100%; }
.tl-modal__box { border-radius: 26px; }
.tl-rules__set { background: radial-gradient(circle at 30% 18%, #3A3D5C 0%, #1F2137 90%); box-shadow: 0 10px 18px -14px rgba(31, 33, 55, .8); }

/* ---- lobby: the start button follows you */
.tl-lobby > .tl-actionbar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 4; }
.tl-lobby .tl-start, .tl-setup .tl-setup__start { min-height: 58px; font-size: 1.15rem; }
.tl-setup__start:disabled, .tl-start:disabled { background: #F6C9BA; color: #fff; box-shadow: none; }
.tl-lobby > .tl-actionbar .muted { background: color-mix(in srgb, var(--card) 92%, transparent); border-radius: 14px; padding: 6px 10px; }
.tl-botav { background: linear-gradient(135deg, #6C63FF, #A855F7) !important; }

/* ---- end of round / game: the hero gradient full-bleed, white cards for the numbers */
.tl-overlay {
  display: block; overflow: auto; overscroll-behavior: contain; padding: 0; z-index: 140;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .24) 0%, rgba(255, 255, 255, 0) 55%), var(--tl-hero);
}
.tl-sheet {
  width: min(560px, 100%); max-height: none; margin: 0 auto; overflow: visible; background: transparent; box-shadow: none; border-radius: 0; animation: none;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 0; display: flex; flex-direction: column; gap: 14px; min-height: 100%;
}
.tl-sheet__hero { padding-bottom: 0; gap: 8px; color: #fff; }
.tl-sheet__trophy { width: 76px; height: 76px; border-radius: 50%; color: #E8890C; background: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .35), 0 18px 28px -10px rgba(160, 40, 10, .7); }
.tl-sheet__trophy .ndj-ic { width: 42px; height: 42px; }
.tl-sheet__title { font-size: clamp(1.8rem, 8.4vw, 2.4rem); line-height: 1.05; color: #fff; text-shadow: 0 3px 5px rgba(160, 40, 10, .4); }
.tl-sheet__sub { display: inline-block; padding: 5px 16px; border-radius: 16px; background: #fff; color: var(--tl-ink); font-weight: 700; max-width: 100%; box-shadow: 0 6px 12px -8px rgba(160, 40, 10, .7); }
.tl-sheet__card { background: var(--card); border-radius: 24px; padding: 6px 14px 16px; box-shadow: 0 20px 34px -22px rgba(120, 30, 10, .7); }
.tl-sheet__h { margin: 14px 0 8px; }
.tl-fam { margin: 0; }
.tl-fam > * { border-radius: 24px; }
.tl-sheet__actions { position: sticky; bottom: 0; margin: auto -16px 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px)); gap: 10px; z-index: 3;
  background: linear-gradient(to bottom, rgba(255, 140, 70, 0), #FF8247 28px); }
.tl-sheet__actions .tl-next { background: #fff; color: #D2381C; text-shadow: none; box-shadow: 0 16px 26px -10px rgba(120, 30, 10, .75), inset 0 -3px 0 rgba(210, 56, 28, .12); }
.tl-sheet__actions .tl-next::before { display: none; }
.tl-sheet__actions .btn-secondary { background: rgba(255, 255, 255, .22); color: #fff; border: 1.5px solid rgba(255, 255, 255, .7); box-shadow: none; text-shadow: 0 1px 2px rgba(160, 40, 10, .35); }
.tl-sheet__actions .btn-ghost { color: #fff; text-shadow: 0 1px 2px rgba(160, 40, 10, .35); }
.tl-sheet__actions .tl-wait { background: #fff; color: var(--tl-ink); border-radius: 16px; }
.tl-showres { background: var(--tl-hero); }
.tl-result.is-win { background: color-mix(in srgb, var(--green) 14%, var(--card)); }
.tl-total.is-first { background: color-mix(in srgb, var(--gold) 26%, var(--card)); }
.tl-podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 0 4px; }
.tl-podium__col { flex: 1 1 0; max-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 0; }
.tl-podium__who { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 6px; width: 100%; border-radius: 18px 18px 0 0; background: #fff; color: var(--tl-ink); text-align: center; min-width: 0; }
.tl-podium__who .ndj-avatar { width: 44px; height: 44px; font-size: 1.15rem; margin-top: -26px; box-shadow: 0 0 0 3px #fff, 0 6px 10px -4px rgba(0, 0, 0, .4); }
.tl-podium__who b { font: 700 .95rem/1.1 var(--font-display); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-podium__who i { font: 700 1.05rem var(--font-display); font-style: normal; color: #C2410C; }
.tl-podium__step { width: 100%; display: grid; place-items: center; font: 700 1.5rem var(--font-display); color: #fff; background: rgba(31, 33, 55, .88); text-shadow: 0 2px 3px rgba(0, 0, 0, .4); }
.tl-podium__col--1 .tl-podium__step { height: 58px; background: linear-gradient(180deg, #FFD36B, #E8890C); color: #4A2A00; text-shadow: none; }
.tl-podium__col--2 .tl-podium__step { height: 40px; }
.tl-podium__col--3 .tl-podium__step { height: 28px; }
.tl-podium__col--1 .tl-podium__who { padding-top: 14px; }
.tl-podium__col { margin-top: 26px; }

/* ---- pass the phone: the navy of the promo */
.tl-privacy { background: radial-gradient(circle at 30% 18%, #3A3D5C 0%, #1F2137 80%); }
.tl-privacy__title { text-shadow: 0 3px 5px rgba(0, 0, 0, .4); }

/* ---- dark mode touches */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tl-overlay { background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, 0) 55%), radial-gradient(circle at 30% 18%, #3A3D5C 0%, #1F2137 82%); }
  :root:not([data-theme="light"]) .tl-sheet__actions { background: linear-gradient(to bottom, rgba(31, 33, 55, 0), #1F2137 28px); }
  :root:not([data-theme="light"]) .tl-sheet__title { color: #FFE66D; }
}
:root[data-theme="dark"] .tl-overlay { background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, 0) 55%), radial-gradient(circle at 30% 18%, #3A3D5C 0%, #1F2137 82%); }
:root[data-theme="dark"] .tl-sheet__actions { background: linear-gradient(to bottom, rgba(31, 33, 55, 0), #1F2137 28px); }
:root[data-theme="dark"] .tl-sheet__title { color: #FFE66D; }

/* ---- short phones (360x640) and the compact "your turn" header */
.tl-play.is-focus .tl-banner { min-height: 72px; padding: 9px 12px 11px 10px; border-radius: 20px; }
.tl-play.is-focus .tl-banner__title { font-size: clamp(1.15rem, 5.2vw, 1.4rem); }
.tl-play.is-focus .tl-banner__sub { font-size: .9rem; line-height: 1.25; min-height: 0; -webkit-line-clamp: 3; display: inline-block; }
.tl-play.is-focus .tl-sets { --tw: 38px; }
@media (max-height: 700px) {
  .tl-play { gap: 6px; }
  .tl-boardwrap { min-height: 96px; }
  .tl-board { padding: 8px; }
  .tl-banner, .tl-play.is-focus .tl-banner { min-height: 0; padding: 7px 10px 9px 8px; gap: 9px; }
  .tl-banner__icon { width: 38px; height: 38px; }
  .tl-banner__icon .ndj-ic { width: 22px; height: 22px; }
  .tl-banner__title, .tl-play.is-focus .tl-banner__title { font-size: 1.12rem; }
  .tl-banner__sub, .tl-play.is-focus .tl-banner__sub { font-size: .84rem; line-height: 1.2; margin-top: 3px; padding: 2px 9px; }
  .tl-meter { margin-top: 5px; height: 7px; }
  .tl-act { min-height: 50px; font-size: .78rem; }
  .tl-act .ndj-ic { width: 20px; height: 20px; }
  .tl-act-done { font-size: .88rem; }
  .tl-seg__btn { min-height: 36px; }
  .tl-rack { padding: 8px 4px 10px; }
  .tl-sets { --tw: 32px; }
  .tl-play.is-focus .tl-sets { --tw: 34px; }
  .tl-chip { min-height: 42px; }
}
@media (max-width: 370px) {
  .tl-act { font-size: .78rem; }
  .tl-act .ndj-ic { display: block; }
  .tl-seg__btn { padding: 4px 9px; font-size: .88rem; gap: 4px; }
  .tl-seg__btn .ndj-ic { width: 16px; height: 16px; }
}
@media (min-width: 560px) { .tl-sets { --tw: 40px; } }
@media (min-width: 760px) { .tl-actions { grid-template-columns: 1fr 1fr 1fr 1.6fr; } }

@keyframes tl-quip { 0% { opacity: 0; transform: translateY(10px) scale(.9); } 10% { opacity: 1; transform: none; } 86% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4px); } }
@keyframes tl-emojipop { 0% { transform: scale(.3) rotate(-12deg); } 60% { transform: scale(1.2) rotate(6deg); } 100% { transform: none; } }
@keyframes tl-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@media (prefers-reduced-motion: reduce) {
  .tl.is-help::before, .tl-set__add.is-fit, .tl-selbar__new.is-valid, .tl-quip, .tl-quip__e, .tl-banner--me.is-warn .tl-banner__icon { animation: none; }
  .tl-quip { opacity: 1; }
  .tl-meter > i, .tl-switch__sw, .tl-switch__sw::after { transition: none; }
}

/* guide: compact enough to read without scrolling on a tall phone; the button stays in reach */
.tl-guide .tl { --w: 28px; }
.tl-guide__step { padding: 10px; gap: 10px; }
.tl-guide__ic { width: 46px; height: 46px; border-radius: 15px; }
.tl-guide__ic .ndj-ic { width: 26px; height: 26px; }
.tl-guide__ic--num { font-size: 1.4rem; }
.tl-guide__txt strong { font-size: 1.04rem; }
.tl-guide__txt > span { font-size: .9rem; line-height: 1.27; }
.tl-guide__ex { margin-top: 4px; padding: 5px; border-radius: 10px; }
.tl-guide__exs { gap: 6px; }
.tl-guide__list { gap: 9px; }
.tl-guide__win { padding: 9px 12px; font-size: .96rem; }
.tl-modal__actions { position: sticky; bottom: -22px; margin: 14px -22px -22px; padding: 12px 22px 22px; background: linear-gradient(to bottom, transparent, var(--card) 10px); border-top: 0; z-index: 2; }
.tl-act-done:disabled { background: #FBE4DA; color: #B5705A; }
:root[data-theme="dark"] .tl-act-done:disabled { background: #4A4458; color: #B9B1C6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-act-done:disabled { background: #4A4458; color: #B9B1C6; } }
.tl.is-help::before { inset: -2px; box-shadow: 0 0 0 2px var(--tl-hl), 0 0 10px 1px rgba(255, 179, 0, .65); }
.tl-board { display: flex; flex-direction: column; }
.tl-sets { flex: 1 0 auto; }
.tl-selbar { margin: auto -10px 0; bottom: 0; border-radius: 0 0 22px 22px; }
.tl-board.has-selbar { padding-bottom: 0; }

/* dark mode: the "my turn" banner stays the hero (the generic dark card rules above would flatten it) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tl-banner--me { background: var(--tl-hero); border-left-width: 0; }
  :root:not([data-theme="light"]) .tl-banner--me.is-warn { background: linear-gradient(145deg, #E0294A 0%, #FF6B4A 100%); }
  :root:not([data-theme="light"]) .tl-banner--me .tl-banner__icon { color: #E04A2C; background: #fff; }
  :root:not([data-theme="light"]) .tl-banner--me.is-warn .tl-banner__icon { color: #C81D3E; }
  :root:not([data-theme="light"]) .tl-banner--me.is-good .tl-banner__icon { color: #0E9F5B; }
}
:root[data-theme="dark"] .tl-banner--me { background: var(--tl-hero); border-left-width: 0; }
:root[data-theme="dark"] .tl-banner--me.is-warn { background: linear-gradient(145deg, #E0294A 0%, #FF6B4A 100%); }
:root[data-theme="dark"] .tl-banner--me .tl-banner__icon { color: #E04A2C; background: #fff; }
:root[data-theme="dark"] .tl-banner--me.is-warn .tl-banner__icon { color: #C81D3E; }
:root[data-theme="dark"] .tl-banner--me.is-good .tl-banner__icon { color: #0E9F5B; }

/* results: the buttons take little room (one big one, two small ones side by side) so the numbers stay readable on a small phone */
.tl-sheet__row { display: flex; gap: 8px; }
.tl-sheet__row .btn { flex: 1 1 0; min-height: 46px; padding: 6px 10px; font-size: .95rem; border-radius: 14px; }
.tl-sheet__actions { gap: 8px; padding-top: 14px; }
.tl-sheet__actions .tl-next { min-height: 56px; }
.tl-sheet__actions .btn-ghost { background: rgba(255, 255, 255, .16); border: 1.5px solid rgba(255, 255, 255, .55); }
.tl-podium__step { background: #2B2D4A; }

/* performance: no infinite animation on the many small glows (they repaint on slow phones); the highlight is static, the movement comes from the lift and the ring */
.tl.is-help::before { animation: none; box-shadow: 0 0 0 2px var(--tl-hl), 0 0 6px 1px rgba(255, 179, 0, .6); }
.tl-set__add.is-fit { animation: none; }
.tl-selbar__new.is-valid { animation: none; }

/* ------------------------------------------------------------ tiles won in the collection (html[data-tiles], slot "tiles": also Dominó)
   no attribute = the ivory tiles above */
:root[data-tiles="marble"] .tl {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 130' preserveAspectRatio='none'%3E%3Cpath d='M-5 38C20 30 30 52 52 44S85 22 105 30' fill='none' stroke='%237A80A6' stroke-opacity='.3' stroke-width='1.6'/%3E%3Cpath d='M-5 96C18 88 40 108 62 96S90 80 105 86' fill='none' stroke='%237A80A6' stroke-opacity='.2' stroke-width='1.2'/%3E%3Cpath d='M52 44C58 60 50 70 60 84' fill='none' stroke='%237A80A6' stroke-opacity='.16' stroke-width='.9'/%3E%3Cpath d='M30 -5C36 14 26 22 34 36' fill='none' stroke='%23BFA27A' stroke-opacity='.28' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat,
    radial-gradient(120% 70% at 30% 0%, #FFFFFF 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #FBFBFE 0%, #EEEFF5 60%, #DFE1EA 100%);
}
:root[data-tiles="marble"] .tl:not(.is-sel):not(.is-fresh) {
  box-shadow: inset 0 calc(var(--w) * -.08) 0 rgba(90, 96, 130, .22), inset 0 1.5px 0 #fff, inset 0 0 0 1px rgba(90, 96, 130, .16), 0 1px 1px rgba(20, 20, 40, .28), 0 6px 10px -4px rgba(20, 20, 40, .4);
}
:root[data-tiles="wood"] .tl {
  --tl-black: #3A2210;
  background:
    radial-gradient(60% 18% at 30% 22%, rgba(120, 66, 22, .22), transparent 70%),
    repeating-linear-gradient(94deg, rgba(110, 60, 20, .12) 0 1.5px, transparent 1.5px 5px, rgba(110, 60, 20, .06) 5px 6px, transparent 6px 9px),
    linear-gradient(180deg, #F8DDB2 0%, #EBC48A 45%, #D9A766 100%);
}
:root[data-tiles="wood"] .tl:not(.is-sel):not(.is-fresh) {
  box-shadow: inset 0 calc(var(--w) * -.08) 0 rgba(110, 60, 20, .32), inset 0 1.5px 0 rgba(255, 240, 210, .9), inset 0 0 0 1px rgba(110, 60, 20, .22), 0 1px 1px rgba(40, 20, 5, .3), 0 6px 10px -4px rgba(40, 20, 5, .45);
}
:root[data-tiles="wood"] .tl__n { text-shadow: 0 1px 0 rgba(255, 236, 200, .7); }
:root[data-tiles="neon"] .tl {
  --tl-red: #FF4F7B; --tl-blue: #4DB5FF; --tl-orange: #3EE07A; --tl-black: #E9E6FF;
  background: radial-gradient(120% 70% at 30% 0%, rgba(140, 120, 255, .28), transparent 60%), linear-gradient(180deg, #2E3154 0%, #1F2137 60%, #171829 100%);
}
:root[data-tiles="neon"] .tl:not(.is-sel):not(.is-fresh) {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tc) 70%, transparent), inset 0 0 calc(var(--w) * .28) color-mix(in srgb, var(--tc) 30%, transparent), inset 0 calc(var(--w) * -.07) 0 rgba(0, 0, 0, .4), 0 1px 1px rgba(0, 0, 0, .4), 0 6px 12px -4px rgba(0, 0, 0, .55);
}
:root[data-tiles="neon"] .tl__n { text-shadow: 0 0 calc(var(--w) * .12) color-mix(in srgb, var(--tc) 85%, transparent), 0 0 2px #fff; }
:root[data-tiles="neon"] .tl__m { box-shadow: 0 0 calc(var(--w) * .14) var(--tc); }
:root[data-tiles="gold"] .tl {
  --tl-black: #2A1A00; --tl-red: #B3122A; --tl-blue: #133F9E; --tl-orange: #0B5E28;
  background:
    linear-gradient(125deg, transparent 32%, rgba(255, 255, 255, .55) 44%, rgba(255, 255, 255, 0) 56%),
    radial-gradient(120% 60% at 30% 0%, #FFF8D6 0%, rgba(255, 248, 214, 0) 60%),
    linear-gradient(180deg, #FFE98A 0%, #FFD23F 40%, #F2B12C 75%, #D18E12 100%);
}
:root[data-tiles="gold"] .tl:not(.is-sel):not(.is-fresh) {
  box-shadow: inset 0 calc(var(--w) * -.08) 0 rgba(150, 90, 0, .4), inset 0 1.5px 0 #FFF8D6, inset 0 0 0 1px rgba(150, 90, 0, .35), 0 1px 1px rgba(60, 35, 0, .35), 0 6px 12px -4px rgba(120, 70, 0, .55);
}
:root[data-tiles="gold"] .tl__n { text-shadow: 0 1px 0 rgba(255, 248, 214, .8); }
:root[data-tiles="marble"] .tl-glyph { background: linear-gradient(180deg, #FBFBFE, #DFE1EA); }
:root[data-tiles="wood"] .tl-glyph { background: linear-gradient(180deg, #F8DDB2, #D9A766); }
:root[data-tiles="neon"] .tl-glyph { background: linear-gradient(180deg, #2E3154, #171829); box-shadow: 0 0 0 1px #4DB5FF, 0 0 4px #4DB5FF; }
:root[data-tiles="gold"] .tl-glyph { background: linear-gradient(180deg, #FFE98A, #D18E12); }

/* prize frame and level on the small chip avatars: a slimmer ring (it stays inside the strip) and a small badge off the letter */
.tl-chip .ndj-fr::after { inset: -3px; padding: 2.5px; }
.tl-chip .ndj-lv { min-width: 15px; height: 15px; padding: 0 3px; right: -8px; bottom: -6px; font-size: .58rem; }

/* the shared reactions tab (reactions.js) rests on the right end of the turn banner: never on the table's sets, the rack or the buttons */
html { --ndj-fxtab-top: 178px; }

/* ============================================================ round 8: the table gets the room
   The table fills everything between the instruction and your rack, and the tiles on it take the biggest size at which
   every set fits (game.js fitBoard); it scrolls only when even the smallest size is not enough. A compact header, rack
   tiles that stay a sure tap (44px+) without eating the screen, the selection bar in the rack header (no table space). */

/* ---- the page: its height is measured (game.js fitScreen) and it never scrolls under the table */
html.tl-lock, html.tl-lock body { overflow: hidden; overscroll-behavior: none; }
/* While the table is up the page is pinned to the screen: on iPhone a scroll left over from the keyboard (typing the name)
   or a rubber-band could otherwise slide the content under the top bar and leave an empty band above it. */
html.tl-lock body { position: fixed; inset: 0; width: 100%; }
.ndj-app.tl-app { padding: 8px 12px; }
@media (max-width: 379px) { .ndj-app.tl-app { padding-inline: 10px; } }
@media (min-width: 560px) { .ndj-app.tl-app { padding: 10px 16px; } }
.tl-play, .tl-play.is-focus {
  height: var(--tl-h, calc(100dvh - var(--tl-top, 60px) - 16px - env(safe-area-inset-bottom, 0px)));
  min-height: 0; gap: 8px;
}

/* ---- players strip: slimmer, and slimmer still on your turn */
.tl-players { gap: 6px; }
.tl-chip { min-height: 44px; padding: 4px 8px 4px 5px; }
.tl-chip .ndj-avatar { width: 30px; height: 30px; font-size: .88rem; }
.tl-play.is-focus .tl-chip { min-height: 36px; }
.tl-play.is-focus .tl-chip--pool { min-height: 36px; }
/* your turn, two players: name and tile count on one line (with more players the names need the width) */
.tl-play.is-focus .tl-players:not(.is-many) .tl-chip:not(.tl-chip--pool) .tl-chip__main { flex-direction: row; align-items: center; gap: 6px; }
.tl-play.is-focus .tl-chip__name { line-height: 1.2; }

/* ---- the instruction: [icon] title [clock] / one plain line / the 30-point meter */
.tl-banner, .tl-play.is-focus .tl-banner {
  display: flex; flex-direction: column; align-items: stretch; gap: 5px;
  min-height: 0; padding: 8px 12px 11px 10px; border-radius: 20px;
}
.tl-banner__row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tl-banner__icon, .tl-play.is-focus .tl-banner__icon { width: 32px; height: 32px; }
.tl-banner__icon .ndj-ic { width: 19px; height: 19px; }
.tl-banner__title, .tl-play.is-focus .tl-banner__title { flex: 1 1 auto; min-width: 0; font-size: clamp(1.04rem, 4.7vw, 1.24rem); line-height: 1.15; }
.tl-banner__side { flex-direction: row; align-items: center; align-self: center; gap: 6px; }
.tl-banner__sub, .tl-play.is-focus .tl-banner__sub {
  margin: 0; font-size: .9rem; line-height: 1.28; min-height: 0;
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.tl-banner--me .tl-banner__sub, .tl-play.is-focus .tl-banner--me .tl-banner__sub { display: -webkit-box; align-self: flex-start; max-width: 100%; margin: 0; padding: 3px 11px; border-radius: 12px; }
.tl-clock, .tl-play.is-focus .tl-clock { font-size: .98rem; }
.tl-banner--me .tl-clock { padding: 2px 10px; }
.tl-banner__bar { height: 4px; }
.tl-pill, .tl-play.is-focus .tl-pill { min-height: 40px; padding: 3px 12px; font-size: .88rem; }
/* the first meld: how far you are from 30 */
.tl-meterrow { display: flex; align-items: center; gap: 8px; }
.tl-meterrow .tl-meter { flex: 1 1 auto; margin: 0; height: 8px; }
.tl-meterrow.is-full .tl-meter > i { background: #FFE66D; }
.tl-meter__n { flex: none; min-width: 3.4em; padding: 1px 8px; border-radius: 999px; text-align: center; background: rgba(255, 255, 255, .24); color: #fff; font: 700 .85rem/1.3 var(--font-display); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(160, 40, 10, .45); }
.tl-meterrow.is-full .tl-meter__n { background: #FFE66D; color: #4A2A00; text-shadow: none; }

/* ---- the table: it takes the rest of the height; compact sets with tight gaps */
.tl-boardwrap { min-height: 110px; }
.tl-board { padding: 8px; border-width: 3px; border-radius: 22px; overflow-x: hidden; }
.tl-sets { flex: none; position: relative; align-content: flex-start; gap: max(5px, calc(var(--tw) * .17)); }
.tl-set { padding: max(3px, calc(var(--tw) * .1)); gap: 3px; border-radius: max(10px, calc(var(--tw) * .34)); }
.tl-set__tiles { gap: max(2px, calc(var(--tw) * .06)); }
.tl-set__why, .tl-set__tag { margin-top: 2px; padding: 1px 8px 1px 5px; font-size: .74rem; }
.tl-set__why .ndj-ic, .tl-set__tag .ndj-ic { width: 12px; height: 12px; }
.tl-note { padding: 0 2px; font-size: .78rem; line-height: 1.25; }
/* "put them here": a round badge on the corner of each set (it takes no room, so nothing reflows when you select) */
.tl-set__add, .tl-set__add.is-fit {
  position: absolute; top: -11px; right: -11px; z-index: 2; display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid #fff; cursor: pointer; animation: none;
  background: var(--tl-hero); color: #fff; box-shadow: 0 4px 10px -3px rgba(0, 0, 0, .55);
}
.tl-set__add::before { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
.tl-set__add.is-fit { background: linear-gradient(180deg, #FFD36B, var(--tl-hl)); color: #3A2A00; }
.tl-set__add .ndj-ic { width: 13px; height: 13px; }
/* a new set: a set-sized slot at the end of the table */
.tl-newset, .tl-newset.is-ready, .is-dragging .tl-newset.is-ready {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: calc(var(--tw) * 1.54 + 3px); min-width: calc(var(--tw) * 2.1); padding: 4px 10px;
  border-radius: max(10px, calc(var(--tw) * .34)); border: 1.5px dashed rgba(255, 255, 255, .42);
  color: rgba(255, 255, 255, .86); background: transparent; font: 600 .8rem/1.15 var(--font-display); text-align: center; cursor: pointer;
}
.tl-newset .ndj-ic { width: 18px; height: 18px; }
.tl-newset.is-ready, .is-dragging .tl-newset.is-ready { border-color: rgba(255, 179, 0, .85); background: rgba(255, 179, 0, .12); color: #fff; }
.tl-newset.is-over { background: rgba(255, 179, 0, .3); border-color: var(--tl-hl); }
.tl-newset.is-empty { flex: 1 1 100%; flex-direction: row; gap: 8px; min-height: 60px; font-size: .92rem; }
.tl-sets.is-fitting .tl-newset:not(.is-empty), .tl-sets.no-slot .tl-newset:not(.is-empty) { display: none; }
.is-dragging .tl-sets.no-slot .tl-newset.is-ready { display: inline-flex; }
/* more sets below: a soft shadow on the bottom edge says "scroll" */
.tl-board.is-scroll { box-shadow: inset 0 10px 24px rgba(8, 10, 30, .45), inset 0 -22px 18px -14px rgba(0, 0, 0, .6), 0 18px 28px -20px rgba(232, 72, 58, .75), 0 3px 6px -2px rgba(43, 45, 66, .4); }
/* where your tiles just landed */
.tl-set.is-landed { animation: tl-landed .65s ease-out; }
@keyframes tl-landed { 0% { box-shadow: 0 0 0 0 rgba(255, 179, 0, .9); background: rgba(255, 179, 0, .32); } 100% { box-shadow: 0 0 0 12px rgba(255, 179, 0, 0); } }

/* ---- your rack: the header doubles as the selection bar */
.tl-dock, .tl-play.is-focus .tl-dock { gap: 6px; }
.tl-dock__head, .tl-play.is-focus .tl-dock__head { position: relative; min-height: 44px; }
.tl-dock__title, .tl-play.is-focus .tl-dock__title { font-size: 1rem; }
.tl-dock .tl-seg__btn, .tl-play.is-focus .tl-dock .tl-seg__btn { min-height: 38px; padding: 3px 11px; font-size: .9rem; }
.tl-dock__head.has-sel > :not(.tl-selbar) { visibility: hidden; }
.tl-dock .tl-selbar {
  position: absolute; inset: 0; z-index: 4; margin: 0; display: flex; align-items: center; gap: 6px; padding: 0 0 0 12px;
  border: 0; border-radius: 14px; background: #1F2137; color: #fff;
  box-shadow: 0 10px 20px -12px rgba(31, 33, 55, .9), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.tl-dock .tl-selbar__n { font-size: .92rem; }
.tl-dock .tl-selbar__btn { min-height: 44px; height: 44px; padding: 4px 12px; border-radius: 12px; }
.tl-dock .tl-selbar__x { width: 44px; height: 44px; border-radius: 12px; }
:root[data-theme="dark"] .tl-dock .tl-selbar { background: #2E3154; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-dock .tl-selbar { background: #2E3154; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); } }
.tl-rack {
  position: relative; align-content: center; row-gap: 5px; column-gap: 4px;
  border-width: 3px; border-radius: 20px; padding: 6px 4px 8px;
}
.tl-rack.is-scroll { overflow-y: auto; overscroll-behavior: contain; align-content: flex-start; }
.tl-rack.is-scroll .tl { touch-action: pan-y; }
/* your turn starts: the banner pops and the rack's rim lights up once */
.tl-rack::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none; opacity: 0; box-shadow: 0 0 0 4px var(--tl-hl), 0 0 26px 4px rgba(255, 179, 0, .65); }
.tl-play.is-cue .tl-dock.is-mine .tl-rack::after { animation: tl-rackcue 1.2s ease-out; }
.tl-play.is-cue .tl-banner--me { animation: tl-cue .5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes tl-rackcue { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tl-cue { 0% { transform: scale(.95); } 60% { transform: scale(1.015); } 100% { transform: none; } }

/* ---- the four buttons: a little shorter */
.tl-actions { gap: 6px; }
.tl-act { min-height: 54px; padding: 4px; gap: 2px; border-radius: 16px; }
.tl-act .ndj-ic { width: 22px; height: 22px; }

/* your turn on a tall screen: the instruction is a white card two lines tall whatever it says, so the table under it
   never changes size while you select and move tiles */
@media (min-height: 701px) {
  .tl-play.is-focus .tl-banner--me .tl-banner__sub {
    display: flex; align-items: center; align-self: stretch; min-height: calc(2.56em + 6px); padding: 3px 12px; overflow: visible;
  }
}

/* ---- short phones (360x640) */
@media (max-height: 700px) {
  .ndj-app.tl-app { padding-block: 6px; }
  .tl-play, .tl-play.is-focus { gap: 5px; }
  .tl-dock, .tl-play.is-focus .tl-dock { gap: 5px; }
  .tl-rack { padding: 4px 4px 6px; }
  .tl-chip, .tl-play.is-focus .tl-chip, .tl-play.is-focus .tl-chip--pool { min-height: 36px; }
  .tl-banner, .tl-play.is-focus .tl-banner { padding: 6px 10px 9px 8px; gap: 4px; }
  .tl-banner__icon, .tl-play.is-focus .tl-banner__icon { width: 28px; height: 28px; }
  .tl-banner__icon .ndj-ic { width: 17px; height: 17px; }
  .tl-banner__title, .tl-play.is-focus .tl-banner__title { font-size: 1.02rem; }
  .tl-banner__sub, .tl-play.is-focus .tl-banner__sub { font-size: .84rem; line-height: 1.22; }
  .tl-board { padding: 6px; }
  .tl-act { min-height: 48px; font-size: .78rem; }
  .tl-act .ndj-ic { width: 20px; height: 20px; }
  .tl-boardwrap { min-height: 90px; }
}

/* ---- tablets and computers: bigger everything, the rack and the buttons stay a comfortable width */
@media (min-width: 760px) {
  .tl-dock { width: 100%; max-width: 760px; margin: 0 auto; }
  .tl-banner__title, .tl-play.is-focus .tl-banner__title { font-size: 1.3rem; }
  .tl-banner__sub, .tl-play.is-focus .tl-banner__sub { font-size: .98rem; }
  .tl-act { min-height: 58px; font-size: .92rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-play.is-cue .tl-banner--me, .tl-play.is-cue .tl-dock.is-mine .tl-rack::after, .tl-set.is-landed, .tl-set.is-flash, .tl-newset.is-flash, .tl-act.is-flash { animation: none; }
  .tl-set.is-landed, .tl-set.is-flash { outline: 3px solid var(--tl-hl); outline-offset: 1px; }
}

/* pinned table: the top bar is part of the page (not sticky), so the table can never slide under it */
html.tl-lock .ndj-topbar { position: relative; top: auto; }
.tl-settings__hint { margin-top: -4px; font-size: var(--fs-body-sm); }
