:root {
  --bg: #0a1018;
  --panel: rgba(15, 23, 34, 0.94);
  --panel-2: rgba(24, 33, 47, 0.94);
  --text: #eef5fb;
  --muted: #a7b7c7;
  --line: rgba(184, 205, 224, 0.16);
  --accent: #47d3ff;
  --accent-2: #c3d1dc;
  --danger: #ff4c75;
  --boost: #25d283;
  --warn: #ffd34d;
  --orange: #ff9632;
  --slot: rgba(255,255,255,0.055);
  --slot-border: rgba(255,255,255,0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  color: var(--text);
  background:
    radial-gradient(circle at 28% 16%, rgba(255,255,255,0.05), transparent 18rem),
    radial-gradient(circle at 78% 72%, rgba(255,255,255,0.035), transparent 18rem),
    linear-gradient(180deg, #081019, #050b12 58%, #04080d);
  overflow-x: hidden;
}
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: 0;
  opacity: 0.13;
  background:
    linear-gradient(90deg, transparent 0 13%, rgba(255,255,255,0.05) 13% 14%, transparent 14% 28%, rgba(255,255,255,0.03) 28% 29%, transparent 29% 47%, rgba(255,255,255,0.04) 47% 48%, transparent 48% 63%, rgba(255,255,255,0.03) 63% 64%, transparent 64% 79%, rgba(255,255,255,0.04) 79% 80%, transparent 80% 100%),
    linear-gradient(135deg, transparent 0 9%, rgba(255,255,255,0.045) 9% 10%, transparent 10% 100%),
    linear-gradient(45deg, transparent 0 84%, rgba(255,255,255,0.04) 84% 85%, transparent 85% 100%);
}
body::after {
  z-index: 0;
  opacity: 0.05;
  background:
    radial-gradient(circle at 56% 52%, rgba(255,255,255,0.8) 0 2px, transparent 4px),
    radial-gradient(circle at 56% 52%, rgba(255,255,255,0.12) 0 90px, transparent 130px),
    radial-gradient(circle at 56% 52%, rgba(255,255,255,0.08) 0 190px, transparent 260px);
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.05rem;
  background: linear-gradient(180deg, #d7e2eb, #aebdcc);
  color: #06111c;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.72; cursor: not-allowed; filter: none; }
button.secondary { background: rgba(255,255,255,0.12); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
button.danger { background: linear-gradient(180deg, #ff7594, #e53a62); color: white; }
button.good { background: linear-gradient(180deg, #63efad, #18aa66); color: #031b10; }
.hidden { display: none !important; }

.intro-screen, .start-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}
.intro-line {
  font-size: clamp(2rem, 5vw, 5rem);
  line-height: 1.05;
  text-align: center;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 0 30px rgba(71,211,255,0.4);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 750ms ease, transform 750ms ease;
}
.intro-line.fading { opacity: 0; transform: translateY(12px); }
.skip-intro { position: fixed; top: 1rem; right: 1rem; background: rgba(255,255,255,0.1); color: var(--text); border: 1px solid var(--line); }
.brand-card {
  width: min(820px, 96vw);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 19, 30, 0.95), rgba(8, 13, 21, 0.95));
  border-radius: 2rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}
.brand-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/branding/cover-art.png') center/cover no-repeat;
  opacity: 0.08;
  mix-blend-mode: screen;
  pointer-events: none;
}
.brand-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,16,25,0.38), rgba(8,13,20,0.65));
  pointer-events: none;
}
.brand-card > * { position: relative; z-index: 1; }
.brand-card h1, .topbar h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  line-height: 0.95;
  font-weight: 1000;
  letter-spacing: 0.01em;
  color: #f5fbff;
  text-shadow: 0 0 24px rgba(255,255,255,0.08);
}
.topbar h1 { font-size: clamp(1.55rem, 2vw, 2.35rem); margin: 0; }
.topbar h1 { font-size: clamp(1.55rem, 2vw, 2.35rem); margin: 0; }
.tagline { color: #fff4a8; font-size: 1.15rem; margin-bottom: 2rem; text-shadow: 0 0 18px rgba(255,216,58,0.18); }
.player-buttons { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.player-buttons button { font-size: 1.1rem; padding: 0.95rem 1.4rem; }
.fine-print { margin-top: 1.5rem; color: var(--muted); font-size: 0.95rem; }

.game { min-height: 100vh; padding: 1rem; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto 1rem;
  max-width: 1680px;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, rgba(10, 18, 28, 0.84), rgba(7, 12, 19, 0.84));
  backdrop-filter: blur(12px);
}

.status-line { color: var(--muted); margin-top: 0.2rem; min-height: 1.1em; }
.topbar-actions { display: flex; gap: 0.5rem; }
.table-layout {
  max-width: 1680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(620px, 1fr) minmax(220px, 280px);
  gap: 1rem;
}
.left-panel, .right-panel, .experiment-panel, .hand-panel {
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(15, 23, 34, 0.94), rgba(11, 18, 28, 0.94));
  box-shadow: 0 16px 55px rgba(0,0,0,0.22);
}
.left-panel, .right-panel { padding: 0.8rem; align-self: start; }
h2 { margin: 0.15rem 0 0.75rem; font-size: 1rem; color: #fff0ff; text-transform: uppercase; letter-spacing: 0.08em; text-shadow: 0 0 14px rgba(255,15,179,0.18); }
.turn-order { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.2rem; }
.order-chip, .score-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-left: 6px solid var(--entity-accent, rgba(255,255,255,0.35));
  background: linear-gradient(90deg, var(--entity-color, rgba(255,255,255,0.08)), rgba(255,255,255,0.06));
  border-radius: 0.8rem;
  padding: 0.55rem 0.7rem;
}
.order-chip.active { outline: 2px solid var(--warn); box-shadow: 0 0 18px rgba(255,211,77,0.18); }
.order-chip.source { background: linear-gradient(135deg, rgba(255, 196, 38, 0.16), rgba(255, 77, 117, 0.1)); }
.order-chip small { color: var(--muted); }
.scoreboard { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.2rem; }
.score-card { display: block; }
.score-card .name { font-weight: 900; display: flex; justify-content: space-between; }
.score-card .stats { color: var(--muted); font-size: 0.88rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin-top: 0.45rem; }
.card-back-mini { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: middle; margin-right: 2px; background: url('assets/card-back.png') center/cover no-repeat; border: 1px solid rgba(255,255,255,0.22); }
.pile-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.pile-row strong { color: var(--text); }

.center-panel { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.experiment-panel { padding: 1rem; position: relative; overflow: hidden; }
.trick-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}
.trick-info > div {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.6rem 0.75rem;
  color: var(--muted);
}
.trick-info strong { color: var(--text); }
.collider-board {
  position: relative;
  min-height: 540px;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(180deg, rgba(17, 28, 40, 0.98), rgba(12, 20, 31, 0.98));
  padding: 1rem;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), inset 0 0 45px rgba(255,255,255,0.03);
}
.collider-board::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background:
    radial-gradient(circle at 56% 50%, rgba(255,255,255,0.6) 0 2px, transparent 4px),
    radial-gradient(circle at 56% 50%, rgba(255,255,255,0.08) 0 75px, transparent 120px),
    radial-gradient(circle at 56% 50%, rgba(255,255,255,0.05) 0 155px, transparent 220px);
}


.entity-markers {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.entity-marker {
  position: absolute;
  left: var(--x, 50%);
  top: 9.5%;
  transform: translate(-50%, -50%);
  width: clamp(92px, 9.5vw, 126px);
  height: clamp(70px, 7.4vw, 96px);
  border-radius: 50% 50% 16px 16px / 82% 82% 18% 18%;
  border: 2px solid rgba(255,255,255,0.24);
  background: var(--marker-color, rgba(255,255,255,0.18));
  display: grid;
  place-items: center;
  color: white;
  text-align: center;
  font-weight: 950;
  text-shadow: 0 2px 3px rgba(0,0,0,0.6);
  box-shadow: 0 12px 28px rgba(0,0,0,0.30), inset 0 10px 18px rgba(255,255,255,0.12);
}
.entity-marker.source-marker {
  background: #262b30;
  border-color: rgba(255,211,77,0.65);
}
.entity-marker.active-marker {
  outline: 3px solid var(--warn);
  box-shadow: 0 0 24px rgba(255,211,77,0.35);
}
.entity-marker small {
  display: block;
  margin-top: 0.12rem;
  color: rgba(255,255,255,0.78);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.entity-marker .source-stack-visual {
  position: absolute;
  left: 50%;
  top: -9%;
  width: 58%;
  height: 58%;
  transform: translateX(-50%) rotate(-4deg);
  border-radius: 10px;
  background: linear-gradient(135deg, #3b4046, #11161d);
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: 0 9px 18px rgba(0,0,0,0.42);
  z-index: -1;
}
.entity-marker .source-stack-visual::before,
.entity-marker .source-stack-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b4046, #11161d);
  border: 2px solid rgba(255,255,255,0.12);
  z-index: -1;
}
.entity-marker .source-stack-visual::before { transform: translate(6px, -4px) rotate(4deg); }
.entity-marker .source-stack-visual::after { transform: translate(11px, -8px) rotate(7deg); }
.entity-marker.source-marker span,
.entity-marker.source-marker small { position: relative; z-index: 2; }
.entity-marker.source-marker small { color: rgba(255, 229, 130, 0.92); }

.beam-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: visible; }
.lane-rail {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  transform-origin: left top;
  overflow: visible;
}
.lane-rail.horizontal {
  height: 18px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  box-shadow: inset 0 0 12px rgba(255,255,255,0.05);
}
.lane-rail.vertical {
  width: 18px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(255,255,255,0.11), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  box-shadow: inset 0 0 12px rgba(255,255,255,0.05);
}
.slots {
  position: absolute;
  inset: 0;
  z-index: 4;
  min-height: 100%;
}
.slot-underlay {
  width: clamp(82px, 9vw, 120px);
  height: clamp(82px, 9vw, 120px);
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.18);
  background: rgba(7, 12, 19, 0.98);
  display: grid;
  place-items: center;
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), inset 0 0 22px rgba(255,255,255,0.03);
  z-index: 1;
}
.slot-underlay.source-slot { border-color: rgba(255,211,77,0.30); background: rgba(9, 12, 16, 0.98); }
.slot-underlay.human-slot { border-color: rgba(71,211,255,0.30); background: rgba(9, 12, 16, 0.98); }
.slot-underlay.ai-slot { border-color: rgba(255,255,255,0.16); }

.slot {
  width: clamp(82px, 9vw, 120px);
  height: clamp(82px, 9vw, 120px);
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.34);
  background: rgba(6, 10, 16, 0.01);
  display: grid;
  place-items: center;
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);
  transition: box-shadow 240ms ease, transform 240ms ease, border-color 240ms ease, background 240ms ease;
  z-index: 6;
}
.slot.empty::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  background: rgba(8, 13, 20, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
.slot.current-slot {
  border-color: var(--warn);
  box-shadow: 0 0 26px rgba(255,211,77,0.33), inset 0 0 18px rgba(255,211,77,0.08);
}
.slot.source-slot {
  border-color: rgba(255,211,77,0.42);
  background: rgba(255,211,77,0.075);
}
.slot.human-slot { border-color: rgba(71,211,255,0.4); }
.slot.ai-slot { border-color: rgba(255,255,255,0.22); }
.slot .slot-label {
  position: absolute;
  left: 50%; top: calc(100% + 4px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 112px;
  z-index: 8;
  color: rgba(255,255,255,0.78);
  font-weight: 800;
  font-size: 0.58rem;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
}
.slot.pending { border-color: var(--warn); box-shadow: 0 0 24px rgba(255,211,77,0.22); }

.slot-orient-controls {
  position: absolute;
  inset: -22px;
  pointer-events: none;
  z-index: 12;
}
.slot-arrow {
  position: absolute;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(18, 28, 41, 0.92);
  border: 1px solid rgba(255,255,255,0.24);
  color: rgba(234,248,255,0.88);
  box-shadow: 0 4px 12px rgba(0,0,0,0.24);
  pointer-events: auto;
  font-weight: 900;
}
.slot-arrow:hover { background: rgba(255,255,255,0.2); }
.slot-arrow.selected {
  background: rgba(255,211,77,0.9);
  color: #201600;
  border-color: rgba(255,255,255,0.8);
}
.slot-arrow-up { left: 50%; top: 0; transform: translate(-50%, -50%); }
.slot-arrow-right { right: 0; top: 50%; transform: translate(50%, -50%); }
.slot-arrow-down { left: 50%; bottom: 0; transform: translate(-50%, 50%); }
.slot-arrow-left { left: 0; top: 50%; transform: translate(-50%, -50%); }

.slot.modified.plus { box-shadow: 0 0 22px rgba(37,210,131,0.55), inset 0 0 24px rgba(37,210,131,0.12); border-color: rgba(37,210,131,0.9); }
.slot.modified.minus { box-shadow: 0 0 22px rgba(255,76,117,0.55), inset 0 0 24px rgba(255,76,117,0.12); border-color: rgba(255,76,117,0.9); }
.slot.colliding { animation: slot-shake 450ms ease; box-shadow: 0 0 35px rgba(255,211,77,0.75), 0 0 70px rgba(255,76,117,0.45); }
.card-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  transition: transform 260ms ease, filter 260ms ease, opacity 260ms ease;
}
.table-card { position: relative; width: 100%; height: 100%; }
.table-card.colliding .card-img { animation: collision-pop 650ms ease; }
.table-card.facedown .card-img { transform: none !important; filter: brightness(0.9) saturate(0.85); }
.true-badge {
  position: absolute;
  right: -20px;
  top: -18px;
  z-index: 10;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 1000;
  color: white;
  border: 2px solid white;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.true-badge.plus { background: var(--boost); }
.true-badge.minus { background: var(--danger); }
.explosion {
  position: absolute;
  inset: -10%;
  z-index: 12;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0 13%, rgba(255,212,55,0.9) 14% 24%, rgba(255,73,84,0.75) 25% 38%, transparent 39%);
  animation: burst 650ms ease-out forwards;
  pointer-events: none;
}
.action-panel {
  margin-top: 0.8rem;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  border-radius: 1rem;
  padding: 0.55rem;
}
.action-text { color: var(--muted); }
.orientation-controls { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.orientation-controls button.selected { outline: 3px solid var(--warn); }
.hand-panel { padding: 0.8rem 1rem; }
.hand-header { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; margin-bottom: 0.75rem; }
.hand-header h2 { margin-bottom: 0; }
#handHint { color: var(--muted); font-size: 0.92rem; min-height: 1.2em; }
.human-hand {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  min-height: 120px;
  justify-content: center;
  align-items: center;
  padding: 0.25rem 0.5rem;
}
.hand-card {
  width: 94px; height: 94px;
  padding: 0;
  background: transparent;
  border-radius: 12px;
  box-shadow: 0 9px 22px rgba(0,0,0,0.28);
  border: 2px solid transparent;
  transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.hand-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.hand-card:hover { transform: translateY(-8px) scale(1.2); z-index: 20; box-shadow: 0 16px 34px rgba(0,0,0,0.38); }
.hand-card:disabled { opacity: 1; filter: none; }
.hand-card.legal { border-color: transparent; }
.hand-card.legal::after { content: ""; position: absolute; left: 16%; right: 16%; bottom: -8px; height: 6px; border-radius: 999px; border: 2px solid rgba(71,211,255,0.95); background: rgba(71,211,255,0.16); box-shadow: 0 0 14px rgba(71,211,255,0.12); }
.hand-card.legal:hover::after { box-shadow: 0 0 18px rgba(71,211,255,0.18); }
.hand-card.dragging { opacity: 0.45; transform: scale(0.96); }
.hand-card.drag-over { outline: 2px dashed rgba(255,211,77,0.75); outline-offset: 6px; }
.hand-card:not(.legal) { opacity: 0.9; }
.hand-card.pending-choice { border-color: var(--warn); }
.log { min-height: 70px; display:flex; flex-direction:column; gap:0.5rem; }
.log-entry {
  border-left: 3px solid rgba(71,211,255,0.5);
  background: rgba(255,255,255,0.055);
  border-radius: 0.5rem;
  padding: 0.55rem 0.65rem;
  color: #d6edf8;
  font-size: 0.9rem;
}
.log-entry.warning { border-left-color: var(--warn); }
.log-entry.danger { border-left-color: var(--danger); }
.log-entry.good { border-left-color: var(--boost); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 1rem;
}
.modal-card {
  width: min(620px, 96vw);
  border: 1px solid var(--line);
  background: #0b1a2a;
  border-radius: 1.4rem;
  padding: 1.2rem;
  box-shadow: 0 25px 95px rgba(0,0,0,0.55);
}
.modal-card h2 { font-size: 1.4rem; text-transform: none; letter-spacing: 0; }
.modal-card p { color: var(--muted); line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.65rem; margin-top: 1rem; flex-wrap: wrap; }

@keyframes collision-pop {
  0% { transform: scale(1) rotate(var(--rot, 0deg)); }
  45% { transform: scale(1.18) rotate(var(--rot, 0deg)); filter: brightness(1.45) saturate(1.2); }
  100% { transform: scale(1) rotate(var(--rot, 0deg)); }
}
@keyframes burst {
  0% { transform: scale(0.2); opacity: 0; }
  45% { opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes slot-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

@media (max-width: 1180px) {
  .table-layout { grid-template-columns: 1fr; }
  .left-panel, .right-panel { order: 2; }
  .center-panel { order: 1; }
  .log { height: 260px; min-height: 260px; }
  .trick-info { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .game { padding: 0.5rem; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-actions { justify-content: space-between; }
  .slot {
  width: clamp(82px, 9vw, 120px);
  height: clamp(82px, 9vw, 120px);
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.34);
  background: rgba(6, 10, 16, 0.01);
  display: grid;
  place-items: center;
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);
  transition: box-shadow 240ms ease, transform 240ms ease, border-color 240ms ease, background 240ms ease;
  z-index: 6;
}
.hand-card { position: relative; overflow: visible; background: rgba(255,255,255,0.07); }
.hand-card-fallback { display: none; position: absolute; inset: auto 3px 3px 3px; font-size: 0.58rem; line-height: 1.05; color: white; text-shadow: 0 1px 2px black; background: rgba(0,0,0,0.36); border-radius: 5px; padding: 2px; }
.hand-card img:not([src]), .hand-card img[src=""] { display:none; }
.hand-card img:not([src]) + .hand-card-fallback, .hand-card img[src=""] + .hand-card-fallback { display:block; }
.empty-hand-note { color: var(--muted); padding: 0.55rem; border: 1px dashed var(--line); border-radius: 0.75rem; }
}

.turn-order, .pile-row, .trick-info { display:none !important; }
.score-details { border: 1px solid var(--line); border-left: 6px solid var(--entity-accent, rgba(255,255,255,0.35)); background: linear-gradient(90deg, var(--entity-color, rgba(255,255,255,0.08)), rgba(255,255,255,0.04)); border-radius: 0.8rem; overflow: hidden; }
.score-details + .score-details { margin-top: 0.5rem; }
.score-details summary { list-style: none; cursor: pointer; padding: 0.6rem 0.7rem; display:flex; justify-content:space-between; align-items:center; font-weight:900; }
.score-details summary::-webkit-details-marker { display:none; }
.score-details .stats { padding: 0 0.7rem 0.7rem; color: var(--muted); font-size:0.9rem; display:grid; grid-template-columns:1fr; gap:0.3rem; }
.slot.current-slot { outline: 3px solid rgba(255,211,77,0.75); outline-offset: 3px; }
.slot-underlay.current-slot-underlay { border-color: rgba(255,211,77,0.55); box-shadow: 0 0 18px rgba(255,211,77,0.18), inset 0 0 18px rgba(255,211,77,0.08); }

.log-more { margin-top:0.45rem; }
.log-entry { font-size:0.92rem; }

.lane-rail::after {
  content: "";
  position: absolute;
  inset: 3px;
  opacity: 0.55;
  background-repeat: repeat;
  background-size: 30px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='12' viewBox='0 0 30 12'%3E%3Cpath d='M5 2 L12 6 L5 10' fill='none' stroke='rgba(255,255,255,0.75)' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  pointer-events: none;
}
.lane-rail.bottom-rail::after { transform: scaleX(-1); }
.lane-rail.left-rail::after {
  inset: 3px;
  transform: rotate(-90deg);
  transform-origin: center;
  background-size: 30px 12px;
}
.lane-rail.right-rail::after {
  inset: 3px;
  transform: rotate(90deg);
  transform-origin: center;
  background-size: 30px 12px;
}

.character-select-title { margin: 0.4rem 0 0.8rem; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.character-grid { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 0.8rem; margin: 0 0 1.25rem; }
.character-card { cursor: pointer; border: 2px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); border-radius: 1rem; padding: 0.5rem; transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; color: var(--text); }
.character-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 0.8rem; display:block; }
.character-card strong { display:block; margin-top: 0.45rem; font-size: 0.95rem; }
.character-card.selected { border-color: var(--warn); box-shadow: 0 0 0 2px rgba(255,211,77,0.2), 0 12px 24px rgba(0,0,0,0.26); transform: translateY(-2px); }
.character-card:hover { transform: translateY(-2px); }
.intro-line.explode { animation: intro-explode 1350ms cubic-bezier(.18,.75,.18,1) both; text-shadow: 0 0 18px rgba(255,212,55,0.35), 0 0 34px rgba(255,80,80,0.18); }
@keyframes intro-explode { 0% { transform: scale(1); letter-spacing: 0.02em; } 18% { transform: scale(1.06); } 36% { transform: scale(1.18); letter-spacing: 0.06em; } 50% { transform: scale(1.06) rotate(-1deg); } 65% { transform: scale(1.18) rotate(1deg); } 100% { transform: scale(1); letter-spacing: 0.02em; } }

.collider-word { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); z-index: 1; font-weight: 1000; font-size: clamp(1.6rem, 4vw, 3.7rem); letter-spacing: 0.12em; color: rgba(255,255,255,0.12); text-align: center; pointer-events: none; transition: color 180ms ease, text-shadow 180ms ease; }
.collider-board[data-trick="blue"] .collider-word { color: rgba(11,183,232,0.22); text-shadow: 0 0 16px rgba(11,183,232,0.08); }
.collider-board[data-trick="orange"] .collider-word { color: rgba(255,156,36,0.22); text-shadow: 0 0 16px rgba(255,156,36,0.08); }
.collider-board[data-trick="purple"] .collider-word { color: rgba(140,54,197,0.22); text-shadow: 0 0 16px rgba(140,54,197,0.08); }
.collider-board[data-trick="teal"] .collider-word { color: rgba(66,214,208,0.22); text-shadow: 0 0 16px rgba(66,214,208,0.08); }

.entity-marker-content { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.12rem; }
.entity-marker-avatar { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(255,255,255,0.34); box-shadow: 0 5px 10px rgba(0,0,0,0.24); margin-bottom: 0.15rem; }
.score-summary { display:flex; align-items:center; gap:0.5rem; }
.score-avatar { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; border:1px solid rgba(255,255,255,0.22); }
.score-summary-label { display:flex; flex-direction:column; line-height:1.05; }
.score-summary-label small { color: var(--muted); font-size: 0.72rem; }

.card-badge-stack { position:absolute; right:-22px; top:-18px; z-index:10; display:flex; align-items:center; gap:6px; }
.card-badge-stack .true-badge { position: static; right:auto; top:auto; }
.winner-crown { position:relative; z-index:11; background: rgba(255,211,77,0.96); color:#2d1d00; border:2px solid #fff1b0; width:30px; height:30px; border-radius:999px; display:grid; place-items:center; font-size:16px; box-shadow:0 8px 18px rgba(0,0,0,0.32); }
.winner-crown[data-tooltip]:hover::after { content: attr(data-tooltip); position:absolute; left:50%; top:-10px; transform: translate(-50%, -100%); white-space: nowrap; background: rgba(7,12,19,0.96); color: #eef5fb; border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; padding: 0.3rem 0.45rem; font-size: 0.72rem; box-shadow: 0 8px 20px rgba(0,0,0,0.28); }

.won-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  padding: 0 0.7rem 0.55rem;
}
.won-mini {
  display: inline-flex;
  flex-direction: column;
  min-width: 48px;
  border-radius: 0.45rem;
  border: 1px solid rgba(255,255,255,0.18);
  border-left: 5px solid var(--suit-color);
  background: rgba(255,255,255,0.055);
  padding: 0.28rem 0.34rem;
  line-height: 1.05;
  font-size: 0.74rem;
}
.won-mini b { font-size: 0.64rem; color: rgba(255,255,255,0.82); }
.won-mini small { color: var(--muted); font-size: 0.62rem; margin-top: 0.1rem; }
.won-empty {
  color: var(--muted);
  font-size: 0.78rem;
  opacity: 0.82;
}

.deck-contents-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}
.deck-suit-group {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(255,255,255,0.045);
  padding: 0.7rem;
}
.deck-suit-group h3 {
  margin: 0 0 0.55rem;
  color: var(--suit-color);
  font-size: 1rem;
}
.deck-card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}
.deck-mini {
  min-width: 44px;
  border-radius: 0.45rem;
  border: 1px solid rgba(255,255,255,0.18);
  border-left: 5px solid var(--suit-color);
  background: rgba(0,0,0,0.20);
  padding: 0.26rem 0.32rem;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
  font-size: 0.72rem;
}
.deck-mini b { font-size: 0.95rem; }
.deck-mini em { font-style: normal; color: var(--text); opacity: 0.88; }
.deck-mini small { color: var(--muted); font-size: 0.6rem; margin-top: 0.12rem; }
@media (max-width: 680px) {
  .deck-contents-grid { grid-template-columns: 1fr; }
}

.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
#deckContentsBtn { white-space: nowrap; }

.score-card-compact {
  border: 1px solid var(--line);
  border-left: 6px solid var(--entity-accent, rgba(255,255,255,0.35));
  background: linear-gradient(90deg, var(--entity-color, rgba(255,255,255,0.08)), rgba(255,255,255,0.04));
  border-radius: 0.8rem;
  overflow: hidden;
  margin-bottom: 0.55rem;
}
.score-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.58rem 0.68rem 0.45rem;
  font-weight: 900;
}
.score-summary { display:flex; align-items:center; gap:0.5rem; min-width: 0; }
.score-avatar {
  width: 30px !important;
  height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  min-width: 30px;
  border-radius: 8px;
  object-fit: cover;
  border:1px solid rgba(255,255,255,0.22);
  display:block;
}
.score-summary-label { display:flex; flex-direction:column; line-height:1.05; min-width: 0; }
.score-summary-label small { color: var(--muted); font-size: 0.72rem; }
.score-more { border-top: 1px solid rgba(255,255,255,0.08); }
.score-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.34rem 0.68rem;
}
.score-more .stats {
  padding: 0 0.68rem 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
  display:grid;
  grid-template-columns:1fr;
  gap:0.25rem;
}
.won-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  padding: 0 0.68rem 0.55rem;
}
.won-mini {
  display: inline-flex;
  flex-direction: column;
  min-width: 48px;
  border-radius: 0.45rem;
  border: 1px solid rgba(255,255,255,0.18);
  border-left: 5px solid var(--suit-color);
  background: rgba(255,255,255,0.055);
  padding: 0.28rem 0.34rem;
  line-height: 1.05;
  font-size: 0.72rem;
}
.won-mini b { font-size: 0.62rem; color: rgba(255,255,255,0.82); }
.won-mini strong { font-size: 0.9rem; color: var(--text); }
.won-mini small { color: var(--muted); font-size: 0.6rem; margin-top: 0.1rem; }
.won-empty { color: var(--muted); font-size: 0.78rem; opacity: 0.82; }

.alarm-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  border: 0;
  border-radius: 1rem;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.18), transparent 12rem),
    conic-gradient(from 0deg, rgba(255, 0, 0, 0.0), rgba(255, 0, 0, 0.30), rgba(255, 0, 0, 0.0), rgba(255, 0, 0, 0.22), rgba(255, 0, 0, 0.0));
  color: white;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 90px rgba(255, 0, 0, 0.32), 0 0 38px rgba(255, 0, 0, 0.22);
}
.alarm-overlay.active {
  animation: alarm-flash 0.85s ease-in-out 3, alarm-sweep 2.55s linear 1;
}
.alarm-overlay span {
  background: rgba(80, 0, 0, 0.72);
  border: 2px solid rgba(255,255,255,0.52);
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 5px rgba(0,0,0,0.6);
  box-shadow: 0 0 28px rgba(255, 0, 0, 0.42);
}
.alarm-overlay::before {
  content: "";
  position: absolute;
  width: 160%;
  height: 28%;
  left: -30%;
  top: 36%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.20), rgba(255,0,0,0.34), transparent);
  filter: blur(2px);
  transform-origin: center;
  animation: alarm-rotate 2.55s linear 1;
}
@keyframes alarm-flash {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}
@keyframes alarm-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes alarm-sweep {
  from { filter: saturate(1); }
  to { filter: saturate(1.25); }
}
.slot.alarm-slot {
  box-shadow: 0 0 30px rgba(255,0,0,0.45), inset 0 0 20px rgba(255,0,0,0.10);
  border-color: rgba(255,75,75,0.85);
}

.tutorial-choice, .play-options {
  margin-top: 1rem;
}
.tutorial-choice {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.play-options-title {
  color: var(--text);
  font-weight: 900;
  margin: 0 0 0.8rem;
}
.tutorial-line {
  font-size: 1.05rem;
  line-height: 1.5;
}
.won-mini.recent-won {
  position: relative;
  animation: recent-won-pulse 1.1s ease-in-out 3;
  box-shadow: 0 0 18px rgba(255,211,77,0.38);
}
.won-mini.recent-won::after {
  content: "➤";
  position: absolute;
  right: -2.15rem;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  color: #ffd34d;
  font-size: 2.25rem;
  line-height: 1;
  -webkit-text-stroke: 2px rgba(66, 38, 0, 0.65);
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.45)) drop-shadow(0 0 10px rgba(255,211,77,0.42));
  animation: won-pointer-bounce 0.82s ease-in-out infinite;
  pointer-events: none;
}
@keyframes won-pointer-bounce {
  0%, 100% { margin-right: 0; }
  50% { margin-right: -8px; }
}
@keyframes recent-won-pulse {
  0%, 100% { transform: scale(1); border-color: rgba(255,255,255,0.18); }
  50% { transform: scale(1.08); border-color: rgba(255,211,77,0.9); }
}

.modal.tutorial-modal {
  place-items: start center;
  align-content: start;
  background: rgba(2, 8, 14, 0.14);
  padding-top: 0.85rem;
  backdrop-filter: none;
}
.modal.tutorial-modal .modal-card {
  width: min(860px, 92vw);
  border-radius: 1.15rem;
  padding: 0.85rem 1rem 0.9rem;
  background: rgba(10, 22, 34, 0.96);
  box-shadow: 0 18px 50px rgba(0,0,0,0.40);
}
.modal.tutorial-modal .modal-card h2 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
  color: rgba(255,255,255,0.84);
}
.modal.tutorial-modal .modal-card p {
  color: var(--text);
}
.tutorial-line-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
}
.tutorial-line-wrap::before {
  content: '✓';
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: #08220a;
  background: linear-gradient(180deg, #d6ffd9, #7fe08d);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.12), 0 8px 16px rgba(0,0,0,0.28);
}
.modal.tutorial-modal .modal-actions {
  margin-top: 0.55rem;
}
.modal.tutorial-modal .modal-actions button {
  min-width: 52px;
  border-radius: 999px;
  font-size: 1.05rem;
  padding: 0.6rem 1rem;
}
.modal.tutorial-modal .modal-actions button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.entity-marker-avatar { display: none !important; }
.score-avatar { display: none !important; }

.intro-screen.intro-alarm::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.18), transparent 12rem),
    conic-gradient(from 0deg, rgba(255,0,0,0), rgba(255,0,0,0.30), rgba(255,0,0,0), rgba(255,0,0,0.24), rgba(255,0,0,0));
  box-shadow: inset 0 0 120px rgba(255,0,0,0.26);
  animation: intro-alarm-flash 0.85s ease-in-out 3, intro-alarm-rotate 2.55s linear 1;
}
@keyframes intro-alarm-flash {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
@keyframes intro-alarm-rotate {
  from { filter: hue-rotate(0deg); transform: rotate(0deg) scale(1.05); }
  to { filter: hue-rotate(-15deg); transform: rotate(360deg) scale(1.05); }
}

.modal.tutorial-modal .modal-card {
  border: 2px solid rgba(255,211,77,0.62) !important;
  background:
    linear-gradient(180deg, rgba(70, 55, 28, 0.98), rgba(27, 26, 22, 0.98)) !important;
  box-shadow: 0 18px 55px rgba(0,0,0,0.46), 0 0 24px rgba(255,211,77,0.18), inset 0 0 0 1px rgba(255,255,255,0.08) !important;
}
.modal.tutorial-modal .modal-card h2 {
  color: #ffe9a6 !important;
}
.modal.tutorial-modal .modal-card p {
  color: #fff8e2 !important;
}
.tutorial-line-wrap::before {
  background: linear-gradient(180deg, #fff2a8, #d9a928) !important;
  color: #2a1d00 !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.12), 0 0 22px rgba(255,211,77,0.28), 0 8px 16px rgba(0,0,0,0.28) !important;
}

.tutorial-pointers {
  position: absolute;
  inset: 0;
  z-index: 39;
  pointer-events: none;
}
.tutorial-pointer {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  color: #ffd34d;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.45)) drop-shadow(0 0 10px rgba(255,211,77,0.40));
  animation: tutorial-pointer-bounce 0.82s ease-in-out infinite;
}
.tutorial-pointer span {
  display: block;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
  -webkit-text-stroke: 2px rgba(66, 38, 0, 0.65);
}
.tutorial-pointer small {
  position: absolute;
  top: 72%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 140px;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  background: rgba(42, 29, 0, 0.78);
  border: 1px solid rgba(255,211,77,0.55);
  color: #fff1b6;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pointer-down span { transform: rotate(90deg) translateX(-58px); }
.pointer-up span { transform: rotate(-90deg) translateX(-58px); }
.pointer-left span { transform: rotate(180deg) translateX(-58px); }
.pointer-right span { transform: translateX(-58px); }
@keyframes tutorial-pointer-bounce {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -9px; }
}

.score-summary {
  gap: 0.35rem !important;
}
.score-card-compact {
  background: linear-gradient(90deg, color-mix(in srgb, var(--entity-accent, #999) 18%, rgba(255,255,255,0.04)), rgba(255,255,255,0.04)) !important;
}

.score-card-compact.score-callout {
  position: relative;
  transform: scale(1.035);
  border-color: rgba(255,211,77,0.75) !important;
  box-shadow: 0 0 0 2px rgba(255,211,77,0.22), 0 14px 30px rgba(0,0,0,0.32);
  z-index: 20;
}
.score-card-compact.score-callout::after {
  content: "➤";
  position: absolute;
  right: -2.15rem;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  color: #ffd34d;
  font-size: 2.6rem;
  line-height: 1;
  -webkit-text-stroke: 2px rgba(66, 38, 0, 0.65);
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.45)) drop-shadow(0 0 10px rgba(255,211,77,0.42));
  animation: score-pointer-bounce 0.82s ease-in-out infinite;
  pointer-events: none;
}
@keyframes score-pointer-bounce {
  0%, 100% { margin-right: 0; }
  50% { margin-right: -8px; }
}
.score-card-compact.score-callout .score-more {
  border-top: 1px solid rgba(255,211,77,0.25);
  margin-top: 0.35rem;
  padding-top: 0.25rem;
}

.collider-board.track-direction-demo .lane-rail {
  box-shadow: inset 0 0 14px rgba(255,211,77,0.16), 0 0 18px rgba(255,211,77,0.10);
  border-color: rgba(255,211,77,0.48);
}
.collider-board.track-direction-demo .lane-rail::after {
  opacity: 0.96;
  background-size: 34px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='14' viewBox='0 0 34 14'%3E%3Cpath d='M6 2 L15 7 L6 12' fill='none' stroke='%23ffd34d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  filter: drop-shadow(0 0 6px rgba(255,211,77,0.42));
  animation: track-arrows-flow 0.9s linear infinite, track-arrows-pulse 0.9s ease-in-out infinite;
}
.collider-board.track-direction-demo .lane-rail.bottom-rail::after {
  animation-direction: reverse, normal;
}
.collider-board.track-direction-demo .lane-rail.left-rail::after,
.collider-board.track-direction-demo .lane-rail.right-rail::after {
  background-size: 34px 14px;
}
@keyframes track-arrows-flow {
  from { background-position: 0 0; }
  to { background-position: 34px 0; }
}
@keyframes track-arrows-pulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

/* Current-value badge: larger and closer to the card's actual value area. */
.card-badge-stack {
  position: absolute !important;
  inset: 0 !important;
  right: auto !important;
  top: auto !important;
  z-index: 14 !important;
  display: block !important;
  pointer-events: none;
}
.card-badge-stack .true-badge {
  position: absolute !important;
  left: 57% !important;
  top: 34% !important;
  transform: translate(-50%, -50%) !important;
  min-width: 48px !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 999px !important;
  font-size: 1.6rem !important;
  line-height: 1 !important;
  font-weight: 1000 !important;
  border: 3px solid rgba(255,255,255,0.94) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,0.38), 0 0 16px rgba(255,255,255,0.18) !important;
  opacity: 0.96;
}
.card-badge-stack .winner-crown {
  position: absolute !important;
  right: -18px !important;
  top: -18px !important;
}

.kickstarter-panel {
  margin-bottom: 1rem;
  padding: 0.8rem;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(67, 32, 74, 0.92), rgba(30, 18, 46, 0.96));
  box-shadow: 0 12px 28px rgba(0,0,0,0.22), inset 0 0 0 1px rgba(255,255,255,0.04);
}
.kickstarter-panel h2 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}
.kickstarter-card {
  display: block;
  color: var(--text);
  text-decoration: none;
  border-radius: 0.9rem;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.kickstarter-card:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(71, 211, 255, 0.48);
  box-shadow: 0 12px 24px rgba(0,0,0,0.28);
}
.kickstarter-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  padding: 0.35rem 0.2rem 0.05rem;
  background: radial-gradient(circle at 35% 20%, rgba(255,255,255,0.08), rgba(0,0,0,0) 42%), linear-gradient(180deg, rgba(18,14,24,0.96), rgba(10,10,16,0.98));
  transform: perspective(900px) rotateY(-23deg) rotateX(4deg) rotateZ(-1.5deg);
  transform-origin: 58% 52%;
  filter: drop-shadow(12px 18px 18px rgba(0,0,0,0.36));
  transition: transform 180ms ease, filter 180ms ease;
}
.kickstarter-card:hover img {
  transform: perspective(900px) rotateY(-19deg) rotateX(3deg) rotateZ(-1deg) translateY(-2px);
  filter: drop-shadow(16px 24px 22px rgba(0,0,0,0.42));
}
.kickstarter-copy {
  padding: 0.75rem 0.8rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.kickstarter-copy strong {
  font-size: 1rem;
}
.kickstarter-copy span {
  color: var(--muted);
  font-size: 0.86rem;
}
.kickstarter-note {
  margin-top: 0.55rem;
}


.collider-rule-cards {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.collider-rule-card {
  position: absolute;
  width: clamp(70px, 7vw, 98px);
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  pointer-events: auto;
  opacity: 0.82;
  filter: saturate(0.95) brightness(0.98);
  box-shadow: none;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, opacity 180ms ease, filter 180ms ease, z-index 180ms ease;
}
.collider-rule-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.65rem;
  box-shadow: 0 12px 24px rgba(0,0,0,0.26), 0 0 0 1px rgba(255,255,255,0.08);
}
.collider-rule-card:hover {
  opacity: 1;
  filter: saturate(1.03) brightness(1.06);
  transform: translate(-50%, -50%) scale(1.46);
  z-index: 80;
}
.rule-first-card { left: 7%; top: 30%; }
.rule-last-card { left: 7%; top: 69%; }
.rule-curve-top-card { left: 93%; top: 30%; }
.rule-curve-bottom-card { left: 93%; top: 69%; }
.slot:hover { z-index: 70; }
.slot:hover .table-card {
  transform: scale(1.42);
  z-index: 80;
}
.table-card {
  transition: transform 180ms ease;
  transform-origin: center center;
}
.game-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(320px, calc(100vw - 2rem));
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255,211,77,0.38);
  background: rgba(7, 12, 19, 0.96);
  color: #eef5fb;
  box-shadow: 0 14px 32px rgba(0,0,0,0.38), 0 0 18px rgba(255,211,77,0.10);
  font-size: 0.85rem;
  line-height: 1.35;
  pointer-events: none;
}
.game-tooltip.hidden { display: none; }
.kickstarter-card[data-tooltip] { position: relative; }
@media (max-width: 900px) {
  .collider-rule-card { width: clamp(48px, 9vw, 68px); opacity: 0.55; }
  .rule-source-card { left: 6%; top: 25%; }
  .rule-first-card { left: 6%; top: 39%; }
  .rule-last-card { left: 6%; top: 77%; }
  .rule-curve-top-card { left: 94%; top: 39%; }
  .rule-curve-bottom-card { left: 94%; top: 77%; }
}

/* --- v03 polish pass: product branding, collider framing, and promo cleanup --- */
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.topbar-title { min-width: 0; }
.durdle-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.7rem 0.38rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  text-decoration: none;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}
.durdle-badge:hover {
  color: var(--text);
  border-color: rgba(255,211,77,0.35);
  box-shadow: 0 10px 22px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,211,77,0.08) inset;
}
.durdle-badge img {
  width: 52px;
  height: auto;
  display: block;
}
.durdle-badge span {
  font-size: 0.72rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.intro-screen {
  gap: 1rem;
}
.intro-box-wrap {
  width: min(440px, 54vw);
  margin-bottom: 0.25rem;
  animation: intro-box-shine 2.2s ease both;
}
.intro-product-box {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 26px 42px rgba(0,0,0,0.42));
}
@keyframes intro-box-shine {
  0% { opacity: 0; transform: scale(0.92) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.brand-hero {
  display: flex;
  justify-content: center;
  margin: 0 auto 1rem;
}
.brand-hero-box {
  width: min(360px, 62vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 36px rgba(0,0,0,0.38));
}

.slots {
  isolation: isolate;
}
.slots::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 20%;
  bottom: 8%;
  border-radius: 1.45rem;
  background: linear-gradient(180deg, rgba(118, 122, 129, 0.30), rgba(85, 89, 96, 0.22));
  border: 1px solid rgba(209, 213, 218, 0.10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), inset 0 20px 40px rgba(255,255,255,0.04), inset 0 -24px 34px rgba(0,0,0,0.18);
  z-index: 0;
}
.lane-rail { z-index: 1; }
.slot-underlay { z-index: 2; }
.slot { z-index: 3; }

/* Align collider rule cards to the same centerlines as the top/bottom card rows. */
.rule-first-card { left: 7%; top: 39%; }
.rule-last-card { left: 7%; top: 77%; }
.rule-curve-top-card { left: 93%; top: 39%; }
.rule-curve-bottom-card { left: 93%; top: 77%; }

.kickstarter-panel h2 { margin-bottom: 0.85rem; }
.kickstarter-card {
  padding: 0.5rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
}
.kickstarter-card img {
  aspect-ratio: unset;
  object-fit: contain;
  padding: 0.15rem;
  background: radial-gradient(circle at 50% 24%, rgba(255,255,255,0.08), transparent 52%), linear-gradient(180deg, rgba(23,19,31,0.96), rgba(14,12,20,0.98));
  transform: none;
  filter: drop-shadow(0 18px 22px rgba(0,0,0,0.35));
}
.kickstarter-card:hover img {
  transform: scale(1.02) translateY(-1px);
  filter: drop-shadow(0 22px 26px rgba(0,0,0,0.40));
}
.kickstarter-copy {
  padding: 0.85rem 0.1rem 0.2rem;
}
.kickstarter-copy strong {
  font-size: 1rem;
  color: var(--text);
}
.kickstarter-copy span {
  font-size: 0.9rem;
  line-height: 1.4;
}
.kickstarter-note { display: none; }

.modal.tutorial-modal .modal-card {
  width: min(1100px, calc(100vw - 2rem)) !important;
}
.tutorial-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 1rem;
}
.tutorial-product {
  border-radius: 1rem;
  border: 1px solid rgba(255,211,77,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  padding: 0.55rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.tutorial-product img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,0.34));
}
.tutorial-product span {
  display: block;
  margin-top: 0.45rem;
  text-align: center;
  color: #fff3c4;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .topbar-brand {
    flex-direction: column;
    align-items: flex-start;
  }
  .tutorial-card-layout {
    grid-template-columns: 1fr;
  }
  .tutorial-product {
    max-width: 240px;
    margin: 0 auto;
  }
}
@media (max-width: 900px) {
  .durdle-badge span { display: none; }
  .intro-box-wrap { width: min(340px, 72vw); }
}


/* --- v03 polish overrides --- */
.title-with-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.title-with-badge.compact {
  justify-content: flex-start;
  gap: 0.85rem;
}
.topbar-title-wrap {
  min-width: 0;
}
.powered-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}
.powered-tag:hover { transform: translateY(-1px); }
.powered-tag img {
  width: 50px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}
.powered-tag span {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.powered-tag strong {
  font-size: 0.85rem;
  color: #f7fbff;
}
.powered-tag small {
  font-size: 0.66rem;
  color: var(--muted);
}
.intro-powered-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 3;
}
.intro-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3rem);
  flex-wrap: wrap;
  max-width: 1100px;
}
.intro-box {
  width: min(42vw, 430px);
  max-width: 88vw;
  filter: drop-shadow(0 18px 42px rgba(0,0,0,0.45));
  transform: scale(0.96);
  transition: transform 500ms ease, filter 500ms ease;
}
.intro-box.showcase {
  animation: intro-box-showcase 2400ms ease both;
}
@keyframes intro-box-showcase {
  0% { transform: scale(0.88); filter: drop-shadow(0 12px 24px rgba(0,0,0,0.28)); }
  45% { transform: scale(1.02); filter: drop-shadow(0 18px 38px rgba(0,0,0,0.42)); }
  100% { transform: scale(1); filter: drop-shadow(0 18px 42px rgba(0,0,0,0.45)); }
}
.intro-line {
  max-width: 8.6em;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.collider-board::before {
  content: '' !important;
  position: absolute !important;
  left: 10.5% !important;
  right: 10.5% !important;
  top: 22% !important;
  bottom: 9% !important;
  border-radius: 1.15rem !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  background: linear-gradient(180deg, rgba(118,118,118,0.22), rgba(84,84,84,0.18)) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), inset 0 0 32px rgba(255,255,255,0.04) !important;
  pointer-events: none;
}
.collider-word {
  top: 58% !important;
}
.rule-first-card { left: 7%; top: 39%; }
.rule-last-card { left: 7%; top: 77%; }
.rule-curve-top-card { left: 93%; top: 39%; }
.rule-curve-bottom-card { left: 93%; top: 77%; }
.collider-rule-card img {
  object-fit: contain;
}
.kickstarter-panel h2 {
  margin-bottom: 0.85rem;
}
.kickstarter-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.035));
}
.kickstarter-card img {
  aspect-ratio: 1 / 1;
  padding: 0.5rem 0.35rem 0.15rem;
  background: radial-gradient(circle at 50% 28%, rgba(255,255,255,0.1), rgba(0,0,0,0) 54%), linear-gradient(180deg, rgba(20,14,26,0.96), rgba(12,10,18,0.98));
  transform: none;
  filter: drop-shadow(14px 20px 18px rgba(0,0,0,0.34));
}
.kickstarter-card:hover img {
  transform: translateY(-2px) scale(1.02);
}
.kickstarter-copy {
  gap: 0.32rem;
}
.kickstarter-copy strong {
  font-size: 1.05rem;
}
.kickstarter-copy span {
  font-size: 0.88rem;
  line-height: 1.35;
}
.tutorial-callout {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.tutorial-product-reminder {
  flex: 0 0 124px;
  width: 124px;
  padding: 0.3rem 0.2rem;
  border-radius: 1rem;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.08);
}
.tutorial-product-reminder img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}
@media (max-width: 720px) {
  .tutorial-product-reminder { display: none; }
}
@media (max-width: 760px) {
  .title-with-badge, .title-with-badge.compact { justify-content: center; }
  .powered-tag { width: 100%; justify-content: center; }
  .intro-stage { flex-direction: column; }
  .intro-powered-tag { left: 50%; transform: translateX(-50%); }
}

.intro-durdle-badge { position: absolute; top: 1rem; left: 1rem; z-index: 3; }


/* --- v04 feedback pass --- */
.tagline {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.intro-screen {
  gap: 0.65rem;
}
.intro-box-wrap {
  margin-bottom: 0 !important;
}
.intro-product-box {
  max-height: min(48vh, 430px);
}
.intro-line {
  margin-top: -0.2rem;
}

.powered-tag,
.durdle-badge {
  flex-direction: column;
  gap: 0.18rem;
  text-align: center;
}
.powered-tag span,
.durdle-badge span {
  display: block;
  font-size: 0.66rem;
  line-height: 1.05;
  color: var(--muted);
  text-transform: none;
}
.powered-tag strong,
.powered-tag small {
  display: none !important;
}
.durdle-badge img,
.powered-tag img {
  display: block;
}

.two-line-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  line-height: 1.05;
}
.two-line-button small {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.72);
  font-weight: 800;
}

.brand-hero {
  display: inline-block;
  text-decoration: none;
  transition: transform 180ms ease, filter 180ms ease;
}
.brand-hero:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.06);
}

.status-line {
  display: none !important;
}
.action-panel:empty {
  display: none;
}
.action-panel {
  justify-content: flex-end;
}
.action-panel > .orientation-controls:only-child {
  margin-left: auto;
}

/* Contact button moved under log */
.contact-us-link {
  margin-top: 0.65rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
}
.mail-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* Legal-play underline only when a subset of hand cards are currently valid. */
.hand-card {
  position: relative;
  overflow: visible;
}
.hand-card.legal::after {
  content: none !important;
}
.hand-card.restricted-legal::after {
  content: "" !important;
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: -8px;
  height: 6px;
  border-radius: 999px;
  border: 2px solid rgba(71,211,255,0.95);
  background: rgba(71,211,255,0.16);
  box-shadow: 0 0 14px rgba(71,211,255,0.12);
}
.hand-card.restricted-legal:hover::after {
  box-shadow: 0 0 18px rgba(71,211,255,0.22);
}

/* Modifier glow emits from the modifier side of hand cards. */
.hand-card.modifier-card::before {
  content: "";
  position: absolute;
  z-index: 4;
  pointer-events: none;
  border-radius: 999px;
  background: var(--mod-glow, rgba(255,255,255,0.45));
  box-shadow: 0 0 14px var(--mod-glow, rgba(255,255,255,0.35)), 0 0 28px var(--mod-glow-soft, rgba(255,255,255,0.18));
  opacity: 0.86;
}
.hand-card.mod-plus { --mod-glow: rgba(37,210,131,0.78); --mod-glow-soft: rgba(37,210,131,0.24); }
.hand-card.mod-minus { --mod-glow: rgba(255,76,117,0.78); --mod-glow-soft: rgba(255,76,117,0.24); }
.hand-card.mod-up::before,
.hand-card.mod-down::before {
  left: 16%;
  right: 16%;
  height: 8px;
}
.hand-card.mod-up::before { top: -7px; }
.hand-card.mod-down::before { bottom: -7px; }
.hand-card.mod-left::before,
.hand-card.mod-right::before {
  top: 16%;
  bottom: 16%;
  width: 8px;
}
.hand-card.mod-left::before { left: -7px; }
.hand-card.mod-right::before { right: -7px; }

/* Demo tutorial back/check controls. */
.modal.tutorial-modal .modal-actions {
  justify-content: flex-end;
  align-items: center;
}
.modal.tutorial-modal .tutorial-back {
  min-width: 0;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
}
.modal.tutorial-modal .tutorial-back:disabled {
  opacity: 0.35;
  cursor: default;
}
.modal.tutorial-modal .modal-card {
  width: min(760px, 92vw) !important;
}
.tutorial-product,
.tutorial-product-reminder {
  display: none !important;
}

/* Make the bend chevrons follow the path vertically, instead of floating horizontally. */
.lane-rail.vertical::after {
  inset: 3px !important;
  background-repeat: repeat-y !important;
  background-size: 14px 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='34' viewBox='0 0 14 34'%3E%3Cpath d='M2 9 L7 18 L12 9' fill='none' stroke='rgba(255,255,255,0.78)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  transform: none !important;
}
.lane-rail.left-rail::after {
  transform: scaleY(-1) !important;
}
.collider-board.track-direction-demo .lane-rail.vertical::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='34' viewBox='0 0 14 34'%3E%3Cpath d='M2 9 L7 18 L12 9' fill='none' stroke='%23ffd34d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-size: 14px 34px !important;
  animation: track-arrows-flow-y 0.9s linear infinite, track-arrows-pulse 0.9s ease-in-out infinite !important;
}
.collider-board.track-direction-demo .lane-rail.left-rail::after {
  transform: scaleY(-1) !important;
}
@keyframes track-arrows-flow-y {
  from { background-position: 0 0; }
  to { background-position: 0 34px; }
}


/* --- v05 targeted polish: intro spacing, hover-only modifier glow, caret legal marker --- */
.intro-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}
.intro-box-wrap {
  margin-bottom: 0;
}
.intro-product-box {
  max-width: min(420px, 52vw);
}
.intro-line {
  margin-top: 0;
}

/* Show restricted legal indicator above the card as a caret instead of a bottom bar. */
.hand-card.restricted-legal::after {
  left: 50%;
  right: auto;
  top: -12px;
  bottom: auto;
  width: 18px;
  height: 12px;
  border: 0;
  border-radius: 0;
  background: rgba(71,211,255,0.95);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transform: translateX(-50%);
  box-shadow: 0 2px 10px rgba(71,211,255,0.28);
}
.hand-card.restricted-legal:hover::after {
  box-shadow: 0 4px 14px rgba(71,211,255,0.34);
}

/* Modifier glow should only appear when a hand card or board card is hovered. */
.hand-card.modifier-card::before,
.table-card.modifier-card::before {
  content: "";
  position: absolute;
  z-index: 4;
  pointer-events: none;
  border-radius: 999px;
  background: var(--mod-glow, rgba(255,255,255,0.45));
  box-shadow: 0 0 14px var(--mod-glow, rgba(255,255,255,0.35)), 0 0 28px var(--mod-glow-soft, rgba(255,255,255,0.18));
  opacity: 0;
  transition: opacity 180ms ease, box-shadow 180ms ease;
}
.hand-card.modifier-card:hover::before,
.slot:hover .table-card.modifier-card::before {
  opacity: 0.96;
}
.table-card.mod-plus { --mod-glow: rgba(37,210,131,0.78); --mod-glow-soft: rgba(37,210,131,0.24); }
.table-card.mod-minus { --mod-glow: rgba(255,76,117,0.78); --mod-glow-soft: rgba(255,76,117,0.24); }
.table-card.mod-up::before,
.table-card.mod-down::before,
.hand-card.mod-up::before,
.hand-card.mod-down::before {
  left: 16%;
  right: 16%;
  height: 8px;
}
.table-card.mod-up::before,
.hand-card.mod-up::before { top: -7px; }
.table-card.mod-down::before,
.hand-card.mod-down::before { bottom: -7px; }
.table-card.mod-left::before,
.table-card.mod-right::before,
.hand-card.mod-left::before,
.hand-card.mod-right::before {
  top: 16%;
  bottom: 16%;
  width: 8px;
}
.table-card.mod-left::before,
.hand-card.mod-left::before { left: -7px; }
.table-card.mod-right::before,
.hand-card.mod-right::before { right: -7px; }


/* v07 tweaks: downward bouncing legal caret, easier-to-click orientation arrows, and consistent modified-value placement */
@keyframes restricted-caret-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(3px); }
}
.hand-card.restricted-legal::after {
  left: 50% !important;
  right: auto !important;
  top: -13px !important;
  bottom: auto !important;
  width: 18px !important;
  height: 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(71,211,255,0.95) !important;
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%) !important;
  transform: translateX(-50%) !important;
  box-shadow: 0 2px 10px rgba(71,211,255,0.28) !important;
  animation: restricted-caret-bounce 1s ease-in-out infinite;
}
.hand-card.restricted-legal:hover::after {
  box-shadow: 0 4px 14px rgba(71,211,255,0.34) !important;
}
.slot-arrow {
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.slot:hover .slot-arrow,
.slot-arrow:hover {
  box-shadow: 0 8px 18px rgba(0,0,0,0.32);
}
.slot:hover .slot-arrow-up,
.slot-arrow-up:hover { transform: translate(-50%, -50%) scale(1.18); }
.slot:hover .slot-arrow-right,
.slot-arrow-right:hover { transform: translate(50%, -50%) scale(1.18); }
.slot:hover .slot-arrow-down,
.slot-arrow-down:hover { transform: translate(-50%, 50%) scale(1.18); }
.slot:hover .slot-arrow-left,
.slot-arrow-left:hover { transform: translate(-50%, -50%) scale(1.18); }
.card-badge-stack .true-badge {
  left: 58% !important;
  top: 35% !important;
  transform: translate(-50%, -50%) !important;
}


/* v08: persistent current-value bubble on every non-collided card; crown moved to bottom-right */
.true-badge.neutral { background: linear-gradient(180deg, rgba(122,133,145,0.98), rgba(89,99,111,0.98)); color: #f5f8fb; }
.true-badge.split { background: linear-gradient(90deg, var(--danger) 0 50%, var(--boost) 50% 100%); color: #ffffff; }
.card-badge-stack .true-badge {
  left: 19% !important;
  top: 80% !important;
  transform: translate(-50%, -50%) !important;
  min-width: 46px !important;
  width: 46px !important;
  height: 46px !important;
  font-size: 1.48rem !important;
}
.card-badge-stack .winner-crown {
  right: -12px !important;
  left: auto !important;
  top: auto !important;
  bottom: -12px !important;
  width: 28px !important;
  height: 28px !important;
}
.hand-card .card-badge-stack .true-badge {
  left: 19% !important;
  top: 80% !important;
  min-width: 32px !important;
  width: 32px !important;
  height: 32px !important;
  font-size: 1rem !important;
  border-width: 2px !important;
  box-shadow: 0 6px 14px rgba(0,0,0,0.30), 0 0 12px rgba(255,255,255,0.12) !important;
}
.hand-card .card-badge-stack .winner-crown { display: none !important; }
.table-card, .hand-card { overflow: visible; }


/* v09: result pauses/highlights and reliable collider-rule-card tooltips */
.collider-rule-cards {
  z-index: 30 !important;
}
.collider-rule-card {
  z-index: 31 !important;
}
.collider-rule-card:hover {
  z-index: 90 !important;
}
.slot.result-highlight {
  outline: 4px solid rgba(255,211,77,0.95);
  outline-offset: 6px;
  box-shadow: 0 0 34px rgba(255,211,77,0.52), inset 0 0 20px rgba(255,211,77,0.16) !important;
}
.slot.result-highlight .table-card {
  filter: drop-shadow(0 0 18px rgba(255,211,77,0.42));
}
@keyframes badge-result-bounce {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -56%) scale(1.14); }
}
.slot.badge-bounce .card-badge-stack .true-badge {
  animation: badge-result-bounce 0.78s ease-in-out infinite;
  box-shadow: 0 10px 24px rgba(0,0,0,0.38), 0 0 22px rgba(255,211,77,0.36) !important;
}


/* v10: no value bubbles in hand zone; crown stays separate at card bottom-right; centered tutorial labels */
.hand-card > .card-badge-stack {
  display: none !important;
}
.card-badge-stack .winner-crown {
  right: -12px !important;
  left: auto !important;
  top: auto !important;
  bottom: -12px !important;
  transform: none !important;
}
.tutorial-pointer small,
.tutorial-line,
.modal-card p,
.action-text,
.play-options-title {
  text-align: center;
}
.tutorial-pointer small {
  display: grid;
  place-items: center;
  line-height: 1.1;
}


/* v11: collider rule cards show tooltip on hover but do not enlarge */
.collider-rule-card:hover {
  transform: translate(-50%, -50%) !important;
  opacity: 1;
  filter: saturate(1.03) brightness(1.06);
}


/* v13: construction-style Contact Us card */
.contact-card-button {
  margin-top: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  display: block;
  overflow: hidden;
  border-radius: 0.9rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.035));
  box-shadow: 0 10px 22px rgba(0,0,0,0.22), inset 0 0 0 1px rgba(255,255,255,0.035);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, filter 180ms ease;
}
.contact-card-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255,211,77,0.62);
  box-shadow: 0 14px 28px rgba(0,0,0,0.28), 0 0 18px rgba(255,211,77,0.10);
  filter: brightness(1.04);
}
.contact-caution {
  min-height: 38%;
  padding: 0.42rem 0.55rem;
  color: #1d1400;
  font-weight: 1000;
  font-size: 0.78rem;
  line-height: 1.05;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,0.28);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0.02)),
    repeating-linear-gradient(135deg, #ffd34d 0 13px, #ffd34d 13px 23px, #201400 23px 34px, #201400 34px 44px);
  border-bottom: 1px solid rgba(0,0,0,0.42);
}
.contact-card-body {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0.55rem;
  align-items: center;
  padding: 0.7rem 0.72rem 0.78rem;
}
.contact-card-body .mail-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,211,77,0.12);
  border: 1px solid rgba(255,211,77,0.36);
  color: #ffe08a;
  font-size: 1.08rem;
}
.contact-copy {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}
.contact-copy strong {
  color: #fff3c9;
  font-size: 0.95rem;
  line-height: 1.05;
}
.contact-copy span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.28;
}


/* v14: move Durdle badge beside Skip Demo Trick and polish card-anatomy lesson */
.tutorial-choice .start-powered-tag {
  align-self: stretch;
  min-height: 56px;
  padding: 0.36rem 0.62rem;
  border-radius: 0.9rem;
  box-sizing: border-box;
}
.tutorial-choice .start-powered-tag img {
  width: 48px;
  height: 30px;
}
.tutorial-choice .start-powered-tag span {
  font-size: 0.62rem;
  line-height: 1.05;
  white-space: nowrap;
}

.tutorial-card-lesson {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  align-items: center;
  justify-items: center;
  text-align: center;
}
.card-lesson-figure {
  position: relative;
  width: min(300px, 70vw);
  margin: 0 auto;
  justify-self: center;
}
.card-lesson-card {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1rem;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,0.42));
}
.lesson-focus {
  position: absolute;
  border: 3px solid rgba(255,211,77,0.98);
  box-shadow: 0 0 18px rgba(255,211,77,0.5), inset 0 0 14px rgba(255,211,77,0.12);
  background: rgba(255,211,77,0.08);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}
.lesson-callout {
  position: absolute;
  padding: 0.34rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(59,44,18,0.96), rgba(39,28,12,0.96));
  color: #fff1bf;
  border: 1px solid rgba(255,211,77,0.55);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0.22;
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 8px 18px rgba(0,0,0,0.24);
  pointer-events: none;
}
.lesson-callout::after {
  content: "➤";
  position: absolute;
  color: #ffd34d;
  font-size: 2rem;
  line-height: 1;
  -webkit-text-stroke: 2px rgba(66, 38, 0, 0.65);
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.45)) drop-shadow(0 0 10px rgba(255,211,77,0.42));
  pointer-events: none;
}
.focus-value { left: 35%; top: 57%; width: 28%; height: 20%; border-radius: 999px; }
.focus-suit { left: 18%; top: 25%; width: 64%; height: 27%; border-radius: 1rem; }
.focus-modifier { right: 7%; top: 40%; width: 23%; height: 20%; border-radius: 1rem; }
.focus-atoms { left: 27%; top: 3%; width: 46%; height: 14%; border-radius: 999px; }

.callout-value { left: -10%; top: 60%; }
.callout-suit { left: -8%; top: 20%; }
.callout-modifier { right: -10%; top: 40%; }
.callout-atoms { right: -8%; top: 4%; }

.callout-value::after,
.callout-suit::after {
  right: -2.05rem;
  top: 50%;
  transform: translateY(-50%);
}
.callout-modifier::after,
.callout-atoms::after {
  left: -2.05rem;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
}
@keyframes lesson-arrow-bounce-right {
  0%, 100% { margin-right: 0; }
  50% { margin-right: -8px; }
}
@keyframes lesson-arrow-bounce-left {
  0%, 100% { margin-left: 0; }
  50% { margin-left: -8px; }
}
.lesson-value .focus-value,
.lesson-value .callout-value,
.lesson-suit .focus-suit,
.lesson-suit .callout-suit,
.lesson-modifier .focus-modifier,
.lesson-modifier .callout-modifier,
.lesson-atoms .focus-atoms,
.lesson-atoms .callout-atoms {
  opacity: 1;
  transform: scale(1.02);
}
.lesson-value .callout-value::after,
.lesson-suit .callout-suit::after {
  animation: lesson-arrow-bounce-right 0.82s ease-in-out infinite;
}
.lesson-modifier .callout-modifier::after,
.lesson-atoms .callout-atoms::after {
  animation: lesson-arrow-bounce-left 0.82s ease-in-out infinite;
}
.card-lesson-copy {
  text-align: center;
  max-width: 46rem;
}
.card-lesson-step {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}
@media (max-width: 720px) {
  .tutorial-choice .start-powered-tag {
    width: 100%;
    flex-direction: row;
    justify-content: center;
  }
  .card-lesson-figure {
    width: min(245px, 78vw);
  }
  .callout-value { left: -4%; }
  .callout-suit { left: -4%; }
  .callout-modifier { right: -4%; }
  .callout-atoms { right: -4%; }
}


/* v16: crown moved to upper-right; orientation arrows stay above hovered cards */
.card-badge-stack {
  overflow: visible !important;
}
.card-badge-stack .winner-crown {
  position: absolute !important;
  top: -10px !important;
  right: -10px !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  width: 28px !important;
  height: 28px !important;
  z-index: 40 !important;
}
.slot-orient-controls {
  inset: -26px !important;
  z-index: 140 !important;
  pointer-events: none;
}
.slot-arrow {
  width: 34px !important;
  height: 34px !important;
  z-index: 145 !important;
  pointer-events: auto !important;
  box-shadow: 0 8px 18px rgba(0,0,0,0.34) !important;
}
.slot:hover .table-card,
.slot.pending .table-card {
  z-index: 90 !important;
}
.slot:hover .slot-orient-controls,
.slot.pending .slot-orient-controls {
  z-index: 150 !important;
}


/* v17: accurate card-anatomy arrow mapping */
.tutorial-card-lesson .card-lesson-figure {
  width: min(315px, 72vw) !important;
  margin-inline: auto !important;
}
.tutorial-card-lesson .lesson-focus,
.tutorial-card-lesson .lesson-callout {
  opacity: 0 !important;
}

/* Value: central printed/current value circle */
.tutorial-card-lesson .focus-value {
  left: 34% !important;
  top: 35% !important;
  width: 32% !important;
  height: 34% !important;
  border-radius: 999px !important;
}
.tutorial-card-lesson .callout-value {
  left: -22% !important;
  top: 48% !important;
}
.tutorial-card-lesson .callout-value::after {
  right: -2.05rem !important;
  left: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

/* Suit: the purple card face/background */
.tutorial-card-lesson .focus-suit {
  left: 4% !important;
  top: 4% !important;
  width: 92% !important;
  height: 92% !important;
  border-radius: 1.1rem !important;
}
.tutorial-card-lesson .callout-suit {
  left: -23% !important;
  top: 18% !important;
}
.tutorial-card-lesson .callout-suit::after {
  right: -2.05rem !important;
  left: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

/* Modifier: the -1 shield at the bottom of the card */
.tutorial-card-lesson .focus-modifier {
  left: 36% !important;
  top: 72% !important;
  width: 28% !important;
  height: 23% !important;
  border-radius: 1rem !important;
}
.tutorial-card-lesson .callout-modifier {
  right: -24% !important;
  top: 79% !important;
}
.tutorial-card-lesson .callout-modifier::after {
  left: -2.05rem !important;
  right: auto !important;
  top: 50% !important;
  transform: translateY(-50%) rotate(180deg) !important;
}

/* Atoms: the scoring banners/icons at the top of the card */
.tutorial-card-lesson .focus-atoms {
  left: 38% !important;
  top: 0% !important;
  width: 26% !important;
  height: 21% !important;
  border-radius: 0.9rem !important;
}
.tutorial-card-lesson .callout-atoms {
  right: -20% !important;
  top: 9% !important;
}
.tutorial-card-lesson .callout-atoms::after {
  left: -2.05rem !important;
  right: auto !important;
  top: 50% !important;
  transform: translateY(-50%) rotate(180deg) !important;
}

/* Show only the callout/focus for the current step. */
.tutorial-card-lesson.lesson-value .focus-value,
.tutorial-card-lesson.lesson-value .callout-value,
.tutorial-card-lesson.lesson-suit .focus-suit,
.tutorial-card-lesson.lesson-suit .callout-suit,
.tutorial-card-lesson.lesson-modifier .focus-modifier,
.tutorial-card-lesson.lesson-modifier .callout-modifier,
.tutorial-card-lesson.lesson-atoms .focus-atoms,
.tutorial-card-lesson.lesson-atoms .callout-atoms {
  opacity: 1 !important;
  transform: scale(1.02);
}
.tutorial-card-lesson.lesson-value .callout-value::after,
.tutorial-card-lesson.lesson-suit .callout-suit::after {
  animation: lesson-arrow-bounce-right 0.82s ease-in-out infinite !important;
}
.tutorial-card-lesson.lesson-modifier .callout-modifier::after,
.tutorial-card-lesson.lesson-atoms .callout-atoms::after {
  animation: lesson-arrow-bounce-left 0.82s ease-in-out infinite !important;
}

@media (max-width: 720px) {
  .tutorial-card-lesson .callout-value,
  .tutorial-card-lesson .callout-suit { left: -8% !important; }
  .tutorial-card-lesson .callout-modifier,
  .tutorial-card-lesson .callout-atoms { right: -8% !important; }
}


/* v18: make badge overlay span full card so crown reliably stays upper-right and value bubble lower-left */
.table-card { overflow: visible !important; }
.card-badge-stack {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  right: auto !important;
  top: auto !important;
  display: block !important;
  z-index: 30 !important;
  overflow: visible !important;
  pointer-events: none !important;
}
.card-badge-stack .true-badge {
  position: absolute !important;
  left: -10px !important;
  bottom: -10px !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  z-index: 31 !important;
  pointer-events: auto !important;
}
.card-badge-stack .winner-crown {
  position: absolute !important;
  right: -10px !important;
  top: -10px !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  z-index: 32 !important;
  pointer-events: auto !important;
}
.hand-card > .card-badge-stack { display: none !important; }


/* v19: tutorial crown emphasis */
@keyframes tutorial-crown-bounce {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 10px 20px rgba(0,0,0,0.34), 0 0 0 0 rgba(255, 211, 77, 0.42); }
  50% { transform: translateY(-5px) scale(1.08); box-shadow: 0 14px 24px rgba(0,0,0,0.38), 0 0 0 8px rgba(255, 211, 77, 0.16); }
}
.slot.crown-bounce .card-badge-stack .winner-crown {
  animation: tutorial-crown-bounce 0.9s ease-in-out infinite !important;
}


/* v20: explicit crown/current-value tutorial emphasis */
@keyframes tutorial-crown-bounce {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 10px 20px rgba(0,0,0,0.34), 0 0 0 0 rgba(255, 211, 77, 0.42); }
  50% { transform: translateY(-5px) scale(1.1); box-shadow: 0 14px 24px rgba(0,0,0,0.38), 0 0 0 8px rgba(255, 211, 77, 0.16); }
}
.slot.crown-bounce .card-badge-stack .winner-crown {
  animation: tutorial-crown-bounce 0.9s ease-in-out infinite !important;
}


/* v21: demo trick rebuild, playtest usability, responsive sizing */
.resolution-check {
  color: rgba(191, 216, 226, 0.78);
  font-size: 0.72rem;
  margin-top: 0.15rem;
  letter-spacing: 0.01em;
}
.resolution-check.warning {
  color: #ffd34d;
}
.audio-toggle.off {
  opacity: 0.72;
  border-color: rgba(255,255,255,0.12);
}
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.panel-title-row h2 { margin-bottom: 0; }
.panel-close {
  padding: 0.36rem 0.58rem;
  font-size: 0.72rem;
}
.reopen-log {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 95;
  box-shadow: 0 10px 28px rgba(0,0,0,0.34);
}
.right-panel.is-hidden {
  display: none !important;
}
.table-layout.log-hidden {
  grid-template-columns: minmax(180px, 220px) minmax(620px, 1fr);
}
.score-metrics {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  white-space: nowrap;
}
.collision-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.7rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255,211,77,0.44);
  background: rgba(255,211,77,0.10);
  color: #ffefb0;
  font-weight: 950;
  font-size: 0.78rem;
}
.score-more[open] summary {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
@keyframes seat-shift-v21 {
  0% { transform: translate(calc(-50% + var(--seat-delta-x, 0%)), -50%) scale(0.98); }
  45% { transform: translate(calc(-50% + (var(--seat-delta-x, 0%) * 0.42)), -54%) scale(1.04); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.entity-marker.seat-shifting {
  animation: seat-shift-v21 3.5s cubic-bezier(.18,.72,.18,1) both;
  z-index: 12;
}
.modal.tutorial-modal .modal-card {
  width: min(820px, 92vw);
}
.tutorial-line-wrap {
  max-width: 62ch;
  margin-inline: auto;
}
.tutorial-line {
  text-align: left !important;
  line-height: 1.58 !important;
  text-wrap: pretty;
  margin: 0 auto;
}
.modal-card p {
  text-align: left;
}
.modal-actions {
  justify-content: center;
}
.game {
  min-height: var(--app-height, 100dvh);
  padding: clamp(0.55rem, 1vw, 1rem);
}
.collider-board {
  min-height: clamp(430px, 58vh, 620px);
}
.table-layout {
  width: min(100%, 1680px);
}
@media (max-width: 1180px) {
  .table-layout {
    grid-template-columns: minmax(170px, 220px) minmax(520px, 1fr);
  }
  .right-panel {
    grid-column: 1 / -1;
    max-height: 34vh;
    overflow: auto;
  }
  .table-layout.log-hidden {
    grid-template-columns: minmax(170px, 220px) minmax(520px, 1fr);
  }
  .collider-board {
    min-height: clamp(420px, 56vh, 560px);
  }
}
@media (max-width: 860px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
  .topbar-actions {
    justify-content: flex-start;
  }
  .table-layout,
  .table-layout.log-hidden {
    grid-template-columns: 1fr;
  }
  .left-panel,
  .right-panel {
    max-height: none;
  }
  .scoreboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .collider-board {
    min-height: 420px;
  }
  .hand-card {
    width: 78px;
    height: 78px;
  }
}
@media (max-width: 620px) {
  .game::before {
    content: "Small screen warning: Supercollider plays best on a tablet, laptop, or desktop. Rotate your device if possible.";
    display: block;
    margin: 0 0 0.6rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(255,211,77,0.35);
    border-radius: 0.75rem;
    background: rgba(255,211,77,0.10);
    color: #ffe9a6;
    font-weight: 800;
    font-size: 0.82rem;
  }
  .collider-board {
    min-height: 380px;
  }
  .entity-marker {
    width: 78px;
    height: 62px;
    font-size: 0.78rem;
  }
  .slot {
    width: clamp(70px, 19vw, 92px);
    height: clamp(70px, 19vw, 92px);
  }
}


/* v22: uploaded music bed and pending-collision siren before confirm */
.pending-controls {
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.pending-collision-siren {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.42rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.055);
  color: rgba(218,235,244,0.72);
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.pending-collision-siren .siren-icon {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  filter: grayscale(1) opacity(0.55);
  transition: filter 180ms ease, transform 180ms ease;
}
.pending-collision-siren.active {
  color: #ffe5e9;
  border-color: rgba(255,76,117,0.85);
  background: linear-gradient(180deg, rgba(255,76,117,0.24), rgba(120,12,38,0.30));
  box-shadow: 0 0 0 2px rgba(255,76,117,0.12), 0 10px 22px rgba(255,30,70,0.18);
}
.pending-collision-siren.active .siren-icon {
  filter: none;
  animation: siren-alert-pulse 0.72s ease-in-out infinite;
}
#confirmPending.collision-confirm {
  border: 3px solid rgba(255,76,117,0.98) !important;
  box-shadow: 0 0 0 4px rgba(255,76,117,0.20), 0 0 28px rgba(255,76,117,0.32) !important;
  background: linear-gradient(180deg, #ff5f80, #b5163f) !important;
  color: #fff7f9 !important;
}
.orientation-controls.collision-ready {
  border-radius: 1rem;
}
@keyframes siren-alert-pulse {
  0%, 100% { transform: rotate(-5deg) scale(1); text-shadow: 0 0 0 rgba(255,255,255,0); }
  50% { transform: rotate(5deg) scale(1.18); text-shadow: 0 0 12px rgba(255,255,255,0.55); }
}
@media (max-width: 620px) {
  .pending-collision-siren .siren-copy {
    max-width: 13rem;
    white-space: normal;
    text-align: left;
  }
}


/* v24: cleaner top music control; hidden viewport readout; collapsed scores by default */
.resolution-check {
  display: none !important;
}
.music-control {
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
  padding: 0.22rem 0.44rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.055);
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}
.music-icon-button {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.20);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  color: #f4fbff;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.music-icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(71,211,255,0.18);
}
.music-icon-button.off {
  opacity: 0.62;
}
.music-volume {
  width: 88px;
  accent-color: #ffd34d;
  cursor: pointer;
}
.music-volume.off {
  opacity: 0.48;
}
.score-more summary {
  user-select: none;
}
@media (max-width: 720px) {
  .music-volume {
    width: 64px;
  }
  .music-control {
    padding-right: 0.34rem;
  }
}


/* v25: continuous seat-marker movement using actual old/new board positions */
@keyframes seat-shift-v25 {
  0% {
    left: var(--seat-from-x, var(--x, 50%));
    transform: translate(-50%, -50%) scale(1);
  }
  18% {
    left: var(--seat-from-x, var(--x, 50%));
    transform: translate(-50%, -56%) scale(1.035);
  }
  100% {
    left: var(--x, 50%);
    transform: translate(-50%, -50%) scale(1);
  }
}
.entity-marker.seat-shifting {
  animation: seat-shift-v25 4.5s cubic-bezier(.16,.72,.16,1) both !important;
  will-change: left, transform;
  z-index: 18 !important;
}


/* v26: demo starts silent; collider structure cards stay outside the active collider lane */
.collider-rule-cards {
  z-index: 18 !important;
  pointer-events: none;
}
.collider-rule-card {
  width: clamp(54px, 5.7vw, 78px) !important;
  opacity: 0.70 !important;
  pointer-events: auto;
}
.rule-first-card,
.rule-last-card {
  left: 3.25% !important;
}
.rule-curve-top-card,
.rule-curve-bottom-card {
  left: 96.75% !important;
}
.rule-first-card { top: 39% !important; }
.rule-last-card { top: 77% !important; }
.rule-curve-top-card { top: 39% !important; }
.rule-curve-bottom-card { top: 77% !important; }
.collider-rule-card:hover {
  transform: translate(-50%, -50%) scale(1.08) !important;
}
@media (max-width: 900px) {
  .collider-rule-card {
    width: clamp(42px, 7vw, 58px) !important;
    opacity: 0.62 !important;
  }
  .rule-first-card,
  .rule-last-card {
    left: 2.5% !important;
  }
  .rule-curve-top-card,
  .rule-curve-bottom-card {
    left: 97.5% !important;
  }
}


/* v27: clearer crowdfunding demo framing and cleaner player score panels */
.what-is-this {
  max-width: 72ch;
  margin: 0.35rem auto 0.95rem;
  color: rgba(222, 239, 248, 0.84);
  font-size: 0.96rem;
  line-height: 1.45;
  text-align: center;
}
.top-explainer {
  margin: 0.14rem 0 0.18rem;
  max-width: 68ch;
  text-align: left;
  font-size: 0.82rem;
  color: rgba(206, 229, 239, 0.76);
}
.score-summary-label small {
  display: none !important;
}
.score-topline {
  align-items: center;
}
.score-metrics.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.26rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(255,211,77,0.62);
  background: linear-gradient(180deg, rgba(255,211,77,0.18), rgba(255,211,77,0.08));
  color: #fff0b8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  white-space: nowrap;
}
.score-metrics.score-pill strong {
  color: #fff6cf;
  font-weight: 950;
}
.score-pill-divider {
  width: 1px;
  align-self: stretch;
  min-height: 1.05rem;
  background: rgba(255,211,77,0.34);
}
.collision-count {
  font-weight: 950;
  color: #ffefb0;
  font-size: 0.78rem;
}
.score-metrics .collision-chip {
  display: none !important;
}
.demo-complete-cta {
  text-align: left;
}
.demo-complete-cta p {
  max-width: 62ch;
}
.cta-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin: 1rem 0 0.8rem;
}
.cta-link {
  min-height: 2.55rem;
  padding: 0.72rem 1rem;
}
@media (max-width: 720px) {
  .top-explainer {
    text-align: left;
    font-size: 0.78rem;
  }
  .score-metrics.score-pill {
    padding-inline: 0.46rem;
  }
}


/* v28: MailerLite mailing-list integration */
.mailing-start-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  color: #ffe9a6;
  font-weight: 900;
  text-decoration: none;
  border: 1px solid rgba(255,211,77,0.30);
  border-radius: 999px;
  padding: 0.52rem 0.8rem;
  background: rgba(255,211,77,0.08);
}
.mailing-start-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(255,211,77,0.18);
}
.mailing-panel {
  margin-top: 0.85rem;
  margin-bottom: 0.95rem;
}
.mailing-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(255,211,77,0.22);
  border-radius: 0.95rem;
  padding: 0.72rem;
  background: linear-gradient(180deg, rgba(255,211,77,0.10), rgba(255,255,255,0.04));
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.mailing-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,211,77,0.48);
  box-shadow: 0 14px 28px rgba(0,0,0,0.24), 0 0 18px rgba(255,211,77,0.12);
}
.mailing-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(255,211,77,0.16);
  border: 1px solid rgba(255,211,77,0.28);
  color: #ffe9a6;
  font-weight: 950;
}
.mailing-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.mailing-copy strong {
  font-size: 0.98rem;
}
.mailing-copy span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.3;
}
.demo-complete-cta .cta-button-row {
  flex-wrap: wrap;
}
