.rhythm-room{--rhythm-ink:#133b38;--rhythm-line:#c7b494;width:min(100%,1320px);margin-inline:auto;color:var(--rhythm-ink);text-align:left}
.rhythm-room .session-banner{text-align:left;margin:0 0 18px}
.game-shell .rhythm-room .session-banner>.meta{margin-inline:0;text-align:left}
.game-shell .rhythm-room .rhythm-cue{text-align:left;font-size:1rem;line-height:1.7;max-width:45rem;margin:22px 0}
.rhythm-sealed-card{display:flex;align-items:center;justify-content:center;gap:28px;width:min(100%,650px);min-height:220px;background:#e6e8f2;border:1px solid #a9b0cd;border-radius:7px;margin:26px 0;box-shadow:0 4px 0 #6572921a}
.rhythm-sealed-card span{display:block;width:50px;height:80px;border:3px solid #9ba4c3;border-radius:18px 18px 9px 9px;transform:rotate(-12deg)}
.rhythm-sealed-card span:last-child{transform:rotate(12deg)}
.game-shell .rhythm-room .rhythm-private-leader{text-align:left;font-size:clamp(2rem,5vw,3.5rem);font-weight:800;line-height:1.3;background:#fff;border-left:6px solid #717eae;border-radius:5px;padding:28px;margin:24px 0;max-width:45rem;overflow-wrap:anywhere}
.game-shell .rhythm-room .rhythm-detective{text-align:left;font-weight:750;font-size:1rem;margin:10px 0}
.game-shell .rhythm-room .rhythm-ring-note{text-align:left;font-size:.85rem;color:#66677d;line-height:1.6;margin:10px 0 22px}
.game-shell .play .rhythm-room :is(.rhythm-detective,.rhythm-ring-note){margin-inline:0}
.rhythm-case-desk{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:30px;align-items:start;margin:22px 0}
.rhythm-seat-map{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;min-width:0;position:relative}
.rhythm-seat-map>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:64px;padding:10px 8px;background:#fff;border:1px solid #afb6ce;border-radius:7px;color:var(--rhythm-ink);box-shadow:none;cursor:pointer;transition:border-color .15s,background-color .15s}
.rhythm-seat-number{font-size:1.22rem;font-variant-numeric:tabular-nums;font-weight:800;line-height:1}
.rhythm-seat-label{font-size:.75rem;line-height:1.25;text-align:center;color:#58586c}
.rhythm-seat-map [data-rhythm-state="detective"]{border:2px solid #566c9a;background:#e9eff9;color:#344c77}
.rhythm-seat-map [data-rhythm-state="detective"] .rhythm-seat-label{color:#344c77;font-weight:750}
.rhythm-seat-map [data-rhythm-state="selected"]{border:3px solid #8d6a31;background:#fff8e9;padding:8px 6px}
.rhythm-seat-map [data-rhythm-state="selected"] .rhythm-seat-label{color:#846129;font-weight:750}
.rhythm-seat-map [data-rhythm-state="tested"]{border-style:dashed;border-color:#bfc4d0;background:#eeeef2;color:#606174}
.rhythm-seat-map [data-rhythm-state="tested"] .rhythm-seat-number{text-decoration:line-through;text-decoration-thickness:1px}
.rhythm-seat-map [data-rhythm-state="answer"]{border:3px solid #39775d;background:#edf8f1;color:#2b624d;padding:8px 6px}
.rhythm-seat-map [data-rhythm-state="answer"] .rhythm-seat-label{color:#2b624d;font-weight:750}
.rhythm-seat-map>button:disabled{cursor:default;opacity:1}
.rhythm-circle-center{display:none}
.rhythm-case-controls{border-top:2px solid #8790b1;padding-top:18px;min-width:0}
.game-shell .rhythm-room .rhythm-budget{text-align:left;font-size:.95rem;line-height:1.6;margin:0 0 18px}
.rhythm-budget strong{font-size:2.6rem;margin-left:6px;font-variant-numeric:tabular-nums}
.game-shell .rhythm-room .rhythm-selected{text-align:left;font-size:.96rem;line-height:1.65;min-height:52px;margin:14px 0}
.rhythm-confirm>[data-action="check"]{width:100%;min-height:54px;font-size:.95rem}
.rhythm-room .rhythm-confirm button:disabled{background:#e8e4f0;border-color:#d6ccdf;color:#5b526e;cursor:not-allowed;box-shadow:none}
.rhythm-case-controls h3{font-size:.95rem;margin:26px 0 14px}
.game-shell .rhythm-room .rhythm-no-guesses{text-align:left;font-size:.85rem;line-height:1.6;color:#66677d;margin:12px 0}
.rhythm-guess-order{list-style:none;padding:0;margin:12px 0}
.rhythm-guess-order li{display:grid;grid-template-columns:20px minmax(0,1fr) auto;gap:10px;align-items:baseline;padding:12px 0;border-top:1px solid #d5d8e4;font-size:.85rem;line-height:1.5}
.rhythm-guess-order li>span:first-child{font-size:.75rem;color:#66677d;font-variant-numeric:tabular-nums}
.rhythm-guess-order li>span:last-child{font-size:.78rem;color:#66677d}
.rhythm-room button:focus-visible{outline:3px solid #75618f;outline-offset:4px}
.game-shell .rhythm-room .rhythm-answer{text-align:left;line-height:1.7;font-size:1rem;background:#edf8f1;border-left:4px solid #4b866a;padding:16px 20px;margin:20px 0}
.rhythm-answer strong{font-size:1.3rem;margin-left:10px}
.game-shell .rhythm-room .rhythm-final-score{text-align:left;font-size:1rem;margin:20px 0;line-height:1.6}
.rhythm-final-score strong{font-size:3rem;margin-left:10px;font-variant-numeric:tabular-nums}
.rhythm-archive{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 30px;margin-top:28px;padding-top:22px;border-top:2px solid #8790b1}
.rhythm-archive>h3{grid-column:1/-1;font-size:1.1rem;margin:0}
.rhythm-record{border:1px solid var(--rhythm-line);border-radius:6px;background:#fff;padding:20px 22px;min-width:0}
.rhythm-record h4{font-size:1rem;margin:0 0 18px;line-height:1.6}
.rhythm-record dl{display:flex;flex-wrap:wrap;gap:20px 32px;margin:0 0 18px}
.rhythm-record dl>div{display:grid;gap:6px}
.rhythm-record dt{font-size:.78rem;color:#66677d}
.rhythm-record dd{font-size:.95rem;font-weight:700;margin:0}
@media(min-width:1150px){
  .game-shell.wide .rhythm-seat-map{display:block;height:clamp(445px,62dvh,670px)}
  .game-shell.wide .rhythm-seat-map::before{position:absolute;inset:10% 8%;border:1px solid #c8c7dc;border-radius:50%;content:"";pointer-events:none}
  .game-shell.wide .rhythm-seat-map>button{position:absolute;left:var(--seat-x);top:var(--seat-y);transform:translate(-50%,-50%);width:76px;height:76px;min-height:0;padding:0;border-radius:50%;background-clip:padding-box}
  .game-shell.wide .rhythm-seat-map>button:not(:disabled){box-shadow:0 2px 3px #30214814}
  .game-shell.wide .rhythm-seat-map>button:not(:disabled):hover{border-color:#66539a;background-color:#f7f4fb}
  .game-shell.wide .rhythm-seat-map>button[data-rhythm-state="selected"]:hover{border-color:#8d6a31;background-color:#fff8e9}
  .game-shell.wide .rhythm-seat-map:has([data-rhythm-seat="12"])>button{width:52px;height:52px}
  .game-shell.wide .rhythm-seat-label{display:none}
  .game-shell.wide .rhythm-circle-center{position:absolute;display:grid;justify-items:center;gap:17px;left:26%;right:26%;top:31%;bottom:28%;align-content:center;text-align:center;color:#58586c;font-size:.95rem;line-height:1.6;pointer-events:none}
  .rhythm-movement{display:flex;align-items:center;gap:8px;height:50px}
  .rhythm-movement i{display:block;width:6px;height:24px;border-radius:8px;background:#edd8aa}
  .rhythm-movement i:nth-child(even){height:34px}
  .rhythm-movement i:nth-child(3){height:44px}
}

@media(max-width:999px){
  .rhythm-case-desk{grid-template-columns:minmax(0,1fr);gap:22px}
  .rhythm-case-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 20px}
  .rhythm-case-controls .rhythm-budget,.rhythm-confirm{grid-column:1}
  .rhythm-case-controls>h3,.rhythm-case-controls>.rhythm-guess-order,.rhythm-case-controls>.rhythm-no-guesses{grid-column:2}
  .rhythm-case-controls>h3{grid-row:1;margin:0 0 14px}
  .rhythm-case-controls>.rhythm-guess-order,.rhythm-case-controls>.rhythm-no-guesses{grid-row:2/5;margin-top:0}
  .rhythm-case-controls>.actions{grid-column:1/-1}
}
@media(max-width:599px){
  .rhythm-seat-map{gap:8px}
  .rhythm-seat-map>button{min-height:64px;padding:6px 4px}
  .rhythm-seat-map [data-rhythm-state="selected"],.rhythm-seat-map [data-rhythm-state="answer"]{padding:4px 2px}
  .rhythm-seat-number{font-size:1.1rem}
  .rhythm-case-controls{display:block}
  .rhythm-budget strong{font-size:2.1rem}
  .game-shell .rhythm-room .rhythm-selected{min-height:0}
  .game-shell.wide .rhythm-room:has([data-rhythm-choice]){padding-bottom:94px}
  .game-shell.wide .rhythm-confirm[data-rhythm-choice]{position:fixed;z-index:4;bottom:0;left:0;right:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px 15px max(12px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid #aca5c4;box-shadow:0 -7px 22px #34284f14}
  .game-shell.wide .rhythm-confirm[data-rhythm-choice] .rhythm-selected{margin:0;font-size:.85rem;line-height:1.4}
  .game-shell.wide .rhythm-confirm[data-rhythm-choice]>.button{width:auto;min-height:44px;max-width:180px}
  .rhythm-archive{grid-template-columns:minmax(0,1fr)}
  .rhythm-record{padding:16px}
  .rhythm-sealed-card{min-height:190px}
  .rhythm-answer strong{display:block;margin:7px 0 0}
}
@media(max-width:359px){.rhythm-seat-map{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.rhythm-room *{animation:none!important;transition:none!important}}

.page-game .game-shell.theme-rhythm:has(.rhythm-room) {
  --rhythm-cream: #fff5df;
  --rhythm-accent: #15534d;
  --rhythm-muted: #4d5e56;
  background: radial-gradient(ellipse at 17% 0,#fffaf0,#f4e8d4 85%);
}
.page-game .game-shell.theme-rhythm:has(.rhythm-room) .game-toolbar {
  background: #f9ecd7;
  color: #153d39;
  border-color: #c7b494;
}
.theme-rhythm:has(.rhythm-room) .game-toolbar .button {
  background: #fff8e8;
  color: var(--rhythm-accent);
  border-color: #a89980;
}
.theme-rhythm .play .rhythm-room .session-banner :is(h2,.meta) {
  color: var(--rhythm-ink);
}
.game-shell .rhythm-room .rhythm-ring-note {color: var(--rhythm-muted);margin-bottom: 13px}
.rhythm-case-desk {gap: clamp(15px,2.4vw,36px);margin-block: 16px}
.rhythm-seat-map {
  padding: clamp(9px,1.6vw,18px);
  background: repeating-linear-gradient(135deg,#ffffff06 0 1px,transparent 1px 5px),linear-gradient(140deg,#37685f,#174641);
  border: 1px solid #24544d;
  border-radius: 16px;
  box-shadow: inset 0 0 0 3px #ffffff21,0 5px 0 #103c36,0 12px 19px #16362b2c;
}
.rhythm-seat-map > button {
  background: var(--rhythm-cream);
  border-color: #dfc599;
  color: var(--rhythm-ink);
}
.rhythm-seat-map .rhythm-seat-label {color: inherit}
.rhythm-seat-map [data-rhythm-state="detective"] {background:#c4e3f4;border-color:#416b8e;color:#173a53}
.rhythm-seat-map [data-rhythm-state="detective"] .rhythm-seat-label {color:inherit}
.rhythm-seat-map [data-rhythm-state="selected"] {background:#ffc36b;border-color:#a84c17;color:#42290e;box-shadow:0 0 0 2px #ffdd9a}
.rhythm-seat-map [data-rhythm-state="selected"] .rhythm-seat-label {color:inherit}
.rhythm-seat-map [data-rhythm-state="tested"] {background:#d0d7c8;border-color:#64796b;color:#344840}
.rhythm-seat-map [data-rhythm-state="answer"] {background:#d7f7c3;border-color:#4e8041;color:#224722}
.rhythm-seat-map [data-rhythm-state="answer"] .rhythm-seat-label {color:inherit}
.rhythm-room button:focus-visible {outline-color:#a04d1b}
.rhythm-seat-map button:focus-visible {outline-color:#fff1c8}
.rhythm-case-controls {
  padding: 16px;
  border: 1px solid var(--rhythm-line);
  border-radius: 12px;
  background: linear-gradient(150deg,#fff8e8,#f9ecd6);
  box-shadow: 0 5px 15px #593e2110;
  color: var(--rhythm-ink);
}
.game-shell .rhythm-room .rhythm-budget {
  display: flex;
  align-items: center;
  gap: 4px 9px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rhythm-line);
  padding-bottom: 9px;
  margin: 0;
}
.rhythm-budget strong {margin-left:0;line-height:1}
.rhythm-budget-marks {display:flex;gap:5px;margin-inline-start:auto}
.rhythm-budget-marks i {width:9px;height:9px;background:#d7c8b2;border-radius:50%}
.rhythm-budget-marks [data-available] {background:var(--rhythm-accent)}
.game-shell .rhythm-room .rhythm-selected {color:var(--rhythm-ink);font-weight:680}
.theme-rhythm .rhythm-room .button:not(.secondary):not(:disabled) {
  background:var(--rhythm-accent);border-color:var(--rhythm-accent);color:#fff8e8;min-height:44px;
}
.theme-rhythm .rhythm-room .button:not(.secondary):not(:disabled):hover {background:#216b61}
.theme-rhythm .rhythm-room .button.secondary {color:var(--rhythm-accent)}
.rhythm-room .rhythm-confirm button:disabled {background:#e8e0d0;border-color:#c6bba4;color:#565847}
.rhythm-guess-order li {border-color:#d3c5ab}
.game-shell .rhythm-room .rhythm-no-guesses,.rhythm-guess-order li > span,.rhythm-record dt {color:var(--rhythm-muted)}
.rhythm-archive {border-color:#729082}
.rhythm-record {background:#fff8e8}
.rhythm-sealed-card {
  min-height: 160px;
  background: repeating-linear-gradient(135deg,#ffffff0b 0 1px,transparent 1px 6px),linear-gradient(130deg,#347065,#194941);
  border-color:#326357;
  box-shadow:inset 0 0 0 5px #ffffff26,0 7px 0 #183e36;
}
.rhythm-sealed-card span {border-color:#e3cfaa;background:#fff4d922}
.game-shell .rhythm-room .rhythm-private-leader {
  color: #183b34;
  background: #fff3d4;
  border-color: var(--rhythm-accent);
}
@media(min-width:1150px) {
  .game-shell.wide .rhythm-seat-map {border-radius:50%;padding:0}
  .game-shell.wide .rhythm-seat-map::before {border-color:#e5d4ae8c;inset:10% 8%}
  .game-shell.wide .rhythm-seat-map > button:not(:disabled) {box-shadow:0 3px 0 #14342b,0 5px 8px #112b2480}
  .game-shell.wide .rhythm-seat-map > button:not(:disabled):hover {background:#fffbe9;border-color:#fff1c6}
  .game-shell.wide .rhythm-seat-map > button[data-rhythm-state="selected"]:not(:disabled) {box-shadow:0 0 0 2px #ffe0a5,0 3px 0 #7d3e15}
  .game-shell.wide .rhythm-seat-map > button[data-rhythm-state="selected"]:hover {background:#ffd18e;border-color:#a84c17}
  .game-shell.wide .rhythm-circle-center {color:#fff3d7}
}
[data-rhythm-phase="round"] .rhythm-circle-center > span {display:none}
@media(max-width:599px) {
  .page-game .game-shell.theme-rhythm.wide .play:has([data-rhythm-phase="ballot"]) {
    justify-content:flex-start;
    padding-block-start:1rem;
  }
  .rhythm-case-controls {padding:13px}
  .game-shell.wide .rhythm-confirm[data-rhythm-choice] {background:#fff7e5;border-color:#bba883}
  .rhythm-sealed-card {min-height:136px}
}
