:root {
  --jungle-900: #0c1f14;
  --jungle-800: #12301d;
  --leaf: #7cc254;
  --amber: #ffb300;
  --amber-dark: #c77c00;
  --lava: #ff6d2e;
  --bone: #fff6e2;
  --bone-dark: #eadcbc;
  --paper: #fbf1d9;
  --ink: #2b1d0e;
  --muted: #7a6a52;
  --red: #e53935;
  --red-soft: #ffcdd2;
  --blue: #1e88e5;
  --blue-soft: #bbdefb;
  --event: #43a047;
  --action: #e53935;
  --scoring: #8e24aa;
  --none: #78909c;
  --wood-1: #8a5a2b;
  --wood-2: #6b4220;
  --wood-3: #4a2b12;
  --felt: #2f6b3a;
  --felt-dark: #1d4a26;
  --radius: 16px;
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Fredoka", system-ui, sans-serif;
  color: var(--bone);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 214, 150, 0.22), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0.5), transparent 65%),
    repeating-linear-gradient(91deg, rgba(0, 0, 0, 0.07) 0 2px, transparent 2px 11px),
    repeating-linear-gradient(89deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 27px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 180px),
    linear-gradient(180deg, #7b4e27, #5a3618 60%, #4a2c13);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: "Lilita One", "Fredoka", sans-serif; font-weight: 400; letter-spacing: 0.02em; }

button { font-family: inherit; }

.muted { color: var(--muted); font-size: 0.9rem; }

/* ---------- Token images ---------- */
.tk { width: 1.3em; height: 1.3em; margin: 0 0.06em; object-fit: contain; vertical-align: -0.3em; display: inline-block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); user-select: none; -webkit-user-drag: none; }
.tk.dz { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(0, 0, 0, 0.3); filter: none; }
.tk.big { width: 2.4rem; height: 2.4rem; vertical-align: middle; }
.dzn { white-space: nowrap; }
.sq { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 2px; background: linear-gradient(135deg, #8bc34a, #558b2f); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.25); vertical-align: -0.05em; margin-right: 1px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: linear-gradient(180deg, #ffd24d, var(--amber));
  box-shadow: 0 4px 0 var(--amber-dark), 0 6px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--amber-dark), 0 3px 8px rgba(0, 0, 0, 0.2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
.btn.big { width: 100%; padding: 0.85rem 1.2rem; font-size: 1.1rem; margin-top: 0.75rem; }
.btn.big:not(:disabled):not(.ghost) { animation: ready 2.4s ease-in-out infinite; }
.btn.sm { padding: 0.4rem 0.75rem; font-size: 0.88rem; border-radius: 10px; box-shadow: 0 3px 0 var(--amber-dark); }
.btn.ghost {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}
.panel .btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--bone-dark); }
.btn.on { background: linear-gradient(180deg, #9be07a, var(--leaf)); box-shadow: 0 3px 0 #4f8a2f; }
.btn.lava { background: linear-gradient(180deg, #ff9160, var(--lava)); box-shadow: 0 4px 0 #b8421a; color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.link { background: none; border: 0; color: #9c5b00; text-decoration: underline; cursor: pointer; font-size: 0.9rem; padding: 0; }

/* ---------- Top bar (walnut rail) ---------- */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 0.8rem 1.4rem;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #3b2210, #2a170a);
  border-bottom: 3px solid #1a0d04;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(255, 210, 140, 0.18);
  position: relative;
  z-index: 3;
}
.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand-logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px #f3d9a4, 0 4px 10px rgba(0, 0, 0, 0.5);
  animation: stomp 3.5s ease-in-out infinite;
}
.brand h1 { margin: 0; font-size: 1.55rem; line-height: 1; color: #ffe08a; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45); }
.brand small { display: block; font-size: 0.78rem; color: rgba(255, 246, 226, 0.65); margin-top: 0.2rem; }
.top-mid { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.top-actions { display: flex; gap: 0.5rem; }

.tracker { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tracker-label { font-size: 0.8rem; color: rgba(255, 246, 226, 0.7); margin-right: 6px; white-space: nowrap; }
.pip {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 700;
  background: linear-gradient(180deg, #f4e4c0, #d9c292);
  color: #7a5a2a;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 1px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.3s var(--pop);
}
.pip.done { background: linear-gradient(180deg, #8fc96b, #5f9d3e); color: #eaffdc; }
.pip.cur {
  background: radial-gradient(circle at 35% 30%, #ff8a80, var(--red) 60%, #8e0000);
  color: #fff;
  border-radius: 50%;
  transform: scale(1.3) translateY(-2px);
  box-shadow: 0 3px 0 #5d0000, 0 0 0 3px rgba(255, 179, 0, 0.55), 0 6px 10px rgba(0, 0, 0, 0.45);
  animation: marker 2.2s ease-in-out infinite;
  z-index: 1;
}

.phase-row { display: flex; gap: 8px; flex-wrap: wrap; perspective: 600px; }
.pcard {
  --pcol: #6d4c41;
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border-radius: 9px;
  background: linear-gradient(180deg, #fffaf0, #f1e2c2);
  color: var(--ink);
  border-left: 6px solid var(--pcol);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 5px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s var(--pop), opacity 0.3s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
}
.pcard.ph-food { --pcol: #43a047; }
.pcard.ph-feed { --pcol: #e64a19; }
.pcard.ph-produce { --pcol: #f9a825; }
.pcard.ph-action { --pcol: #1e88e5; }
.pc-i { font-size: 1.05rem; line-height: 1; }
.pc-i .tk { width: 1.25em; height: 1.25em; }
.phase-row.fresh .pcard { animation: dealPhase 0.6s var(--pop) both; }
.phase-row.fresh .pcard:nth-child(2) { animation-delay: 0.1s; }
.phase-row.fresh .pcard:nth-child(3) { animation-delay: 0.2s; }
.phase-row.fresh .pcard:nth-child(4) { animation-delay: 0.3s; }
.pc-n { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--pcol); color: #fff; font-size: 0.72rem; font-weight: 700; }
.pcard.done {
  color: transparent;
  background: repeating-linear-gradient(45deg, #5d3a1a 0 6px, #6f4721 6px 12px);
  border-left-color: #3b2410;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  transform: rotateY(180deg) scale(0.94);
  opacity: 0.8;
}
.pcard.done > * { visibility: hidden; }
.pcard.cur { transform: translateY(-4px) scale(1.06) rotate(-1.5deg); box-shadow: 0 0 0 3px var(--amber), 0 8px 18px rgba(0, 0, 0, 0.45); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 18px;
  padding: 18px;
  max-width: 1560px;
  margin: 0 auto;
  align-items: start;
}
.main-col { min-width: 0; display: grid; gap: 16px; align-content: start; }
/* Side by side while each board gets ~400px, otherwise stacked. */
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 16px; justify-items: center; }
.boards > .player { width: 100%; max-width: 620px; }

/* ---------- Player mats (felt) ---------- */
.player {
  position: relative;
  border-radius: 18px;
  padding: 12px 12px 10px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.08), transparent 70%),
    repeating-radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--felt), var(--felt-dark));
  border: 3px solid #2a170a;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 30px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.35s ease, transform 0.35s var(--pop), filter 0.35s ease;
  min-width: 0;
}
.player::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 13px;
  border: 2px dashed color-mix(in srgb, var(--pc) 55%, rgba(255, 255, 255, 0.3));
  pointer-events: none;
}
.player.pl-red { --pc: var(--red); --pcs: var(--red-soft); }
.player.pl-blue { --pc: var(--blue); --pcs: var(--blue-soft); }
.player:not(.active):not(.target) { filter: saturate(0.85) brightness(0.93); }
.player.active { transform: translateY(-3px); box-shadow: 0 0 0 4px var(--pc), 0 0 28px color-mix(in srgb, var(--pc) 55%, transparent), 0 18px 34px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.3); }
.player.target { box-shadow: 0 0 0 4px var(--lava), 0 18px 34px rgba(0, 0, 0, 0.5); animation: targetPulse 1.4s ease-in-out infinite; }
.p-head { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 8px; }
.p-name { display: flex; align-items: center; gap: 0.45rem; font-family: "Lilita One", sans-serif; font-size: 1.3rem; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); min-width: 0; }
.p-mascot { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--pc), 0 3px 8px rgba(0, 0, 0, 0.45); flex: 0 0 auto; }
.player.active .p-mascot { animation: stomp 2.2s ease-in-out infinite; }
.tag { font-family: "Fredoka", sans-serif; font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px; background: rgba(255, 255, 255, 0.16); letter-spacing: 0.04em; text-shadow: none; }
.turn-tag { background: var(--pc); color: #fff; animation: pulseTag 1.6s ease-in-out infinite; }
.target-tag { background: var(--lava); color: #fff; }
.p-score {
  font-family: "Lilita One", sans-serif;
  background: radial-gradient(circle at 35% 30%, #fff59d, #fbc02d 65%, #f57f17);
  color: #4a2c00;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 1rem;
  box-shadow: 0 3px 0 #b36b00, 0 4px 8px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}
.res { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.65rem 0.18rem 0.3rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffaf0, #eedfbd);
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  font-weight: 600;
  font-size: 0.98rem;
}
.chip .tk { width: 1.6em; height: 1.6em; margin: -0.2em 0; }
.chip b { font-weight: 700; min-width: 1ch; }
.chip.bump { animation: bump 0.5s var(--pop); }
.chip.up { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(124, 194, 84, 0.8); }
.chip.down { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(255, 109, 46, 0.8); }
.chip .delta {
  position: absolute;
  right: -6px; top: -12px;
  font-style: normal;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  color: #fff;
  background: #2e7d32;
  pointer-events: none;
  animation: floatUp 1.4s ease-out forwards;
}
.chip.down .delta { background: #c62828; }
.board-wrap { position: relative; display: flex; justify-content: center; }
.board { width: 100%; max-width: 470px; height: auto; display: block; user-select: none; -webkit-user-select: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.board.selecting { touch-action: none; }
.p-foot { position: relative; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 8px; }
.book-btn { display: inline-flex; align-items: center; gap: 0.45rem; }
.book-btn.bump { animation: bump 0.5s var(--pop); }
.book-ic {
  width: 18px; height: 22px;
  border-radius: 3px 5px 5px 3px;
  background: linear-gradient(90deg, #5d0000 0 3px, var(--pc) 3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), inset -2px 0 0 rgba(255, 255, 255, 0.5);
}
.blocked { font-size: 0.85rem; color: #ffd0c6; background: rgba(0, 0, 0, 0.25); padding: 0.15rem 0.5rem; border-radius: 999px; }

/* ---------- Board SVG ---------- */
.cell { transition: fill 0.12s ease; }
.selecting .cell.can { cursor: pointer; stroke: #fffbe0; stroke-width: 2; animation: canPulse 1.8s ease-in-out infinite; }
.selecting .cell.can:hover { fill: #fff59d; }
.cell.sel { fill: #ffd54f !important; animation: none !important; }
.item, .badges, .fences { pointer-events: none; }
.piece.zz { filter: saturate(0.3) brightness(0.88); }
.piece.drop { animation: pieceDrop 0.6s var(--pop) both; transform-box: fill-box; transform-origin: 50% 50%; }
.piece.focus .focus-ring, .piece.focus .focus-cell { pointer-events: none; animation: focusPulse 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
.piece.focus .focus-ring { animation-name: focusRing; }
.fence.new { animation: fenceIn 0.5s var(--pop) both; transform-box: fill-box; transform-origin: 50% 50%; }
.sleep-tok.danger { animation: danger 1s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
.edge { cursor: pointer; }
.edge .ev { stroke: rgba(255, 255, 255, 0.6); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; animation: march 1.2s linear infinite; }
.edge .eh { stroke: transparent; stroke-width: 16; stroke-linecap: butt; }
.edge:hover .ev { stroke: #ffe066; stroke-width: 5; stroke-dasharray: none; animation: none; }
.edge.pend .ev { stroke: #ffd54f; stroke-width: 6; stroke-dasharray: none; animation: none; filter: drop-shadow(0 0 3px rgba(255, 213, 79, 0.9)); }
.board text { font-family: "Fredoka", sans-serif; }

/* ---------- Control panel (rulebook parchment) ---------- */
.panel {
  position: sticky;
  top: 12px;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(255, 255, 255, 0.6), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(190, 150, 80, 0.18), transparent 55%),
    linear-gradient(180deg, var(--bone), var(--paper));
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 0 3px #2a170a, inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  overflow: hidden;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}
.panel-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 16px 14px; }
.banner {
  padding: 0.85rem 4.2rem 0.85rem 1rem;
  color: #fff;
  background: linear-gradient(135deg, #3d5a2e, #26401c);
  position: relative;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
  animation: bannerIn 0.45s var(--pop);
}
.banner.b-red { background: linear-gradient(135deg, #ef5350, #b71c1c); }
.banner.b-blue { background: linear-gradient(135deg, #42a5f5, #0d47a1); }
.b-who { font-family: "Lilita One", sans-serif; font-size: 1.35rem; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2); }
.b-phase { font-size: 0.92rem; opacity: 0.95; margin-top: 2px; }
.b-phase .tk { width: 1.15em; height: 1.15em; }
.banner::after {
  content: "";
  position: absolute;
  right: 12px; top: calc(50% - 25px);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: url("/img/dino-game/cover.webp") center / cover;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 4px 10px rgba(0, 0, 0, 0.35);
}
.banner.b-red::after { background-image: url("/img/dino-game/trex.webp"); animation: stomp 2.4s ease-in-out infinite; }
.banner.b-blue::after { background-image: url("/img/dino-game/brachiosaurus.webp"); animation: stomp 2.4s ease-in-out infinite; }

.task { padding-top: 14px; animation: taskIn 0.35s ease both; }
.task h2 { margin: 0 0 0.4rem; font-size: 1.5rem; color: #3d2a12; }
.task h3 { margin: 0 0 0.4rem; font-size: 1.2rem; color: #3d2a12; }
.task p { margin: 0.35rem 0; line-height: 1.45; }
.hint { background: #fff; border: 1px dashed #d8c49a; border-radius: 12px; padding: 0.55rem 0.7rem; font-size: 0.9rem; color: #5d4a2c; margin: 0.6rem 0; }

.phase-order { list-style: none; padding: 0; margin: 0.6rem 0; display: grid; gap: 6px; perspective: 700px; }
.phase-order li { display: flex; align-items: center; gap: 0.6rem; background: #fff; border-radius: 12px; padding: 0.5rem 0.7rem; box-shadow: 0 3px 0 var(--bone-dark); animation: flipIn 0.55s var(--pop) both; }
.phase-order li:nth-child(2) { animation-delay: 0.12s; }
.phase-order li:nth-child(3) { animation-delay: 0.24s; }
.phase-order li:nth-child(4) { animation-delay: 0.36s; }
.po-n { width: 26px; height: 26px; border-radius: 8px; background: var(--amber); display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.po-i { font-size: 1.3rem; }
.po-i .tk { width: 1.6em; height: 1.6em; }
.po-t b { display: block; }
.po-t small { color: var(--muted); }

.bonus-pick { background: #fff3d6; border: 2px solid #ffcf6b; border-radius: 12px; padding: 0.65rem; margin: 0.6rem 0; }

.stepper { display: flex; align-items: center; gap: 0.5rem; background: #fff; border-radius: 12px; padding: 0.4rem 0.5rem 0.4rem 0.75rem; margin: 0.4rem 0; box-shadow: 0 2px 0 var(--bone-dark); }
.stepper .st-l { flex: 1; font-weight: 600; }
.stepper .st-l .tk { width: 1.6em; height: 1.6em; margin-right: 0.15rem; }
.stepper b { min-width: 2ch; text-align: center; font-size: 1.2rem; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 0; background: #f1e3c2; font-size: 1.3rem; font-weight: 700; cursor: pointer; color: var(--ink); box-shadow: 0 2px 0 #d8c49a; transition: transform 0.1s ease; }
.stepper button:hover:not(:disabled) { background: #ffd24d; }
.stepper button:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }

.budget { display: flex; gap: 5px; flex-wrap: wrap; margin: 0.5rem 0; }
.slot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; background: rgba(255, 255, 255, 0.7); border: 2px dashed #d8c49a; }
.slot .tk { width: 34px; height: 34px; }
.slot.full { border-style: solid; border-color: #ffcf6b; background: #fff8e1; animation: tokenDrop 0.35s var(--pop); }

.fence-line { background: #fff; border-radius: 12px; padding: 0.55rem 0.75rem; margin: 0.4rem 0; box-shadow: 0 2px 0 var(--bone-dark); }
.fence-line .tk { width: 1.6em; height: 1.6em; }

.erow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem 0.6rem;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  margin: 0.45rem 0;
  border: 2px solid transparent;
  box-shadow: 0 2px 0 var(--bone-dark);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s var(--pop);
}
.erow:hover { border-color: #ffd24d; transform: translateX(2px); }
.erow.on { border-color: var(--leaf); background: #f1fbe9; }
.erow.dis { opacity: 0.55; filter: grayscale(0.8); cursor: not-allowed; }
.erow.static { cursor: default; }
.ebadge { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #4a2a10; color: #fff; font-weight: 700; font-family: "Lilita One", sans-serif; box-shadow: 0 0 0 2px #f3d9a4; }
.edinos { font-size: 0.92rem; line-height: 1.5; }
.edinos small { display: block; color: var(--muted); }
.ecost { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.echeck { grid-column: 3; justify-self: end; font-weight: 700; color: #2e7d32; }
.fc { display: inline-flex; align-items: center; gap: 2px; padding: 0.1rem 0.45rem 0.1rem 0.2rem; border-radius: 999px; font-size: 0.85rem; font-weight: 700; background: #f4ead2; }
.fc .tk { width: 1.45em; height: 1.45em; margin: -0.15em 0; }
.fc.meat { background: #ffe0d6; color: #a83a18; }
.fc.plant { background: #dcf3cf; color: #2f6b1a; }
.fc.flex { background: #fff0c2; color: #7a5a00; }
.fc.free { background: #e0f2f1; color: #00695c; padding-left: 0.45rem; }
.status-pill { font-size: 0.78rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px; }
.status-pill .tk { width: 1.3em; height: 1.3em; }
.status-pill.ok { background: #dcf3cf; color: #2f6b1a; }
.status-pill.warn { background: #ffe0b2; color: #a55200; }
.status-pill.danger { background: #ffcdd2; color: #b71c1c; }
.status-pill.dead { background: #cfd8dc; color: #37474f; }

.warn-box { background: #fff1ee; border: 2px solid #ffc4b4; color: #8f2d12; border-radius: 12px; padding: 0.55rem 0.7rem; font-size: 0.9rem; margin: 0.5rem 0; }
.warn-box div + div { margin-top: 0.2rem; }
.pay-line { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; font-weight: 600; margin: 0.5rem 0; }
.power-card { display: flex; gap: 0.7rem; align-items: center; margin: 0.5rem 0 0.8rem; padding: 0.6rem; border-radius: 14px; background: linear-gradient(135deg, #fff8e1, #ffe9b3); border: 2px solid #f0b429; animation: dealCard 0.5s var(--pop) both; }
.power-card img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.power-card b { font-family: "Lilita One", sans-serif; font-size: 1.05rem; }
.power-card p { margin: 0.15rem 0 0; font-size: 0.86rem; }
.flex-pick { margin: 0.6rem 0; padding: 0.5rem 0.6rem; border-radius: 12px; background: #fde9f1; border: 2px dashed #ec407a; }
.flex-pick p { margin: 0 0 0.2rem; font-size: 0.88rem; }

.act-count { font-family: "Lilita One", sans-serif; font-size: 1.25rem; margin-bottom: 0.5rem; }
.act-count .dots { display: inline-flex; gap: 5px; margin-left: 0.4rem; vertical-align: middle; }
.act-count .dots i { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff59d, var(--amber)); box-shadow: 0 2px 0 var(--amber-dark); display: inline-block; transition: transform 0.3s var(--pop); }
.act-count .dots i.used { background: #d8c49a; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25); transform: scale(0.8); }
.act-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 0.5rem; }
.act-top .act-count { margin: 0; }
.back-btn { flex: 0 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile {
  display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); align-items: center; column-gap: 0.55rem; row-gap: 0;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-radius: 14px;
  border: 0;
  background: #fff;
  box-shadow: 0 3px 0 var(--bone-dark);
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.15s var(--pop), box-shadow 0.15s ease;
  animation: dealIn 0.4s var(--pop) both;
  animation-delay: calc(var(--n, 0) * 45ms);
}
.tile:hover:not(:disabled) { transform: translateY(-3px) rotate(-0.6deg); box-shadow: 0 6px 0 #ffcf6b; }
.tile:disabled { cursor: not-allowed; background: rgba(255, 255, 255, 0.35); box-shadow: none; outline: 2px dashed rgba(120, 90, 50, 0.35); outline-offset: -2px; }
.tile:disabled .t-i { filter: grayscale(1); opacity: 0.45; }
.tile:disabled .t-t { color: #8a7a62; }
.tile:disabled .t-s { color: #a0522d; font-weight: 600; }
.tile .t-i { grid-row: span 2; font-size: 1.5rem; height: 2.4rem; display: flex; align-items: center; justify-content: center; }
.tile .t-i .tk:not(.dz) { width: 2.2rem; height: 2.2rem; }
.tile .t-i .tk.dz { width: 2.2rem; height: 2.2rem; }
.tile .t-t { font-weight: 700; line-height: 1.2; }
.tile .t-s { font-size: 0.76rem; color: var(--muted); line-height: 1.25; }
.act-help { margin: 0 0 0.5rem !important; font-size: 0.85rem; color: var(--muted); }
.mini-back {
  width: 1.8rem; height: 2.4rem;
  border-radius: 5px;
  background: repeating-linear-gradient(45deg, #5d3a1a 0 4px, #6f4721 4px 8px);
  border: 2px solid #3b2410;
  box-shadow: 3px -3px 0 #fffaf0, 3px -3px 0 1.5px #3b2410;
  transform: rotate(-8deg);
}

.opt-list { display: grid; gap: 8px; margin: 0.5rem 0; }
.opt {
  display: flex; align-items: center; gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #fff;
  box-shadow: 0 3px 0 var(--bone-dark);
  cursor: pointer;
  color: var(--ink);
  font-size: 0.98rem;
  transition: transform 0.15s var(--pop), border-color 0.15s ease;
}
.opt:hover:not(:disabled) { border-color: #ffd24d; transform: translateX(3px); }
.opt:disabled { cursor: not-allowed; background: rgba(255, 255, 255, 0.35); box-shadow: none; outline: 2px dashed rgba(120, 90, 50, 0.35); outline-offset: -2px; position: relative; }
.opt:disabled .o-i, .opt:disabled .o-t { filter: grayscale(1); opacity: 0.5; }
.opt:disabled::after { content: "Can’t afford"; flex: 0 0 auto; white-space: nowrap; font-size: 0.68rem; font-weight: 700; color: #a0522d; background: #fff1e6; padding: 0.05rem 0.45rem; border-radius: 6px; }
.opt .o-i { font-size: 1.6rem; display: flex; }
.opt .o-i .tk:not(.dz) { width: 2.4rem; height: 2.4rem; }
.opt .o-t { flex: 1; }
.opt .o-t b { display: block; }
.opt .o-t small { color: var(--muted); }
.opt-list .opt { animation: dealIn 0.35s var(--pop) both; }
.opt-list .opt:nth-child(2) { animation-delay: 0.05s; }
.opt-list .opt:nth-child(3) { animation-delay: 0.1s; }
.opt-list .opt:nth-child(4) { animation-delay: 0.15s; }
.opt-list .opt:nth-child(n+5) { animation-delay: 0.2s; }

.place-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.place-head h3 { margin: 0; }
.place-head .dz { width: 3rem; height: 3rem; animation: tokenDrop 0.45s var(--pop); }
.place-box { background: #fff; border-radius: 14px; padding: 0.75rem; margin: 0.5rem 0; box-shadow: 0 3px 0 var(--bone-dark); }
.pb-title { font-weight: 700; font-size: 1.05rem; }
.pb-count { margin: 0.3rem 0; }
.pb-msg { font-size: 0.92rem; font-weight: 600; padding: 0.35rem 0.55rem; border-radius: 10px; }
.pb-msg.ok { background: #dcf3cf; color: #2f6b1a; }
.pb-msg.bad { background: #fff1ee; color: #a83a18; }

/* ---------- Dino cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0.5rem 0; perspective: 900px; }
.modal .card-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.dcard {
  --tc: var(--none);
  position: relative;
  background: linear-gradient(180deg, #fffdf6, #f7ecd2);
  border-radius: 14px;
  border: 3px solid var(--tc);
  padding: 7px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.14), 0 8px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s var(--pop), box-shadow 0.2s ease;
  animation: dealCard 0.5s var(--pop) both;
}
.card-grid .dcard:nth-child(2) { animation-delay: 0.05s; }
.card-grid .dcard:nth-child(3) { animation-delay: 0.1s; }
.card-grid .dcard:nth-child(4) { animation-delay: 0.15s; }
.card-grid .dcard:nth-child(5) { animation-delay: 0.2s; }
.card-grid .dcard:nth-child(6) { animation-delay: 0.25s; }
.card-grid .dcard:nth-child(7) { animation-delay: 0.3s; }
.card-grid .dcard:nth-child(n+8) { animation-delay: 0.35s; }
.dcard.t-event { --tc: var(--event); }
.dcard.t-action { --tc: var(--action); }
.dcard.t-scoring { --tc: var(--scoring); }
.dcard.pick { cursor: pointer; }
.dcard.pick:hover { transform: translateY(-6px) rotate(-1deg) scale(1.02); box-shadow: 0 12px 0 rgba(0, 0, 0, 0.1), 0 0 0 3px #ffd24d, 0 16px 26px rgba(0, 0, 0, 0.2); z-index: 1; }
.dcard.pick:hover .dc-art img { transform: scale(1.08); }
.dcard.nope { opacity: 0.6; filter: grayscale(0.9); box-shadow: none; border-style: dashed; animation: none; }
.dcard.blockedc { opacity: 0.5; }
.grid-split { grid-column: 1 / -1; margin: 0.4rem 0 -0.1rem; padding-top: 0.5rem; border-top: 2px dashed var(--bone-dark); font-weight: 700; font-size: 0.85rem; color: #8a7a62; }
.grid-note { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.dc-head { display: flex; flex-direction: column; }
.dc-name { font-family: "Lilita One", sans-serif; font-size: 0.98rem; line-height: 1.15; min-width: 0; padding-right: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-name.long { font-size: 0.82rem; line-height: 1.4; }
.dc-pts {
  position: absolute; top: -10px; right: -9px; z-index: 2;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff59d, #fbc02d 65%, #f57f17);
  font-family: "Lilita One", sans-serif;
  font-size: 1.05rem;
  color: #4a2c00;
  box-shadow: 0 2px 0 #c77c00;
}
.dc-art {
  position: relative;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 55%, #fff), var(--sc));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12);
}
.dc-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.dc-lock { position: absolute; left: 4px; right: 4px; bottom: 4px; text-align: center; font-size: 0.68rem; font-weight: 700; color: #fff; background: rgba(50, 28, 8, 0.82); padding: 0.15rem 0.3rem; border-radius: 6px; line-height: 1.2; }
.dc-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%); transform: translateX(-100%); pointer-events: none; }
.dcard.pick:hover .dc-art::after { animation: shine 0.8s ease; }
.dc-price { display: flex; align-items: center; justify-content: space-between; gap: 4px; background: #fff3cf; border-radius: 8px; padding: 2px 7px; font-size: 0.86rem; line-height: 1.5; }
.dc-price small { font-size: 0.7rem; font-weight: 700; color: var(--muted); }
.dc-price b { white-space: nowrap; }
.dc-price .tk, .dc-stat .tk { width: 1.25em; height: 1.25em; margin: 0; vertical-align: -0.3em; }
.dc-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dc-stat { display: grid; justify-items: center; font-size: 0.84rem; line-height: 1.2; white-space: nowrap; }
.dc-stat + .dc-stat { border-left: 1px dashed var(--bone-dark); }
.dc-stat small { font-size: 0.64rem; color: var(--muted); font-weight: 600; }
.dc-ab { font-size: 0.8rem; line-height: 1.3; }
.dc-type { display: inline-block; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #fff; background: var(--tc); padding: 0.05rem 0.4rem; border-radius: 6px; margin-right: 3px; }
.dc-why { font-size: 0.78rem; font-weight: 700; color: #a83a18; }
.dc-tag { position: absolute; top: -9px; left: 10px; z-index: 1; font-size: 0.66rem; font-weight: 700; background: #3d2a12; color: #fff; padding: 0.05rem 0.45rem; border-radius: 6px; }

/* ---------- Market ---------- */
.market { flex: 0 0 auto; padding: 8px 14px 12px; border-top: 2px dashed var(--bone-dark); background: rgba(216, 196, 154, 0.22); }
.market.picking { background: #fff6d6; }
.m-title { font-family: "Lilita One", sans-serif; font-size: 0.95rem; margin-bottom: 0.35rem; }
.m-hint { font-family: "Fredoka", sans-serif; font-size: 0.75rem; font-weight: 700; color: #9c5b00; margin-left: 0.3rem; animation: pulseTag 1.6s ease-in-out infinite; }
.m-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; perspective: 800px; }
.m-row > * { min-width: 0; }
.deck-back {
  position: relative;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 224, 138, 0.25), transparent 45%),
    repeating-linear-gradient(45deg, #5d3a1a 0 8px, #6f4721 8px 16px);
  border: 3px solid #3b2410;
  color: #ffe08a;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  min-height: 62px;
  box-shadow:
    0 2px 0 #2a170a,
    calc(var(--stack, 0) * 1px) calc(var(--stack, 0) * 1.5px) 0 -1px #6f4721,
    calc(var(--stack, 0) * 2px) calc(var(--stack, 0) * 3px) 0 -2px #3b2410,
    0 8px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s var(--pop);
}
.deck-back b { font-size: 1.2rem; line-height: 1; font-family: "Lilita One", sans-serif; }
.deck-back small { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; }
.deck-back.gone { opacity: 0.35; }
.deck-back.pick:hover, .mini.pick:hover { transform: translateY(-4px) rotate(-1deg); }
.deck-back.pick, .mini.pick { cursor: pointer; animation: glow 1.4s ease-in-out infinite; }
.mini {
  --tc: var(--none);
  position: relative;
  border-radius: 12px;
  border: 3px solid var(--tc);
  background: linear-gradient(180deg, #fffdf6, #f7ecd2);
  padding: 4px 6px 4px 4px;
  min-height: 62px;
  display: grid; grid-template-columns: 50px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: 6px;
  font-size: 0.76rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.14);
  transition: transform 0.2s var(--pop);
}
.mini.deal { animation: dealFlip 0.7s var(--pop) both; }
.mini.view { cursor: pointer; }
.mini.view:hover { transform: translateY(-2px); }
.mini .m-info { position: absolute; bottom: -7px; right: -7px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid #2a170a; background: #fffdf6; color: #2a170a; font: italic 700 0.8rem Georgia, serif; line-height: 1; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.mini .m-info:hover { background: var(--amber); }
.piece-info .btn { margin-top: 0.8rem; }
.mini.t-event { --tc: var(--event); }
.mini.t-action { --tc: var(--action); }
.mini.t-scoring { --tc: var(--scoring); }
.mini .ma { grid-row: span 2; position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 55%, #fff), var(--sc)); }
.mini .ma img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini .mp { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff59d, #fbc02d 65%, #f57f17); font-family: "Lilita One", sans-serif; font-size: 0.82rem; color: #4a2c00; box-shadow: 0 2px 0 #c77c00; }
.mini .mn { font-family: "Lilita One", sans-serif; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .ms { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .ms .tk { width: 1.35em; height: 1.35em; }
.mini.empty { min-height: 62px; border-style: dashed; border-color: var(--bone-dark); color: var(--muted); display: grid; place-items: center; background: transparent; box-shadow: none; }

/* ---------- Log ---------- */
.log-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 0.86rem; color: #4d3d24; max-height: 65vh; overflow-y: auto; }
.log-list li { padding: 0.25rem 0.5rem; border-radius: 8px; background: rgba(255, 255, 255, 0.6); line-height: 1.45; }
.log-list li:first-child { animation: logIn 0.4s ease; background: #fffbe8; box-shadow: inset 3px 0 0 var(--amber); }
.log-list li .lr { color: var(--muted); font-size: 0.75rem; margin-right: 0.3rem; }
.pn { font-weight: 700; }
.pn-red { color: #c62828; }
.pn-blue { color: #1565c0; }

/* ---------- Die ---------- */
.die-wrap { display: flex; justify-content: center; margin: 0.8rem 0; padding: 10px 0; perspective: 400px; }
.die {
  width: 76px; height: 76px;
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff, #efe4c9);
  box-shadow: 0 6px 0 #cdb98c, 0 12px 20px rgba(0, 0, 0, 0.25), inset 0 2px 0 #fff;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 11px;
  gap: 2px;
}
.die.small { width: 46px; height: 46px; padding: 7px; border-radius: 11px; box-shadow: 0 4px 0 #cdb98c; flex: 0 0 auto; }
.die i { border-radius: 50%; background: transparent; margin: 2px; }
.die i.on { background: radial-gradient(circle at 35% 35%, #d32f2f, #7f0000); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); }
.die.rolling { animation: dieTumble 0.3s linear infinite; }
.die.landed { animation: dieLand 0.6s var(--pop); }
.die-inline { display: flex; align-items: center; gap: 0.7rem; margin: 0.4rem 0; }

/* ---------- Scoreboard ---------- */
.scoreboard { width: 100%; border-collapse: collapse; margin: 0.6rem 0; font-size: 0.95rem; }
.scoreboard th, .scoreboard td { padding: 0.4rem 0.45rem; text-align: right; border-bottom: 1px solid var(--bone-dark); }
.scoreboard th:first-child, .scoreboard td:first-child { text-align: left; }
.scoreboard tbody tr { animation: dealIn 0.4s ease both; }
.scoreboard tbody tr:nth-child(2) { animation-delay: 0.1s; }
.scoreboard tbody tr:nth-child(3) { animation-delay: 0.2s; }
.scoreboard tbody tr:nth-child(4) { animation-delay: 0.3s; }
.scoreboard tbody tr:nth-child(5) { animation-delay: 0.4s; }
.scoreboard tbody tr:nth-child(6) { animation-delay: 0.5s; }
.scoreboard tfoot td { font-weight: 700; font-size: 1.1rem; border-bottom: 0; }
.winner { text-align: center; font-family: "Lilita One", sans-serif; font-size: 1.7rem; margin: 0.4rem 0; }
.winner .big { font-size: 3rem; display: block; animation: stomp 1.2s ease-in-out infinite; }
.winner .win-dino { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; margin: 0 auto 0.4rem; box-shadow: 0 0 0 5px #ffd24d, 0 10px 20px rgba(0, 0, 0, 0.3); }

/* ---------- Legend ---------- */
.legend { padding: 0 18px 24px; font-size: 0.85rem; color: rgba(255, 246, 226, 0.85); text-align: center; }
.legend summary { display: inline-block; cursor: pointer; font-weight: 700; padding: 0.3rem 0.8rem; border-radius: 999px; background: rgba(0, 0, 0, 0.22); list-style: none; }
.legend summary::-webkit-details-marker { display: none; }
.legend summary span { font-weight: 400; opacity: 0.8; }
.legend .lg { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; justify-content: center; margin-top: 0.6rem; }
.legend .lg span { display: inline-flex; align-items: center; gap: 0.35rem; background: rgba(0, 0, 0, 0.22); padding: 0.2rem 0.6rem 0.2rem 0.3rem; border-radius: 999px; }
.legend .tk { width: 1.6em; height: 1.6em; }
.sw { width: 16px; height: 16px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0, 0, 0, 0.3); margin-left: 0.2rem; }

/* ---------- Setup (box lid) ---------- */
/* ---------- Setup (shared home layout in game-home.css) ---------- */
.setup { --gh-frame: #b07a3c; --gh-frame-2: #2a170a; --gh-line: var(--bone-dark); --gh-accent: var(--amber); --gh-accent-soft: rgba(255, 179, 0, 0.35); }
.setup .gh-hero .floater { top: auto; bottom: auto; left: auto; }
.setup .gh-hero .floater.f0 { right: 4%; top: 40%; }
.setup .gh-hero .floater.f1 { right: 13%; bottom: 7%; }
.setup .gh-hero .floater.f2 { right: 3%; bottom: 9%; }
.setup .gh-hero .floater:nth-of-type(n+5) { display: none; }
.gh-title { right: 24%; }
.gh-title h1 { font-family: "Lilita One", sans-serif; font-weight: 400; color: #ffe08a; text-shadow: 0 4px 0 #7a3c00, 0 8px 18px rgba(0, 0, 0, 0.6); -webkit-text-stroke: 1px #7a3c00; }
.floater { position: absolute; width: 54px; height: 54px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45)); animation: bob 4s ease-in-out infinite; pointer-events: none; }
.floater.f0 { left: 4%; bottom: 10%; }
.floater.f1 { right: 5%; bottom: 14%; animation-delay: -1s; }
.floater.f2 { left: 16%; bottom: 3%; animation-delay: -2s; width: 46px; height: 46px; }
.floater.f3 { right: 17%; bottom: 3%; animation-delay: -3s; }
.floater.f4 { right: 3%; top: 38%; animation-delay: -1.5s; width: 40px; height: 40px; }
.floater.f5 { left: 3%; top: 40%; animation-delay: -2.5s; width: 46px; height: 46px; }
.floater.f6 { left: 44%; bottom: 2%; animation-delay: -0.5s; width: 44px; height: 44px; }
.floater.f7 { left: 30%; bottom: 12%; animation-delay: -3.5s; width: 36px; height: 36px; }
.setup-card { background: linear-gradient(180deg, var(--bone), var(--paper)); color: var(--ink); border-radius: 22px; padding: 1.6rem; text-align: left; box-shadow: 0 0 0 3px #2a170a, 0 20px 50px rgba(0, 0, 0, 0.45); animation: rise 0.6s 0.3s ease both; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.2rem; }
.name-field label { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; margin-bottom: 0.3rem; }
.nf-dino { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 2px 5px rgba(0, 0, 0, 0.3); }
.name-field input { width: 100%; padding: 0.7rem 0.8rem; border-radius: 12px; border: 2px solid var(--bone-dark); font: inherit; font-size: 1.05rem; background: #fff; color: var(--ink); }
.name-field input:focus { outline: none; border-color: var(--amber); }
.dot-red, .dot-blue { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.dot-red { background: var(--red); }
.dot-blue { background: var(--blue); }
.first-q { font-weight: 700; margin: 0.4rem 0 0.6rem; font-size: 1.05rem; }
.first-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.first-btns .btn { padding: 1rem; font-size: 1.1rem; }
.first-btns .btn.fr { background: linear-gradient(180deg, #ef7370, var(--red)); color: #fff; box-shadow: 0 4px 0 #9a1f1c; }
.first-btns .btn.fb { background: linear-gradient(180deg, #64b5f6, var(--blue)); color: #fff; box-shadow: 0 4px 0 #0d4f8f; }
.start-game { display: block; width: 100%; padding: 1rem; font-size: 1.2rem; }
.setup-foot { margin-top: 1.2rem; font-size: 0.9rem; color: var(--muted); }
.setup-foot .tk { width: 1.5em; height: 1.5em; }

.setup:not(.vs-ai):not(.vs-online) .gh-modes .m-2p, .setup.vs-ai .gh-modes .m-ai, .setup.vs-online .gh-modes .m-online { border-color: var(--gh-accent); background: #fff8e1; box-shadow: 0 0 0 3px var(--gh-accent-soft); }
.setup:not(.vs-ai) .only-ai, .setup.vs-ai .only-2p { display: none; }
.setup:not(.vs-online) .only-online { display: none; }
.setup.vs-online .name-row, .setup.vs-online .ai-opts, .setup.vs-online .first-pick, .setup.vs-online .start-game, .setup.vs-online .setup-foot { display: none; }
.online-box { display: grid; gap: 1rem; }
.ol-form { display: grid; gap: 0.55rem; }
.ol-form label { font-weight: 700; }
.ol-form input { width: 100%; padding: 0.7rem 0.8rem; border-radius: 12px; border: 2px solid var(--bone-dark); font: inherit; font-size: 1.05rem; background: #fff; color: var(--ink); }
.ol-form input:focus { outline: none; border-color: var(--amber); }
.ol-form .muted { margin: 0; font-size: 0.85rem; }
.seg.ol-mode { grid-template-columns: 1fr 1fr; }
.ol-h { margin: 0.6rem 0 0.35rem; font-size: 1rem; }
.ol-game { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0.7rem; margin-bottom: 0.4rem; border-radius: 12px; background: #fff; border: 2px solid var(--bone-dark); }
.olg-main { display: grid; gap: 1px; min-width: 0; }
.olg-main small { color: var(--muted); }
.olg-mode { font-size: 0.8rem; color: var(--muted); }
.olg-btns { display: flex; gap: 0.35rem; flex-shrink: 0; }
.ol-refresh { margin-top: 0.3rem; }
.ai-bar.ol-wait { background: linear-gradient(135deg, #fff8e1, #ffecb3); color: #8d5a00; }
.b-clock { margin-top: 0.35rem; display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; background: rgba(255, 255, 255, 0.85); color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.b-clock.mine { box-shadow: 0 0 0 2px var(--amber); }
.b-clock.low { background: #ffebee; color: #c62828; animation: pulseTag 1s ease-in-out infinite; }
.setup.gate .setup-card { text-align: center; }
a.btn { display: inline-block; text-align: center; text-decoration: none; }
.setup.gate .setup-card .btn { display: inline-block; margin-top: 0.6rem; text-decoration: none; }
.ai-card { padding: 0.7rem 0.8rem; border-radius: 12px; border: 2px dashed var(--bone-dark); font-size: 1.05rem; font-weight: 600; background: #fffaf0; }

.ai-opts { display: grid; gap: 0.7rem; margin: 0.4rem 0 0.8rem; }
.seg-group { display: grid; gap: 0.3rem; margin-bottom: 0.6rem; }
.seg-label { font-weight: 700; font-size: 0.95rem; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.seg-btn {
  display: grid; gap: 1px; align-content: start;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  border: 2px solid var(--bone-dark);
  background: #fff;
  font: inherit; text-align: left; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.seg-btn b { font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 1.02rem; }
.seg-btn small { color: var(--muted); font-size: 0.78rem; line-height: 1.25; }
.seg-btn:hover { transform: translateY(-1px); }
.seg-btn.on { border-color: var(--amber); background: #fff8e1; box-shadow: 0 0 0 3px rgba(255, 179, 0, 0.35); }
@media (max-width: 480px) {
  .seg-btn small { font-size: 0.72rem; }
}

.ai-bar {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 12px;
  padding: 0.5rem 0.7rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  color: #0d47a1;
  font-weight: 700;
  animation: dealIn 0.3s ease both;
}
.ai-bar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff; animation: stomp 1.6s ease-in-out infinite; }
.dots3 { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.dots3 b { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: dot 1s ease-in-out infinite; }
.dots3 b:nth-child(2) { animation-delay: 0.15s; }
.dots3 b:nth-child(3) { animation-delay: 0.3s; }
.task.ai-run { pointer-events: none; opacity: 0.75; filter: saturate(0.8); }
.watch { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.9rem 1rem; border-radius: 16px; background: #f4ecdb; border: 2px dashed #c9b48a; }
.watch img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #fff; animation: stomp 1.6s ease-in-out infinite; flex-shrink: 0; }
.watch.pl-red img { box-shadow: 0 0 0 3px var(--red); }
.watch.pl-blue img { box-shadow: 0 0 0 3px var(--blue); }
.watch h3 { margin: 0 0 0.2rem; }
.watch p { margin: 0.25rem 0 0; }
.w-step { font-weight: 700; color: var(--muted); }
.w-doing { font-weight: 700; color: #0d47a1; }
.w-help { font-size: 0.88rem; color: var(--muted); }
.boards.watching .edge, .boards.watching .cell.can { pointer-events: none; cursor: default; animation: none; }
.boards.watching .edge .ev { animation: none; }
.cell.has { cursor: pointer; }

.modal.small { width: min(440px, 100%); text-align: center; }
.modal.medium { width: min(620px, 100%); }
/* How to play: tabbed sections, worker-space table and the card gallery */
.modal.rules { width: min(960px, 100%); padding-top: 0; }
.rules-top { position: sticky; top: 0; z-index: 3; margin: 0 -1.4rem 0.4rem; padding: 1rem 1.4rem 0.6rem; background: var(--bone); border-bottom: 2px solid var(--bone-dark); }
.rules-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.rules-tab { font: inherit; font-size: 0.88rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 2px solid var(--bone-dark); background: #fff; color: var(--ink); cursor: pointer; }
.rules-tab:hover { border-color: #c9a46a; }
.rules-tab.on { background: #6b3f0a; border-color: #6b3f0a; color: #fff; }
.rules-pane[hidden] { display: none; }
.rules-lead { font-size: 1.05rem; }
.rules-link { font: inherit; font-size: 0.9rem; font-weight: 700; color: #1565c0; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.rules-steps li { margin-bottom: 0.2rem; }
.rules-icons { list-style: none; padding: 0; }
.rules-icons li { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.35rem; }
.rules-icons li > span { flex: 0 0 1.6rem; text-align: center; font-size: 1.1rem; }
.rule-box { background: #fff4d6; border-left: 5px solid #e0a12a; border-radius: 10px; padding: 0.5rem 0.9rem; margin: 0.6rem 0; }
.rule-box ol { margin: 0; padding-left: 1.2rem; }
.rules-table-wrap { overflow-x: auto; margin: 0.6rem 0; }
.rules-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: #fff; border-radius: 10px; overflow: hidden; }
.rules-table th, .rules-table td { border: 1px solid var(--bone-dark); padding: 6px 8px; text-align: left; vertical-align: top; line-height: 1.35; }
.rules-table thead th { background: #f3e2c0; }
.rules-table thead small { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.rules-table tbody th { white-space: nowrap; background: #fbf3df; }
.rules-sub small { display: block; margin-top: 0.15rem; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.dc-copies { padding: 2px 0 6px; text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.rules-card { cursor: default; }
@media (max-width: 640px) {
  .rules-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -1.4rem; padding-right: 1.4rem; }
  .rules-tab { flex: 0 0 auto; }
  .rules-table { min-width: 520px; font-size: 0.82rem; }
}
.confirm-box h2 { margin: 0.3rem 0 0.2rem; font-size: 1.5rem; }
.confirm-box p { margin: 0 0 0.6rem; color: #5d4a2c; }
.confirm-box .btn-row { justify-content: center; }
.confirm-box .btn { min-width: 130px; }
.confirm-dino { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px #ffd24d, 0 6px 14px rgba(0, 0, 0, 0.25); animation: stomp 2s ease-in-out infinite; }
.piece-info { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.piece-info .dcard { animation: dealCard 0.5s var(--pop) both; }
.piece-art { display: grid; place-items: center; height: 160px; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--bone-dark); }
.piece-art .tk { width: 110px; height: 110px; }
.facts { list-style: none; padding: 0 !important; margin: 0 !important; display: grid; gap: 8px; }
.facts li { background: #fff; border-radius: 12px; padding: 0.55rem 0.7rem; box-shadow: 0 2px 0 var(--bone-dark); line-height: 1.45 !important; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 10, 2, 0.72); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; z-index: 50; animation: fade 0.18s ease; }
.modal { background: linear-gradient(180deg, var(--bone), var(--paper)); color: var(--ink); border-radius: 20px; width: min(900px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 1.3rem 1.4rem; box-shadow: 0 0 0 3px #2a170a, 0 30px 60px rgba(0, 0, 0, 0.5); animation: rise 0.3s var(--pop); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.modal-head h2 { margin: 0; font-size: 1.6rem; }
.modal h3 { margin: 1.1rem 0 0.35rem; font-size: 1.15rem; color: #6b3f0a; }
.modal p, .modal li { line-height: 1.6; }
.modal ul, .modal ol { padding-left: 1.3rem; margin: 0.3rem 0; }
.x { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #f1e3c2; font-size: 1.2rem; cursor: pointer; color: var(--ink); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; pointer-events: none; width: min(460px, calc(100% - 24px)); }
.toast { background: #2b1d0e; color: var(--bone); padding: 0.7rem 1rem; border-radius: 14px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); font-weight: 600; text-align: center; animation: toastIn 0.35s var(--pop); border: 2px solid rgba(255, 179, 0, 0.5); }
.toast .tk { width: 1.5em; height: 1.5em; }
.toast.bad { border-color: #ff8a65; }
.toast.good { border-color: var(--leaf); }
.toast.out { animation: toastOut 0.3s ease forwards; }

/* ---------- Flying pieces & turn banner ---------- */
.fly-tok { position: fixed; width: 34px; height: 34px; z-index: 80; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.45)); will-change: transform; }
.fly-card {
  --tc: var(--none);
  position: fixed;
  z-index: 81;
  width: 96px;
  padding: 4px 4px 6px;
  border-radius: 10px;
  border: 3px solid var(--tc);
  background: #fffdf6;
  color: var(--ink);
  text-align: center;
  font-family: "Lilita One", sans-serif;
  font-size: 0.8rem;
  pointer-events: none;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  will-change: transform;
}
.fly-card.t-event { --tc: var(--event); }
.fly-card.t-action { --tc: var(--action); }
.fly-card.t-scoring { --tc: var(--scoring); }
.fly-card img { width: 100%; height: 64px; object-fit: contain; border-radius: 6px; display: block; margin-bottom: 3px; }
.turn-ov { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; pointer-events: none; }
.to-card {
  --pc: #3d5a2e;
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.8rem 1.6rem 0.8rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--pc) 80%, #fff), var(--pc));
  color: #fff;
  border: 4px solid #fff6e2;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  animation: turnSweep 1.45s cubic-bezier(.2, .9, .2, 1) forwards;
}
.to-card.pl-red { --pc: #c62828; }
.to-card.pl-blue { --pc: #1565c0; }
.to-card img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px #fff; }
.to-card small { display: block; font-size: 0.95rem; opacity: 0.92; font-weight: 600; }
.to-card small .tk { width: 1.3em; height: 1.3em; }
.to-card b { display: block; font-family: "Lilita One", sans-serif; font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 400; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.to-round { flex-direction: column; gap: 0; padding: 1rem 2.4rem; border-radius: 24px; --pc: #6b4220; text-align: center; }
.to-round small { text-transform: uppercase; letter-spacing: 0.12em; }
.to-round b { font-size: clamp(3rem, 12vw, 4.6rem); line-height: 1; }
.to-round span { font-weight: 600; opacity: 0.9; }

/* ---------- Confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti img { position: absolute; top: -60px; width: 38px; height: 38px; animation: fall linear forwards; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35)); }
.confetti img.cf-dino { border-radius: 50%; object-fit: cover; width: 44px; height: 44px; box-shadow: 0 0 0 2px #fff; }

/* ---------- Winner reveal ---------- */
.reveal {
  position: fixed; inset: 0; z-index: 66; display: grid; place-items: center; padding: 18px; overflow: auto;
  background: radial-gradient(ellipse at 50% 35%, rgba(70, 40, 12, 0.97), rgba(8, 4, 1, 0.99) 70%);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--bone); animation: fade 0.5s ease both; cursor: pointer;
}
.reveal.decided { cursor: default; }
.rv-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.rv-rays {
  position: absolute; left: 50%; top: 42%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 77, 0.16) 0 9deg, transparent 9deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 52%); mask-image: radial-gradient(circle, #000 0, transparent 52%);
  transition: opacity 0.8s ease;
}
.reveal.announced .rv-rays { opacity: 1; animation: spin 26s linear infinite; }
.rv-stage { position: relative; width: min(640px, 100%); display: grid; gap: 1rem; justify-items: center; text-align: center; }
.rv-title { font-family: "Lilita One", sans-serif; font-size: clamp(1.8rem, 5vw, 2.6rem); color: #ffe08a; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.5); animation: rvDrop 0.7s var(--pop) both; }
.rv-duel { margin-top: 0.9rem; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0.8rem; width: 100%; }
.rv-side {
  --pc: var(--red); position: relative; display: grid; justify-items: center; gap: 0.3rem; padding: 1.1rem 0.6rem 0.9rem; border-radius: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 30%, #2b1d0e), #1c1107); box-shadow: 0 0 0 3px var(--pc), 0 18px 36px rgba(0, 0, 0, 0.5);
  transition: transform 0.6s var(--pop), filter 0.6s ease, opacity 0.6s ease, box-shadow 0.6s ease;
  animation: rvInL 0.7s var(--pop) 0.4s both;
}
.rv-side.pl-blue { --pc: var(--blue); animation-name: rvInR; }
.rv-mascot { width: clamp(72px, 18vw, 120px); height: clamp(72px, 18vw, 120px); border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--pc), 0 8px 18px rgba(0, 0, 0, 0.5); }
.rv-name { font-size: clamp(1rem, 3vw, 1.3rem); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-total { font-family: "Lilita One", sans-serif; font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.5); min-width: 2ch; }
.rv-total.done { animation: bump 0.4s var(--pop); }
.rv-side.win .rv-total { color: #ffd24d; }
.rv-crown { position: absolute; top: -1.9rem; font-size: 2.6rem; opacity: 0; transform: translateY(-60px) rotate(-20deg); pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5)); }
.rv-vs { font-family: "Lilita One", sans-serif; font-size: clamp(1.4rem, 4vw, 2rem); color: var(--lava); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.6); animation: rvSlam 0.5s var(--pop) 0.9s both; transition: opacity 0.4s ease; }
.rv-rows { display: grid; gap: 0.35rem; width: min(480px, 100%); }
.rv-row { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 3.5rem; align-items: center; gap: 0.5rem; padding: 0.35rem 0.6rem; border-radius: 12px; background: rgba(255, 246, 226, 0.08); opacity: 0; transform: translateY(10px) scale(0.96); transition: opacity 0.35s ease, transform 0.45s var(--pop); }
.rv-row.in { opacity: 1; transform: none; }
.rv-row small { font-size: 0.9rem; color: rgba(255, 246, 226, 0.75); }
.rv-row span { font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.rv-row span.lead { color: #ffd24d; }
.rv-verdict { min-height: 4.6rem; display: grid; place-items: center; }
.rv-drum { font-family: "Lilita One", sans-serif; font-size: clamp(1.3rem, 4vw, 1.8rem); color: #ffe08a; animation: fade 0.4s ease both; }
.rv-drum i { font-style: normal; display: inline-block; animation: dot 0.9s ease-in-out infinite; }
.rv-drum i:nth-child(2) { animation-delay: 0.15s; }
.rv-drum i:nth-child(3) { animation-delay: 0.3s; }
.rv-head { font-family: "Lilita One", sans-serif; font-size: clamp(2.2rem, 8vw, 3.6rem); line-height: 1.1; color: #ffd24d; text-shadow: 0 4px 0 #6b3f0a, 0 0 30px rgba(255, 210, 77, 0.55); animation: rvStamp 0.6s var(--pop) both; }
.rv-sub { font-size: 1.05rem; color: rgba(255, 246, 226, 0.85); opacity: 0; transition: opacity 0.5s ease; }
.reveal.announced .rv-sub { opacity: 1; }
.rv-actions { opacity: 0; pointer-events: none; transition: opacity 0.4s ease 0.6s; }
.reveal.decided .rv-actions { opacity: 1; pointer-events: auto; }
.rv-skip { position: fixed; right: 16px; bottom: 16px; background: rgba(255, 246, 226, 0.12); color: var(--bone); border: 1px solid rgba(255, 246, 226, 0.3); border-radius: 999px; padding: 0.4rem 0.9rem; font-weight: 600; cursor: pointer; }
.reveal.decided .rv-skip { display: none; }
.reveal.suspense .rv-side { animation: rvShake 0.35s ease-in-out infinite; }
.reveal.suspense .rv-side.pl-blue { animation-delay: 0.12s; }
.reveal.announced .rv-side { animation: none; }
.reveal.announced .rv-side.win { transform: scale(1.1); box-shadow: 0 0 0 4px #ffd24d, 0 0 50px rgba(255, 210, 77, 0.6), 0 18px 36px rgba(0, 0, 0, 0.5); animation: rvGlow 1.6s ease-in-out 0.6s infinite; z-index: 1; }
.reveal.announced .rv-side.win .rv-mascot { animation: stomp 1.2s ease-in-out 0.5s infinite; }
.rv-side.win .rv-crown, .rv-side.tie .rv-crown { animation: rvCrown 0.7s var(--pop) 0.2s both; }
.rv-side.lose { transform: scale(0.88); filter: grayscale(0.75) brightness(0.7); }
.reveal.announced .rv-vs { opacity: 0.35; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rvDrop { from { opacity: 0; transform: translateY(-50px) scale(1.3); } to { opacity: 1; transform: none; } }
@keyframes rvInL { from { opacity: 0; transform: translateX(-70px) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes rvInR { from { opacity: 0; transform: translateX(70px) rotate(6deg); } to { opacity: 1; transform: none; } }
@keyframes rvSlam { from { opacity: 0; transform: scale(3) rotate(-15deg); } to { opacity: 1; transform: none; } }
@keyframes rvShake { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-3px, 1px) rotate(-1deg); } 75% { transform: translate(3px, -1px) rotate(1deg); } }
@keyframes rvStamp { 0% { opacity: 0; transform: scale(2.6) rotate(-8deg); } 60% { opacity: 1; transform: scale(0.94) rotate(1deg); } 100% { transform: none; } }
@keyframes rvCrown { from { opacity: 0; transform: translateY(-60px) rotate(-20deg); } to { opacity: 1; transform: translateY(0) rotate(-8deg); } }
@keyframes rvGlow { 0%, 100% { box-shadow: 0 0 0 4px #ffd24d, 0 0 40px rgba(255, 210, 77, 0.45), 0 18px 36px rgba(0, 0, 0, 0.5); } 50% { box-shadow: 0 0 0 6px #ffe08a, 0 0 70px rgba(255, 210, 77, 0.8), 0 18px 36px rgba(0, 0, 0, 0.5); } }

/* ---------- Animations ---------- */
@keyframes stomp { 0%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-5px) rotate(-4deg); } 40% { transform: translateY(0) rotate(0); } }
@keyframes flipIn { from { opacity: 0; transform: rotateX(80deg) translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes dealPhase { from { opacity: 0; transform: translateY(-30px) rotateY(180deg) scale(0.7); } to { opacity: 1; transform: none; } }
@keyframes dealIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes dealCard { from { opacity: 0; transform: translateY(-24px) rotateY(90deg) rotate(-4deg); } to { opacity: 1; transform: none; } }
@keyframes dealFlip { 0% { opacity: 0; transform: translateX(-60px) rotateY(180deg) scale(0.8); } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes pulseTag { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
@keyframes targetPulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(255, 109, 46, 0.9), 0 18px 34px rgba(0, 0, 0, 0.5); } 50% { box-shadow: 0 0 0 9px rgba(255, 109, 46, 0.35), 0 18px 34px rgba(0, 0, 0, 0.5); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(6px) scale(0.6); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes tokenDrop { 0% { opacity: 0; transform: translateY(-18px) scale(1.4); } 100% { opacity: 1; transform: none; } }
@keyframes focusPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes focusRing { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } }
@keyframes pieceDrop { 0% { opacity: 0; transform: translateY(-26px) scale(1.3); } 55% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes fenceIn { from { opacity: 0; transform: scale(0.1); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 179, 0, 0), 0 3px 0 rgba(0, 0, 0, 0.2); } 50% { box-shadow: 0 0 0 5px rgba(255, 179, 0, 0.6), 0 3px 0 rgba(0, 0, 0, 0.2); } }
@keyframes ready { 0%, 86%, 100% { transform: none; } 90% { transform: translateY(-3px); } 94% { transform: translateY(0); } 97% { transform: translateY(-1px); } }
@keyframes marker { 0%, 100% { transform: scale(1.3) translateY(-2px); } 50% { transform: scale(1.3) translateY(-5px); } }
@keyframes canPulse { 0%, 100% { stroke-opacity: 0.15; } 50% { stroke-opacity: 0.85; } }
@keyframes danger { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18) rotate(-6deg); } }
@keyframes march { to { stroke-dashoffset: -14; } }
@keyframes dieTumble { 0% { transform: translateY(0) rotate(0) rotateX(0); } 25% { transform: translateY(-18px) rotate(90deg) rotateX(30deg); } 50% { transform: translateY(0) rotate(180deg); } 75% { transform: translateY(-10px) rotate(270deg) rotateY(30deg); } 100% { transform: translateY(0) rotate(360deg); } }
@keyframes dieLand { 0% { transform: scale(1.25) rotate(-12deg); } 60% { transform: scale(0.92) rotate(4deg); } 100% { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
@keyframes fall { to { transform: translateY(115vh) rotate(540deg); } }
@keyframes bannerIn { from { transform: translateX(-12px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes taskIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes logIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes shine { to { transform: translateX(100%); } }
@keyframes dot { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-12px) rotate(6deg); } }
@keyframes kenBurns { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, 1%); } }
@keyframes lidDrop { from { opacity: 0; transform: translateY(-40px) rotate(-4deg) scale(0.95); } to { opacity: 1; transform: rotate(-1.2deg); } }
@keyframes turnSweep {
  0% { opacity: 0; transform: translateX(-60vw) rotate(-8deg) scale(0.8); }
  22% { opacity: 1; transform: translateX(0) rotate(-2deg) scale(1.04); }
  30% { transform: translateX(0) rotate(0) scale(1); }
  72% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(60vw) rotate(6deg) scale(0.85); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .topbar { grid-template-columns: 1fr auto; gap: 0.6rem 1rem; }
  .top-mid { grid-column: 1 / -1; grid-row: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
  .tracker { flex-wrap: nowrap; }
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; padding: 12px; }
  .boards { gap: 10px; }
  .player { padding: 10px; }
  .m-row { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel {
    position: sticky;
    top: auto;
    bottom: 0;
    max-height: 48vh;
    order: 2;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    z-index: 5;
  }
  .main-col { order: 1; }
  .market { padding: 6px 10px 8px; }
  .market:not(.picking) .m-title { display: none; }
  .m-row { grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .deck-back, .mini, .mini.empty { min-height: 46px; }
  .mini { grid-template-columns: 38px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0.7rem 0.9rem; }
  .top-mid { grid-column: 1 / -1; grid-row: 2; }
  .boards { grid-template-columns: minmax(0, 1fr); }
  .layout { padding: 10px; gap: 12px; }
  .name-row, .first-btns { grid-template-columns: 1fr; }
  .seg.ol-mode { grid-template-columns: 1fr; }
  .piece-info { grid-template-columns: 1fr; }
  .piece-info .dcard { max-width: 260px; margin: 0 auto; }
  .pip { width: 19px; height: 19px; font-size: 0.6rem; }
  .player.active { transform: none; }
}
@media (max-width: 520px) {
  .topbar { gap: 0.5rem; padding: 0.55rem 0.7rem; }
  .brand-logo { width: 34px; height: 34px; }
  .brand h1 { font-size: 1.15rem; white-space: nowrap; }
  .brand small { display: none; }
  .topbar { grid-template-columns: 1fr; }
  .top-actions { grid-row: 2; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
  .top-mid { grid-row: 3; }
  .top-actions .btn { padding: 0.35rem 0.55rem; font-size: 0.8rem; white-space: nowrap; }
  .log-btn .lb-t { display: none; }
  .tracker { gap: 2px; flex-wrap: nowrap; }
  .tracker-label { display: none; }
  .pip { width: 16px; height: 16px; font-size: 0.55rem; flex: 0 0 auto; border-radius: 4px; }
  .pip.cur { transform: scale(1.15); animation: none; }
  .phase-row { gap: 5px; }
  .pcard { font-size: 0.74rem; padding: 0.2rem 0.45rem 0.2rem 0.25rem; border-left-width: 4px; }
  .pc-i { display: none; }
  .pc-n { width: 16px; height: 16px; font-size: 0.62rem; }
  .panel { max-height: 45vh; }
  .layout { padding: 8px; }
  .player { padding: 8px; }
  .p-mascot { width: 30px; height: 30px; }
  .chip { font-size: 0.9rem; }
  .floater { width: 34px !important; height: 34px !important; }
  .gh-hero .floater { display: none; }
  .gh-title { right: 1rem; }
  .to-card img { width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Game history page ---------- */
.hist-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1.2rem; background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15)); }
.hist-top .brand { color: inherit; text-decoration: none; }
.hist { max-width: 900px; margin: 0 auto; padding: 1.2rem 1rem 3rem; display: grid; gap: 1rem; }
.hcard { background: linear-gradient(180deg, var(--bone), var(--paper)); color: var(--ink); border-radius: 20px; padding: 1.2rem; box-shadow: 0 0 0 3px #2a170a, 0 16px 40px rgba(0, 0, 0, 0.4); }
.hcard.gate-card { text-align: center; }
.hcard h2 { margin: 0 0 0.6rem; }
.hstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; }
.hstat { background: linear-gradient(180deg, var(--bone), var(--paper)); color: var(--ink); border-radius: 16px; padding: 0.8rem 0.9rem; box-shadow: 0 0 0 3px #2a170a; display: grid; gap: 0.1rem; }
.hstat small { color: var(--muted); font-weight: 600; }
.hstat b { font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 1.8rem; line-height: 1.1; }
.hstat span { font-size: 0.8rem; color: var(--muted); }
.seg.hfilter { grid-template-columns: repeat(4, 1fr); margin-bottom: 0.8rem; }
.seg.hfilter .seg-btn { text-align: center; }
.hlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.hrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 0.7rem; padding: 0.6rem 0.8rem; background: #fff; border: 2px solid var(--bone-dark); border-radius: 14px; }
.hi { font-size: 1.4rem; }
.ht { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm { font-weight: 500; font-size: 0.82rem; color: var(--muted); margin-left: 0.25rem; }
.hmain small { color: var(--muted); }
.hres { display: flex; align-items: center; gap: 0.5rem; }
.hs { font-variant-numeric: tabular-nums; min-width: 3.4rem; text-align: right; }
.hb { padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.hb.win { background: #e8f5e9; color: #2e7d32; }
.hb.loss { background: #ffebee; color: #c62828; }
.hb.tie, .hb.local { background: #fff8e1; color: #8d5a00; }
.hcard .btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--bone-dark); }
.hmore { width: 100%; margin-top: 0.8rem; }
@media (max-width: 700px) {
  .hstats { grid-template-columns: repeat(2, 1fr); }
  .seg.hfilter { grid-template-columns: repeat(2, 1fr); }
  .hrow { grid-template-columns: auto minmax(0, 1fr) auto; }
  .hact { grid-column: 2 / -1; }
  .hact:empty { display: none; }
}
.ai-plan { background: #fff; border: 1px dashed #d8c49a; border-radius: 12px; padding: 0.5rem 0.7rem; font-size: 0.9rem; }

/* Prototype rules (admin test setting) */
.market.proto .m-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.market.proto .mini { grid-template-columns: 34px minmax(0, 1fr); column-gap: 4px; }
.ev-note { margin: 0 0 0.5rem; padding: 0.45rem 0.6rem; border-radius: 10px; background: #fff3cd; border: 2px solid #ffcf6b; font-size: 0.85rem; line-height: 1.3; }
.proto-opts { margin: 0.4rem 0 0.6rem; padding: 0.5rem 0.6rem 0.2rem; border: 2px dashed var(--amber); border-radius: 12px; }
.proto-opts .link { margin-bottom: 0.4rem; }
.setup.vs-online .proto-opts { display: none; }

/* Prototype worker board */
.meeple { width: 24px; height: 24px; display: inline-block; flex: 0 0 auto; overflow: visible; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.meeple path { stroke: rgba(0, 0, 0, 0.5); stroke-width: 1.3; stroke-linejoin: round; }
.meeple.m-red path { fill: #e53935; }
.meeple.m-blue path { fill: #1e88e5; }
.meeple.mini { width: 18px; height: 18px; vertical-align: -3px; }
.meeple.grab { cursor: grab; touch-action: none; width: 30px; height: 30px; animation: meepleBob 1.2s ease-in-out infinite; }
.meeple.lifted { opacity: 0.25; animation: none; }
.meeple-ghost { position: fixed; z-index: 10000; pointer-events: none; width: 42px; height: 42px; transform: translate(-50%, -65%) rotate(-8deg); filter: drop-shadow(0 12px 6px rgba(0, 0, 0, 0.35)); }
.meeple.placed { width: 30px; height: 30px; }
.meeple.drop { animation: meepleDrop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.meeple.hover { opacity: 0.7; animation: meepleHover 0.9s ease-in-out infinite; }
@keyframes meepleBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes meepleDrop { 0% { transform: translateY(-46px) scale(1.35); opacity: 0; } 55% { opacity: 1; } 100% { transform: none; } }
@keyframes meepleHover { 0%, 100% { transform: translateY(-10px) rotate(-6deg); } 50% { transform: translateY(-17px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .meeple.grab, .meeple.drop, .meeple.hover { animation: none; } }

.wboard { padding: 8px 8px 10px; border-radius: 14px; border: 3px solid #8d6e45; background: repeating-linear-gradient(90deg, rgba(120, 80, 30, 0.05) 0 2px, transparent 2px 14px), linear-gradient(180deg, #ecdcb0, #d9bf88); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 4px 0 rgba(0, 0, 0, 0.18); }
.wb-pools { display: flex; gap: 6px; margin-bottom: 4px; }
.wb-pool { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.45); border: 2px solid transparent; }
.wb-pool.turn { background: #fff8e1; border-color: var(--amber); }
.wb-name { font-size: 0.7rem; font-weight: 700; color: #6b4e24; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-meeples { display: flex; align-items: flex-end; gap: 3px; min-height: 30px; }
.wb-meeples small { font-size: 0.68rem; color: var(--muted); align-self: center; }
.wb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 6px; padding-top: 16px; }
.wspace { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 20px 4px 6px; min-height: 92px; border-radius: 12px; border: 2px solid #a98a5c; background: radial-gradient(circle at 50% 12%, #fffaf0, #f2e2bb 70%); font: inherit; color: inherit; text-align: center; cursor: default; transition: transform 0.15s, box-shadow 0.15s; }
.wspace.open { cursor: pointer; border-color: #7a9a45; box-shadow: 0 3px 0 rgba(90, 120, 40, 0.35); }
.wspace.open:hover, .wspace.drop-hover { transform: translateY(-2px); background: #fffdf3; box-shadow: 0 0 0 3px var(--amber), 0 4px 0 rgba(0, 0, 0, 0.15); }
.wspace:disabled:not(.occ):not(.pend) { opacity: 0.6; filter: grayscale(0.7); }
.wspace.occ.o-red { border-color: rgba(229, 57, 53, 0.7); background: radial-gradient(circle at 50% 12%, #fff3f2, #f6dcd6 70%); }
.wspace.occ.o-blue { border-color: rgba(30, 136, 229, 0.7); background: radial-gradient(circle at 50% 12%, #f1f7ff, #d9e7f6 70%); }
.wspace.pend { box-shadow: 0 0 0 3px var(--amber); }
.ws-slot { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); width: 34px; height: 34px; display: grid; place-items: center; }
.ws-slot.many { width: auto; display: flex; gap: 0; }
.ws-slot.many .meeple.placed { width: 22px; height: 22px; margin: 0 -2px; }
.wspace.unl { border-style: dashed; background: radial-gradient(circle at 50% 12%, #fbfff4, #e6efcf 70%); }
.ws-tier { margin-top: 2px; font-size: 0.62rem; font-weight: 700; color: #5b7a2a; letter-spacing: 0.02em; }
.ws-ring { width: 24px; height: 24px; border-radius: 50%; border: 2px dashed rgba(100, 70, 25, 0.5); background: rgba(255, 255, 255, 0.6); }
.wspace.open .ws-ring, .wspace.drop-hover .ws-ring { border-color: #7a9a45; background: #f4ffe4; }
.ws-ic { font-size: 1.25rem; line-height: 1.1; }
.ws-ic .tk { width: 1.5rem; height: 1.5rem; }
.ws-name { font-size: 0.76rem; line-height: 1.1; }
.ws-desc { font-size: 0.64rem; line-height: 1.15; color: var(--muted); }
.wspace:disabled .ws-desc { color: #8a5a2d; }
.wspace .ws-desc.ev { color: #1565c0; font-weight: 700; }
.pend-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0.5rem; padding: 4px 10px; border-radius: 999px; background: #fff8e1; border: 2px solid #ffcf6b; font-size: 0.8rem; }
.watch-mini { display: flex; align-items: center; gap: 6px; margin-bottom: 0.5rem; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.6); font-size: 0.85rem; }
/* Prototype: full-size dino market under the parks */
.big-market:empty { display: none; }
.big-market { margin-top: 14px; padding: 12px 14px 16px; border-radius: var(--radius); background: linear-gradient(180deg, var(--bone), var(--paper)); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 0 3px #2a170a; color: var(--ink); }
.bm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; margin-bottom: 0.6rem; }
.bm-head h2 { margin: 0; font-family: "Lilita One", sans-serif; font-size: 1.2rem; }
.bm-hint { font-size: 0.82rem; color: var(--muted); }
.bm-hint.live { font-weight: 700; color: #9c5b00; animation: pulseTag 1.6s ease-in-out infinite; }
.bm-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: start; padding-top: 8px; }
.bm-sub { margin: 0.9rem 0 0; padding-top: 0.6rem; border-top: 2px dashed var(--bone-dark); font-weight: 700; font-size: 0.9rem; color: #6b4e24; }
.big-market .dcard { animation: none; padding: 6px; gap: 5px; }
.big-market .dcard.deal { animation: dealCard 0.5s var(--pop) both; }
.big-market .dcard.view { cursor: pointer; }
.big-market .dcard.view:not(.nope):hover { transform: translateY(-3px); }
.big-market .dc-art { aspect-ratio: 1 / 1; max-width: none; }
.big-market .dcard.pick:hover .dc-art img { transform: none; }
.bm-sub small { margin-left: 0.4rem; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.bm-shop-sub { margin: 0 0 0.1rem; padding-top: 0; border-top: 0; }
.bm-hand { --hc: var(--red); margin-top: 1rem; padding: 0 12px 12px; border-radius: 14px; border: 3px solid var(--hc); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--hc) 14%, #fff8e6) 0 14px, color-mix(in srgb, var(--hc) 8%, #fff8e6) 14px 28px); }
.bm-hand.pl-blue { --hc: var(--blue); }
.bm-hand .bm-sub { margin: 0; padding-top: 0.55rem; border-top: 0; color: color-mix(in srgb, var(--hc) 70%, #3d2a12); }
.hand-grid { --hc: var(--red); padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--hc) 10%, #fff8e6); }
.hand-grid.pl-blue { --hc: var(--blue); }
.hand-grid .dcard.held .dc-tag { background: var(--hc); }
.hand-grid .dcard.held { box-shadow: 0 0 0 3px var(--hc), 0 6px 14px rgba(0, 0, 0, 0.18); }
.big-market .dcard.held { background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--hc, #e53935) 10%, #fffaf0)); box-shadow: 0 0 0 3px var(--hc, #e53935), 0 6px 14px rgba(0, 0, 0, 0.18); }
.big-market .dcard.held .dc-tag { background: var(--hc, #e53935); font-size: 0.72rem; }
.bm-breed { border-style: dashed; background: repeating-linear-gradient(135deg, #fffaf0 0 14px, #fff3dc 14px 28px); }
.big-market .dcard.bred { background: linear-gradient(180deg, #fff, #fff6e0); box-shadow: 0 0 0 3px #d9a441, 0 6px 14px rgba(0, 0, 0, 0.18); }
.big-market .dcard.bred .dc-tag { background: #b7791f; font-size: 0.72rem; }
.big-market .dc-ab { font-size: 0.76rem; }
.bm-deck { min-height: 150px; align-self: stretch; }
.bm-deck b { font-size: 1.8rem; }
.bm-deck.pick { cursor: pointer; animation: glow 1.4s ease-in-out infinite; }
@media (min-width: 861px) { .market.proto { display: none; } }
@media (max-width: 1180px) { .bm-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .bm-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bm-deck { min-height: 90px; } }

/* Prototype: round event card */
.ev-card { display: flex; align-items: center; gap: 12px; margin: 0.4rem 0 0.8rem; padding: 12px 14px; border-radius: 14px; border: 3px solid #e0a100; background: radial-gradient(circle at 15% 30%, #fffbe6, #ffe8a3); box-shadow: 0 4px 0 #c78a00, 0 8px 18px rgba(0, 0, 0, 0.15); }
.evc-ic { font-size: 2.6rem; line-height: 1; flex: 0 0 auto; }
.evc-ic .tk { width: 3rem; height: 3rem; }
.ev-card small { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #9c5b00; }
.ev-card b { display: block; font-family: "Lilita One", sans-serif; font-size: 1.35rem; line-height: 1.1; }
.ev-card p { margin: 0.2rem 0 0; font-size: 0.88rem; line-height: 1.3; }
.ev-card.goal { border-color: #2e7d6b; background: radial-gradient(circle at 15% 30%, #effff8, #bfe8d8); box-shadow: 0 4px 0 #1f5c4e, 0 8px 18px rgba(0, 0, 0, 0.15); }
.ev-card.goal small { color: #1f5c4e; }

.goal-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 8px; }
.goal-card { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 2px solid #2e7d6b; background: linear-gradient(180deg, #f4fffa, #d6f1e6); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: 0 3px 0 #1f5c4e; }
.goal-card:hover { transform: translateY(-2px); }
.goal-card .gc-ic { grid-row: span 3; font-size: 1.9rem; line-height: 1; }
.goal-card b { font-family: "Lilita One", sans-serif; font-size: 1.05rem; line-height: 1.1; }
.goal-card small { font-size: 0.78rem; line-height: 1.25; color: #35554b; }
.goal-card .gc-pts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gc-p { padding: 1px 7px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; color: #fff; background: var(--red); }
.gc-p.pl-blue { background: var(--blue); }
.goal-card.hidden { border-style: dashed; border-color: #8a9a92; background: repeating-linear-gradient(135deg, #eef1ee 0 10px, #e3e8e4 10px 20px); box-shadow: none; color: var(--muted); }
.goal-list { padding-left: 1.1rem; text-align: left; }
.goal-list li { margin: 0.35rem 0; }
.goal-list .gm-hidden { color: var(--muted); }
.goal-list.all { font-size: 0.9rem; }
@media (max-width: 720px) { .goal-row { grid-template-columns: 1fr; } }
.pcard.ev-chip { border-left-color: #e0a100; background: #fff3c4; }

.ev-reveal { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; background: rgba(25, 12, 2, 0.6); cursor: pointer; animation: evrFade 0.3s ease both; }
.evr-card { width: min(300px, 80vw); aspect-ratio: 5 / 7; perspective: 1200px; animation: evrIn 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.evr-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: evrFlip 0.8s 0.55s cubic-bezier(0.4, 0, 0.2, 1) both; }
.evr-back, .evr-front { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); }
.evr-back { border: 5px solid #3b2410; background: radial-gradient(circle at 50% 45%, rgba(255, 224, 138, 0.3), transparent 50%), repeating-linear-gradient(45deg, #5d3a1a 0 12px, #6f4721 12px 24px); color: #ffe08a; gap: 8px; }
.evr-back span { font-size: 4rem; }
.evr-back b { font-family: "Lilita One", sans-serif; font-size: 1.6rem; letter-spacing: 0.1em; text-transform: uppercase; }
.evr-front { transform: rotateY(180deg); padding: 22px 20px; gap: 8px; border: 5px solid #e0a100; background: radial-gradient(circle at 50% 30%, #fffdf2, #ffe6a0); color: var(--ink); }
.evr-front small { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #9c5b00; }
.evr-ic { font-size: 5rem; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.15)); }
.evr-ic .tk { width: 5.5rem; height: 5.5rem; }
.evr-front b { font-family: "Lilita One", sans-serif; font-size: 2rem; line-height: 1.1; }
.evr-front p { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.evr-card.goal .evr-back { background: radial-gradient(circle at 50% 45%, rgba(191, 232, 216, 0.3), transparent 50%), repeating-linear-gradient(45deg, #1f4d42 0 12px, #275e51 12px 24px); color: #bfe8d8; border-color: #12342c; }
.evr-card.goal .evr-front { border-color: #2e7d6b; background: radial-gradient(circle at 50% 30%, #f4fffa, #bfe8d8); }
.evr-card.goal .evr-front small { color: #1f5c4e; }
.evr-front em { margin-top: auto; font-size: 0.75rem; font-style: normal; color: var(--muted); }
@keyframes evrFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes evrIn { from { transform: translateY(-60px) scale(0.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes evrFlip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@media (prefers-reduced-motion: reduce) { .evr-inner { transform: rotateY(180deg); } }
