/* Shield Review. Loaded after /css/site.css. No inline styles (site CSP). */
:root {
  --c0: #b5462f; /* history: brick */
  --c1: #1f7a4d; /* geography: green */
  --c2: #7b3fa0; /* fine arts: plum */
  --c3: #b8860b; /* latin: gold */
  --c4: #1f6fb2; /* science: blue */
  --c5: #d0632b; /* math: orange */
  --c6: #2a8f8f;
  --c7: #8a5a3c;
  --empty: #ece6da;
}
.c0 { --cc: var(--c0); } .c1 { --cc: var(--c1); } .c2 { --cc: var(--c2); } .c3 { --cc: var(--c3); }
.c4 { --cc: var(--c4); } .c5 { --cc: var(--c5); } .c6 { --cc: var(--c6); } .c7 { --cc: var(--c7); }
.cwild { --cc: var(--lapis); }

#wr [hidden] { display: none !important; }
.wr-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin: 16px 0;
}
.wr-field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.wr-field legend { font-weight: 800; font-size: 18px; padding: 0; margin-bottom: 6px; }
.wr-hint { color: var(--muted); margin: 0 0 8px; font-size: 15px; }
.wr-error { color: #a12a1a; font-weight: 800; min-height: 1em; margin: 8px 0; }

.wr-btn {
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 18px;
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
}
.wr-btn:hover { border-color: var(--lapis); }
.wr-btn:focus-visible, .wr-choice:focus-visible, .wr-pick-buttons button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wr-btn.primary { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.wr-btn.primary:hover { background: #16304f; }
.wr-btn.big { font-size: 18px; padding: 12px 22px; min-height: 52px; }
.wr-btn.small { padding: 6px 14px; min-height: 36px; font-size: 14px; }
.wr-btn.ghost { background: transparent; }
.wr-btn:disabled { opacity: 0.55; cursor: default; }
.wr-row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

.wr-toggle { display: grid; gap: 8px; }
@media (min-width: 640px) { .wr-toggle { grid-template-columns: 1fr 1fr; } }
.wr-toggle label, .wr-cats label {
  display: flex; gap: 10px; align-items: flex-start;
  border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px;
  background: #fff; cursor: pointer;
}
.wr-toggle label:has(input:checked) { border-color: var(--lapis); }
.wr-toggle input, .wr-cats input { margin-top: 5px; width: 20px; height: 20px; flex: none; accent-color: var(--lapis); }
.wr-toggle small, .wr-cats small { display: block; color: var(--muted); font-size: 14px; }

.wr-cats { display: grid; gap: 8px; }
@media (min-width: 640px) { .wr-cats { grid-template-columns: 1fr 1fr; } }
.wr-cats label { border-left: 8px solid var(--cc); }
.wr-cats label:has(input:checked) { border-color: var(--cc); background: #fff; }

.wr-players { display: grid; gap: 10px; }
.wr-player-row {
  display: grid; gap: 8px; grid-template-columns: 1fr;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff;
}
@media (min-width: 640px) { .wr-player-row { grid-template-columns: 1fr minmax(250px, auto) auto; align-items: end; } }
.wr-player-row .p-tiers { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 4px; }
.wr-player-row .p-tiers legend { font-size: 14px; font-weight: 800; padding: 0; margin-bottom: 4px; }
.p-tier-boxes { display: flex; flex-wrap: wrap; gap: 6px; }
.wr-player-row label.p-tier {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-height: 44px; background: #fff; cursor: pointer;
}
.wr-player-row label.p-tier input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--ink, #1d2a3a); }
.wr-player-row label.p-tier:has(input:checked) { border-color: var(--ink, #1d2a3a); background: color-mix(in srgb, var(--ink, #1d2a3a) 6%, #fff); }
.p-tier-note { font-size: 12px; font-weight: 600; color: #6b6258; min-height: 1em; }
.wr-tier-tag { margin: -4px 0 10px; font-size: 13px; font-weight: 700; color: #6b6258; }
.wr-tier-tag:empty { display: none; }
.wr-player-row label { display: grid; gap: 4px; font-size: 14px; font-weight: 800; }
.wr-player-row input, .wr-player-row select {
  font: inherit; font-weight: 600; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; min-height: 44px;
}

/* Shield gem widgets: realistic shield (shield-realistic.js). Art carries its own fills;
   CSS only sizes the boxes and animates the newly lit gem. */
.wr-shield { width: 40px; height: 60px; flex: none; }
.wr-shield.big { width: 132px; height: 200px; }
.wr-shield svg { width: 100%; height: 100%; display: block; overflow: visible; }
.rs-gem.pop { animation: wr-pop 0.6s ease; transform-box: fill-box; transform-origin: center; }
@keyframes wr-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.wr-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.wr-title { margin: 0; font-size: clamp(26px, 5vw, 36px); letter-spacing: -0.02em; }

.wr-scoreboard { display: grid; gap: 8px; margin: 12px 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.wr-score {
  display: flex; gap: 10px; align-items: center;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px;
}
.wr-score.active { border-color: var(--lapis); box-shadow: 0 0 0 2px rgba(30,58,95,0.15); }
.wr-score b { display: block; line-height: 1.2; overflow-wrap: anywhere; }
.wr-score small { color: var(--muted); font-size: 13px; }

.wr-turn-head { display: flex; gap: 16px; align-items: center; }
.wr-turn-head h2 { margin: 0; font-size: 26px; overflow-wrap: anywhere; }
.wr-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pine); }

.wr-die-area { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 16px; }
.wr-die {
  flex: 1 1 200px; min-height: 64px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; border: 2px dashed var(--line); background: #fff;
  font-size: 22px; font-weight: 800; text-align: center; padding: 8px 12px;
}
.wr-die.landed { border-style: solid; border-color: var(--cc); color: #fff; background: var(--cc); }
.wr-die.spinning { border-style: solid; border-color: var(--cc); color: var(--cc); }

.wr-pick { margin-top: 16px; }
.wr-pick-buttons { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.wr-pick-buttons button {
  font: inherit; font-weight: 800; font-size: 17px; min-height: 52px; cursor: pointer;
  border-radius: 14px; border: 2px solid var(--cc); background: #fff; color: var(--ink);
  border-left-width: 10px; padding: 8px 10px; text-align: left;
}
.wr-pick-buttons button.owned { opacity: 0.7; }
.wr-pick-buttons button small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }

.wr-question { border-top: 8px solid var(--cc); }
.wr-chip {
  display: inline-block; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px;
  background: var(--cc); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.wr-question h2 { margin: 0 0 14px; font-size: clamp(20px, 4.2vw, 26px); line-height: 1.25; outline: none; }
.wr-choices { display: grid; gap: 10px; }
@media (min-width: 700px) { .wr-choices { grid-template-columns: 1fr 1fr; } }
.wr-choice {
  font: inherit; font-weight: 700; font-size: 18px; text-align: left;
  min-height: 56px; padding: 12px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  display: flex; gap: 10px; align-items: center; touch-action: manipulation;
}
.wr-choice:hover:not(:disabled) { border-color: var(--lapis); }
.wr-choice .key {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg); font-weight: 800; font-size: 15px;
}
.wr-choice:disabled { cursor: default; }
.wr-choice.right { border-color: var(--pine); background: #e3f3ec; }
.wr-choice.right .key { background: var(--pine); color: #fff; }
.wr-choice.wrong { border-color: #a12a1a; background: #f8e4e0; }
.wr-choice.wrong .key { background: #a12a1a; color: #fff; }
.wr-feedback { margin: 14px 0 6px; font-size: 17px; }
.wr-feedback:empty { margin: 0; }
.wr-feedback b.ok { color: var(--pine); }
.wr-feedback b.no { color: #a12a1a; }
.wr-feedback p { margin: 4px 0; }
.wr-feedback .note { color: var(--muted); }
.wr-question .wr-btn { margin-top: 8px; width: 100%; }
@media (min-width: 700px) { .wr-question .wr-btn { width: auto; } }

.wr-result { text-align: center; }
.wr-result .wr-shield { margin: 0 auto 8px; }
.wr-result h1 { margin: 6px 0; font-size: clamp(30px, 6vw, 44px); letter-spacing: -0.02em; }
.wr-result .lede { margin: 0 auto 10px; }
.wr-result .wr-row-actions { justify-content: center; }
.wr-stats { display: grid; gap: 8px; margin: 12px 0; text-align: left; }
.wr-stat {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: #fff;
}
.wr-stat .who { display: flex; gap: 10px; align-items: center; }
.wr-missed { margin: 0; padding-left: 22px; }
.wr-missed li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.wr-missed li span { display: block; color: var(--pine); font-weight: 800; }
.wr-rules ul { margin: 8px 0 0; padding-left: 20px; }
.wr-rules summary { font-weight: 800; cursor: pointer; }

.wr-celebrate { animation: wr-bounce 0.9s ease 2; }
@keyframes wr-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  .rs-gem, .rs-gem.pop, .wr-celebrate, .wr-cat-row.pop { animation: none; transition: none; }
}

/* Board mode: shield path and gems */
.wr-board-wrap { margin-top: 12px; min-width: 0; overflow-x: clip; }
.wr-board-layout {
  display: grid; gap: 16px; align-items: start;
  min-width: 0;
}
@media (min-width: 800px) {
  .wr-board-layout { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
}
.wr-board-shield { text-align: center; min-width: 0; }
.wr-board-shield svg { width: min(180px, 100%); height: auto; display: block; margin: 0 auto; overflow: visible; }
/* Board shield art comes from shield-realistic.js (see the gem widget rules above). */
.wr-gem-status {
  margin: 10px 0 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.wr-board-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
@media (min-width: 600px) {
  .wr-board-track { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
.wr-space {
  position: relative;
  min-height: 48px;
  min-width: 0;
  border-radius: 10px;
  border: 2px solid var(--cc, var(--line));
  background: color-mix(in srgb, var(--cc, #ccc) 18%, #fff);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; text-align: center; padding: 4px;
  color: var(--ink);
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.wr-space.wild {
  --cc: var(--lapis);
  border-style: dashed;
}
.wr-space .tokens {
  position: absolute; bottom: 2px; left: 2px; right: 2px;
  display: flex; flex-wrap: wrap; gap: 2px; justify-content: center;
}
.wr-token {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid #fff; box-shadow: 0 0 0 1px #333;
  background: var(--tok, #1E3A5F);
}
.wr-space.here { box-shadow: 0 0 0 3px var(--gold); }

.wr-toggle { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .wr-toggle { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  #screen-setup .wr-toggle { grid-template-columns: 1fr 1fr 1fr; }
}

.wr-token.tok0 { background: #1E3A5F; }
.wr-token.tok1 { background: #b5462f; }
.wr-token.tok2 { background: #1f7a4d; }
.wr-token.tok3 { background: #7b3fa0; }
.wr-token.tok4 { background: #c4920a; }
.wr-token.tok5 { background: #157a8c; }
.wr-token.tok6 { background: #a33b6b; }
.wr-token.tok7 { background: #d06a1a; }
.wr-turn.board-mode .wr-turn-head { display: none; }
.wr-turn.board-mode #die-area { display: none !important; }
/* Board mode: hide the empty turn card unless subject pick is showing (wild space). */
.wr-turn.board-mode:not(.show-pick) { display: none !important; }
.wr-turn.board-mode.show-pick { display: block; }

/* Category icons (aged-metal stroke) */
.wr-ico {
  flex: none;
  display: block;
  overflow: visible;
}
.wr-ico-wrap {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #8a8f96;
  border-radius: 8px;
  background: #f4efe4;
  margin-top: 1px;
}
.wr-cat-txt { display: grid; gap: 2px; min-width: 0; }
.wr-cats small.wr-cue {
  color: #6a7078;
  font-size: 13px;
  font-weight: 700;
}
.wr-pick-btn .wr-pick-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wr-pick-btn .wr-pick-name { font-weight: 800; }
.wr-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.wr-chip .wr-ico { flex: none; }
.wr-space-lab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.wr-space-lab .wr-ico { flex: none; }



/* Shield Review: count control + aged shield details */
.wr-count-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin: 0 0 10px; font-weight: 600;
}
.wr-count-row label { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.wr-count-row input[type="number"] {
  width: 4.5rem; padding: 6px 8px; font-size: 16px;
  border: 1px solid var(--line, #c9c2b4); border-radius: 8px;
  background: #fff; color: var(--ink, #1a1a1a);
}
.wr-hint-inline { font-weight: 400; color: var(--muted, #667); font-size: 14px; }
.wr-board-shield svg { width: min(190px, 100%); }


/* Play layout: main column + category status sidebar */
.wr-play-layout {
  display: grid;
  gap: 14px;
  align-items: start;
  min-width: 0;
  width: 100%;
  overflow-x: clip;
}
.wr-play-main {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
@media (min-width: 960px) {
  .wr-play-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
  }
}
.wr-cat-sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
.wr-sidebar-title {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.wr-sidebar-legend { margin: 0 0 10px; font-size: 13px; }
.wr-cat-status {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.wr-cat-row {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 2px solid var(--line);
  border-left: 8px solid var(--cc, var(--line));
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}
.wr-cat-row.won {
  border-color: var(--cc);
  background: color-mix(in srgb, var(--cc) 10%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cc) 35%, transparent);
}
.wr-cat-row.progress { border-color: color-mix(in srgb, var(--cc) 55%, var(--line)); }
.wr-cat-row.pop { animation: wr-pop 0.6s ease; }
.wr-cat-row-body { min-width: 0; flex: 1; display: grid; gap: 4px; }
.wr-cat-row-body b { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.wr-cat-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.wr-pips { display: inline-flex; flex-wrap: wrap; gap: 3px; align-items: center; max-width: 100%; }
.wr-pip {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--cc, #8a8f96);
  background: #fff;
}
.wr-pips.n6 .wr-pip { width: 7px; height: 7px; }
.wr-pip.on { background: var(--cc); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cc) 40%, transparent); }
.wr-status-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.5em; padding: 0 6px; border-radius: 999px;
  background: var(--bg, #f4efe4); color: var(--ink); font-weight: 800;
}
.wr-cat-row.won .wr-status-num { background: var(--cc); color: #fff; }
.wr-status-word { font-weight: 800; }
.wr-cat-row.won .wr-status-word { color: var(--pine, #1f7a4d); }
.wr-cat-row.open .wr-status-word { color: var(--muted); }
.wr-cat-row.progress .wr-status-word { color: var(--ink); }
@media (max-width: 959px) {
  .wr-cat-sidebar { order: 2; }
  .wr-play-main { order: 1; }
}

/* Setup hero: title/lede left, crown+shield+sword trio right */
.wr-setup-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}
.wr-setup-hero-text { flex: 1 1 220px; min-width: 0; }
.wr-setup-hero-text .lede { max-width: 36rem; }
@media (max-width: 639px) {
  .wr-setup-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .wr-hero-trio { order: 2; }
  .wr-setup-hero-text { order: 1; }
}

/* Live card-pool counts near subject/difficulty setup */
.wr-pool-counts {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted, #6b6258);
  font-weight: 600;
}
.wr-pool-counts .wr-pool-total { display: block; margin-bottom: 2px; }
.wr-pool-counts .wr-pool-cat { display: block; }
.wr-pool-counts details { margin: 0; }
.wr-pool-counts summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}
.wr-pool-counts summary::-webkit-details-marker { display: none; }
.wr-cat-actions { margin-top: 8px; margin-bottom: 0; }


/* Step 1+2: printable board download + overflow safety */
.wr-board-dl { margin: 10px 0 0; }
a.wr-board-download {
  color: var(--lapis, #1E3A5F);
  font-weight: 800;
  text-decoration: underline;
}
a.wr-board-download:hover { color: #16304f; }
a.wr-board-download.on { background: #e7eef6; border-radius: 8px; padding: 2px 6px; }
.wr-board-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; }
#board-set-note:empty { display: none; }
.wr-profiles { display: grid; gap: 8px; margin: 0 0 12px; }
@media (min-width: 800px) { .wr-profiles { grid-template-columns: 1fr 1fr 1fr; } }
.wr-profile {
  font: inherit; font-weight: 700; text-align: left; cursor: pointer;
  border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink);
  padding: 10px 12px; min-height: 44px; touch-action: manipulation;
}
.wr-profile:hover { border-color: var(--lapis); }
.wr-profile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wr-profile.on { border-color: var(--lapis); box-shadow: inset 0 0 0 1px var(--lapis); }
.wr-profile b { display: block; font-size: 16px; }
.wr-profile small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; margin-top: 3px; }
#wr, #screen-play, .wrap {
  max-width: 100%;
  overflow-x: clip;
}
@media (max-width: 600px) {
  .wr-space { font-size: 10px; min-height: 44px; padding: 3px; }
  .wr-space-lab .wr-ico { width: 12px; height: 12px; }
}

/* Step 3: shared ring path board */
.wr-board-ring-layout { grid-template-columns: 1fr !important; }
.wr-board-path-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-width: 0;
}
.wr-board-track-ring {
  display: block !important;
  overflow: visible !important;
}
.wr-board-path-svg { width: 100%; height: auto; display: block; }
.wr-board-shield-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%);
  width: min(176px, 38%);
  pointer-events: none;
}
.wr-board-shield-center svg { width: 100%; height: auto; }
@media (max-width: 639px) {
  .wr-board-path-wrap { max-width: 100%; }
  .wr-board-shield-center { width: min(138px, 38%); }
}
.wr-board-wrap.printed-mode .wr-board-path-wrap {
  max-width: 100%;
  position: static;
  margin: 0;
}
.wr-board-wrap.printed-mode .wr-board-shield-center { display: none !important; }
.wr-board-wrap.printed-mode .wr-board-track-ring {
  min-height: 0;
  overflow: visible !important;
}
.wr-board-wrap.printed-mode .wr-printed-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--line, #c9c2b4);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted, #6b6258);
}
.wr-printed-pick { margin-top: 12px; }
.wr-inline-check {
  display: flex; gap: 8px; align-items: center;
  margin-top: 10px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.wr-inline-check input { width: 18px; height: 18px; accent-color: var(--lapis); }
.wr-printed-tally { margin-top: 14px; text-align: left; }
.wr-printed-tally-list { margin: 8px 0 0; padding-left: 1.2em; font-weight: 700; }
#board-track-field[hidden] { display: none !important; }

/* Printed mode: player/team picker chips */
.wr-printed-player-picker { margin: 10px 0 8px; }
.wr-player-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wr-player-chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px;
}
.wr-player-chip.active {
  border-color: var(--lapis, #1E3A5F);
  background: color-mix(in srgb, var(--lapis, #1E3A5F) 10%, #fff);
  box-shadow: 0 0 0 2px rgba(30,58,95,0.15);
}
.wr-chip-swatch {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid #fff; box-shadow: 0 0 0 1px #333; flex: none;
}
.wr-chip-swatch.t0 { background: #1E3A5F; }
.wr-chip-swatch.t1 { background: #b5462f; }
.wr-chip-swatch.t2 { background: #1f7a4d; }
.wr-chip-swatch.t3 { background: #7b3fa0; }
.wr-chip-swatch.t4 { background: #c4920a; }
.wr-chip-swatch.t5 { background: #157a8c; }
.wr-chip-swatch.t6 { background: #a33b6b; }
.wr-chip-swatch.t7 { background: #d06a1a; }



/* Hero trio: taller classic v2 shield, extra gaps, no overlap */
.wr-hero-trio {
  position: relative;
  isolation: isolate;
  flex: 0 0 520px;
  width: 520px;
  height: 530px;
  margin: 0;
  overflow: visible;
}
.wr-hero-sword {
  position: absolute;
  left: 12px;
  bottom: 8px;
  width: 148px;
  z-index: 1;
  transform: rotate(-2deg);
  transform-origin: center center;
  opacity: .96;
  filter: drop-shadow(0 6px 10px rgba(21,32,44,.24));
  pointer-events: none;
}
.wr-hero-sword img {
  display: block;
  width: 100%;
  height: auto;
}
.wr-hero-crown {
  position: absolute;
  top: 4px;
  left: 68%;
  width: 168px;
  transform: translateX(-50%);
  z-index: 2;
  filter: drop-shadow(0 3px 6px rgba(21,32,44,.18));
  pointer-events: none;
}
.wr-hero-crown .cc-crown,
.wr-hero-crown .cc-crown-frame,
.wr-hero-crown .cc-crown-img {
  display: block;
  width: 100%;
  height: auto;
}
.wr-hero-shield,
#setup-hero-shield.wr-setup-hero-shield.wr-shield.big {
  position: absolute !important;
  left: 68% !important;
  bottom: 8px !important;
  top: auto !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  z-index: 2;
  /* v5 taller/narrower aspect 457/694; ~400px tall desktop */
  width: 263px !important;
  height: 400px !important;
  margin: 0 !important;
  flex: none !important;
}
.wr-hero-shield svg,
#setup-hero-shield.wr-shield.big svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Classic shield: faceted gem sparkle (respect reduced motion) */
.sc-shield .sc-lit .sc-sparkle {
  transform-box: fill-box;
  transform-origin: center;
  animation: sc-twinkle 2.4s ease-in-out infinite;
}
.sc-shield .sc-lit .sc-sparkle:nth-of-type(2) { animation-delay: 1.1s; }
@keyframes sc-twinkle {
  0%, 100% { opacity: .55; transform: scale(0.85); }
  45% { opacity: 1; transform: scale(1.15); }
  70% { opacity: .7; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .sc-shield .sc-lit .sc-sparkle { animation: none; }
}

/* Classic photo shield fills big/board slots */
.wr-shield.big svg.sc-shield,
.wr-board-shield-center svg.sc-shield {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.wr-board-shield-center {
  width: min(176px, 38%);
}
@media (max-width: 639px) {
  .wr-hero-trio {
    flex: 0 0 auto;
    width: min(360px, 94vw);
    height: 350px;
    margin: 6px auto 0;
  }
  .wr-hero-crown {
    width: 108px;
    top: 2px;
    left: 66%;
  }
  .wr-hero-sword {
    left: 6px;
    bottom: 6px;
    width: 92px;
    transform: rotate(-1deg);
  }
  .wr-hero-shield,
  #setup-hero-shield.wr-setup-hero-shield.wr-shield.big {
    width: 164px !important;
    height: 249px !important;
    left: 66% !important;
    bottom: 6px !important;
  }
  .wr-board-shield-center { width: min(138px, 38%); }
}

.wr-result-crown {
  width: min(300px, 84%);
  margin: 0 auto 22px;
  padding-bottom: 6px;
  filter: drop-shadow(0 4px 10px rgba(21,32,44,.2));
}
.wr-result #result-title {
  margin-top: 14px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.wr-result .wr-row-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.cc-crown { width: 100%; }
.cc-crown-frame { line-height: 0; position: relative; }
.cc-crown-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ===== 2026-10-11 UI pass: crown fit, bigger player shields, celebrations, challenge, sound ===== */

/* Crown: clear-crown.js sets sizing with inline style attributes, which the site CSP
   (style-src 'self') blocks. The PNG then rendered at its natural 981px and was cut off.
   Size it from classes instead, and cap it to the viewport. */
.cc-crown, .cc-crown-frame { display: block; width: 100%; }
.cc-crown-frame { aspect-ratio: 981 / 544; }
.cc-crown picture { display: block; width: 100%; height: 100%; }
.cc-crown-img { display: block; width: 100%; height: auto; max-width: 100%; }
.wr-result-crown {
  /* width capped so height (width * 544/981) stays under ~26% of the viewport */
  width: min(320px, 80vw, 47vh);
  max-width: 100%;
  margin: 0 auto 14px;
  overflow: visible;
}
.wr-result { overflow: hidden; }
.wr-result .wr-shield.big { width: min(132px, 30vw); height: auto; aspect-ratio: 132 / 200; }

/* Player shields: bigger so the gems read */
.wr-score .wr-shield, .wr-stat .wr-shield { width: 60px; height: 90px; }
.wr-scoreboard { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (max-width: 639px) {
  .wr-score .wr-shield, .wr-stat .wr-shield { width: 52px; height: 78px; }
  .wr-scoreboard { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* Gem earned: brief glow on the shield and a pop on the new gem */
.wr-gem-glow { animation: wr-gem-glow 1.4s ease-out 1; }
@keyframes wr-gem-glow {
  0% { filter: drop-shadow(0 0 0 rgba(232,197,71,0)); transform: scale(1); }
  25% { filter: drop-shadow(0 0 14px rgba(232,197,71,.95)); transform: scale(1.08); }
  100% { filter: drop-shadow(0 0 0 rgba(232,197,71,0)); transform: scale(1); }
}
.sc-socket.pop { animation: wr-gem-pop 1s ease-out 1; transform-box: fill-box; transform-origin: center; }
@keyframes wr-gem-pop { 0% { transform: scale(.4); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* Win banner */
.wr-win-banner {
  margin: 4px auto 14px; padding: 12px 18px; max-width: 34ch;
  border-radius: 14px; background: linear-gradient(135deg, #1E3A5F, #2b5a8f);
  color: #fff; font-weight: 800; font-size: clamp(22px, 5.4vw, 34px); line-height: 1.2;
  box-shadow: 0 6px 18px rgba(21,32,44,.25); overflow-wrap: anywhere;
}
.wr-win-banner.show { animation: wr-banner-in .7s cubic-bezier(.2,1.4,.4,1) 1; }
@keyframes wr-banner-in { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* Challenge mode note in feedback */
.wr-challenge-note { display: block; margin-top: 4px; color: #8a4a12; font-weight: 700; }

/* Confetti canvas (fx.js) */
.fx-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9998; }

/* Speaker button and menu (fx.js), fixed lower right */
.fx-sound { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 9999; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.fx-sound-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid #fff;
  background: #1E3A5F; color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 12px rgba(21,32,44,.3);
}
.fx-sound-btn.muted { background: #5b6672; }
.fx-sound-btn:focus-visible { outline: 3px solid #e8c547; outline-offset: 2px; }
.fx-sound-menu {
  background: #fff; color: #15202c; border: 1px solid #d5dde6; border-radius: 12px;
  padding: 10px 14px; min-width: 190px; box-shadow: 0 8px 22px rgba(21,32,44,.22);
}
.fx-sound-menu[hidden] { display: none; }
.fx-sound-title { margin: 0 0 6px; font-weight: 800; }
.fx-sound-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 16px; cursor: pointer; min-height: 44px; }
.fx-sound-row input { width: 22px; height: 22px; accent-color: #1E3A5F; }
.fx-credits-open-btn {
  display: block; margin: 4px 0 2px; padding: 8px 0; min-height: 40px; background: none; border: 0;
  color: #1f6fb2; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer;
}
.fx-credits-open-btn:focus-visible, .wr-linkbtn:focus-visible, .fx-credits-link:focus-visible { outline: 3px solid #e8c547; outline-offset: 2px; }
.wr-linkbtn { background: none; border: 0; padding: 0 2px; margin: 0; color: #1f6fb2; font: inherit; text-decoration: underline; cursor: pointer; }

/* Music credits dialog (fx.js) */
.fx-credits-backdrop {
  position: fixed; inset: 0; z-index: 10000; background: rgba(21,32,44,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.fx-credits-backdrop[hidden] { display: none; }
.fx-credits {
  background: #fff; color: #15202c; border-radius: 14px; width: min(640px, 100%); max-height: min(86vh, 900px);
  overflow-y: auto; padding: 16px 18px 18px; box-shadow: 0 12px 32px rgba(21,32,44,.35);
}
.fx-credits:focus { outline: none; }
.fx-credits-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -16px; background: #fff; padding: 4px 0 8px; }
.fx-credits-title { margin: 0; font-size: 20px; }
.fx-credits-close { margin: 0; }
.fx-credits-intro { margin: 4px 0 10px; font-size: 14px; color: #3b4a5a; }
.fx-credits-list { margin: 0; padding-left: 22px; }
.fx-credits-item { padding: 8px 0; border-top: 1px solid #e3e8ee; font-size: 14px; }
.fx-credits-item p { margin: 2px 0; }
.fx-credits-name { font-weight: 800; font-size: 15px; }
.fx-credits-by { color: #3b4a5a; }
.fx-credits-lic.is-ccby { color: #15202c; }
.fx-credits-link { color: #1f6fb2; overflow-wrap: anywhere; }
body.fx-credits-open { overflow: hidden; }
/* keep the floating button from covering the last buttons on the page */
body { padding-bottom: 72px; }

@media (prefers-reduced-motion: reduce) {
  .wr-gem-glow, .sc-socket.pop, .wr-win-banner.show { animation: none; }
  .wr-gem-glow { filter: drop-shadow(0 0 10px rgba(232,197,71,.9)); }
}

/* Verse reference under the answer (Bible cards with an optional `ref`) */
.wr-feedback .wr-ref { margin: 2px 0 6px; font-size: 14px; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.wr-missed li .wr-ref { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------- Scoring (Simple / Hot Streak), 20261011s ---------- */
.wr-subfield { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.wr-subfield legend { font-weight: 800; padding: 0; margin-bottom: 6px; }
.wr-score-pts { display: block; font-size: 13px; font-weight: 800; color: var(--lapis); }
.wr-streak-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  background: #fde8c8; color: #8a3b00; font-size: 12px; font-weight: 800;
}
.wr-turn-points { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--lapis); }
.wr-points { margin: 4px 0 0; font-weight: 800; font-size: 15px; color: var(--muted); }
.wr-points.up { color: var(--pine); }
.wr-points.down { color: #9b2c2c; }
.wr-stat-detail { flex: 1 1 auto; text-align: right; }
.wr-stat-pts { flex: 0 0 auto; min-width: 72px; text-align: right; font-weight: 800; color: var(--lapis); }
.wr-stat-head { border: 0; background: transparent; padding-top: 0; padding-bottom: 0; font-size: 13px; color: var(--muted); font-weight: 700; }
.wr-stat-head .wr-stat-pts { color: var(--muted); }
@media (max-width: 480px) {
  .wr-stat { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "who pts" "det det"; row-gap: 4px; }
  .wr-stat .who { grid-area: who; justify-content: flex-start; }
  .wr-stat .who .wr-shield { margin: 0; flex: 0 0 auto; }
  .wr-stat .who b { text-align: left; }
  .wr-stat .wr-stat-pts { grid-area: pts; }
  .wr-stat .wr-stat-detail { grid-area: det; text-align: left; font-size: 14px; color: var(--muted); }
  .wr-stat-head { grid-template-areas: "who pts"; }
  .wr-stat-head span:first-child { grid-area: who; }
  .wr-stat-head .wr-stat-detail { display: none; }
}

/* ---------- Dice and tap feedback, 20261011s ---------- */
@keyframes wr-die-press { 0% { transform: scale(1); } 40% { transform: scale(0.92); } 100% { transform: scale(1); } }
@keyframes wr-die-tumble {
  0% { transform: rotate(0deg) translateY(0); } 25% { transform: rotate(-5deg) translateY(-2px); }
  50% { transform: rotate(4deg) translateY(1px); } 75% { transform: rotate(-3deg) translateY(-1px); } 100% { transform: rotate(0deg) translateY(0); }
}
@keyframes wr-die-settle { 0% { transform: scale(1.06); } 60% { transform: scale(0.98); } 100% { transform: scale(1); } }
.wr-die.wr-die-press { animation: wr-die-press 160ms ease-out; box-shadow: 0 0 0 4px rgba(30,58,95,0.18); }
.wr-die.wr-die-tumble { animation: wr-die-tumble 180ms linear infinite; box-shadow: 0 0 0 4px rgba(30,58,95,0.12); }
.wr-die.wr-die-settle { animation: wr-die-settle 260ms ease-out; }

/* Visible pressed state on every tappable control */
.wr-btn, .wr-choice, .wr-pick-btn, .wr-toggle label, .wr-inline-check, .fx-sound-btn, .fx-sound-row, .wr-rules summary {
  transition: transform 90ms ease-out, filter 90ms ease-out, box-shadow 90ms ease-out;
}
.wr-btn:active:not(:disabled), .wr-choice:active:not(:disabled), .wr-pick-btn:active:not(:disabled),
.fx-sound-btn:active, .wr-toggle label:active, .wr-inline-check:active, .fx-sound-row:active, .wr-rules summary:active {
  transform: scale(0.97);
  filter: brightness(0.94);
}
button:active:not(:disabled) { filter: brightness(0.94); }

@media (prefers-reduced-motion: reduce) {
  .wr-die.wr-die-press, .wr-die.wr-die-tumble, .wr-die.wr-die-settle { animation: none; }
  .wr-die.wr-die-press { box-shadow: 0 0 0 4px rgba(30,58,95,0.3); }
  .wr-btn:active:not(:disabled), .wr-choice:active:not(:disabled), .wr-pick-btn:active:not(:disabled),
  .fx-sound-btn:active, .wr-toggle label:active, .wr-inline-check:active, .fx-sound-row:active, .wr-rules summary:active {
    transform: none; filter: brightness(0.9);
  }
}
