.dots li.part { background: var(--accent); border-color: var(--accent); animation: pop 0.35s ease-out; }

.prompt { text-align: center; font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: 0.01em; margin: 0 0 18px; }
.round-no {
  display: block;
  font-family: var(--body); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 4px;
}
.key-hint {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
@media (pointer: coarse) { .key-hint { display: none; } }

/* --- the square sound player --- */
.player-row { --size: 210px; position: relative; display: flex; justify-content: center; margin: 0 auto 24px; }
.player {
  --p: 0;
  position: relative;
  width: var(--size); aspect-ratio: 1;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 24px;
  background:
    radial-gradient(circle at 50% 40%, rgba(227, 168, 69, 0.08), transparent 65%),
    linear-gradient(160deg, var(--panel-2), var(--panel));
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  transition: box-shadow 0.25s, border-color 0.25s;
}
.player.playing { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 4px rgba(227, 168, 69, 0.08), 0 18px 40px -24px rgba(0, 0, 0, 0.9); }
.player .key-hint { position: absolute; top: 12px; right: 12px; }

.play, .mini-play {
  position: relative;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--text); color: var(--bg);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.play { width: calc(var(--size) * 0.5); height: calc(var(--size) * 0.5); margin-top: calc(var(--size) * -0.125); }
.play:hover, .mini-play:hover { background: #fff; }
.play:active, .mini-play:active { transform: scale(0.96); }
.play svg:not(.ring), .mini-play svg:not(.ring) { width: 44%; height: 44%; }
.play-icon, .stop-icon { display: grid; place-items: center; width: 100%; height: 100%; grid-area: 1 / 1; }
.stop-icon, .playing .play-icon { display: none; }
.playing .stop-icon { display: grid; }
.buffering .stop-icon { opacity: 0.4; }

/* progress ring around the play button */
.ring { position: absolute; inset: -9px; width: calc(100% + 18px) !important; height: calc(100% + 18px) !important; transform: rotate(-90deg); pointer-events: none; }
.ring circle { fill: none; stroke: var(--line); stroke-width: 3.5; }
.ring .ring-fill { stroke: var(--accent); stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p)); stroke-linecap: round; opacity: 0; }
.playing .ring-fill { opacity: 1; }

.volume {
  position: absolute; left: calc(var(--size) * 0.085); right: calc(var(--size) * 0.085); bottom: calc(var(--size) * 0.075);
  display: flex; align-items: center; gap: 8px;
  color: var(--muted);
}
.volume svg { width: 20px; height: 20px; flex: none; }
.volume input {
  flex: 1; min-width: 0; height: 24px; margin: 0;
  -webkit-appearance: none; appearance: none; background: none; cursor: pointer;
}
.volume input::-webkit-slider-runnable-track {
  height: 5px; border-radius: 999px;
  background: linear-gradient(to right, var(--steel) var(--v, 70%), var(--line) var(--v, 70%));
}
.volume input::-moz-range-track { height: 5px; border-radius: 999px; background: var(--line); }
.volume input::-moz-range-progress { height: 5px; border-radius: 999px; background: var(--steel); }
.volume input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5.5px;
  border-radius: 50%; background: var(--text); border: 0;
}
.volume input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; }
.volume input:focus-visible { outline: none; }
.volume input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent); }

.player { container-type: inline-size; }
/* a small player has no room for its corner labels; the sound buttons below show the same thing */
@container (max-width: 185px) {
  .player .key-hint, .clip-now { display: none; }
}

/* which of the round's sounds is selected, top left of the player */
.clip-now {
  position: absolute; top: 13px; left: 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
}

/* Sound 1, Sound 2... under the player */
.clips { display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 520px; margin: -10px auto 16px; }
.clips[hidden], .clips-hint[hidden] { display: none; }
.clip-list {
  position: relative;
  display: flex; gap: 6px; min-width: 0; padding: 2px;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.clip-list::-webkit-scrollbar { display: none; }
.clip:first-child { margin-left: auto; } /* centred when they fit, scrollable from the start when they don't */
.clip:last-child { margin-right: auto; }
.clip { flex: none; }
.clip {
  position: relative;
  min-height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel);
  color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.clip:hover { border-color: var(--steel); color: var(--text); }
.clip.current { border-color: var(--accent); color: var(--text); }
.clip.playing { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); }
.clip.playing::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; vertical-align: 2px;
  border-radius: 50%; background: var(--accent); animation: blink 0.9s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }
.clip-nav {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--panel-2); color: var(--text);
  cursor: pointer;
}
.clip-nav svg { width: 15px; height: 15px; }
.clip-nav:hover:not(:disabled) { border-color: var(--steel); }
.clip-nav:disabled { opacity: 0.35; cursor: default; }
.clips-hint { display: flex; align-items: center; justify-content: center; gap: 5px; margin: -8px 0 18px; color: var(--muted); font-size: 12px; }
@media (pointer: coarse) { .clips-hint { display: none !important; } }

/* "your pick" sound, beside the player after a wrong guess */
.pick-sound {
  --p: 0;
  position: absolute; top: 50%; left: calc(50% + var(--size) / 2 + 14px);
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  width: 78px; padding: 10px 6px 9px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel);
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer;
  animation: rise 0.3s ease-out;
}
.pick-sound:hover { border-color: var(--loss); color: var(--text); }
.pick-sound.playing { border-color: var(--loss); color: var(--text); box-shadow: inset 0 calc(-3px) 0 -0px var(--loss); }
.pick-sound-label { display: inline-flex; align-items: center; gap: 3px; }
.pick-sound-label svg { width: 14px; height: 14px; }

/* --- the two choice squares --- */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 420px; margin: 0 auto; }
.choice {
  position: relative;
  aspect-ratio: 1;
  /* icons on top, label underneath, both sized from the square's own width (cqw), so the strip
     never runs into the label however small the square gets */
  container-type: inline-size;
  display: flex; flex-direction: column; justify-content: space-between; align-items: stretch;
  padding: 14% 0 11%;
  text-align: center;
  overflow: hidden;
  border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.choice:hover { border-color: var(--accent); }
.choice:active { transform: scale(0.98); }
.choice-label { padding: 0 6px; font-family: var(--display); font-size: clamp(15px, 13cqw, 28px); font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1; }
.choice-label em { display: block; margin-top: 4px; font: 600 clamp(9px, 5.6cqw, 12px) var(--body); letter-spacing: 0.06em; color: var(--muted); }

.carousel {
  position: relative;
  overflow: hidden;
  -webkit-mask: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
  mask: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
}
.carousel-track { display: flex; gap: clamp(6px, 5cqw, 10px); width: max-content; animation: marquee var(--dur, 70s) linear infinite; }
.choice[data-open="item"] .carousel-track { animation-direction: reverse; }
.carousel img { width: clamp(24px, 29cqw, 58px); height: clamp(24px, 29cqw, 58px); border-radius: 50%; background: var(--panel-2); object-fit: cover; flex: none; }
.choice[data-open="item"] .carousel img { border-radius: 12px; }
.choice:hover .carousel-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

.dev-files { display: grid; gap: 4px; width: fit-content; max-width: 100%; margin: 10px auto 0; text-align: left; }
.dev-file { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 12px; }
.dev-file em { flex: none; width: 120px; text-align: right; font-style: normal; font-weight: 600; color: var(--accent); }
.dev-file code {
  min-width: 0; overflow-wrap: anywhere;
  padding: 2px 7px; border: 1px dashed var(--accent); border-radius: 6px;
  font: 500 12px ui-monospace, monospace; color: var(--text); cursor: copy;
}
.dev-file code:hover { background: rgba(227, 168, 69, 0.12); }
.sl-board .dev-files { margin: 6px 0 0; }
.dev-hint { width: fit-content; margin: 14px auto 0; font-size: 12px; color: var(--accent); border: 1px dashed var(--accent); border-radius: 6px; padding: 2px 8px; }

/* --- answer bubbles: hero with ability/gun in the corner, or an item --- */
.bubble-wrap { --s: 52px; position: relative; display: inline-block; width: var(--s); height: var(--s); flex: none; }
.bubble-wrap.size-lg { --s: 116px; }
.bubble-wrap.size-sm { --s: 46px; }
.bubble-wrap.size-xs { --s: 24px; }
.bubble {
  display: block; width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden; clip-path: circle(50%);
  background: var(--panel-2);
  box-shadow: 0 0 0 2px var(--line);
}
.bubble img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bubble.item.cat-weapon { box-shadow: 0 0 0 2px #d9873a; }
.bubble.item.cat-vitality { box-shadow: 0 0 0 2px #6fb04f; }
.bubble.item.cat-spirit { box-shadow: 0 0 0 2px #a46ad8; }
.corner {
  position: absolute; right: -6%; bottom: -6%;
  width: 44%; height: 44%;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #0b131d;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--line);
}
.corner img { width: 72%; height: 72%; object-fit: contain; }
.corner.gun { color: var(--accent); }
.gun-glyph { width: 66%; height: 66%; }
.size-xs .corner { box-shadow: 0 0 0 1.5px var(--panel-2); }

/* --- reveal --- */
.reveal {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  max-width: 460px; margin: 0 auto;
  padding: 20px 22px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--panel);
  text-align: left;
}
.reveal.win { border-color: color-mix(in srgb, var(--win) 60%, var(--line)); }
.reveal.loss { border-color: color-mix(in srgb, var(--loss) 60%, var(--line)); }
.reveal.part { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.reveal.pop { animation: pop-in 0.35s ease-out; }
.reveal.shake { animation: shake 0.4s ease; }
@keyframes pop-in { 50% { transform: scale(1.04); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.reveal-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.verdict { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.win .verdict { color: var(--win); }
.loss .verdict { color: var(--loss); }
.part .verdict { color: var(--accent); }
.reveal-text b { font-family: var(--display); font-size: 32px; font-weight: 800; line-height: 1.05; }
.reveal-sub { color: var(--muted); font-size: 14px; }
.your-pick { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.ans-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 4px; border-radius: 999px; background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 14px; }
.ans-chip.wrong { box-shadow: inset 0 0 0 1px var(--loss); }
.ans-chip .corner { right: -14%; bottom: -14%; }

.after { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; }
@keyframes rise { from { opacity: 0; transform: translateY(calc(-50% + 8px)); } }

/* --- picker dialogs --- */
.sl-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: min(680px, 86vh);
  padding: 0;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel); color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}
.sl-dialog[open] { display: flex; flex-direction: column; }
.sl-dialog::backdrop { background: rgba(5, 9, 14, 0.7); backdrop-filter: blur(3px); }
.sl-dialog .picker-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 4px 18px; margin: 0; }
.sl-dialog .picker-head p { flex: 1; margin: 0; font-family: var(--display); font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.picker-close { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 6px; }
.dialog-hint { margin: 0 18px 10px; color: var(--muted); font-size: 13px; }

.hero-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding: 2px 10px 14px; overflow-y: auto;
}
.hero-cell, .item-cell {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 2px 7px;
  border: 0; border-radius: 12px; background: none;
  cursor: pointer; min-width: 0;
}
.hero-cell span, .item-cell span {
  font-size: 12px; font-weight: 600; line-height: 1.15; text-align: center;
  width: 100%; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.hero-cell img { width: 54px; height: 54px; border-radius: 50%; background: var(--panel-2); object-fit: cover; transition: transform 0.12s; }
.hero-cell:hover, .item-cell:hover { background: var(--panel-2); }
.hero-cell:hover img { transform: scale(1.06); }
.hero-cell.open { background: var(--panel-2); box-shadow: inset 0 -3px 0 var(--accent); }
.hero-cell.open img { box-shadow: 0 0 0 2px var(--accent); }

.kit {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  margin: 2px 0 8px; padding: 10px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 14px;
  background: #0f1925;
  animation: kit-open 0.18s ease-out;
}
@keyframes kit-open { from { opacity: 0; transform: translateY(-6px); } }
.kit-opt {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 3px; min-width: 0;
  border: 1px solid transparent; border-radius: 11px; background: none;
  cursor: pointer;
}
.kit-opt:hover { background: var(--panel-2); border-color: var(--line); }
.kit-opt.fits { border: 1px dashed var(--win); }
.kit-icon {
  display: grid; place-items: center;
  width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #26384d, #142131);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--accent);
}
.kit-icon img { width: 70%; height: 70%; object-fit: contain; }
.kit-name {
  font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kit-opt em { font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: auto; }

#item-search {
  margin: 6px 14px 8px;
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: 500 16px var(--body);
}
#item-search:focus { outline: none; border-color: var(--accent); }
.item-lists { overflow-y: auto; padding: 0 10px 14px; }
.item-cat h4 { margin: 10px 8px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.cat-weapon h4 { color: #d9873a; }
.cat-vitality h4 { color: #6fb04f; }
.cat-spirit h4 { color: #a46ad8; }
.item-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.item-cell img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.cat-weapon .item-cell img { box-shadow: 0 0 0 1px #d9873a55; }
.cat-vitality .item-cell img { box-shadow: 0 0 0 1px #6fb04f55; }
.cat-spirit .item-cell img { box-shadow: 0 0 0 1px #a46ad855; }
.item-cell.fits { outline: 1px dashed var(--win); }
.item-lists .empty { color: var(--muted); text-align: center; padding: 24px; }

/* --- scoreboard --- */
.sl-board ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; text-align: left; }
.sl-board li {
  display: grid; grid-template-columns: 28px 40px 46px 1fr; align-items: center; gap: 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.sl-board li:last-child { border-bottom: 0; padding-bottom: 0; }
.row-head { display: flex; flex-direction: column; align-items: center; gap: 3px; font-weight: 700; font-size: 14px; }
.row-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.win .row-dot { background: var(--win); }
.part .row-dot { background: var(--accent); }
.loss .row-dot { background: var(--loss); }
.mini-play { --p: 0; width: 34px; height: 34px; margin: 3px; }
.mini-play .ring { inset: -5px; width: calc(100% + 10px) !important; height: calc(100% + 10px) !important; }
.b-main { min-width: 0; }
.b-main b { font-family: var(--display); font-size: 19px; font-weight: 800; }
.b-sub { margin-left: 8px; color: var(--muted); font-size: 12px; }
.b-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.b-yours { color: var(--loss); }
.b-pct { color: var(--steel); font-weight: 600; }
.b-pct.hero { color: var(--accent); }
.verdict-mark.good { color: var(--win); font-weight: 700; }

@media (max-width: 520px) {
  .prompt { font-size: 26px; }
  .player-row { --size: 172px; }
  .clip-now { display: none; } /* no room beside the ring; the chips below show which sound is on */
  .clips { gap: 6px; }
  .clip { padding: 0 11px; }
  .pick-sound { width: 66px; left: calc(50% + var(--size) / 2 + 8px); }
  .choices { gap: 10px; }
  .reveal { gap: 16px; padding: 16px; }
  .bubble-wrap.size-lg { --s: 92px; }
  .reveal-text b { font-size: 26px; }
  .hero-grid { padding: 2px 6px 12px; gap: 2px; }
  .hero-cell img { width: 46px; height: 46px; }
  .hero-cell span, .item-cell span { font-size: 11px; }
  .kit { gap: 2px; padding: 8px 4px; }
  .kit-icon { width: 42px; height: 42px; }
  .kit-name { font-size: 11px; }
  .item-cell img { width: 46px; height: 46px; }
  .sl-board li { grid-template-columns: 22px 36px 40px 1fr; gap: 8px; }
  .sl-board .bubble-wrap.size-sm { --s: 40px; }
}

/* --- fit to the window: player, squares and reveal share the height that's left (cqh = % of the play area) --- */
body.fit .player-row { --size: clamp(112px, 31cqh, 210px); margin-bottom: clamp(10px, 2.6cqh, 24px); }
body.fit .clips { margin-top: calc(-0.4 * clamp(10px, 2.6cqh, 24px)); margin-bottom: clamp(6px, 1.8cqh, 16px); }
body.fit .clips-hint { margin: calc(-0.5 * clamp(6px, 1.8cqh, 16px)) 0 clamp(6px, 1.8cqh, 18px); }
body.fit .choices { max-width: min(420px, calc(2 * clamp(100px, 30cqh, 203px) + 14px)); }
body.fit .reveal { padding: clamp(10px, 2cqh, 20px) 22px; }
body.fit .bubble-wrap.size-lg { --s: clamp(60px, 16cqh, 116px); }
body.fit .reveal-text b { font-size: clamp(22px, 4.6cqh, 32px); }
body.fit .your-pick { margin-top: clamp(6px, 1.4cqh, 14px); }
body.fit .after { margin-top: clamp(8px, 2cqh, 22px); }
body.fit .dev-files { margin-top: 6px; }
@media (max-width: 520px) {
  body.fit .player-row { --size: clamp(112px, 31cqh, 172px); }
}
