* { box-sizing: border-box; }
.print-sheet { border:2px solid #171713; box-shadow:8px 8px 0 #3048d8; }
.print-sheet h2::before { content:""; display:inline-block; width:48px; height:48px; background:url("/weirdprint-mark.svg") center/contain no-repeat; vertical-align:middle; margin-inline-end:12px; }
.print-sheet article { border-top:1px solid #171713; padding-block:1rem; }
textarea { width: 100%; font: inherit; border: 1px solid var(--line); padding: .75rem; border-radius: .5rem; }
details.panel { margin-block-start: 1rem; }
summary { cursor: pointer; font-weight: 750; padding-block: .5rem; }
:root {
  color-scheme: light;
  --paper: #f5efe4; --ink: #171713; --purple: #3048d8; --green: #f2c94c;
  --line: #cbc0d7; --soft: #fdfaf3; --muted: #5e566e;
  font: 17px/1.5 system-ui, Arial, sans-serif; color: var(--ink); background: var(--paper);
}
body { margin: 0; min-height: 100vh; }
body::before {
  position: fixed; content: ""; z-index: -1; inset: 0;
  background: radial-gradient(ellipse at 85% 4%, #e5daf9, transparent 48%);
}
.masthead, main, .connection { width: min(100% - 2rem, 62rem); margin-inline: auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding-block: 1rem; }
.masthead [hidden] { display: none; }
#rules-sheet { width: min(36rem, 92vw); max-height: 80vh; padding: 1.5rem; border: 2px solid var(--purple); border-radius: 1rem; background: var(--soft); color: var(--ink); }
#rules-sheet::backdrop { background: #17171388; }
#rules-sheet form { position: sticky; top: 0; text-align: end; }
.crown-sides { display: grid; gap: .55rem; border: none; padding: 0; }
.crown-sides legend { font-weight: 750; margin-block-end: .5rem; }
.crown-sides label { display: flex; align-items: center; gap: .65rem; border: 2px solid var(--line); padding: .65rem; border-radius: .65rem; cursor: pointer; }
.crown-sides label:has(:checked) { border-color: var(--purple); }
.crown-sides input[type="radio"] { width: 1.2rem; min-height: 1.2rem; flex: none; accent-color: var(--purple); }
.crown-sides small { display: block; font-weight: normal; }
.move { margin-block: 1rem; border-inline-start: .25rem solid var(--purple); padding-inline-start: .9rem; }
.move h3 { margin-block: 0 .3rem; }
.brand { color: var(--ink); font-size: 1.42rem; font-weight: 900; letter-spacing: -.08em; text-decoration: none; direction: ltr; }
.brand span { color: var(--purple); }
main { padding-block: clamp(1rem, 4vw, 3rem); }
body[data-role="play"] main { max-width: 37rem; }
.layout { display: grid; gap: clamp(1rem, 3vw, 2rem); align-items: start; }
.live-picker { margin-block-start: 1.2rem; }
.pool-search { display: grid; gap: .75rem; margin-block: 1rem; }
.pool-search label { min-width: 0; }
.pool-search input, .pool-search select { display: block; }
.pool-card { padding-block: .85rem; border-block-start: 1px solid var(--line); }
.pool-card small { color: var(--muted); }
.pool-card .actions { margin-block: .35rem 0; }
.pool-card summary { overflow-wrap: anywhere; }
.live-picker [data-live-compose] { margin-block: .8rem 1.2rem; }
@media (min-width: 640px) { .pool-search { grid-template-columns: 2fr 1fr; } }
@media (min-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(15rem, .45fr); }
}
.panel { padding: clamp(1.15rem, 3vw, 2rem); background: var(--soft); border: 1px solid var(--line); border-radius: 1.5rem; box-shadow: 0 5px 0 #e4dbe8; }
.hero { background: var(--purple); color: white; overflow: hidden; }
.hero p { max-width: 30ch; font-size: 1.25rem; }
.hero h1 { font-size: clamp(3rem, 10vw, 7rem); line-height: .9; }
h1, h2, p { margin-block: 0 .68em; }
h1, h2 { line-height: 1.12; letter-spacing: -.04em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 2rem); }
[dir="rtl"] h1, [dir="rtl"] h2 { letter-spacing: normal; }
button, .button, input, select { font: inherit; }
button, .button {
  min-height: 46px; padding: .55rem 1rem; border: 1px solid transparent; border-radius: .7rem;
  background: var(--purple); color: white; font-weight: 750; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center;
}
button:hover, .button:hover { filter: brightness(.9); }
button:disabled { opacity: .55; cursor: wait; }
button.quiet, .button.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.hero button { background: var(--green); color: var(--ink); }
.hero .quiet { color: white; border-color: #b9a9ed; background: transparent; }
.player-welcome { margin-block-end: 1rem; }
.player-welcome h1 { font-size: clamp(2.75rem, 12vw, 5.5rem); }
.player-welcome h2 { margin-block-start: .7em; }
.count-choice { display: flex; align-items: center; gap: .8rem; }
.count-choice select { width: min(100%, 12rem); }
.count-choice bdi { font-weight: 750; }
.recovery { margin-block-start: 1rem; }
.recovery p { margin-block: .65rem; }
.recovery-link { margin-block-end: .5rem; }
:focus-visible { outline: 3px solid #9971e0; outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-block: 1rem 0; }
.stack { display: grid; gap: .65rem; }
label { font-weight: 700; }
input:not([type="checkbox"]), select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: .55rem; padding: .45rem .65rem; background: white; color: var(--ink); }
input[type="range"] { accent-color: var(--purple); padding: 0; }
input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--purple); vertical-align: middle; }
.constraints, .connection { color: var(--muted); }
.connection { min-height: 1.5em; margin-block: 0 1rem; }
.chips { list-style: none; margin: .6rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.chips li { background: #ede5fa; border-radius: .55rem; padding: .3rem .65rem; overflow-wrap: anywhere; }
.code { display: block; direction: ltr; text-align: center; font-size: clamp(2rem, 7vw, 3rem); letter-spacing: .16em; font-weight: 850; font-variant-numeric: tabular-nums; }
.qr { display: block; width: 100%; max-width: 21rem; aspect-ratio: 1; margin: .5rem auto; background: white; border-radius: .4rem; }
.join-link { display: block; overflow-wrap: anywhere; color: var(--purple); font-size: .88rem; }
.choice { justify-content: start; background: #eee6fa; color: var(--ink); width: 100%; text-align: start; }
.choice:hover { background: #dfcff5; }
.note { background: var(--green); border-radius: .65rem; padding: .65rem .8rem; font-weight: 650; }
.meta { display: flex; flex-wrap: wrap; justify-content: space-between; color: var(--muted); gap: .5rem; margin-block-end: .7rem; font-weight: 720; }
.reveal-list { display: grid; gap: .76rem; margin-block: 1.2rem; }
.bar-label { display: flex; justify-content: space-between; gap: 1rem; font-weight: 750; }
.track { height: .86rem; border-radius: 99rem; overflow: hidden; background: #eae1f4; }
.bar { height: 100%; background: var(--purple); animation: fill .75s cubic-bezier(.2,.7,.2,1) both; transform-origin: left; }
[dir="rtl"] .bar { transform-origin: right; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.totals, .winner-names { overflow-wrap: anywhere; }
.totals { padding-inline-start: 1.6rem; }
.totals li { margin-block: .35rem; padding: .25rem .4rem; border-bottom: 1px solid var(--line); }
.totals li strong { float: inline-end; margin-inline-start: .5rem; }
.winner { background: var(--green); }
.finale > :only-child { grid-column: 1 / -1; }
.winner-names { font-size: clamp(2.5rem, 7vw, 5.25rem); animation: arrive .7s cubic-bezier(.2,1.4,.5,1) both; }
@keyframes arrive { from { transform: translateY(20px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
audio { width: 100%; }
body[data-role="screen"] { font-size: clamp(1.2rem, 2.4vw, 2rem); }
body[data-role="screen"] main { width: min(95%, 90rem); }
body[data-role="screen"] h1 { font-size: clamp(2.7rem, 7vw, 6rem); }
body[data-role="screen"] .qr { max-width: 28rem; }
body[data-role="screen"] .code { font-size: clamp(2.8rem, 6vw, 5.4rem); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
}
