:root {
  color-scheme: dark;
  --ad-reserved-space: 0px;
  --bg: #0c1020;
  --surface: #171c31;
  --surface-2: #202640;
  --line: #343b59;
  --text: #f7f3ea;
  --muted: #aeb5cc;
  --accent: #f2b45e;
  --accent-ink: #291c0a;
  --danger: #e78b91;
  --radius: 20px;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", system-ui, sans-serif;
}
/* Chinchiro: tumbling cubes plus the original 2D animation for comparison. */
.card.chinchiro-setup { animation: none; }
.chinchiro-setup h2 { font-size: 1.6rem; margin: 0 0 18px; }
.chinchiro-choice { display: flex; gap: 8px; }
.chinchiro-choice button { flex: 1; min-width: 0; padding: 10px 6px; }
.chinchiro-throws { min-width: 0; padding: 0; margin: 20px 0; border: 0; }
.chinchiro-throws legend { margin-bottom: 10px; font-weight: 800; }
.card.chinchiro-game { padding: 16px; padding-bottom: 22px; animation: none; }
body:has(.chinchiro-controls) #app { padding-bottom: calc(114px + var(--ad-reserved-space) + env(safe-area-inset-bottom)); }
.chinchiro-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chinchiro-heading h2 { margin: 0; font-size: 1.5rem; }
.chinchiro-heading button { min-height: 44px; padding: 8px 12px; border-radius: 12px; white-space: nowrap; }
.chinchiro-progress { text-align: center; color: var(--muted); font-size: 1.1rem; margin: 12px 0 0; }
.chinchiro-progress strong { color: var(--text); font-size: 1.4rem; }
.chinchiro-stage { position: relative; isolation: isolate; width: min(100%, 360px); height: 230px; margin: 0 auto; }
.chinchiro-bowl { position: absolute; left: 5%; right: 5%; top: 78px; height: 145px; border-radius: 50%; background: linear-gradient(160deg, #d59751, #654028 68%, #311f19); box-shadow: 0 14px 18px #0006, inset 0 -9px 2px #351f19; border-top: 3px solid #f5c78c; }
.bowl-inner { position: absolute; inset: 5px 5px 25px; border-radius: 50%; background: radial-gradient(ellipse at 50% 62%, #a87047, #68432c 67%, #392718); box-shadow: inset 0 10px 14px #0007, 0 2px 0 #f0be7980; }
.bowl-shine { position: absolute; inset: 16px 20px 37px; border: 1px solid #f9ca7540; border-radius: 50%; }
.chinchiro-dice { position: absolute; inset: 0; pointer-events: none; }
.chinchiro-die { position: absolute; width: 49px; height: 49px; top: 122px; left: calc(50% - 24px); border-radius: 11px; background: #bbb3a5; box-shadow: 3px 6px 0 #bfb3a0, 5px 9px 11px #0008; }
.die-0 { left: calc(50% - 86px); top: 120px; rotate: -12deg; }
.die-1 { left: calc(50% - 24px); top: 144px; rotate: 9deg; }
.die-2 { left: calc(50% + 38px); top: 119px; rotate: 19deg; }
.die-face { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px; height: 100%; padding: 9px; border-radius: 10px; background: linear-gradient(135deg, #fffdf6, #ded8ca); border: 1px solid #fffaf0; }
.die-pip { display: block; border-radius: 50%; }
.die-pip.is-pip { background: #262331; box-shadow: inset 1px 1px 1px #0006; }
.die-one .is-pip { background: #b73247; scale: 1.2; }
.chinchiro-stage[data-rolling="true"] .die-face { visibility: hidden; }
.chinchiro-celebration { position: absolute; inset: 25px 0 0; display: grid; place-items: center; pointer-events: none; color: #ffe5a1; font-size: 150px; opacity: 0; text-shadow: 0 0 30px #ffbf48; }
.chinchiro-stage.pinzoro-burst { background: radial-gradient(ellipse, #ffcf5a30, transparent 65%); }
.chinchiro-stage.is-shonben .die-0 { left: calc(50% + 50px); top: 164px; rotate: 32deg; }
.chinchiro-stage.is-shonben[data-rolling="true"] .die-0 { left: calc(50% - 24px); top: 122px; }
.chinchiro-outcome { min-height: 38px; margin: 5px 0 18px; text-align: center; font-size: 1.55rem; font-weight: 900; }
.chinchiro-outcome.is-pinzoro { color: #ffe096; text-shadow: 0 0 20px #ffbf4860; }
.chinchiro-affected, .chinchiro-rankings { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.chinchiro-game h3 { font-size: 1rem; margin: 0 0 12px; }
.chinchiro-affected ul, .chinchiro-rankings ol, .chinchiro-assignment-list { list-style: none; padding: 0; margin: 0; }
.chinchiro-affected li { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: 44px; padding: 8px 0; border-bottom: 1px solid #343b5950; }
.chinchiro-affected li strong { min-width: 0; overflow-wrap: anywhere; }
.chinchiro-affected li > span { text-align: right; flex-shrink: 0; max-width: 64%; color: var(--accent); }
.chinchiro-affected small { display: block; font-size: .72rem; color: var(--muted); }
.chinchiro-rankings li { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 44px; padding: 8px 6px; border-radius: 8px; }
.chinchiro-rankings li:nth-child(odd) { background: var(--surface-2); }
.chinchiro-rankings li > span { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.chinchiro-rankings strong { min-width: 0; overflow-wrap: anywhere; }
.chinchiro-rankings b { white-space: nowrap; color: var(--accent); }
.chinchiro-home { min-height: 44px; margin-top: 14px; }
.chinchiro-end-actions { margin-top: 24px; }
.chinchiro-final-title { margin-top: 18px !important; scroll-margin-top: 16px; font-size: 1.35rem !important; }
.chinchiro-controls { position: fixed; z-index: 35; bottom: calc(12px + var(--ad-reserved-space) + env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; display: flex; gap: 10px; width: min(calc(100% - 24px), 688px); padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: #171c31f5; box-shadow: 0 6px 22px #0008; }
.chinchiro-roll { flex: 1; min-width: 0; min-height: 52px; touch-action: manipulation; }
.chinchiro-role-button { flex: 0 0 54px; padding: 8px; min-height: 52px; touch-action: manipulation; }
.chinchiro-sheet { position: fixed; inset: auto 0 0; margin: 0 auto; width: min(100%,720px); max-width: 100%; max-height: min(80dvh, 720px); padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; color: var(--text); background: var(--surface); overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 -10px 50px #0006; }
.chinchiro-sheet::backdrop { background: #04060eaa; }
.chinchiro-sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--muted); margin: 0 auto 20px; }
.chinchiro-sheet-heading { position: sticky; z-index: 1; top: -18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; margin-bottom: 12px; background: var(--surface); }
.chinchiro-sheet-close { flex-shrink: 0; width: 44px; height: 44px; }
.chinchiro-sheet h3 { margin: 0; font-size: 1.1rem; }
.chinchiro-assignment-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chinchiro-assignment-list strong { min-width: 0; overflow-wrap: anywhere; }
.chinchiro-assignment-list span { white-space: nowrap; color: var(--accent); font-size: .9rem; }
.chinchiro-rules details { border-bottom: 1px solid var(--line); }
.chinchiro-rules summary { cursor: pointer; min-height: 48px; padding: 14px 0; font-weight: 800; }
.chinchiro-rules p { line-height: 1.7; font-size: .9rem; overflow-wrap: anywhere; }
/* Keep approved English hand names readable without shortening them. */
html[lang="en"] .chinchiro-assignment-list li { grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr); gap: 12px; }
html[lang="en"] .chinchiro-assignment-list span { white-space: normal; overflow-wrap: anywhere; text-align: right; }
html[lang="en"] .chinchiro-heading h2 { min-width: 0; overflow-wrap: anywhere; }
html[lang="en"] .chinchiro-heading button { flex-shrink: 0; }
html[lang="en"] .chinchiro-outcome { font-size: clamp(1.15rem, 5.5vw, 1.55rem); overflow-wrap: anywhere; }
html[lang="en"] .chinchiro-game .primary, html[lang="en"] .chinchiro-game .secondary,
html[lang="en"] .chinchiro-setup button, html[lang="en"] .chinchiro-controls button { white-space: normal; overflow-wrap: anywhere; }
html[lang="en"] .chinchiro-sheet-heading h3 { min-width: 0; overflow-wrap: anywhere; }
html[lang="en"] .chinchiro-affected li > span { min-width: 0; overflow-wrap: anywhere; }
html[lang="en"] .chinchiro-rules summary { overflow-wrap: anywhere; }
@media (max-width: 359px) {
  .chinchiro-heading h2 { font-size: 1.3rem; }
  .chinchiro-stage { height: 215px; }
  .chinchiro-bowl { height: 135px; }
  .chinchiro-choice button { font-size: .87rem; }
  .chinchiro-affected small { font-size: .68rem; }
}
* { box-sizing: border-box; }
html { scroll-padding-bottom: calc(20px + var(--ad-reserved-space) + env(safe-area-inset-bottom)); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 5%, rgba(138, 49, 80, .28), transparent 36rem),
    radial-gradient(circle at 5% 35%, rgba(53, 79, 121, .25), transparent 32rem),
    var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(242, 180, 94, .65); outline-offset: 2px; }
#app { min-height: 100vh; padding: 20px 16px calc(30px + var(--ad-reserved-space) + env(safe-area-inset-bottom)); }
.shell { width: min(100%, 720px); margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 12px; margin: 4px 0; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 900; transform: rotate(3deg); }
.brand h1 { margin: 0; font-size: clamp(1.45rem, 6vw, 2.15rem); letter-spacing: .02em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: .875rem; }
.card { border: 1px solid var(--line); background: rgba(23, 28, 49, .94); border-radius: var(--radius); padding: clamp(18px, 5vw, 30px); box-shadow: 0 24px 70px rgba(0,0,0,.24); }
.eyebrow { color: var(--accent); font-weight: 800; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
h2 { margin: 8px 0 10px; font-size: clamp(1.5rem, 7vw, 2.35rem); line-height: 1.22; }
.lead { margin: 0 0 24px; color: var(--muted); line-height: 1.7; }
.landing-intro { margin-bottom: 18px; padding: 0 2px; }
.landing-intro h2 { margin: 0 0 6px; font-size: clamp(1.05rem, 4vw, 1.35rem); line-height: 1.45; }
.landing-intro p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.65; }
.landing-links { display: flex; flex-wrap: wrap; column-gap: 18px; }
.landing-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: .875rem; text-underline-offset: 3px; }
.count-container { container-type: inline-size; }
.count-picker { display: grid; grid-template-columns: 56px 56px minmax(64px, 1fr) 56px 56px; grid-template-areas: "down-five down value up up-five"; align-items: center; gap: 8px; margin: 18px 0 26px; }
.count-picker [data-action="count-down-five"] { grid-area: down-five; }
.count-picker [data-action="count-down"] { grid-area: down; }
.count-picker .count-value { grid-area: value; }
.count-picker [data-action="count-up"] { grid-area: up; }
.count-picker [data-action="count-up-five"] { grid-area: up-five; }
/* 4 × 56px buttons + 64px count + 4 × 8px gaps = 320px. */
@container (width < 320px) {
  .count-picker { grid-template-columns: 56px minmax(64px, 1fr) 56px; grid-template-areas: "down value up" "down-five . up-five"; gap: 12px; }
}
.count-button { height: 54px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); color: var(--text); font-size: 1.45rem; font-weight: 800; }
.count-value { text-align: center; }
.count-value strong { display: block; font-size: 2.5rem; line-height: 1; }
.count-value span { color: var(--muted); font-size: .85rem; }
.card.amida-card { min-width: 0; animation: none; }
.amida-animation { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.amida-animation select { background: var(--surface-2); color: var(--text); padding: 10px; border-radius: 10px; }
.amida-inputs { container-type: inline-size; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 12px 0; min-width: 0; }
.amida-inputs label { display: grid; gap: 4px; margin: 0; }
.amida-input-row { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.amida-row-heading { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-bottom: 6px; }
.amida-fixed { color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: .7rem; }
.amida-row-heading .secondary { margin-left: auto; min-height: 44px; padding: 6px 12px; border-radius: 10px; }
.amida-fields { display: grid; gap: 8px; }
.amida-name { width: 100%; max-width: 360px; min-width: 0; }
.amida-field-error:empty { display: none; }
.amida-quantity { display: grid; align-content: start; gap: 4px; }
.amida-stepper { display: grid; grid-template-columns: 44px 48px 44px; align-items: center; gap: 4px; }
.amida-stepper button { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 1.25rem; font-weight: 800; touch-action: manipulation; }
.amida-stepper output { text-align: center; font-size: 1.1rem; font-weight: 800; }
@container (min-width: 520px) {
  .amida-fields { grid-template-columns: minmax(0, 360px) 144px; gap: 16px; }
}
.amida-total { font-weight: 800; font-size: 1.15rem; }
.amida-inputs input { min-width: 0; width: 100%; min-height: 44px; padding: 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font-size: 16px; }
.amida-inputs input[aria-invalid="true"] { border: 2px solid #f39ba6; }
.amida-field-error, .amida-error { color: #ffb6bd; }
.amida-scroll { overflow-x: auto; max-width: 100%; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 16px; }
.amida-result-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.amida-result-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 52px; text-align: left; }
.amida-result-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.amida-result-card strong { flex-shrink: 0; }
.amida-input-row[hidden] { display: none; }
.amida-view-picker { flex-wrap: wrap; }
.amida-view-picker button { min-width: 0; white-space: normal; }
.amida-editor { max-width: calc(100vw - 24px); }
.amida-editor .amida-fields { display: flex; flex-direction: column; align-items: stretch; }
.amida-editor .amida-name { max-width: none; min-width: 0; }
.amida-editor input { width: 100%; min-width: 0; font-size: 16px; }
.amida-seat-transfer { margin-bottom: 12px; white-space: normal; }
.seat-confirm p { overflow-wrap: anywhere; line-height: 1.7; }
.amida-diagram { --amida-fit: 0; display: grid; width: 100%; grid-template-columns: var(--amida-label-width) minmax(var(--amida-track-min-width), 1fr) var(--amida-label-width); min-width: calc(var(--amida-track-min-width) + 2 * var(--amida-label-width)); }
.amida-endpoints { display: grid; min-width: 0; grid-auto-rows: var(--amida-lane-height); }
.amida-endpoints > span, .amida-person { display: flex; align-items: center; justify-content: center; padding: 3px; text-align: center; overflow: hidden; overflow-wrap: anywhere; font-size: .75rem; line-height: 1.2; border-left: 3px solid var(--line); }
.amida-person { border: 0; border-left: 3px solid var(--line); background: transparent; color: var(--text); min-width: 0; width: 100%; min-height: 44px; border-radius: 4px; }
.amida-person:disabled { opacity: 1; cursor: default; }
.amida-person[aria-pressed="true"], .amida-outcomes .is-selected { background: #f2b45e30; box-shadow: inset 0 0 0 2px var(--accent); }
.amida-endpoints b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 2.4em; width: 100%; font-weight: inherit; }
.amida-track { display: block; width: 100%; max-width: 100%; min-width: 0; }
@media (max-width: 600px), (pointer: coarse), (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  .amida-scroll { width: 100%; min-width: 0; overflow: visible; }
  .amida-diagram { --amida-fit: 1; grid-template-columns: 52px minmax(0, 1fr) 44px; width: 100%; max-width: 100%; min-width: 0; }
  .amida-endpoints span, .amida-endpoints b { min-width: 0; max-width: 100%; }
}
.amida-lane, .amida-bridge { stroke: #71809f; stroke-width: 2; }
.amida-route { fill: none; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.amida-route[hidden], .amida-results[hidden], .amida-error[hidden] { display: none; }
.amida-results { margin: 24px 0; }
.amida-selected-status { position: sticky; top: 8px; z-index: 2; padding: 8px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; overflow-wrap: anywhere; }
.amida-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.amida-result { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 2px; width: 100%; min-width: 0; min-height: 60px; text-align: left; padding: 6px 8px; margin: 0; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; font-size: .8rem; }
.amida-result > span { display: flex; align-items: center; gap: 4px; }
.amida-result-name, .amida-result strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.amida-result .participant-chip { flex-shrink: 0; }
.amida-result[aria-pressed="true"] { border-color: var(--accent); background: #f2b45e20; }
@media (min-width: 768px) { .amida-result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hub-members summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; cursor: pointer; list-style: none; font-size: .85rem; }
.hub-members summary::-webkit-details-marker { display: none; }
.hub-members summary strong { min-width: 0; overflow-wrap: anywhere; }
.hub-members summary:focus-visible { outline: 2px solid var(--accent); }
.hub-members .members-hide, .hub-members[open] .members-show { display: none; }
.hub-members[open] .members-hide { display: inline; }
.hub-members { overflow-anchor: none; }
.seat-assignment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.seat-assignment { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 8px; background: var(--surface); border-radius: 10px; }
.seat-assignment strong { flex-shrink: 0; }
@media (max-width: 767px) {
  .amida-start-button { position: fixed; z-index: 35; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(80px, var(--ad-reserved-space)) + 16px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); min-height: 48px; border-radius: 12px; box-shadow: 0 4px 20px #0008; }
  .amida-card:has(.amida-editor[open]) .amida-start-button, .amida-card:has(input:focus) .amida-start-button { visibility: hidden; }
  .amida-card { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
}
.amida-result > * { min-width: 0; overflow-wrap: anywhere; flex: 1; }
.amida-result strong { text-align: right; }
.amida-result .participant-chip { display: inline-grid; width: 28px; height: 28px; font-size: .8rem; }
.amida-result:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.participants { display: grid; gap: 10px; margin: 0 0 22px; }
.participant-row { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; }
.participant-chip { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #11162a; font-size: .9rem; font-weight: 900; border: 2px solid rgba(255,255,255,.55); }
.participant-row input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; background: #11162a; color: var(--text); padding: 11px 14px; font-size: 1rem; }
.participant-row input::placeholder { color: #7f87a2; }
.actions { display: grid; gap: 10px; }
.primary, .secondary { min-height: 54px; border-radius: 16px; padding: 12px 16px; font-weight: 850; border: 1px solid transparent; }
.primary { background: var(--accent); color: var(--accent-ink); }
.secondary { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.wide { width: 100%; }
.danger-button { min-height: 54px; border: 1px solid #a8505b; border-radius: 16px; padding: 12px 16px; color: #fff; background: #8f3b48; font-weight: 850; }
.text-button, .icon-button, .link-button { border: 0; color: var(--text); background: transparent; font-weight: 750; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 1.3rem; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.notice { margin: -8px 0 18px; border: 1px solid #78623e; border-radius: 14px; padding: 12px 14px; background: #342a1d; color: #ffe4ae; line-height: 1.5; }
.summary-strip { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 22px 0; padding: 16px; border-radius: 14px; background: var(--surface-2); }
.summary-strip span { color: var(--muted); }
.hero-panel { padding: 10px 2px 24px; }
.hero-panel h2 { margin-bottom: 18px; }
.member-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.person-badge { display: inline-flex; align-items: center; min-width: 0; gap: 10px; }
.person-badge .participant-chip { flex: 0 0 auto; }
.person-badge > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.person-badge strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .96rem; }
.person-badge small { color: var(--muted); font-size: .72rem; margin-top: 1px; }
.person-badge.compact .participant-chip { width: 34px; height: 34px; font-size: .78rem; }
.feature-grid { display: grid; gap: 12px; }
.game-participant-count { display: grid; gap: 4px; margin: 12px 0; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.game-participant-count span { color: var(--muted); font-size: .85em; }
.feature-card { display: grid; grid-template-columns: 58px 1fr; gap: 14px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(23, 28, 49, .93); }
.feature-card button { grid-column: 1 / -1; width: 100%; }
.feature-card h3 { margin: 3px 0 4px; font-size: 1.25rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.feature-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: #7b2d4a; color: #fff5eb; font-size: 1.65rem; font-weight: 900; }
.seat-icon { background: #385a6c; }
.bill-icon { background: #6d5936; }
.poker-feature { border-color: #5d3b4c; background: linear-gradient(135deg, rgba(49, 29, 50, .95), rgba(23, 28, 49, .95)); }
.manage-list { display: grid; gap: 12px; margin: 18px 0; }
.manage-person { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #11162a; }
.manage-person > input { min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); color: var(--text); }
.toggle-row { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: .9rem; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.helper { color: var(--muted); font-size: .85rem; line-height: 1.5; text-align: center; }
.game-header, .result-heading { margin: 10px 2px 22px; }
.game-header h2, .result-heading h2 { margin-bottom: 8px; }
.game-header p, .result-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.board-panel { padding: 18px 12px; border: 1px solid #4d4054; border-radius: 22px; background: linear-gradient(135deg, #47263a, #242039); box-shadow: inset 0 0 40px rgba(0,0,0,.18); }
.board-label { display: flex; justify-content: space-between; margin: 0 4px 12px; color: #e9d1da; font-size: .85rem; }
.board-cards, .card-pair { display: flex; justify-content: center; gap: 6px; }
.playing-card { display: inline-grid; grid-template-rows: auto 1fr; align-items: start; width: clamp(48px, 15vw, 74px); aspect-ratio: .69; padding: 7px; border-radius: 10px; background: #fbf9f2; color: #161a28; box-shadow: 0 6px 18px rgba(0,0,0,.23); font-weight: 900; }
.playing-card b { font-size: .9rem; }
.playing-card span { place-self: center; font-size: clamp(1rem, 5vw, 1.55rem); }
.red-card { color: #b72d3f; }
.hidden-card { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #283452, #283452 5px, #344264 5px, #344264 10px); color: #9cabc9; border: 2px solid #7b88a6; }
.hands-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 20px; }
.hand-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.hand-card .person-badge { max-width: 100%; }
.current-hand-name { text-align: center; font-size: .9rem; color: var(--accent); font-weight: 750; }
.hand-card .playing-card { width: min(42%, 58px); }
.sticky-action { position: sticky; bottom: calc(12px + var(--ad-reserved-space) + env(safe-area-inset-bottom)); z-index: 10; padding-top: 8px; }
.sticky-action .primary { box-shadow: 0 12px 36px rgba(0,0,0,.45); }
.ranking-list, .payment-list, .bill-list { display: grid; gap: 9px; margin: 0 0 18px; }
.ranking-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 6px 10px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.ranking-row.rank-1 { border-color: #a97939; background: linear-gradient(90deg, rgba(113, 72, 26, .55), var(--surface)); }
.rank-number { grid-row: span 3; color: var(--accent); font-size: 1.6rem; text-align: center; }
.result-hand { grid-column: 2; display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.result-hand-label { font-size: .75rem; color: var(--muted); }
.result-hand .playing-card { width: 42px; padding: 5px; border-radius: 7px; }
.result-hand .playing-card span { font-size: 1.15rem; }
.rank-number small { font-size: .7rem; margin-left: 1px; }
.hand-name { grid-column: 2; color: var(--muted); font-size: .88rem; }
.hand-name small { display: block; color: #e4b3bd; margin-top: 3px; }
.button-stack { display: grid; gap: 10px; }
.table-wrap { padding: 20px 8px; overflow-x: auto; }
.swipe-hint { margin: -10px 2px 2px; color: var(--muted); font-size: .78rem; }
.seat-row { display: flex; justify-content: space-around; gap: 8px; min-width: 540px; }
.seat-node { display: grid; justify-items: center; gap: 6px; width: 96px; min-height: 86px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.seat-node .person-badge { flex-direction: column; gap: 3px; }
.seat-node .person-badge > span:last-child { max-width: 78px; }
.seat-number { color: var(--accent); font-size: .78rem; font-weight: 850; }
.long-table { display: grid; place-items: center; min-width: 540px; height: 112px; margin: 10px 0; border: 2px solid #705237; border-radius: 56px; background: linear-gradient(90deg, #513721, #6c4c2f 50%, #513721); box-shadow: inset 0 0 0 7px rgba(255,255,255,.04), 0 14px 28px rgba(0,0,0,.3); }
.long-table span { color: rgba(255,255,255,.3); font-weight: 900; letter-spacing: .4em; }
.compact-card { margin-bottom: 12px; padding: 18px; box-shadow: none; }
.field-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .85rem; font-weight: 750; }
.money-input { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; border-bottom: 2px solid var(--line); }
.money-input span { color: var(--accent); font-size: 1.5rem; font-weight: 900; }
.money-input input { min-width: 0; width: 100%; border: 0; background: transparent; color: var(--text); padding: 8px 0; font-size: clamp(1.8rem, 9vw, 3rem); font-weight: 900; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.section-heading h3 { margin: 3px 0 0; }
.target-grid, .bulk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.target-row, .bulk-person { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #11162a; }
.target-row input, .bulk-person input { position: absolute; opacity: 0; pointer-events: none; }
.target-row.selected, .bulk-person.selected { border-color: #b88a4e; background: #30291f; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 0 10px; padding: 4px; border-radius: 16px; background: #11162a; }
.segmented button { min-height: 48px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 800; }
.segmented button.active { background: var(--surface-2); color: var(--text); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.bulk-trigger { margin-bottom: 10px; }
.bulk-panel { margin-bottom: 12px; padding: 16px; border: 1px solid #6d5a3c; border-radius: 18px; background: #28231f; }
.percent-slider { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; }
.percent-slider input { accent-color: var(--accent); width: 100%; min-width: 0; height: 44px; margin: 0; touch-action: pan-y; }
.percent-steps { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.percent-steps output { min-width: 4ch; text-align: center; font-size: 1.25rem; font-weight: 800; }
.percent-slider strong { min-width: 56px; font-size: 1.25rem; text-align: right; }
.bulk-preview { color: #d7c9b6; font-size: .84rem; line-height: 1.6; }
.bill-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.percent-input { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.percent-input input { width: 72px; min-height: 42px; border: 1px solid var(--line); border-radius: 11px; background: #11162a; color: var(--text); padding: 7px; text-align: right; font-weight: 800; }
.money { grid-column: 2; color: var(--accent); white-space: nowrap; }
.calculation-status { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 14px; border: 1px solid #556348; border-radius: 15px; background: #263023; }
.calculation-status span { color: var(--muted); }
.calculation-status.over { border-color: #77434b; background: #352127; }
.payment-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.payment-row > strong { color: var(--accent); font-size: 1.25rem; white-space: nowrap; }
.empty-state { padding: 30px 14px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 16px; }
.event-footer { padding: 32px 0 6px; text-align: center; }
.danger-link { color: var(--danger); }
.modal-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(4, 6, 14, .82); backdrop-filter: blur(8px); }
.modal { width: min(100%, 460px); padding: 24px; border: 1px solid #62424d; border-radius: 22px; background: #191728; box-shadow: 0 28px 90px rgba(0,0,0,.55); }
.ad-slot { position: fixed; z-index: 30; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); translate: -50% 0; width: min(calc(100% - 24px), 680px); height: 66px; border: 1px dashed #59617d; border-radius: 15px; background: rgba(11, 15, 29, .96); display: flex; align-items: center; justify-content: center; gap: 8px; color: #8991ab; backdrop-filter: blur(12px); }
.ad-slot span { font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
.ad-slot small { font-size: .72rem; }
@media (min-width: 620px) {
  #app { padding-top: 38px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-card:first-child, .feature-card[data-game="solo-poker"] { grid-column: 1 / -1; }
  .hands-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manage-person { grid-template-columns: minmax(170px, .8fr) 1fr; align-items: center; }
  .manage-person .toggle-row { grid-column: 2; }
  .target-grid, .bulk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bill-row { grid-template-columns: minmax(0, 1fr) 110px 130px; }
  .money { grid-column: auto; text-align: right; }
}
@media (max-width: 400px) {
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 36px; border-radius: 10px; }
  .hands-grid { grid-template-columns: 1fr 1fr; }
  .hand-card { padding: 9px; }
  .playing-card { padding: 5px; }
  .target-grid, .bulk-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise .35s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } }
}

/* Display preferences never change automatically with participant count. */
.display-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.poker-mini.hands-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.poker-mini .hand-card { padding: 6px; gap: 5px; border-radius: 10px; }
.poker-mini .person-badge { gap: 4px; }
.poker-mini .person-badge .participant-chip { width: 23px; height: 23px; font-size: .68rem; }
.poker-mini .person-badge strong { font-size: .75rem; }
.poker-mini .person-badge small { display: none; }
.poker-mini .playing-card { width: 30px; padding: 3px; border-radius: 5px; }
.poker-mini .playing-card b { font-size: .7rem; }
.poker-mini .playing-card span { font-size: .95rem; }
.poker-mini .current-hand-name { font-size: .72rem; overflow-wrap: anywhere; }
.poker-mini .ranking-row { grid-template-columns: minmax(30px, max-content) minmax(0, 1fr) auto; padding: 7px; gap: 4px; }
.poker-mini .rank-number { grid-row: span 2; font-size: 1.1rem; white-space: nowrap; }
.poker-mini .result-hand { grid-column: 3; grid-row: span 2; margin: 0; }
.poker-mini .result-hand-label { display: none; }
.poker-text.hands-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.poker-text .hand-card { grid-template-columns: minmax(0, 1fr) auto minmax(65px, .65fr); align-items: center; padding: 7px; gap: 6px; border-radius: 9px; }
.poker-text .person-badge { gap: 4px; }
.poker-text .person-badge .participant-chip { width: 24px; height: 24px; font-size: .7rem; }
.poker-text .person-badge strong { font-size: .78rem; }
.poker-text .person-badge small, .poker-text .result-hand-label { display: none; }
.poker-text .playing-card { display: inline-flex; align-items: center; width: auto; aspect-ratio: auto; padding: 0; border-radius: 0; background: none; color: var(--text); box-shadow: none; gap: 1px; }
.poker-text .playing-card.red-card { color: #ff9ca9; }
.poker-text .playing-card b, .poker-text .playing-card span { font-size: .8rem; }
.poker-text .current-hand-name, .poker-text .hand-name { font-size: .72rem; text-align: right; overflow-wrap: anywhere; }
.poker-text.ranking-list { gap: 4px; }
.poker-text .ranking-row { grid-template-columns: max-content minmax(0, 1fr) auto minmax(65px, .65fr); gap: 5px; padding: 4px 7px; border-radius: 9px; }
.poker-text .rank-number { grid-row: auto; min-width: 3ch; white-space: nowrap; font-size: .85rem; }
.poker-text .result-hand, .poker-text .hand-name { grid-column: auto; margin: 0; }
@media (max-width: 600px) and (orientation: portrait) {
  .swipe-hint { display: none; }
  .table-wrap { padding: 10px 0; overflow-x: visible; }
  .seat-row { display: grid; grid-template-columns: repeat(var(--seat-columns), minmax(0, 1fr)); min-width: 0; gap: 4px; }
  .seat-node { width: 100%; min-width: 0; min-height: 84px; padding: 6px 2px; gap: 4px; border-radius: 8px; }
  .seat-node .person-badge { width: 100%; }
  .seat-node .person-badge > span:last-child { max-width: 100%; }
  .seat-node .person-badge strong { white-space: normal; overflow-wrap: anywhere; font-size: .7rem; line-height: 1.35; }
  .seat-node .person-badge small { display: none; }
  .seat-node .person-badge .participant-chip { width: 26px; height: 26px; font-size: .7rem; }
  .seat-number { font-size: .7rem; }
  .bottom-seats .seat-number { order: 1; }
  .long-table { min-width: 0; height: 60px; margin: 7px 0; border-radius: 22px; box-shadow: none; }
  .board-cards .playing-card { width: min(15vw, 74px); min-width: 0; }
}

.result-board { padding: 12px; border-radius: 16px; }
.result-board .board-label { margin-bottom: 8px; }
.result-board .playing-card { width: 38px; padding: 4px; border-radius: 6px; }
.result-board .playing-card span { font-size: 1rem; }
.poker-normal.ranking-list { grid-template-columns: minmax(0, 1fr); }
.poker-normal .ranking-row { grid-template-columns: max-content 86px minmax(0, 1fr); gap: 8px; padding: 12px; }
.poker-normal .rank-number { grid-column: 1; grid-row: 1; white-space: nowrap; font-size: 1.15rem; }
.poker-normal .ranking-row > .person-badge { grid-column: 2 / -1; grid-row: 1; }
.poker-normal .result-hand { grid-column: 1 / 3; grid-row: 2; gap: 5px; margin: 0; }
.poker-normal .hand-name { grid-column: 3; grid-row: 2; min-width: 0; overflow-wrap: anywhere; }
.best-hand { grid-column: 1 / -1; grid-row: 3; min-width: 0; }
.best-cards { display: flex; flex-wrap: nowrap; gap: 5px; margin-top: 5px; }
.best-cards .playing-card { width: 32px; flex: 0 0 32px; padding: 3px; border-radius: 5px; }
.best-cards .playing-card b { font-size: .7rem; }
.best-cards .playing-card span { font-size: .95rem; }
.game-header { margin: 0 2px 10px; }
.game-header h2.eyebrow { font-size: .82rem; margin: 0; }
.board-label { align-items: center; gap: 8px; white-space: nowrap; }
.board-stage { font-size: .8rem; }
.poker-help { margin: -10px 0 14px; color: var(--muted); font-size: .85rem; }
.poker-help summary { display: flex; align-items: center; gap: 7px; width: fit-content; min-height: 44px; cursor: pointer; list-style: none; }
.poker-help summary::-webkit-details-marker { display: none; }
.poker-help summary::after { content: "＋"; }
.poker-help[open] summary::after { content: "−"; }
.poker-help summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.help-mark { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-weight: 800; }
.help-content { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); line-height: 1.7; overflow-wrap: anywhere; }
.help-content h3 { margin: 16px 0 6px; color: var(--text); font-size: 1rem; }
.help-content h3:first-child { margin-top: 0; }
.help-content p { margin: 8px 0; }
.hand-guide { padding-left: 1.7em; }
.hand-guide li { margin-bottom: 9px; }
.hand-guide strong { display: block; color: var(--text); }

/* Keep the title and subtitle readable next to a single, fixed-size menu button. */
.topbar { align-items: flex-start; }
.brand { min-width: 0; align-items: flex-start; }
.brand > div:last-child { min-width: 0; }
.brand-mark, .top-actions { flex-shrink: 0; }
.brand h1 { white-space: nowrap; font-size: clamp(1.3rem, 5.4vw, 2.15rem); }
.brand p { display: block; font-size: .8125rem; line-height: 1.6; overflow-wrap: anywhere; }
.beta-badge { display: inline-block; vertical-align: middle; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: .65em; color: var(--muted); font-weight: 500; }
.menu-toggle { width: 44px; height: 44px; }
.rank-number { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hand-card, .hand-name, .current-hand-name { min-width: 0; overflow-wrap: anywhere; }
.manage-person > input { width: 100%; min-width: 0; }
.member-cloud > .person-badge { max-width: 100%; }

/* Native modal supplies focus containment and makes the underlying game inert. */
.drawer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; padding: 0; margin: 0; border: 0; background: transparent; color: var(--text); overflow: hidden; }
.drawer::backdrop { background: rgba(4, 6, 14, 0); transition: background 180ms ease; }
.drawer.is-open::backdrop { background: rgba(4, 6, 14, .5); }
.drawer-panel { position: fixed; right: 0; top: 0; width: min(78vw, 340px); height: 100%; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 40px #0005; transform: translateX(100%); transition: transform 180ms ease; }
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.drawer-heading h2 { font-size: 1.25rem; margin: 0; }
.drawer-heading button { flex-shrink: 0; width: 44px; height: 44px; }
.drawer-links { display: grid; gap: 8px; }
.drawer-links button { text-align: left; min-height: 48px; }
.coming-soon { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; }
.coming-soon small { font-size: .7rem; }
.drawer .help-content { margin-top: 16px; padding: 12px; font-size: .875rem; }
@media (prefers-reduced-motion: reduce) {
  .drawer-panel, .drawer::backdrop { transition: none; }
}
/* More seats retain the same table, with horizontal scrolling when needed. */
@media (max-width: 600px) and (orientation: portrait) {
  .seat-row { grid-template-columns: repeat(var(--seat-columns), minmax(26px, 1fr)); }
  .table-wrap { overflow-x: auto; }
  .seat-number { white-space: nowrap; }
}

/* Translations and large yen amounts must stay inside their existing panels. */
.language-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.language-picker button { text-align: center; padding-inline: 6px; }
.language-picker [aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.money, .payment-row > strong { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.bill-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.payment-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.payment-row > strong { text-align: right; }
.calculation-status > strong { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.calculation-status > span { flex-shrink: 0; }
.section-heading > strong { flex-shrink: 0; }
.summary-strip { flex-wrap: wrap; }
.modal { color: var(--text); max-height: calc(100dvh - 36px); overflow-y: auto; }
.modal::backdrop { background: rgba(4, 6, 14, .82); backdrop-filter: blur(8px); }
.target-row:focus-within, .bulk-person:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.board-label { flex-wrap: wrap; }
.primary, .secondary, .text-button, .danger-button, .segmented button { overflow-wrap: anywhere; }
.text-button, .link-button, .toggle-row { min-height: 44px; }
.participant-row { grid-template-columns: 42px minmax(0, 1fr); }

.count-value { min-width: 0; overflow-wrap: anywhere; }
.target-row .person-badge, .bulk-person .person-badge { max-width: 100%; }
.result-heading, .notice { overflow-wrap: anywhere; }
@media (max-width: 600px) and (orientation: portrait) {
  .seat-row, .long-table { min-width: calc(var(--seat-columns) * 30px + (var(--seat-columns) - 1) * 4px); }
  html[lang="en"] .seat-row, html[lang="en"] .long-table { min-width: calc(var(--seat-columns) * 44px + (var(--seat-columns) - 1) * 4px); }
  .swipe-hint.many-seats { display: block; margin: 0 2px 8px; }
  .seat-node { grid-template-rows: auto 1fr; }
  .bottom-seats .seat-node { grid-template-rows: 1fr auto; }
  .seat-node .person-badge { align-self: start; }
}
@media (min-width: 620px) {
  .bill-row { grid-template-columns: minmax(0, 1fr) 110px minmax(0, 130px); }
}

/* Keep browser pinch zoom available; suppress double-tap zoom on controls. */
button, select, input, label { touch-action: manipulation; }
.poker-settings { min-width: 0; margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.poker-settings legend { padding: 0 6px; font-size: .85rem; }
.poker-settings label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; font-size: .85rem; }
.poker-settings select { width: auto; max-width: 100%; min-height: 44px; padding: 6px 10px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
/* Advertising layout is restored with the same visibility flag. */
html[data-ad-visible="true"] { --ad-reserved-space: 80px; }
.ad-slot[hidden] { display: none; }

/* Result mini mode keeps the existing rank / name + hand-name / cards grid. */
.poker-mini.ranking-list .result-hand .card-pair { flex-wrap: nowrap; gap: 3px; }
.poker-mini.ranking-list .result-hand .playing-card { width: 26px; flex: 0 0 26px; padding: 3px; }
.poker-mini.ranking-list .result-hand .playing-card b { font-size: .65rem; }
.poker-mini.ranking-list .result-hand .playing-card span { font-size: .82rem; }
.poker-mini.ranking-list .ranking-row > .person-badge { grid-column: 2; grid-row: 1; }
.poker-mini.ranking-list .hand-name { grid-column: 2; grid-row: 2; font-size: .72rem; line-height: 1.35; }
@media (max-width: 360px) {
  .poker-mini.ranking-list .result-hand .playing-card { width: 22px; flex-basis: 22px; padding: 2px; }
}

/* Cube geometry stays separate from travel so faces rotate together as a solid die. */
.chinchiro-animation { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.chinchiro-animation legend { color: var(--muted); font-size: .75rem; margin-bottom: 6px; }
.chinchiro-animation button { font-size: .8rem; min-height: 44px; padding: 6px 10px; }
.chinchiro-animation button[aria-pressed="true"] { border-color: var(--accent); background: #f2b45e22; color: var(--accent); }
.rolling-stage .rolling-die { rotate: none; background: none; box-shadow: none; }
.die-body, .die-cube { position: absolute; inset: 0; }
.die-rest { display: block; width: 49px; height: 49px; }
.die-motion { position: absolute; width: 96px; height: 96px; left: -23.5px; top: -23.5px; }
.die-cube.is-tumbling .die-rest { visibility: hidden; }
.rolling-stage.is-shonben { height: 285px; }
.rolling-stage.is-shonben[data-rolling] .die-0 { left: calc(100% - 61px); top: 224px; rotate: none; }
.die-shadow { position: absolute; left: -3px; right: -3px; top: 39px; height: 20px; border-radius: 50%; background: #20150e; filter: blur(5px); opacity: .65; }


.chinchiro-settings { margin: 12px 0 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.chinchiro-settings summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); font-size: .9rem; }
.chinchiro-settings summary::before { content: '▸'; margin-right: 8px; }
.chinchiro-settings[open] summary::before { content: '▾'; }
.chinchiro-quick-rules { padding: 14px; border: 1px solid #f2b45e55; background: #f2b45e0c; border-radius: 14px; margin-bottom: 20px; }
.chinchiro-quick-rules h3 { margin: 0 0 8px; font-size: .95rem; color: var(--accent); }
.chinchiro-quick-rules p { margin: 0; font-size: .9rem; line-height: 1.7; }
.chinchiro-quick-rules button { min-height: 44px; }
.chinchiro-affected li { padding: 14px 12px; margin: 8px 0; border: 1px solid var(--line); border-radius: 14px; }
.chinchiro-affected li.has-bonus { border-color: #f2b45e88; background: #f2b45e12; }
.chinchiro-affected li strong { font-size: 1.15rem; }
.chinchiro-points-change { display: block; font-size: clamp(1.25rem, 6vw, 1.9rem); line-height: 1.35; overflow-wrap: anywhere; }
.chinchiro-points-total { color: var(--text); }
.chinchiro-navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.chinchiro-navigation .chinchiro-home { margin: 0; }
.chinchiro-rank-person { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.chinchiro-rank-person strong { max-width: 100%; overflow-wrap: anywhere; }
.chinchiro-rank-role { min-width: 0; max-width: 100%; padding: 3px 7px; border-radius: 7px; background: #f2b45e18; color: var(--accent); font-size: .75rem; line-height: 1.5; overflow-wrap: anywhere; }
.chinchiro-rank-role[hidden] { display: none; }
.chinchiro-role-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: #f2b45e18; }
.chinchiro-navigation.has-role-toggle { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; }
.chinchiro-navigation.has-role-toggle button { min-width: 0; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.chinchiro-navigation.has-role-toggle [data-action="chinchiro-end"] { grid-column: 1 / -1; justify-self: end; }
@media (min-width: 600px) {
  .chinchiro-navigation.has-role-toggle { grid-template-columns: auto auto 1fr; }
  .chinchiro-navigation.has-role-toggle [data-action="chinchiro-end"] { grid-column: auto; }
}

.chinchiro-affected li:not(.has-bonus) .chinchiro-points-change { font-size: 1rem; color: var(--muted); }
.rolling-stage.is-shonben .die-1 { left: calc(50% - 72px); top: 137px; }
.rolling-stage.is-shonben .die-2 { left: calc(50% + 2px); top: 119px; }

/* Billing additions use the existing cards, controls and participant badges. */
.setup-purpose { margin: 16px 0; }
.setup-purpose button { white-space: normal; min-width: 0; }
.weight-input { width: 100%; min-width: 0; }
.weight-input, .weight-panel select { min-height: 44px; padding: 8px; color: var(--text); background: #11162a; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.bill-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bill-member-details { margin: 12px 0; }
.bill-member-details > summary { padding: 10px 0; min-height: 44px; cursor: pointer; color: var(--accent); }
.billing-directory { min-width: 0; scroll-margin-top: 140px; }
.site-information { width:min(calc(100% - 32px),720px); margin:0 auto; padding:20px 0 28px; border-top:1px solid var(--line); color:var(--muted); font-size:.8rem; overflow-wrap:anywhere; }
.site-information nav { display:flex; flex-wrap:wrap; gap:8px 18px; }
.site-information a { color:var(--accent); display:inline-flex; align-items:center; min-height:44px; }
body:has(.chinchiro-controls) .site-information { padding-bottom:calc(114px + env(safe-area-inset-bottom)); }
.drawer-links .guide-link { text-decoration:none; display:block; padding:12px; text-align:center; }
.billing-directory:focus { outline: none; }
.billing-search { display: grid; gap: 5px; min-width: 0; margin-top: 12px; font-size: .85rem; color: var(--muted); }
.billing-search input { width: 100%; min-width: 0; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #11162a; color: var(--text); font: inherit; }
.billing-range { margin: 6px 0 10px; }
.billing-pagination { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 7px; align-items: center; margin: 10px 0; }
.billing-pagination button, .billing-pagination select { width: 100%; min-width: 0; min-height: 44px; padding: 7px; }
.billing-pagination label { min-width: 0; }
.billing-pagination .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.billing-pagination select { color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: .8rem; }
.billing-match-actions { flex-wrap: wrap; }
.billing-confirm-bar { position: sticky; top: 8px; z-index: 12; padding: 8px; margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; background: #11162af5; box-shadow: 0 4px 16px #0005; }
.billing-confirm-bar .calculation-status { padding: 8px; margin: 0 0 6px; }
.billing-collection-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; position: sticky; top: 8px; z-index: 12; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #11162af5; box-shadow: 0 4px 16px #0005; }
.billing-collection-toolbar .billing-search { margin: 0; }
.billing-collection-toolbar > button { min-width: 0; max-width: 100px; padding: 8px; }
.billing-paged .bill-row, .billing-paged .collection-row { padding: 10px; gap: 6px 10px; }
.bill-row:has(.weight-input) > .money { grid-column: 1 / -1; text-align: right; }
.weight-panel select { display: block; width: 100%; margin: 10px 0; }
.weight-panel > .actions { margin-bottom: 16px; }
.weight-panel > .field-label { margin-top: 16px; }
.collection-summary dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.collection-summary dt, .collection-detail small { color: var(--muted); font-size: .8rem; }
.collection-summary dd { margin: 5px 0 0; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.collection-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.collection-row.is-settled { border-color: #556348; }
.collection-detail { min-width: 0; overflow-wrap: anywhere; }
.collection-detail small { display: block; margin-top: 4px; }
.collection-row .payment-toggle { min-width: 0; white-space: normal; padding: 9px; }
@media (min-width: 620px) {
  .bill-row:has(.weight-input) > .money { grid-column: auto; }
}


