:root {
  color-scheme: light;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --paper: #f4f1f8;
  --surface: #fdfbff;
  --ink: #241f32;
  --muted: #625970;
  --border: #ded6e9;
  --purple: #6342ca;
  --violet: #d9c8ff;
  --board: #221b31;
  --board-line: #49405c;
  --board-muted: #c3b9d0;
  --copper: #ffab72;
  --red: #a02e50;
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled, input:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.stage :focus-visible { outline-color: var(--violet); }
.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.mast { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; text-decoration: none; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--purple); border-radius: 10px; }
.mark svg { width: 21px; height: 21px; }
.back { color: var(--muted); font-size: .82rem; text-decoration: none; text-align: right; }
.back:hover, footer a:hover { color: var(--purple); }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 26px 0 22px; }
.kicker { margin: 0 0 6px; font: 800 .72rem/1.4 ui-monospace, monospace; letter-spacing: .10em; color: var(--muted); }
.kicker span { display: inline-block; width: 7px; height: 7px; background: var(--purple); border-radius: 50%; margin-right: 3px; vertical-align: 1px; }
h1 { font-weight: 950; font-size: clamp(2.8rem, 6vw, 4.25rem); line-height: 1.03; letter-spacing: -.085em; margin: 0 0 8px; }
h1 em { font-style: normal; color: var(--purple); }
.intro > div > p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }
.session-tag { min-width: 138px; display: flex; gap: 4px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--purple); }
.session-tag i { width: 3px; height: 10px; border-radius: 4px; background: currentColor; }
.session-tag i:nth-child(2), .session-tag i:nth-child(5) { height: 20px; }
.session-tag i:nth-child(3) { height: 30px; }
.session-tag i:nth-child(4) { height: 25px; }
.session-tag span { margin-left: 7px; font: 700 .65rem/1.35 ui-monospace, monospace; white-space: nowrap; }
.session-tag b { color: var(--ink); }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(288px, 342px); gap: 16px; align-items: start; }
.session { display: grid; gap: 12px; min-width: 0; }
.stage { background: var(--board); color: #fff7ff; border: 1px solid var(--board-line); border-radius: 22px; padding: 18px; min-width: 0; }
.stage-top, .stage-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.stage-top .kicker { color: var(--board-muted); margin-bottom: 3px; }
.stage-top strong { font: 800 .9rem ui-monospace, monospace; }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; background: #312743; border: 1px solid #504361; padding: 5px 9px; border-radius: 999px; font-size: .72rem; white-space: nowrap; }
.stage-pill i { width: 7px; height: 7px; background: #b6a8c9; border-radius: 50%; }
.stage-pill i.on { background: #bff0c4; }
.beat-head, .bar { display: grid; grid-template-columns: 34px repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 6px; align-items: center; }
.beat-head { margin: 16px 0 7px; text-align: center; font: 750 .72rem ui-monospace, monospace; color: var(--board-muted); }
.beat-head small { font-size: .56rem; }
.grid-wrap { position: relative; }
.bars { display: grid; gap: 6px; }
.bar { min-height: 53px; position: relative; }
.bar-number { color: var(--board-muted); font: 750 .79rem ui-monospace, monospace; text-align: center; }
.cell { display: grid; place-items: center; align-self: stretch; min-width: 0; border-radius: 8px; background: #30273f; border: 1px solid #4d405d; }
.cell.tick::after { content: ""; width: 8px; height: 2px; border-radius: 2px; background: #b4a4c7; opacity: .6; }
.cell.word { font-size: clamp(.78rem, 2.5vw, 1.19rem); font-weight: 900; color: #301d4e; text-align: center; overflow-wrap: anywhere; line-height: 1.14; padding: 4px; background: var(--violet); border-color: transparent; }
.cell.word.b { background: #bce9da; color: #173b33; }
.cell.word.blank { background: #3a304b; color: #f1e8fa; border-color: #635174; }
.bar.active .bar-number { color: var(--copper); }
.bar.active .cell { border-color: #776987; }
.bar.active .cell.is-beat { background: #514262; border-color: #a28db8; }
.bar.active .cell.word.is-beat { background: #fff1d9; color: #412e32; border-color: var(--copper); }
.bar.past { opacity: .67; }
.ball { position: absolute; z-index: 2; width: 16px; height: 16px; border-radius: 50%; background: var(--copper); border: 2px solid #fff1db; transform: translate(-50%, -50%); pointer-events: none; }
.countdown { position: absolute; z-index: 3; inset: 0; border-radius: 9px; display: grid; place-content: center; justify-items: center; gap: 6px; background: #211a31ef; }
.countdown span { font-size: .87rem; font-weight: 800; }
.countdown b { font: 900 5.5rem/.95 ui-monospace, monospace; color: var(--copper); }
.stage-bottom { margin-top: 11px; color: var(--board-muted); font: 750 .73rem ui-monospace, monospace; }
progress { display: block; width: 100%; height: 4px; margin-top: 6px; border: 0; border-radius: 4px; overflow: hidden; appearance: none; background: #4c405f; color: var(--violet); }
progress::-webkit-progress-bar { background: #4c405f; }
progress::-webkit-progress-value { background: var(--violet); }
progress::-moz-progress-bar { background: var(--violet); }
.actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, auto) 44px; gap: 7px; margin-top: 12px; }
.play, .stage-button { min-height: 44px; border: 1px solid transparent; border-radius: 9px; font-weight: 850; }
.play { background: var(--violet); color: #281b42; }
.play:hover { background: #e8ddff; }
.play span:first-child { margin-right: 7px; font-size: .8em; }
.stage-button { display: flex; align-items: center; justify-content: center; gap: 5px; color: #f4ecfa; background: #342a45; border-color: #605071; padding: 4px 9px; font-size: .75rem; white-space: nowrap; }
.stage-button:hover { border-color: #baa8cc; }
.stage-button[aria-pressed="true"] { background: #503550; border-color: #b27c9f; }
.stage-button.icon { font-size: 1.25rem; padding: 0; }
.stage-button svg { width: 16px; height: 16px; }
.controls, .recorder { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.controls { padding: 16px; }
.controls-top, .recorder-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.controls-top .kicker { margin-bottom: 3px; }
h2 { margin: 0; font-weight: 850; letter-spacing: -.045em; font-size: 1.15rem; }
.tempo-badge { background: #f0e7ff; color: #542da6; border-radius: 7px; padding: 6px 8px; white-space: nowrap; font: 850 .72rem ui-monospace, monospace; }
.beat-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 11px; }
.beat-choice, .choices button, select, .shuffle { border: 1px solid var(--border); background: #f6f2fb; color: var(--ink); border-radius: 8px; min-height: 40px; }
.beat-choice { display: flex; align-items: center; gap: 7px; padding: 5px 8px; text-align: left; min-width: 0; }
.beat-choice strong, .beat-choice small { display: block; line-height: 1.15; }
.beat-choice strong { font-size: .76rem; }
.beat-choice small { font: 700 .61rem ui-monospace, monospace; color: var(--muted); margin-top: 2px; }
.beat-bars { display: inline-flex; align-items: end; gap: 2px; color: var(--purple); }
.beat-bars i { width: 2px; height: 5px; border-radius: 2px; background: currentColor; }
.beat-bars i:nth-child(2) { height: 10px; }
.beat-bars i:nth-child(3) { height: 7px; }
.beat-choice[aria-pressed="true"], .choices button[aria-pressed="true"] { border-color: #9676ed; color: #4b289d; background: #ede3ff; }
.beat-choice:not(:disabled):hover, .choices button:not(:disabled):hover, select:hover, .shuffle:hover:not(:disabled) { border-color: #9676ed; }
.tempo { display: grid; margin-top: 9px; gap: 1px; }
legend, label { font-weight: 780; font-size: .75rem; color: var(--muted); }
input[type="range"] { width: 100%; height: 24px; margin: 0; accent-color: var(--purple); }
.control-divider { margin: 6px 0 9px; border-top: 1px solid var(--border); }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
legend { margin-bottom: 5px; }
.word-count { margin-left: 4px; color: var(--purple); font: 800 .67rem ui-monospace, monospace; }
.choices { display: flex; gap: 6px; }
.choices button { flex: 1 1 0; min-width: 0; font-size: .78rem; font-weight: 800; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.field { display: grid; gap: 4px; margin-top: 8px; min-width: 0; }
select { width: 100%; padding: 0 7px; font-size: .8rem; }
.shuffle { width: 100%; margin-top: 9px; min-height: 39px; color: #522fac; font-size: .78rem; font-weight: 800; }
.shuffle span { font-size: 1rem; margin-right: 3px; }
.notice { margin: 7px 0 0; min-height: 2.4em; font-size: .71rem; line-height: 1.4; color: var(--muted); }
.recorder { padding: 13px 15px; }
.record-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rec-badge { flex: none; display: inline-flex; align-items: center; gap: 4px; background: #f8e4ed; color: var(--red); border-radius: 6px; padding: 5px 6px; font: 850 .68rem ui-monospace, monospace; }
.rec-badge i, .record-button i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.recorder.recording .rec-badge { background: #f0c6d8; }
.recorder.recording .record-button i { border-radius: 2px; }
.recorder h2 { font-size: .95rem; }
.recorder p { margin: 3px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.record-button { flex: none; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #dba5bd; color: var(--red); background: #fbeef4; border-radius: 8px; padding: 6px 9px; font-weight: 850; font-size: .76rem; }
.record-button:hover { background: #f7dce9; }
.take { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.take audio { flex: 1 1 190px; width: 100%; min-width: 0; height: 40px; }
.take a { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 5px 8px; color: #4b289d; background: #f0e7ff; border: 1px solid var(--border); border-radius: 7px; text-decoration: none; font-size: .77rem; font-weight: 800; }
.guide { margin: 42px 0 0; padding-top: 21px; border-top: 1px solid var(--border); }
.guide > h2, .faq h2 { font-size: 1.38rem; }
.guide p { font-size: .88rem; line-height: 1.65; color: var(--muted); }
.guide p.kicker { font-size: .72rem; }
.guide-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 16px; }
.guide-steps section { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 13px; }
.guide-steps b { font: 800 .73rem ui-monospace, monospace; color: var(--purple); }
.guide h3 { font-size: .91rem; margin: 4px 0; }
.guide-steps p { margin: 0; }
.faq { margin-top: 26px; }
.faq h2 { margin-bottom: 8px; }
details { border-bottom: 1px solid var(--border); }
summary { padding: 10px 0; font-size: .87rem; font-weight: 800; cursor: pointer; }
details p { margin: 0 0 11px; }
.ad-zone { width: min(100%, 760px); margin: 28px auto 32px; min-height: 110px; text-align: center; }
.ad-zone:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-zone small { display: block; margin-bottom: 6px; color: var(--muted); font-size: .7rem; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 28px; padding: 14px 0 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: .77rem; }
@media (min-width: 741px) and (max-height: 820px) {
  .mast { min-height: 54px; }
  .intro { padding: 16px 0 14px; }
  h1 { font-size: clamp(2.8rem, 5vw, 3.55rem); }
  .bar { min-height: 45px; }
}
@media (max-width: 740px) {
  .wrap { width: min(100% - 22px, 520px); }
  .mast { min-height: 52px; }
  .intro { padding: 16px 0 13px; }
  h1 { font-size: clamp(2.55rem, 11vw, 3.7rem); margin-bottom: 6px; }
  .intro > div > p:last-child { font-size: .8rem; }
  .session-tag { display: none; }
  .workbench, .guide-steps { grid-template-columns: 1fr; gap: 10px; }
  .session { gap: 8px; }
  .stage, .controls, .recorder { padding: 10px; border-radius: 14px; }
  .beat-head, .bar { grid-template-columns: 21px repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 4px; }
  .beat-head { margin: 9px 0 5px; }
  .bars { gap: 4px; }
  .bar { min-height: 39px; }
  .stage-bottom { margin-top: 7px; }
  .actions { margin-top: 8px; grid-template-columns: minmax(0,1fr) auto 40px; }
  .cell { border-radius: 5px; }
  .ball { width: 13px; height: 13px; }
  body.is-playing .intro { display: none; }
  body.is-playing .workbench { margin-top: 7px; }
  .guide { margin-top: 30px; }
}
@media (max-width: 355px) {
  .record-heading { gap: 5px; }
  .rec-badge { display: none; }
}

.beat-invite { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding:11px 14px; background:var(--surface); border:1px solid var(--border); border-radius:13px; }
.beat-invite p { margin:4px 0 0; color:var(--muted); font-size:.78rem; }
.beat-invite button,.beat-dialog-actions button,.beat-close { min-height:42px; padding:7px 10px; border:1px solid #a893dc; border-radius:8px; background:#f3eaff; color:#46298d; font-size:.8rem; font-weight:800; }
.beat-invite button { flex:none; }
#beat-challenge { width:min(420px,calc(100% - 24px)); padding:19px; border:1px solid var(--board-line); border-radius:18px; color:#f7edff; background:var(--board); }
#beat-challenge::backdrop { background:#1710209c; }
#beat-challenge form { position:absolute; top:10px; right:10px; }
.beat-close { min-height:32px; padding:1px 8px; font-size:1.1rem; }
.beat-round { margin:7px 0 14px; color:var(--board-muted); font:700 .78rem ui-monospace,monospace; }
#beat-marks { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; }
#beat-marks i { display:block; height:41px; border:1px solid var(--board-line); border-radius:8px; background:#3b304d; }
#beat-marks .cue { background:#f7be8d; border-color:#f7be8d; }
#beat-marks .hit { background:#bce9da; border-color:#bce9da; }
#beat-message { min-height:2.6em; font-size:.85rem; line-height:1.45; }
.beat-dialog-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); gap:7px; }
#beat-tap { min-height:65px; touch-action:manipulation; font-size:1.05rem; }
#beat-tap:disabled { opacity:.65; }
#beat-types { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-top:13px; }
#beat-types button { min-height:40px; padding:5px; background:#393049; border:1px solid #66527e; border-radius:8px; color:#f4edff; font-size:.75rem; font-weight:760; }
#beat-types button[aria-pressed="true"] { background:#d9c8ff; color:#332353; border-color:#d9c8ff; }
#beat-results { list-style:none; display:grid; gap:4px; margin:0 0 13px; padding:0; font-size:.78rem; color:var(--board-muted); }
#beat-challenge :focus-visible { outline-color:var(--violet); }
