:root {
  --ink: #2a2140;
  --ink-soft: #5b5370;
  --paper: #fff8ec;
  --paper-2: #fdeed6;
  --line: #ead9bc;

  --left: #1fa3ff;
  --left-dark: #0b78c4;
  --right: #ff4fa0;
  --right-dark: #c92a74;

  --base-A: #ff5a5f;
  --base-T: #ffc233;
  --base-G: #3b82f6;
  --base-C: #1fbf9a;
  --base-U: #a066ff;

  --good: #3ccf4e;
  --good-dark: #23963a;
  --warn: #ff9f1c;

  --board: #2f5a46;
  --chalk: #f4f1e6;

  --radius: 18px;
  --display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --hand: "Patrick Hand", "Comic Sans MS", "Chalkboard SE", cursive;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #f6e7cf;
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  touch-action: none;
}
#stage canvas { display: block; outline: none; }
#stage.grab canvas { cursor: grab; }
#stage.can-pick canvas { cursor: pointer; }
#stage.dragging canvas { cursor: grabbing; }

.hidden { display: none !important; }

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }

/* ---------- chunky buttons ---------- */
.btn {
  --c: #fff;
  --c-dark: #d9c9ad;
  --t: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  padding: 12px 22px 13px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1;
  color: var(--t);
  background: var(--c);
  box-shadow: 0 5px 0 var(--c-dark), 0 8px 18px rgba(42, 33, 64, .18);
  transform: translateY(0);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:hover:not(:disabled) { filter: brightness(1.05); }
.btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--c-dark), 0 3px 8px rgba(42, 33, 64, .18);
}
.btn:disabled { filter: grayscale(.7) opacity(.55); }

.btn.start { --c: var(--good); --c-dark: var(--good-dark); --t: #fff; font-size: 24px; padding: 16px 34px 17px; }
.btn.check { --c: var(--good); --c-dark: var(--good-dark); --t: #fff; font-size: 24px; padding: 15px 30px 16px; min-width: 230px; }
.btn.check.ready { animation: nudge 1.4s ease-in-out infinite; }
.btn.hint { --c: #fff3d6; --c-dark: #e5c98d; }
.btn.restart { --c: #ff7a59; --c-dark: #cf4f30; --t: #fff; font-size: 16px; padding: 10px 16px 11px; }
.btn.restart.big { font-size: 20px; padding: 14px 26px 15px; }
.btn.ghost { --c: #fff; --c-dark: #d9c9ad; }

@keyframes nudge {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.04); }
}

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 14px;
  border: 0;
  background: #fff;
  color: var(--ink);
  display: grid; place-items: center;
  box-shadow: 0 4px 0 #d9c9ad;
  transition: transform .08s, box-shadow .08s;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d9c9ad; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn .off { display: none; }
.icon-btn.muted .on { display: none; }
.icon-btn.muted .off { display: block; }
.icon-btn.muted { color: #a59cb6; }

.btn-mini {
  border: 0;
  border-radius: 10px;
  padding: 7px 14px 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  background: transparent;
  color: var(--ink-soft);
}
.btn-mini.primary { background: var(--ink); color: #fff; box-shadow: 0 3px 0 #120d1f; }
.btn-mini.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #120d1f; }

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  color: var(--ink);
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px 18px;
  pointer-events: none;
  z-index: 5;
}
#hud > * { pointer-events: auto; }
.hud-left { justify-self: start; }
.hud-right { justify-self: end; display: flex; gap: 8px; align-items: center; }

.logo-small {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  background: #fff;
  padding: 6px 14px 4px;
  border-radius: 14px;
  box-shadow: 0 4px 0 #d9c9ad;
}
.logo-small b { color: var(--base-A); }

.hud-center { display: flex; gap: 10px; align-items: stretch; }

.score-box {
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  padding: 6px 20px 8px;
  text-align: center;
  box-shadow: 0 5px 0 #120d1f;
  min-width: 120px;
}
.score-box small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.score-box strong { font-family: var(--display); font-size: 34px; line-height: 1; display: inline-block; }
.score-box strong.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.35); color: #9dffa6; } }

.turn-pill {
  --pc: var(--left);
  --pc-dark: var(--left-dark);
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border-radius: 16px;
  padding: 6px 16px 6px 8px;
  box-shadow: 0 5px 0 #d9c9ad;
  opacity: .55;
  transform: scale(.94);
  transition: all .3s cubic-bezier(.3, 1.6, .5, 1);
}
.turn-pill.girl { --pc: var(--right); --pc-dark: var(--right-dark); flex-direction: row-reverse; padding: 6px 8px 6px 16px; text-align: right; }
.turn-pill.active { opacity: 1; transform: scale(1.04); box-shadow: 0 5px 0 var(--pc-dark), 0 0 0 3px var(--pc); }
.turn-pill .avatar {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--pc);
  position: relative;
}
.turn-pill .avatar::after {
  content: ""; position: absolute; inset: 9px 8px 6px;
  border-radius: 50% 50% 40% 40%;
  background: radial-gradient(circle at 35% 45%, var(--ink) 2.5px, transparent 3px),
              radial-gradient(circle at 65% 45%, var(--ink) 2.5px, transparent 3px),
              #ffd9b8;
}
.pill-text { display: flex; flex-direction: column; line-height: 1.05; }
.pill-name { font-family: var(--display); font-weight: 800; font-size: 19px; }
.pill-text small { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.turn-pill.active small::after { content: " · your turn"; color: var(--pc-dark); }

/* ---------- progress ---------- */
#progress {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: min(400px, 70vw);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4;
  pointer-events: none;
}
#progress-count {
  font-family: var(--display); font-size: 15px; font-weight: 800;
  background: #fff; border-radius: 10px; padding: 2px 8px;
  box-shadow: 0 3px 0 #d9c9ad;
  white-space: nowrap;
}
.progress-track {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--n, 8), 1fr);
  gap: 5px;
  background: #ffffffcc;
  padding: 5px;
  border-radius: 12px;
  box-shadow: 0 3px 0 #d9c9ad;
}
.progress-track span {
  height: 14px;
  border-radius: 6px;
  background: #ece2d0;
  position: relative;
  overflow: hidden;
  transition: background .3s;
}
.progress-track span.current { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); animation: blink 1s ease-in-out infinite; }
.progress-track span.done { background: linear-gradient(90deg, var(--l) 50%, var(--r) 50%); animation: pop .4s ease; }
@keyframes blink { 50% { box-shadow: inset 0 0 0 2px #0000; } }
@keyframes pop { 50% { transform: scaleY(1.6); } }

/* ---------- rule card ---------- */
#rules {
  position: fixed;
  left: 18px;
  top: 84px;
  transform: rotate(-1.5deg);
  background: var(--board);
  color: var(--chalk);
  font-family: var(--hand);
  padding: 14px 18px 16px;
  border-radius: 10px;
  border: 7px solid #a8763f;
  box-shadow: 0 10px 24px rgba(42, 33, 64, .28);
  z-index: 3;
  min-width: 170px;
}
#rules h3 { margin: 0 0 8px; font-weight: 400; font-size: 24px; letter-spacing: .02em; }
.rule { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.rule .link { flex: 1; height: 0; border-top: 3px dashed #f4f1e6aa; min-width: 26px; }
.rule .note { font-size: 18px; line-height: 1; color: #ffd5f0; }
.rule.rna { margin-top: 12px; }
.chip {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.2);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.18);
}
.chip.A, .title-strand .A { background: var(--base-A); }
.chip.T, .title-strand .T { background: var(--base-T); }
.chip.G, .title-strand .G { background: var(--base-G); }
.chip.C, .title-strand .C { background: var(--base-C); }
.chip.U { background: var(--base-U); position: relative; }
.chip.U::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 12px;
  background: linear-gradient(45deg, transparent 46%, #ffd5f0 46%, #ffd5f0 54%, transparent 54%);
}

/* ---------- bottom bar ---------- */
#actions {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  padding: 0 16px 14px;
  pointer-events: none;
  z-index: 5;
}
#actions > * { pointer-events: auto; }
#instruction {
  position: fixed;
  top: 126px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  background: #fff;
  border-radius: 14px;
  padding: 8px 18px;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 0 #d9c9ad;
  text-align: center;
  max-width: 92vw;
}
#instruction b.left { color: var(--left-dark); }
#instruction b.right { color: var(--right-dark); }
.action-row { display: flex; gap: 12px; align-items: center; }
.keys {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  background: #fff8ecd0;
  padding: 3px 10px;
  border-radius: 8px;
}

/* ---------- speech bubble ---------- */
.bubble {
  position: fixed;
  left: 0; top: 0;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border-radius: 22px;
  padding: 14px 18px 12px;
  box-shadow: 0 6px 0 #d9c9ad, 0 18px 30px rgba(42, 33, 64, .22);
  z-index: 8;
  transform-origin: 50% 100%;
  animation: bubble-in .35s cubic-bezier(.3, 1.6, .5, 1);
}
.bubble::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: var(--tail, 50%);
  width: 26px; height: 26px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 4px;
  box-shadow: 5px 5px 0 #d9c9ad;
  z-index: -1;
}
.bubble.tone-good { box-shadow: 0 6px 0 var(--good-dark), 0 0 0 4px var(--good), 0 18px 30px rgba(42, 33, 64, .22); }
.bubble.tone-hint { box-shadow: 0 6px 0 #d18a1a, 0 0 0 4px var(--warn), 0 18px 30px rgba(42, 33, 64, .22); }
.bubble-who { font-family: var(--display); font-weight: 800; font-size: 14px; color: #9b4dca; letter-spacing: .03em; text-transform: uppercase; }
.bubble-text { font-size: 19px; font-weight: 700; line-height: 1.35; min-height: 26px; }
.bubble-text .b { font-family: var(--display); font-weight: 800; padding: 0 5px; border-radius: 6px; color: #fff; }
.bubble-text .b.A { background: var(--base-A); }
.bubble-text .b.T { background: var(--base-T); color: var(--ink); }
.bubble-text .b.G { background: var(--base-G); }
.bubble-text .b.C { background: var(--base-C); }
.bubble-text .b.U { background: var(--base-U); }
.bubble-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.bubble-actions:empty, .bubble-actions.none { display: none; }
@keyframes bubble-in { from { transform: scale(.6); opacity: 0; } }

/* ---------- character tags & popups ---------- */
#tags, #pops { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#pops { z-index: 9; }
.name-tag {
  position: absolute;
  left: 0; top: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 12px;
  border-radius: 12px;
  background: var(--left);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 3px 0 var(--left-dark);
  white-space: nowrap;
  transform: translate(-50%, -100%);
  transition: opacity .3s;
}
.name-tag.girl { background: var(--right); box-shadow: 0 3px 0 var(--right-dark); }
.name-tag .nt-pts { background: #fff; color: var(--ink); border-radius: 8px; padding: 0 7px; font-size: 14px; }
.name-tag.off { opacity: 0; }

.pop {
  position: absolute;
  font-family: var(--display);
  font-weight: 800;
  font-size: 46px;
  color: var(--good);
  -webkit-text-stroke: 6px #fff;
  paint-order: stroke fill;
  text-shadow: 0 5px 0 rgba(35, 150, 58, .45);
  transform: translate(-50%, -50%);
  animation: rise 1.4s ease-out forwards;
  white-space: nowrap;
}
.pop.warn { color: var(--warn); text-shadow: 0 4px 0 rgba(196, 106, 0, .45); font-size: 32px; }
@keyframes rise {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.5); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
  30% { transform: translate(-50%, -70%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1); }
}

/* ---------- full screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 20;
  background: radial-gradient(ellipse at center, rgba(42, 33, 64, .15), rgba(42, 33, 64, .55));
  overflow-y: auto;
}
#title-screen { background: radial-gradient(ellipse at 50% 60%, rgba(255, 248, 236, .15), rgba(42, 33, 64, .55)); }

.card {
  background: var(--paper);
  border-radius: 28px;
  padding: 28px 32px 30px;
  box-shadow: 0 10px 0 #d8c29d, 0 30px 60px rgba(42, 33, 64, .35);
  max-width: 560px;
  width: 100%;
  text-align: center;
  animation: card-in .5s cubic-bezier(.3, 1.4, .5, 1);
  position: relative;
}
@keyframes card-in { from { transform: translateY(30px) scale(.94); opacity: 0; } }

.title-strand { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.title-strand span {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-family: var(--display); font-weight: 800; font-size: 28px; color: #fff;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.18);
  animation: wobble 2.4s ease-in-out infinite;
}
.title-strand span:nth-child(2) { animation-delay: .15s; color: var(--ink); }
.title-strand span:nth-child(3) { animation-delay: .3s; }
.title-strand span:nth-child(4) { animation-delay: .45s; }
@keyframes wobble { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-8px) rotate(-6deg); } 60% { transform: translateY(0) rotate(4deg); } }

h1 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(42px, 8vw, 64px);
  line-height: .95;
  color: var(--ink);
  letter-spacing: -.01em;
}
.subtitle {
  margin: 4px 0 18px;
  font-family: var(--hand);
  font-size: 26px;
  color: #9b4dca;
}
h2 { font-family: var(--display); font-weight: 800; font-size: 34px; margin: 0 0 10px; line-height: 1.05; }

.how {
  text-align: left;
  margin: 0 0 18px;
  padding: 14px 18px 14px 40px;
  background: #fff;
  border-radius: 16px;
  border: 2px dashed var(--line);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}
.how li { margin: 4px 0; }
.how li::marker { font-family: var(--display); font-weight: 800; color: #9b4dca; }
.how.plain { list-style: none; padding-left: 18px; }
.how.plain li { padding-left: 22px; position: relative; }
.how.plain li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 10px; height: 10px; border-radius: 3px; background: var(--base-A); }
.how.plain li:nth-child(2)::before { background: var(--base-T); }
.how.plain li:nth-child(3)::before { background: var(--base-G); }
.how.plain li:nth-child(4)::before { background: var(--base-C); }
.how.plain li:nth-child(5)::before { background: var(--base-U); }

.players { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.player {
  display: flex; flex-direction: column; gap: 4px;
  text-align: left;
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--left-dark);
}
.player.girl { color: var(--right-dark); }
.player input {
  font-family: var(--display); font-weight: 700; font-size: 22px;
  padding: 8px 12px 6px;
  border-radius: 12px;
  border: 3px solid var(--left);
  background: #fff;
  color: var(--ink);
  outline: none;
  width: 100%;
  user-select: text;
  -webkit-user-select: text;
}
.player.girl input { border-color: var(--right); }
.player input:focus { box-shadow: 0 0 0 4px #1fa3ff33; }
.player.girl input:focus { box-shadow: 0 0 0 4px #ff4fa033; }

.loading { margin: 12px 0 0; font-size: 14px; font-weight: 700; color: var(--ink-soft); }

.stars { display: flex; justify-content: center; gap: 8px; margin: -6px 0 10px; }
.stars i {
  width: 58px; height: 58px;
  background: #e6d8bf;
  clip-path: polygon(50% 3%, 62% 36%, 97% 37%, 69% 58%, 79% 93%, 50% 73%, 21% 93%, 31% 58%, 3% 37%, 38% 36%);
  transform: scale(.4); opacity: 0;
  animation: star-in .5s cubic-bezier(.3, 1.8, .5, 1) forwards;
}
.stars i:nth-child(2) { width: 72px; height: 72px; margin-top: -10px; animation-delay: .25s; }
.stars i:nth-child(3) { animation-delay: .5s; }
.stars i.on { background: #ffc233; }
@keyframes star-in { to { transform: scale(1); opacity: 1; } }

.win-names { font-size: 18px; font-weight: 700; margin: 0 0 14px; color: var(--ink-soft); }
.win-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.win-stats div { background: #fff; border-radius: 16px; padding: 10px; border: 2px dashed var(--line); }
.win-stats small { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.win-stats strong { font-family: var(--display); font-size: 38px; line-height: 1.1; }
.fact {
  font-family: var(--hand);
  font-size: 21px;
  line-height: 1.25;
  background: var(--board);
  color: var(--chalk);
  padding: 12px 16px;
  border-radius: 12px;
  margin: 0 0 18px;
  text-align: left;
}
.fact::before { content: "Did you know? "; color: #ffe08a; }
.win-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.confirm-card, .help-card { max-width: 520px; }
.confirm-card p { font-size: 17px; font-weight: 600; margin: 0 0 20px; }

/* peek mode: hide win card so kids can orbit the helix */
body.admiring #win-screen { display: none !important; }
#admire-back {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 10;
}


/* ---------- end-of-game summary ---------- */
#recap {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: min(440px, calc(100vw - 32px));
  z-index: 12;
}
.recap-card {
  background: var(--paper);
  border-radius: 24px;
  padding: 18px 22px 18px;
  box-shadow: 0 8px 0 #d8c29d, 0 24px 50px rgba(42, 33, 64, .3);
}
.recap-card.turn { animation: recap-in .35s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes recap-in { from { transform: translateX(-14px); opacity: .3; } }
.recap-head { display: flex; justify-content: space-between; align-items: baseline; }
.recap-kicker {
  font-family: var(--hand); font-size: 22px; color: #9b4dca;
}
.recap-step { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--ink-soft); }
.recap-dots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin: 4px 0 10px; }
.recap-dots span { height: 6px; border-radius: 3px; background: #ece2d0; transition: background .3s; }
.recap-dots span.on { background: var(--good); }
.recap-card h2 { font-size: 30px; margin: 0 0 8px; }
.recap-art {
  background: #fff;
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.recap-art svg { display: block; width: 100%; height: auto; max-height: 150px; }
.recap-art .lbl { font-family: var(--display); font-weight: 700; font-size: 13px; fill: var(--ink-soft); }
.recap-art .big { font-family: var(--display); font-weight: 800; font-size: 26px; fill: #fff; }
.recap-text { font-size: 18px; font-weight: 700; line-height: 1.45; margin: 0 0 14px; }
.recap-text b { color: #9b4dca; }
.recap-text .b {
  font-family: var(--display); font-weight: 800;
  padding: 0 6px; border-radius: 6px; color: #fff;
}
.recap-text .b.A { background: var(--base-A); }
.recap-text .b.T { background: var(--base-T); color: var(--ink); }
.recap-text .b.G { background: var(--base-G); }
.recap-text .b.C { background: var(--base-C); }
.recap-text .b.U { background: var(--base-U); }
.recap-buttons { display: flex; gap: 8px; align-items: center; }
.recap-buttons .spacer { flex: 1; }
.btn.small { font-size: 18px; padding: 10px 18px 11px; }


/* ---------- creator credit ---------- */
.credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px dashed var(--line);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
}
.credit b { color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 17px; }
.credit span { margin-right: 4px; }
.credit-link {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 0 #d9c9ad;
  transition: transform .12s ease, color .15s, background .15s, box-shadow .12s;
}
.credit-link svg { width: 20px; height: 20px; }
.credit-link:hover { transform: translateY(-2px); color: #fff; }
.credit-link.mail:hover { background: var(--base-A); box-shadow: 0 5px 0 #c63e43; }
.credit-link.linkedin:hover { background: #0a66c2; box-shadow: 0 5px 0 #084a8c; }
.credit-link:active { transform: translateY(2px); box-shadow: 0 1px 0 #d9c9ad; }
.credit-link:focus-visible { outline: 3px solid var(--left); outline-offset: 2px; }


/* ---------- creator badge (always visible) ---------- */
#maker {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 5px 4px 12px;
  border-radius: 12px;
  background: rgba(255, 248, 236, .88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 3px 0 rgba(217, 201, 173, .9), 0 6px 14px rgba(42, 33, 64, .12);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
#maker b { color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 14px; }
.maker-text { margin-right: 3px; }
.maker-link {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--ink);
  transition: background .15s, color .15s, transform .12s;
}
.maker-link svg { width: 16px; height: 16px; }
.maker-link:hover { color: #fff; transform: translateY(-1px); }
.maker-link.mail:hover { background: var(--base-A); }
.maker-link.linkedin:hover { background: #0a66c2; }
.maker-link:focus-visible { outline: 2px solid var(--left); outline-offset: 1px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #hud { grid-template-columns: 1fr auto; padding: 10px; }
  .hud-left { display: none; }
  .hud-center { justify-self: start; }
  .turn-pill small { display: none; }
  .turn-pill { padding: 4px 10px 4px 4px; }
  .turn-pill.girl { padding: 4px 4px 4px 10px; }
  .turn-pill .avatar { width: 30px; height: 30px; border-radius: 9px; }
  .turn-pill .avatar::after { inset: 7px 6px 5px; }
  .pill-name { font-size: 16px; }
  .score-box { min-width: 86px; padding: 4px 12px 6px; }
  .score-box strong { font-size: 26px; }
  .btn.restart { padding: 10px 12px; }
  .btn.restart { font-size: 0; gap: 0; }
  #progress { top: 74px; }
  #instruction { top: 112px; width: max-content; }
  #rules { top: auto; bottom: 110px; transform: none; padding: 8px 10px; min-width: 0; border-width: 5px; }
  #rules h3 { display: none; }
  .chip { width: 30px; height: 30px; font-size: 19px; }
  .rule { margin: 4px 0; }
  .rule .note { font-size: 14px; }
  .keys { display: none; }
}

@media (max-width: 600px) {
  #maker { left: 50%; bottom: 6px; transform: translateX(-50%); padding: 2px 4px 2px 10px; font-size: 11px; }
  #maker b { font-size: 12.5px; }
  .maker-link { width: 22px; height: 22px; }
  .maker-link svg { width: 14px; height: 14px; }
  #actions { padding-bottom: 42px; }
  #recap { left: 8px; right: 8px; width: auto; top: auto; bottom: 38px; transform: none; }
  .recap-card { padding: 14px 16px; max-height: 62vh; overflow-y: auto; }
  .recap-card h2 { font-size: 24px; }
  .recap-text { font-size: 16px; }
  .recap-art svg { max-height: 96px; }
  #hud { padding: 8px; gap: 6px; }
  .hud-right { gap: 5px; }
  .icon-btn { width: 36px; height: 36px; border-radius: 11px; }
  .icon-btn svg { width: 20px; height: 20px; }
  .btn.restart { padding: 8px 9px; }
  .turn-pill .avatar { display: none; }
  .turn-pill, .turn-pill.girl { padding: 6px 10px; }
  #rules {
    left: 50%; bottom: 124px; top: auto;
    transform: translateX(-50%);
    display: flex; gap: 12px; align-items: center;
    white-space: nowrap;
  }
  #rules .rule { margin: 0; gap: 4px; }
  #rules .rule .link { min-width: 10px; }
  #rules .rule.rna { margin: 0; }
  #btn-help { display: none; }
  .hud-center { gap: 6px; }
  .pill-text small { display: none; }
  .turn-pill .pill-text { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
  .score-box small { font-size: 9px; }
  .btn.check { min-width: 0; font-size: 20px; padding: 13px 20px 14px; }
  .btn.hint { font-size: 16px; padding: 12px 14px 13px; }
  #instruction { font-size: 15px; }
  .players { grid-template-columns: 1fr; }
  .card { padding: 22px 18px 24px; }
  .how { font-size: 15px; }
  .bubble-text { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
