.quarkle-masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid #eeeeea; text-align: left; }
.game-shell { width: min(calc(100% - 24px), 1180px); margin: 0 auto; padding: clamp(12px, 2.2vw, 24px) 0 24px; }
.game-shell .brand { font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: .9; }
.section-label, .back-link { color: var(--muted); font-size: .7rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.section-label { margin: 18px 0 0; }
.game-shell .back-link { display: inline-block; margin: 0; font-size: .62rem; letter-spacing: .12em; text-decoration: none; }
.back-link:hover, .text-link:hover { text-decoration: underline; }
.quarkle-stage { width: min(100%, 820px); margin: 0 auto; }
.quarkle-card { aspect-ratio: auto; min-height: 0; padding: clamp(32px, 6vw, 64px); }
.quarkle-card::before { inset: 10px; }
.quarkle-card .quisi-card__inner { width: min(100%, 610px); }
.eyebrow { margin: 0 0 9px; color: var(--muted); font-size: .66rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.quarkle-card h1, .quarkle-panel h1, .game-toolbar h1 { margin: 0 0 12px; font-family: var(--question-font); font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 500; line-height: 1.04; letter-spacing: -.035em; }
.quarkle-card .intro { margin-bottom: 32px; color: var(--muted); }
.rules-copy { padding-top: 24px; border-top: 1px solid #deded9; }
.rules-copy h2, .quarkle-panel h2 { margin: 0 0 14px; font-family: var(--question-font); font-size: 1.35rem; font-weight: 500; }
.quarkle-card .rules-copy p { margin: 0 0 13px; font-size: .96rem; line-height: 1.65; }
.quarkle-card .rules-copy .rule-note { margin-top: 18px; color: var(--muted); font-size: .82rem; }
.new-game-form { width: min(100%, 420px); margin-top: 28px; display: grid; gap: 10px; }
.choice-group { min-width: 0; margin: 0 0 15px; padding: 0; border: 0; }
.choice-group legend { margin-bottom: 10px; font-size: .7rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.choice-grid { display: grid; gap: 8px; }
.choice-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card { position: relative; display: flex; min-height: 88px; flex-direction: column; justify-content: center; gap: 6px; padding: 14px; border: 1px solid #deded9; background: #fff; cursor: pointer; font-weight: 400 !important; letter-spacing: 0 !important; text-transform: none !important; transition: border-color 130ms ease, background 130ms ease; }
.choice-card:has(input:checked) { border-color: var(--ink); background: #f5f5f1; box-shadow: inset 0 0 0 1px var(--ink); }
.choice-card:has(input:focus-visible) { outline: 2px solid #686862; outline-offset: 3px; }
.choice-card input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; }
.choice-card__title { font-size: .83rem; font-weight: 600; letter-spacing: .01em; }
.choice-card__detail { color: var(--muted); font-size: .7rem; font-weight: 400; line-height: 1.4; }
.choice-card--compact { min-height: 72px; align-items: center; text-align: center; }
.choice-card--compact .choice-card__detail { margin-top: -4px; font-size: .6rem; text-transform: uppercase; }
.dice-choice { min-height: 105px; }
.dice-choice--unavailable { cursor: not-allowed; opacity: .58; }
.dice-choice__preview { display: flex; justify-content: center; gap: 5px; width: 100%; color: var(--ink); font-size: 1.4rem; }
.dice-choice__preview img { width: 28px; height: 28px; object-fit: contain; }
.dice-choice__swatch { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #deded9; border-radius: 7px; font-size: 1.35rem; line-height: 1; }
.dice-choice__swatch--white { background: #fff; color: #222; }
.dice-choice__swatch--black { border-color: #292929; background: #292929; color: #fff; }
.rules-disclosure { margin-top: 28px; padding-top: 18px; border-top: 1px solid #deded9; }
.rules-disclosure summary { cursor: pointer; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.rules-disclosure .rules-copy { margin-top: 16px; padding-top: 0; border-top: 0; }
.score-chart-wrap { overflow-x: auto; margin-top: 18px; }
.score-chart { width: 100%; border-collapse: collapse; font-size: .8rem; line-height: 1.45; }
.score-chart caption { margin-bottom: 8px; text-align: left; font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.score-chart tr { border-top: 1px solid #e8e8e3; }
.score-chart th, .score-chart td { padding: 10px 8px; text-align: left; vertical-align: top; }
.score-chart th { width: 45%; font-weight: 500; }
.score-chart td { color: var(--muted); }
.score-chart td span { font-size: .72rem; }
.new-game-form label, .share-box label { font-size: .7rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.new-game-form input, .share-row input { min-width: 0; width: 100%; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; outline: 0; background: transparent; color: var(--ink); padding: 12px 2px; font: 400 1rem var(--body-font); }
.button { min-height: 46px; border: 1px solid var(--ink); border-radius: 0; padding: 13px 18px; font: 600 .68rem/1 var(--body-font); letter-spacing: .13em; text-transform: uppercase; cursor: pointer; transition: background 130ms ease, color 130ms ease; }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button--primary { margin-top: 9px; background: var(--ink); color: white; }
.button--primary:hover:not(:disabled) { background: #383838; }
.button--secondary { background: transparent; color: var(--ink); }
.button--secondary:hover:not(:disabled) { background: #f2f2ef; }
.form-error { margin: 3px 0 0; color: #7d2525; font-size: .85rem; }
.quarkle-panel { padding: clamp(24px, 5vw, 42px); border: 1px solid #deded9; background: var(--paper); }
.quarkle-panel > p { color: var(--muted); line-height: 1.55; }
.quarkle-panel .new-game-form { margin-top: 24px; }
.quiet { color: var(--muted); }
.share-row { display: flex; align-items: end; gap: 14px; }
.share-row .button { flex: 0 0 auto; }
.game-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 20px; margin: 0 0 10px; }
.game-toolbar h1 { margin: 0; font-size: clamp(2.1rem, 6vw, 3.5rem); }
.game-toolbar .button { min-height: 38px; margin: 0; padding: 10px 13px; font-size: .62rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.share-box { margin: -8px 0 20px; padding: 20px; border: 1px solid #deded9; }
.game-notice { min-height: 25px; margin: 0 0 16px; color: var(--muted); font-size: .82rem; }
.game-layout { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.6fr); gap: 18px; align-items: start; }
.scoreboard, .table-panel { padding: clamp(20px, 4vw, 30px); }
.score-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.status-pill { padding: 7px 9px; border: 1px solid #deded9; color: var(--muted); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.scores { display: grid; gap: 8px; }
.score-row { display: flex; justify-content: space-between; gap: 12px; padding: 13px 12px; border: 1px solid transparent; background: #f7f7f4; font-size: .9rem; }
.score-row.active { border-color: #8c8c87; }
.score-row.final { border-color: var(--ink); }
.target-note { margin: 18px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.table-panel > h2 { margin: 0 0 14px; font-size: 1.6rem; }
.turn-title { font-family: var(--question-font); font-weight: 500; }
.game-instructions { margin: 12px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.turn-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.turn-stats div { padding: 12px; border: 1px solid #e6e6e2; }
.turn-stats span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; }
.turn-stats strong { font-family: var(--question-font); font-size: 1.25rem; font-weight: 500; }
.dice { display: grid; grid-template-columns: repeat(3, minmax(45px, 1fr)); gap: 10px; margin: 23px 0; }
.die { display: grid; aspect-ratio: 1; place-items: center; border: 1px solid #deded9; background: #fbfbf8; color: var(--ink); font-size: clamp(2rem, 7vw, 3.1rem); line-height: 1; }
.die img { width: 80%; height: 80%; object-fit: contain; }
.dice--celebrating .die:not(.empty) { animation: quarkle-hot-dice 620ms ease-in-out both; }
.dice--celebrating .die:nth-child(2) { animation-delay: 45ms; }
.dice--celebrating .die:nth-child(3) { animation-delay: 90ms; }
.dice--celebrating .die:nth-child(4) { animation-delay: 135ms; }
.dice--celebrating .die:nth-child(5) { animation-delay: 180ms; }
.dice--celebrating .die:nth-child(6) { animation-delay: 225ms; }
.dice--demo-roll .die:not(.empty) { animation: quarkle-demo-roll 900ms cubic-bezier(.22,.8,.32,1) both; }
.dice--demo-roll .die:nth-child(2) { animation-delay: 70ms; }
.dice--demo-roll .die:nth-child(3) { animation-delay: 140ms; }
.dice--demo-roll .die:nth-child(4) { animation-delay: 210ms; }
.dice--demo-roll .die:nth-child(5) { animation-delay: 280ms; }
.dice--demo-roll .die:nth-child(6) { animation-delay: 350ms; }
@keyframes quarkle-hot-dice {
    0%, 100% { transform: translateY(-3px); }
    45% { transform: translateY(-15px); }
    70% { transform: translateY(-1px); }
}
@keyframes quarkle-demo-roll {
    0% { opacity: 0; transform: translateY(-18px) rotate(-4deg) scale(.92); }
    42% { opacity: 1; transform: translateY(4px) rotate(2deg) scale(1.02); }
    68% { transform: translateY(-14px) rotate(-1deg) scale(1); }
    84% { transform: translateY(1px); }
    100% { transform: translateY(-3px); }
}
.die.selectable { cursor: pointer; }
.die.selected { border: 2px solid var(--ink); transform: translateY(-3px); }
.die.kept { border-color: transparent; background: var(--ink); color: white; }
.die.empty { border-style: dashed; color: #c7c7c1; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions[hidden] { display: none; }
.actions .button { flex: 1 1 150px; padding-inline: 12px; }
.end-turn-control { display: flex; align-items: start; flex-direction: column; gap: 4px; margin-top: 8px; }
.end-turn-control[hidden], .end-turn-control .button[hidden] { display: none; }
.end-turn-control .button { min-width: 155px; }
.turn-countdown { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.turn-message { min-height: 24px; margin: 18px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.text-link { display: inline-block; margin-top: 10px; }
.footer__link { color: inherit; text-decoration: none; }
.footer__link:hover { color: var(--ink); }
.game-shell > .footer { margin-top: 52px; }
@media (max-width: 650px) {
    .game-shell { width: min(calc(100% - 20px), 1180px); padding-top: 10px; }
    .quarkle-masthead { margin-bottom: 12px; padding-bottom: 8px; }
    .game-shell .brand { font-size: 1.55rem; }
    .game-shell .back-link { font-size: .58rem; }
    .quarkle-card { padding: 34px; }
    .quarkle-card::before { inset: 8px; }
    .quarkle-card .rules-copy p { font-size: .9rem; }
    .choice-card { padding: 11px; }
    .choice-card__title { font-size: .75rem; }
    .choice-card__detail { font-size: .64rem; }
    .game-layout { grid-template-columns: 1fr; }
    .game-layout .table-panel { order: 0; }
    .game-layout .scoreboard { order: 1; }
    .scoreboard, .table-panel { padding: 14px; }
    .game-toolbar { margin-bottom: 6px; }
    .game-notice { min-height: 0; margin-bottom: 8px; font-size: .75rem; }
    .table-panel > h2 { margin-bottom: 11px; font-size: 1.35rem; }
    .turn-stats { gap: 6px; }
    .game-instructions { margin-top: 10px; font-size: .75rem; }
    .dice { grid-template-columns: repeat(3, minmax(0, clamp(66px, 22vw, 92px))); justify-content: center; gap: 8px; margin: 14px 0; }
    .die { width: 100%; }
    .turn-message { margin-top: 10px; }
    .game-shell > .footer { margin-top: 24px; }
    .share-row { align-items: stretch; flex-direction: column; gap: 8px; }
    .share-row .button { align-self: start; }
    .turn-stats div { padding: 10px 8px; }
    .turn-stats strong { font-size: 1.05rem; }
}
