/* Layout: three screens behind one app bar.
   1 Home: a GarageBand-style carousel of genre cards (swipe, tap the centred card to open).
   2 Levels: three big cards, each in its own colours.
   3 Practice: lanes of reels + drum score on the left; SPIN / Play and settings in a side column on wide or
     landscape screens, or a sticky bottom bar in portrait. The score can open full screen.
   Menu screens are a fixed dark charcoal look; each level keeps its own look:
   新手 baby blue + white, 老手 wine red + black, 職業 black + metallic gold. */
:root {
  --bg: #141417; --surface: #1E1E23; --ink: #F3F3F5; --ink-2: #9A9AA5; --line: #2E2E35;
  --off: #2A2A31; --tint: #19191E; --reel: #0E0E11;
  --accent: #F3F3F5; --on-accent: #141417; --accent-fill: #F3F3F5;
  --hat: #4DC0D0; --ride: #9DA9F2; --snare: #EBA548; --kick: #F26B5A; --kick-fill: #F26B5A; --pedal: #C79BEB;
  --title: #F3F3F5; --title-fill: none;
  --labw: 220px;
  --f-display: 'Bricolage Grotesque', 'Noto Sans TC', system-ui, sans-serif;
  --f-body: 'Noto Sans TC', system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-level="practice"] {
  --bg: #F2F2F2; --surface: #FFFFFF; --ink: #111111; --ink-2: #6B6B6B; --line: #D6D6D6;
  --off: #E4E4E4; --tint: #F4F4F4; --reel: #EDEDED;
  --accent: #111111; --on-accent: #FFFFFF; --accent-fill: #111111;
  --hat: #111111; --ride: #444444; --snare: #111111; --kick: #111111; --kick-fill: #111111; --pedal: #555555;
  --title: #111111; --title-fill: none;
  color-scheme: light;
}
:root[data-level="rookie"] {
  --bg: #0E0A07; --surface: #18110C; --ink: #F3E7DF; --ink-2: #A8968A; --line: #33251B;
  --off: #2E231B; --tint: #1C1613; --reel: #090706;
  --accent: #B87333; --on-accent: #1E0F06;
  --accent-fill: linear-gradient(135deg, #7A4321 0%, #D99A6C 28%, #A9622F 52%, #F0BE95 76%, #8A4E26 100%);
  --hat: #5DB8C6; --ride: #9DA9F2; --snare: #E8A65E; --kick: #C98252; --pedal: #C79BEB;
  --kick-fill: linear-gradient(150deg, #F0C29C 0%, #C47C4A 45%, #8A4E26 100%);
  --title: transparent; --title-fill: linear-gradient(120deg, #8A4E26 0%, #F0BE95 30%, #B06A36 55%, #F7D2B2 78%, #8A4E26 100%);
  color-scheme: dark;
}
:root[data-level="vet"] {
  --bg: #0B0B10; --surface: #15161C; --ink: #EEF0F3; --ink-2: #9AA0A8; --line: #262833;
  --off: #24262F; --tint: #191B1E; --reel: #08090A;
  --accent: #B8BEC6; --on-accent: #15171A;
  --accent-fill: linear-gradient(135deg, #7C828A 0%, #E9EDF1 28%, #A3A9B1 52%, #FAFBFC 76%, #868C94 100%);
  --hat: #5DB8C6; --ride: #9DA9F2; --snare: #EBA548; --kick: #C3C9D1; --pedal: #C79BEB;
  --kick-fill: linear-gradient(150deg, #FAFBFC 0%, #BFC5CC 45%, #7C828A 100%);
  --title: transparent; --title-fill: linear-gradient(120deg, #7C828A 0%, #F2F4F7 30%, #A3A9B1 55%, #FFFFFF 78%, #868C94 100%);
  color-scheme: dark;
}
:root[data-level="pro"] {
  --bg: #0D0B05; --surface: #17140A; --ink: #F2EBDA; --ink-2: #A99F86; --line: #332C15;
  --off: #2C2614; --tint: #1A1814; --reel: #0A0908;
  --accent: #C79A45; --on-accent: #1C1405;
  --accent-fill: linear-gradient(135deg, #8E6A24 0%, #E8C877 26%, #B4883A 50%, #F6E1A0 74%, #9C752C 100%);
  --hat: #7CC3C9; --ride: #AEB9F3; --snare: #E0805C; --kick: #C9A04B; --pedal: #C49DE8;
  --kick-fill: linear-gradient(150deg, #F6E2A4 0%, #D4AA55 45%, #A27A2F 100%);
  --title: transparent; --title-fill: linear-gradient(120deg, #A27A2F 0%, #F3DA94 30%, #C49643 55%, #FBEAB6 78%, #A9812F 100%);
  color-scheme: dark;
}

/* 淺色／深色模式：html[data-scheme] 由設定決定（預設跟隨系統） */
:root[data-scheme="light"] {
  --bg: #E8E8EB; --surface: #FFFFFF; --ink: #1D1D1F; --ink-2: #6E6E73; --line: #D9D9DE;
  --off: #E6E6EA; --tint: #F0F0F3; --reel: #ECECEF;
  --accent: #1D1D1F; --on-accent: #FFFFFF; --accent-fill: #1D1D1F;
  --hat: #1E95A8; --ride: #5866D2; --snare: #D2800F; --kick: #DE4E3B; --kick-fill: #DE4E3B; --pedal: #9256CF;
  --title: #1D1D1F; --title-fill: none;
  color-scheme: light;
}
:root[data-scheme="dark"][data-level="practice"] {
  --bg: #0E0E0E; --surface: #1A1A1A; --ink: #F2F2F2; --ink-2: #9A9A9A; --line: #333333;
  --off: #2A2A2A; --tint: #151515; --reel: #0A0A0A;
  --accent: #F2F2F2; --on-accent: #111111; --accent-fill: #F2F2F2;
  --hat: #F2F2F2; --ride: #C8C8C8; --snare: #F2F2F2; --kick: #F2F2F2; --kick-fill: #F2F2F2; --pedal: #BDBDBD;
  --title: #F2F2F2; --title-fill: none;
  color-scheme: dark;
}
:root[data-scheme="light"][data-level="practice"] {
  --bg: #E6E6E8; --surface: #FFFFFF; --ink: #111111; --ink-2: #5E5E5E; --line: #BDBDC0;
  --off: #DCDCDE; --tint: #F2F2F3; --reel: #E9E9EB;
  --accent: #111111; --on-accent: #FFFFFF; --accent-fill: #111111;
  --hat: #111111; --ride: #444444; --snare: #111111; --kick: #111111; --kick-fill: #111111; --pedal: #555555;
  --title: #111111; --title-fill: none;
}
:root[data-scheme="light"][data-level="rookie"] {
  --bg: #FAF5F1; --surface: #FFFFFF; --ink: #2A1A10; --ink-2: #8A6E5C; --line: #E6D6CA;
  --off: #EFE3D9; --tint: #F6EDE6; --reel: #F2E7DE;
  --accent: #A0602A; --on-accent: #1E0F06;
  --accent-fill: linear-gradient(135deg, #7A4321 0%, #D99A6C 28%, #A9622F 52%, #F0BE95 76%, #8A4E26 100%);
  --hat: #1E95A8; --ride: #5866D2; --snare: #C8761E; --kick: #A9622F; --pedal: #9256CF;
  --kick-fill: linear-gradient(150deg, #E3A77A 0%, #B06A36 45%, #7A4321 100%);
  --title: transparent; --title-fill: linear-gradient(120deg, #6A3A1C 0%, #C47C4A 35%, #8A4E26 60%, #B9733F 85%, #6A3A1C 100%);
}
:root[data-scheme="light"][data-level="vet"] {
  --bg: #F3F4F6; --surface: #FFFFFF; --ink: #16181B; --ink-2: #6B7078; --line: #D6D9DE;
  --off: #E4E6EA; --tint: #EEF0F2; --reel: #E8EAED;
  --accent: #5E646C; --on-accent: #15171A;
  --accent-fill: linear-gradient(135deg, #7C828A 0%, #E9EDF1 28%, #A3A9B1 52%, #FAFBFC 76%, #868C94 100%);
  --hat: #1E95A8; --ride: #5866D2; --snare: #D2800F; --kick: #7C828A; --pedal: #9256CF;
  --kick-fill: linear-gradient(150deg, #C9CED4 0%, #8E949C 45%, #5E646C 100%);
  --title: transparent; --title-fill: linear-gradient(120deg, #3E444C 0%, #8E949C 35%, #5A6068 60%, #9AA0A8 85%, #3E444C 100%);
}
:root[data-scheme="light"][data-level="pro"] {
  --bg: #FAF7EE; --surface: #FFFFFF; --ink: #1F1808; --ink-2: #857857; --line: #E6DCC3;
  --off: #EFE6CF; --tint: #F6F0E1; --reel: #F1E9D5;
  --accent: #9C752C; --on-accent: #1C1405;
  --accent-fill: linear-gradient(135deg, #8E6A24 0%, #E8C877 26%, #B4883A 50%, #F6E1A0 74%, #9C752C 100%);
  --hat: #1E95A8; --ride: #5866D2; --snare: #C9603B; --kick: #A27A2F; --pedal: #9256CF;
  --kick-fill: linear-gradient(150deg, #E8C877 0%, #B4883A 45%, #7A5A1C 100%);
  --title: transparent; --title-fill: linear-gradient(120deg, #6E5016 0%, #B4883A 35%, #8A6620 60%, #C49643 85%, #6E5016 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 15px; line-height: 1.5;
  transition: background-color 0.4s, color 0.4s;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* App bar */
.bar { display: flex; align-items: center; gap: 10px; min-height: 60px; padding-block: 10px; max-width: 1180px; margin-inline: auto; }
.back {
  width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.back svg { width: 18px; height: 18px; }
.bar-t { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.bar-t h1 {
  margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 22px; line-height: 1.1; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--title); background: var(--title-fill); -webkit-background-clip: text; background-clip: text;
}
.ownertag { flex: none; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); }
.ownertag::before { content: attr(data-t); }
.lvtag { flex: none; font-family: var(--f-display); font-weight: 800; font-size: 13px; padding: 1px 10px; border-radius: 99px; background: var(--accent-fill); color: var(--on-accent); }
.langsw { flex: none; display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--surface); }
.langsw button { border: 0; background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 99px; cursor: pointer; }
.langsw button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.screen { max-width: 1180px; margin-inline: auto; padding-block: 4px 28px; }

/* 1 Home */
.home { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 1vh 28px; }
.hint { margin: 0; text-align: center; font-size: 13px; color: var(--ink-2); }
.carwrap { position: relative; min-width: 0; }
.hcat { display: grid; gap: 4px; min-width: 0; }
.sect.hrow-t { padding-inline: max(16px, env(safe-area-inset-left, 0px)); max-width: 1180px; width: 100%; margin-inline: auto; font-size: 15px; color: var(--ink); }
.car {
  --cw: min(58vw, 330px, max(150px, calc((100svh - 400px) / 1.375)));
  position: relative; display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: max(calc(50% - var(--cw) / 2), env(safe-area-inset-left, 0px)); padding-block: 10px 6px;
}
.car::-webkit-scrollbar { display: none; }
.gcard {
  flex: none; width: var(--cw); scroll-snap-align: center; border: 0; background: none; padding: 0; color: inherit; cursor: pointer;
  display: grid; justify-items: center; gap: 4px; text-align: center;
  transform: scale(calc(1 - var(--k, 0) * 0.12)); opacity: calc(1 - var(--k, 0) * 0.5);
  transition: transform 0.12s ease-out, opacity 0.12s;
}
.gart {
  position: relative; display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 11; border-radius: 24px; overflow: hidden;
  box-shadow: 0 22px 44px -22px rgba(0, 0, 0, 0.8); margin-bottom: 10px;
}
.gart svg { display: block; width: 100%; height: 100%; }
.gname { font-family: var(--f-display); font-weight: 800; font-size: clamp(18px, 4.6vw, 24px); line-height: 1.15; }
.gsub { font-size: 13px; color: var(--ink-2); }
.soonb {
  position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  padding: 2px 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.5); color: #FFFFFF;
}
.dots { display: flex; justify-content: center; gap: 2px; }
.dots button { width: 22px; height: 22px; border: 0; padding: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dots button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background-color 0.2s, transform 0.2s; }
.dots button[aria-current="true"]::before { background: var(--ink); transform: scale(1.15); }
.carnav:disabled { opacity: 0.3; cursor: default; }
.carnav {
  display: none; position: absolute; top: calc(10px + var(--cwp) * 0.34); width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--ink); cursor: pointer; align-items: center; justify-content: center; z-index: 2;
}
.carnav svg { width: 18px; height: 18px; }
.carnav.prev { left: max(16px, env(safe-area-inset-left, 0px)); }
.carnav.next { right: max(16px, env(safe-area-inset-right, 0px)); }
@media (hover: hover) and (min-width: 760px) { .carnav { display: inline-flex; } }

/* 2 Levels */
.levels { display: grid; gap: 14px; }
.sect { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.04em; }
.ucards { display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); padding-top: 6px; }
.ucards .gcard { width: auto; transform: none; opacity: 1; }
.lvcards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.lvc {
  position: relative; border: 0; border-radius: 22px; padding: 20px; text-align: left; cursor: pointer; overflow: hidden;
  display: grid; gap: 10px; align-content: start; min-height: 150px;
}
.lvc b { font-family: var(--f-display); font-weight: 800; font-size: 32px; line-height: 1; }
.lvc p { margin: 0; font-size: 15px; line-height: 1.6; opacity: 0.86; max-width: 34em; padding-right: 40px; }
.pips { display: flex; gap: 4px; }
.pips i { width: 18px; height: 5px; border-radius: 3px; background: currentColor; opacity: 0.22; }
.pips i.f { opacity: 1; }
.lvc .go { position: absolute; right: 16px; bottom: 16px; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.lvc .go svg { width: 16px; height: 16px; }
.lvc[data-lv="rookie"] { background: #0E0B09; color: #F3E7DF; box-shadow: inset 0 0 0 1px #3A2A22; }
.lvc[data-lv="rookie"] b { color: transparent; background: linear-gradient(120deg, #8A4E26 0%, #F0BE95 30%, #B06A36 55%, #F7D2B2 78%, #8A4E26 100%); -webkit-background-clip: text; background-clip: text; }
.lvc[data-lv="rookie"] .go { background: linear-gradient(135deg, #7A4321, #D99A6C 30%, #A9622F 55%, #F0BE95 80%); color: #1E0F06; }
.lvc[data-lv="rookie"] .pips i { background: #C98252; }
.lvc[data-lv="vet"] { background: #0B0C0E; color: #EEF0F3; box-shadow: inset 0 0 0 1px #2E3136; }
.lvc[data-lv="vet"] b { color: transparent; background: linear-gradient(120deg, #7C828A 0%, #F2F4F7 30%, #A3A9B1 55%, #FFFFFF 78%, #868C94 100%); -webkit-background-clip: text; background-clip: text; }
.lvc[data-lv="vet"] .go { background: linear-gradient(135deg, #7C828A, #E9EDF1 30%, #A3A9B1 55%, #FAFBFC 80%); color: #15171A; }
.lvc[data-lv="vet"] .pips i { background: #BFC5CC; }
.lvc[data-lv="pro"] { background: #0B0A08; color: #F2EBDA; box-shadow: inset 0 0 0 1px #3B3222; }
.lvc[data-lv="pro"] b { color: transparent; background: linear-gradient(120deg, #A27A2F 0%, #F3DA94 30%, #C49643 55%, #FBEAB6 78%, #A9812F 100%); -webkit-background-clip: text; background-clip: text; }
.lvc[data-lv="pro"] .go { background: linear-gradient(135deg, #8E6A24, #E8C877 30%, #B4883A 55%, #F6E1A0 80%); color: #1C1405; }
.lvc[data-lv="pro"] .pips i { background: #D4AA55; }
.lvc:active { transform: scale(0.99); }
:root[data-scheme="light"] .lvc[data-lv="rookie"] { background: #FFFFFF; color: #2A1A10; box-shadow: inset 0 0 0 1px #E6D6CA; }
:root[data-scheme="light"] .lvc[data-lv="rookie"] b { background: linear-gradient(120deg, #6A3A1C 0%, #C47C4A 35%, #8A4E26 60%, #B9733F 85%, #6A3A1C 100%); -webkit-background-clip: text; background-clip: text; }
:root[data-scheme="light"] .lvc[data-lv="vet"] { background: #FFFFFF; color: #16181B; box-shadow: inset 0 0 0 1px #D6D9DE; }
:root[data-scheme="light"] .lvc[data-lv="vet"] b { background: linear-gradient(120deg, #3E444C 0%, #8E949C 35%, #5A6068 60%, #9AA0A8 85%, #3E444C 100%); -webkit-background-clip: text; background-clip: text; }
:root[data-scheme="light"] .lvc[data-lv="vet"] .pips i { background: #8E949C; }
:root[data-scheme="light"] .lvc[data-lv="pro"] { background: #FFFFFF; color: #1F1808; box-shadow: inset 0 0 0 1px #E6DCC3; }
:root[data-scheme="light"] .lvc[data-lv="pro"] b { background: linear-gradient(120deg, #6E5016 0%, #B4883A 35%, #8A6620 60%, #C49643 85%, #6E5016 100%); -webkit-background-clip: text; background-clip: text; }
:root[data-scheme="light"] .lvc[data-lv="pro"] .pips i { background: #B4883A; }
/* 淺色練習模式：卡片、格子加外框，跟背景分開 */
:root[data-scheme="light"][data-level="practice"] .stage,
:root[data-scheme="light"][data-level="practice"] .staffbox,
:root[data-scheme="light"][data-level="practice"] .scorebox { box-shadow: inset 0 0 0 1px #C9C9CC, 0 1px 2px rgba(0, 0, 0, 0.06); }
:root[data-scheme="light"][data-level="practice"] .rl { box-shadow: inset 0 0 0 1px #CFCFD2; }
:root[data-scheme="light"] .mcard:not(.ch) { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
:root[data-scheme="light"] .gart { box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.35); }
:root[data-scheme="light"] .sheet { background: rgba(0, 0, 0, 0.32); }

@media (min-width: 720px), (orientation: landscape) and (max-height: 520px) {
  .lvcards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lvc { min-height: 220px; }
}

/* Coming soon */
.soon { display: grid; gap: 16px; justify-items: center; text-align: center; padding-top: 4vh; }
.soon .gart { width: min(80vw, 360px); }
.soon h2 { margin: 0; font-family: var(--f-display); font-size: 24px; font-weight: 800; }
.soon p { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 30em; }

/* 3 Practice */
.play { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "panel" "actions"; }
.play-main { grid-area: main; display: grid; gap: 14px; min-width: 0; align-content: start; }
.panel { grid-area: panel; display: grid; gap: 18px; align-content: start; min-width: 0; }
.actions {
  grid-area: actions; position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px;
  padding-block: 10px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg);
}
.tright:empty { display: none; }
.toscore { font-weight: 700; }
.score { display: grid; gap: 12px; }
.sctool {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; background: var(--bg);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-block: 8px;
}
.scgap { flex: 1; }
.scf { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.scf select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background-color: var(--surface); color: var(--ink);
  border-radius: 99px; padding: 6px 28px 6px 12px; font-family: var(--f-mono); font-size: 13px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23777' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.sctempo { display: flex; align-items: center; gap: 4px; }
#scBpm { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); min-width: 5.4em; text-align: center; }
#scBpm b { font-size: 17px; font-weight: 500; color: var(--ink); }
.scclick { font-size: 13px; }
.scclick input { width: 18px; height: 18px; }
#scoreGo { min-width: 104px; }
.scorebox { background: var(--surface); border-radius: 18px; padding: 14px 12px; display: grid; gap: 2px; min-width: 0; }
.scl, .scl0 { display: block; width: 100%; height: auto; }
.scl0 { margin-bottom: 6px; }
#scBaseL { display: none !important; }
.basewrap { position: relative; }
.basewrap.off svg.scl0 .bar0 > :not(.s-bn), .basewrap.off svg.scl0 > :not(.bar0) { display: none; }
.basewrap .bl { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.eyeb { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.basewrap .eyeb { position: absolute; transform: translateY(-50%); width: 26px; height: 26px; }
.eyeb[aria-pressed="false"] { opacity: 0.7; }
.scfoot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#scPdf { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent); }
#scPdf.locked { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.scl .hit { fill: transparent; cursor: pointer; }
.scl .hit:hover { fill: var(--ink); fill-opacity: 0.04; }
.s-bn { fill: var(--ink-2); font-family: var(--f-mono); }
@media (max-width: 560px) { .scgap { display: none; } .sctool { gap: 8px 10px; } }
@media (orientation: landscape) and (max-height: 520px) {
  .sctool { gap: 6px 8px; padding-block: 6px; flex-wrap: nowrap; }
  .scf { gap: 4px; font-size: 12px; }
  .scf select { padding: 5px 22px 5px 9px; font-size: 12px; background-position: right 8px center; }
  .scgap { display: block; }
  #scoreGo, #scPdf { min-width: 0; min-height: 36px; padding-inline: 12px; }
  #scPdf span { display: none; }
  .sctool .advb > span { display: none; }
  .sctool .advb { min-height: 36px; padding-inline: 10px; }
  .sctool #scLoop.on .lbl { display: inline; font-size: 12px; }
  .scclick { font-size: 12px; gap: 6px; }
  .sctempo .stepper { width: 30px; height: 30px; }
  #scBpm { min-width: 4.6em; }
}
.sttl { display: flex; align-items: center; gap: 10px; }
.recopen { display: inline-flex; align-items: center; gap: 7px; border: 0; background: var(--ink); color: var(--surface); font: inherit; font-size: 14px; font-weight: 800; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.recnav { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border-radius: 12px; background: var(--tint); }
.recnav .reccur { flex: 1; }
.recnav .ibtn svg { width: 15px; height: 15px; }
.reccur { font-size: 13px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reccur small { font-weight: 600; color: var(--ink-2); margin-left: 6px; }
.rectip { margin: 0 18px; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 12px; font-size: 13px; line-height: 1.65; display: grid; gap: 4px; }
.rectip b { font-size: 13.5px; }
.recsec summary .rt { display: grid; gap: 2px; }
.recsec summary em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--ink-2); }
.reckick { display: grid; gap: 3px; padding: 0 18px; }
.reckick small { color: var(--ink-2); font-size: 12px; padding-left: 30px; }
.reclist { display: grid; gap: 14px; padding: 0 18px; }
.recsec summary { cursor: pointer; font-weight: 800; font-size: 14px; padding: 6px 0; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.recsec summary::-webkit-details-marker { display: none; }
.recsec summary::after { content: '▾'; color: var(--ink-2); }
.recsec[open] summary::after { content: '▴'; }
.recsec summary small { font-weight: 600; color: var(--ink-2); margin-left: auto; }
.recgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; padding: 4px 0 6px; }
.recit { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 7px 8px; text-align: left; cursor: pointer; font: inherit; display: grid; gap: 1px; }
.recit b { font-size: 15px; font-weight: 800; }
.recit span { font-size: 11.5px; color: var(--ink-2); }
.recit[aria-current="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.recit[aria-current="true"] span { color: var(--surface); opacity: .8; }
.recit { transition: transform .12s ease, background .12s ease; }
.recit:active { transform: scale(.94); }
.recit.picked { animation: recPick .28s ease; }
@keyframes recPick { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.lane.hfhide .pick, .lane.hfhide .fixed { display: none !important; }
.swtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.swtabs::-webkit-scrollbar { display: none; }
#scPdf, #histPdf { display: none !important; }
.swtabs button { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.swtabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.swtabs button.soon:not([aria-selected="true"]) { opacity: 0.55; }
.swnav { display: grid; gap: 10px; min-width: 0; }
.swchips { display: flex; flex-wrap: wrap; gap: 6px; }
.swchips button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 10px; cursor: pointer; text-align: left; line-height: 1.3; }
.swchips button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 700; }
.swchips button .n { font-family: var(--f-mono); color: var(--ink-2); margin-right: 4px; }
.swchips button .ok { color: var(--accent); font-weight: 800; margin-left: 4px; }
.swchips.pcs button { border-radius: 99px; padding: 6px 14px; }
@media (max-width: 700px) {
  .swchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .swchips::-webkit-scrollbar { display: none; }
  .swchips button { flex: none; white-space: nowrap; }
}
.swinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: var(--surface); border-radius: 14px; padding: 10px 14px; }
.swinfo b { font-size: 15px; }
.swinfo .tag { font-size: 12.5px; color: var(--ink-2); flex-basis: 100%; }
.swinfo .best { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.swinfo .sp { flex: 1; }
.swinfo .btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
#swDraw { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.swsel {
  appearance: none; -webkit-appearance: none; flex: 0 1 17em; min-width: 0; max-width: 20em; border: 1px solid var(--ink); background-color: var(--surface); color: var(--ink);
  border-radius: 9px; padding: 6px 30px 6px 10px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.swtip { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--ink-2) 55%, transparent); line-height: 19px !important; cursor: pointer; font: 800 13px/22px var(--f-sans, inherit); color: var(--ink); background: color-mix(in srgb, var(--ink-2) 22%, var(--surface)); padding: 0; }
.swtip[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink-2); }
.swhd { display: flex; align-items: center; gap: 8px; min-width: 0; }
.swck { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 15px; font-weight: 900; cursor: pointer; padding: 0; }
.swck[aria-pressed="true"] { background: #2f9e5f; border-color: #2f9e5f; color: #fff; }
.swseg { max-width: 460px; display: flex; background: color-mix(in srgb, var(--ink-2) 16%, transparent); border-radius: 10px; padding: 3px; gap: 2px; }
.swseg button { flex: 1; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 0; border-radius: 8px; cursor: pointer; }
.swseg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.brrh button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; }
.brrh button b { font-size: 12.5px; }
.brrh button b small { font-weight: 600; opacity: .7; }
.brfeet { margin-bottom: 8px; }
.brrh .brbt { display: block; }
.swseg .ok { color: #2f9e5f; margin-left: 3px; }
.swtabs button .ok { color: #2f9e5f; margin-left: 4px; font-weight: 800; }
.lvtabs .lvb { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.lvtabs .lvb svg { width: 10px; height: 7px; transform: rotate(-90deg); transition: transform .18s; }
.lvtabs .lvb[aria-expanded="true"] svg { transform: none; }
.lvtabs .lvb[aria-current="true"] { box-shadow: inset 0 0 0 1.5px currentColor; }
.swtabs.lvtabs button.lvb, .swtabs.lvtabs button.lvchip { color: var(--ink); }
.swtabs.lvtabs button.lvb[aria-current="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); box-shadow: none; }

.lvtabs .lvchip { font-weight: 700; }
.lvtabs .lvgrp { display: inline-flex; flex: none; gap: 6px; padding: 3px; border-radius: 99px; background: color-mix(in srgb, var(--ink-2) 20%, transparent); }
.lvtabs .lvgrp button { border-color: transparent; }
.lvtabs .lvgrp .lvb[aria-current="true"] { background: var(--ink); }
.lvtabs .lvgrp .lvchip { background: transparent; }
.lvtabs .lvchip[aria-selected="true"], .lvtabs .lvgrp .lvchip[aria-selected="true"] { background: var(--surface); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); font-weight: 800; }

.swpick { position: relative; flex: 0 1 auto; min-width: 0; display: flex; }
.swpick .swsel { flex: 0 1 auto; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; background-image: none; padding: 6px 12px; white-space: nowrap; text-align: left; }
.swsel .nm { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hdots { display: inline-flex; gap: 2px; vertical-align: baseline; margin: 0 1px; }
.hdots i { font-style: normal; width: 1.5em; height: 1.5em; border-radius: 50%; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-2) 45%, transparent); color: color-mix(in srgb, var(--ink-2) 55%, transparent); display: inline-grid; place-items: center; font-size: 0.78em; font-weight: 500; line-height: 1; font-family: var(--f-body); }
.hdots i.on { background: var(--ink); color: var(--surface); box-shadow: 0 0 0 1px var(--ink); font-weight: 800; }
.hdots i > b, .hdots i.lc { font-weight: inherit; }
.hdots i.lc { padding-bottom: 0.14em; }
.hplus { margin: 0 3px; font-weight: 700; }
.swsel svg { flex: none; width: 12px; height: 8px; color: var(--ink-2); }
.swsel .ok { color: #2f9e5f; font-weight: 800; }
.swsel.single { cursor: default; opacity: 1; }
.swsel.single svg { display: none; }
.swkind { flex: none; display: inline-flex; background: color-mix(in srgb, var(--ink-2) 18%, transparent); border-radius: 99px; padding: 2px; gap: 2px; }
.swkind button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 99px; cursor: pointer; white-space: nowrap; transition: background .18s, color .18s; }
.swkind button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.swkind button:disabled { opacity: 0.35; cursor: default; }
.swhd .swpick + .swpick { margin-left: -2px; }
.swlist { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: min(92vw, 440px); max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.2); padding: 6px; }
.swlist[hidden] { display: none; }
.swopt { display: flex; width: 100%; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-align: left; padding: 9px 12px 9px 6px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.swopt[aria-selected="true"] { background: color-mix(in srgb, var(--ink-2) 24%, transparent); font-weight: 800; }
.swopt .ok { flex: none; width: 1.2em; text-align: center; color: #2f9e5f; font-weight: 800; }
.swgrp { font-size: 11.5px; color: var(--ink-2); padding: 8px 8px 2px; font-weight: 700; }
.swhd #scLoop { flex: none; width: 32px; height: 32px; min-height: 0; border-radius: 50%; padding: 0; justify-content: center; position: relative; margin-left: auto; border: 1.5px solid var(--line); }
.swhd #scLoop .lbl { display: none !important; }
.swhd #scLoop + .swck { margin-left: 0; }
.swhd #scLoop.on { border-color: var(--accent); color: var(--surface); background: var(--accent); }
#scLoop[data-st]:not([data-st=""])::after { content: attr(data-st); position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; border-radius: 8px; background: var(--ink); color: var(--surface); font: 800 10px/15px var(--f-sans, sans-serif); text-align: center; }
.swmore .tapb, .pldock .tapb, #plMore .tapb { height: 52px !important; font-size: 17px !important; font-weight: 800; text-align: center !important; letter-spacing: 0.1em; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.clkseg { display: inline-flex; background: color-mix(in srgb, var(--ink-2) 16%, transparent); border-radius: 9px; padding: 2px; gap: 2px; }
.clkseg button { border: 0; background: transparent; color: var(--ink-2); width: 36px; height: 30px; border-radius: 7px; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.clkseg button svg { width: 12px; height: 19px; }
.clkseg button b { font-size: 11px; white-space: nowrap; }
.clkseg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.swopt.lvR { color: #2E8B57; } .swopt.lvV { color: #3B6FD4; } .swopt.lvP { color: #C94A48; }
:root[data-scheme="dark"] .swopt.lvR { color: #7DCB9C; } :root[data-scheme="dark"] .swopt.lvV { color: #8EAEEA; } :root[data-scheme="dark"] .swopt.lvP { color: #E89A98; }
#scScore.swmode .sctool, #scScore.swmode .sckeys { display: none; }
#scScore.swmode { padding-bottom: 96px; }
#scPlay.docked { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "main" "panel" !important; grid-template-rows: auto !important; padding-bottom: 96px; }
#scPlay.docked .actions { display: none !important; }
#scPlay.docked .panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
#scPlay.docked .panel .keys { display: none; }
#scPlay.docked .panel:not(:has(> :not([hidden]):not(.keys):not(.note:empty))) { display: none; }
.pldock .tempo { flex: none; display: flex; align-items: center; gap: 2px; }
.pldock .tempo .l, .pldock .bpmbox span { display: none; }
.pldock .bpmin { width: 3.2em; font-size: 17px; }
.pldock #spin, .pldock #play { flex: 1; min-width: 0; height: 44px; min-height: 0; border-radius: 12px; font-size: 15px; padding: 0 8px; gap: 6px; }
.pldock #play svg { width: 16px; height: 16px; }
.swmore .switch { padding: 6px 10px; }
.swmore .tapb { width: 100%; }
.swdock { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(560px, calc(100% - 20px));
  background: var(--surface); border-radius: 18px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 8px 10px; display: flex; align-items: center; gap: 8px; }
.swdock[hidden] { display: none; }
.swdock .dslot { display: contents; }
.swdock .sctempo { flex: none; gap: 2px; }
.swdock .sctempo .tapb { display: none; }
.swdock .bpmin { width: 3.2em; font-size: 17px; }
.swdock .bpmbox span { display: none; }
.swdock #scoreGo { flex: 1; min-width: 0; height: 44px; border-radius: 12px; background: var(--ink); color: var(--surface); border-color: var(--ink); font-size: 15px; font-weight: 800; justify-content: center; }
.swmorebtn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 900; cursor: pointer; padding: 0; }
.swmore { position: absolute; right: 8px; bottom: calc(100% + 8px); background: var(--surface); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.22); padding: 8px; display: grid; gap: 6px; min-width: 210px; }
.swmore[hidden] { display: none; }
.swmore > * { width: 100%; justify-content: flex-start; }
.swmore .advb > span, .swmore .tapb { display: inline; }
.swmore .scclick { padding: 6px 10px; }
.swmore .tapb { text-align: left; height: 36px; padding: 0 12px; }
#scScore.swmode #scNote:not(:empty) { position: fixed; z-index: 31; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100% - 32px);
  background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: 12px; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.bookcta { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; padding: 14px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--ink-2); }
.swnote { flex-basis: 100%; font-size: 13px; line-height: 1.6; background: color-mix(in srgb, #519BFF 13%, transparent); border-radius: 10px; padding: 8px 12px; }
.swnote b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.swtabs button.golink { border-style: dashed; color: var(--ink); }
.swtabs.lvtabs button.golink { margin-left: auto; border: 0; background: transparent; padding: 7px 4px; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.swseg { margin-inline: auto; width: 100%; box-sizing: border-box; }
#fsOpen [data-i18n="full"], #chFs [data-i18n="full"] { display: none; }
#fsOpen, #chFs { padding-inline: 8px; }
.swsoonbox { background: var(--surface); border-radius: 18px; padding: 40px 20px; text-align: center; display: grid; gap: 6px; }
.swsoonbox b { font-size: 18px; }
.swsoonbox p { margin: 0; color: var(--ink-2); font-size: 14px; }
#scPlay.swsoon #stage, #scPlay.swsoon #staffbox, #scPlay.swsoon .tbar, #scPlay.swsoon .panel, #scPlay.swsoon .actions { display: none !important; }
.tbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.spinno { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

.stage { background: var(--surface); border-radius: 18px; padding: 14px 12px; display: grid; gap: 16px; }
.counts, .steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.beat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 7px; align-items: center; }
.beat:nth-child(odd) { background: var(--tint); }
.counts .beat { padding-block: 4px; }
.counts span { font-family: var(--f-mono); font-size: 10px; line-height: 1; color: var(--ink-2); text-align: center; }
.counts span.n { font-size: 13px; font-weight: 500; color: var(--ink); }
.countrow { display: grid; grid-template-columns: minmax(0, 1fr); }
.countrow .sp { display: none; }

.st-next { opacity: 0.38; display: block; }
#staff.st6, .fs-body #staff.st6 { display: flex; flex-wrap: wrap; align-content: center; align-items: flex-start; }
#staff.st6 svg { flex: none; width: 50%; }
.fs-body #staff:not(.st6) { flex-direction: column; justify-content: center; align-items: stretch; }
.s-nx { fill: var(--ink-2); font-weight: 700; }
.nextbox { display: grid; gap: 6px; padding: 8px 10px; border-radius: 12px; border: 1px dashed var(--line); opacity: 0.75; }
.nextbox .nxt { margin: 0; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.nextlane { --nc: var(--snare); }
.nextlane .lab { min-height: 0; }
.nextlane .nxt { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.nextlane .steps::before, .nextlane .steps::after { display: none; }
.nextlane .beat { padding-block: 2px; }
.nc { display: block; height: 12px; border-radius: 3px; background: var(--off); }
.nc.on { background: var(--nc); }
.tomlane .lab { min-height: 0; }
.tomlane .names .nm { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.lane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; --fill: var(--lane); }
.lane[data-id="bd"] { --fill: var(--kick-fill); }
.lab { display: flex; align-items: center; gap: 10px; min-width: 0; }
.names { flex: 1; min-width: 0; display: grid; }
.limb { font-weight: 700; font-size: 14px; line-height: 1.3; }
.nm { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.nm .inst { font-family: var(--f-mono); font-size: 11px; }
.tools { display: flex; align-items: center; gap: 6px; flex: none; }
.ibtn {
  width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.ibtn svg { width: 15px; height: 15px; }
.ibtn .on-only { display: none; }
.ibtn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.ibtn[aria-pressed="true"] .on-only { display: inline; }
.ibtn[aria-pressed="true"] .off-only { display: none; }
.ibtn:disabled { opacity: 0.5; cursor: default; }
.sw {
  height: 26px; min-width: 42px; padding: 0 9px; border-radius: 99px; border: 1px solid var(--line); background: transparent;
  color: var(--ink-2); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.sw[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent); color: var(--on-accent); }
.modes { padding-top: 2vh; }
.mcards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.mcard {
  --sf: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', 'PingFang TC', 'Noto Sans TC', sans-serif;
  border: 0; border-radius: 22px; padding: 46px 24px 0; cursor: pointer; overflow: hidden; text-align: center;
  display: grid; grid-template-rows: auto 1fr; justify-items: center; gap: 12px;
  background: #FFFFFF; color: #1D1D1F; font-family: var(--sf);
}
.mcard b { font-family: var(--sf); font-weight: 600; font-size: clamp(34px, 8.6vw, 52px); line-height: 1.07; letter-spacing: -0.02em; }
.mcard .cta {
  display: inline-flex; align-items: center; gap: 4px; padding: 8px 18px; border-radius: 980px;
  background: #519BFF; color: #FFFFFF; font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
}
.mcard .mart { align-self: end; width: min(78%, 340px); height: auto; margin-top: 14px; transition: transform 0.5s cubic-bezier(.2,.7,.2,1); }
.mcard:hover .mart { transform: translateY(-4px) scale(1.02); }
.mcard.ch { background: #000000; color: #F5F5F7; }
.mcard.ch b { color: transparent; background: linear-gradient(100deg, #E2B08A 0%, #F5F5F7 45%, #EBD08E 100%); -webkit-background-clip: text; background-clip: text; }
.mcard:focus-visible { outline: 2px solid #519BFF; outline-offset: 3px; }
@media (min-width: 720px), (orientation: landscape) and (max-height: 520px) {
  .mcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcard { min-height: min(68vh, 560px); padding-top: 54px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .mcard { min-height: calc(100vh - 80px); padding-top: 26px; gap: 8px; }
  .mcard b { font-size: 32px; }
  .mcard .mart { width: min(60%, 260px); }
}
.mcard:active { transform: scale(0.99); }
/* 兩個選項做成正方形，並限制大小讓整個畫面放得下 */
.mcard { aspect-ratio: 1 / 1; min-height: 0 !important; width: 100%; max-width: calc((100svh - 130px) / 2); justify-self: center; padding: 8% 6% 0 !important; gap: 4% !important; }
.mcard .mart { width: min(74%, 440px); min-height: 0; max-height: 100%; }
.mcard b { font-size: clamp(26px, 6.4vw, 52px); }
@media (min-width: 720px), (orientation: landscape) and (max-height: 520px) {
  .mcards { align-items: center; }
  .mcard { max-width: calc(100svh - 120px); }
}
@media (orientation: landscape) and (max-height: 520px) { .mcard b { font-size: 28px; } }
@media (min-width: 720px), (orientation: landscape) and (max-height: 520px) {
  .mcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcard { min-height: min(60vh, 420px); }
}
.psel { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.play.practice .lane.rest .pick, .play.practice .lane.rest .ico { opacity: 1; }
.pick .chev { position: absolute; right: 3px; top: 50%; z-index: 3; transform: translateY(-50%); font-size: 9px; color: var(--ink-2); pointer-events: none; }
.ico .chev { right: 0; top: auto; bottom: 0; transform: none; }
.play.practice #spin, .play.practice .hist, .play.practice #chalSet, .fs.practice #fsSpin { display: none; }
.hist { display: inline-flex; align-items: center; gap: 6px; }
.hist .ibtn { width: 28px; height: 28px; }
.setgrp { display: grid; gap: 10px; }
.paytag { display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: linear-gradient(135deg, #F6E1A0, #C79A45 55%, #A9812F); color: #1C1405; letter-spacing: 0; }
.coopts { display: grid; gap: 8px; }
.chslot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 12px 0 10px; }
.chslot .rl { height: 174px; border-radius: 12px; --pl: 33.333%; --u: 33.333%; }
.swinfo.chinfo { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; font-size: 14px; line-height: 1.4; white-space: nowrap; }
.swinfo.chinfo span:first-child { font-weight: 800; }
.swinfo.chinfo span:last-child { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.bsvg { width: 100%; height: 100%; overflow: visible; }
.bsvg .bl { stroke: var(--line); stroke-width: 1; }
.bsvg .bh, .bsvg .bb { fill: var(--ink); }
.bsvg .bs { stroke: var(--ink); stroke-width: 1.2; } .bsvg .bs.thin { stroke-width: 0.9; }
.bsvg .ba { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
.bsvg .bt { font: 800 10px Inter, sans-serif; fill: var(--ink); text-anchor: middle; } .bsvg .bg { font-size: 7px; }
.bsvg .tn { font: 800 8px Inter, sans-serif; fill: var(--ink); text-anchor: middle; }
.chslot .ri:not(.mid) .bsvg { opacity: 0.45; }
rect.chcur { transition: opacity 0.4s ease; } rect.chcur.go { opacity: 0; }
.chslot .ri { white-space: normal; overflow: hidden; padding: 0 4px; text-align: center; font-size: 11.5px; line-height: 1.25; color: var(--ink-2); word-break: break-word; }
.chslot .ri.mid { color: var(--ink); font-weight: 800; font-size: 12.5px; }
.rhrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.rhrow .spinno { min-width: 5.5em; text-align: center; }
.chmach { background: var(--surface); border-radius: 18px; padding: 12px 12px 10px; margin: 10px 0 12px; }
.chmach .chbeats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chmach .chbeats span { text-align: center; font-family: var(--f-mono, monospace); font-size: 13px; font-weight: 800; color: var(--ink-2); background: var(--tint); border-radius: 6px; padding: 3px 0; }
.chmach .chbeats, .chmach .chslot { max-width: 520px; margin-left: auto; margin-right: auto; }
.chmach .chslot { margin-top: 6px; margin-bottom: 10px; }
.chmach .chslot .rl { width: 100%; }
.chbars { display: flex; justify-content: center; gap: 8px; }
.chbars button { border: 1px solid var(--line); background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; padding: 5px 14px; border-radius: 999px; cursor: pointer; }
.chbars.many { flex-wrap: wrap; gap: 5px; }
.chbars.many button { min-width: 30px; padding: 4px 0; font-size: 12px; }
.chbars button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chstaffhd { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-radius: 18px 18px 0 0; padding: 12px 12px 0; }
.chstaffhd[hidden] { display: none; }
#swDock #swDraw { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent); }
#swDock #swDraw:disabled { opacity: 0.6; }
.chstaffhd { margin-bottom: -12px; }
.chstaffhd b { font-size: 15px; font-weight: 800; }
.chstaffhd + .scorebox { border-radius: 0 0 18px 18px; }
:root[data-scheme="dark"] .chstaffhd + .scorebox { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-2) 38%, transparent); }
#chStaffHd > b[data-i18n="score"], .sttl h2[data-i18n="score"] { display: none; }
#chStaffHd { position: relative; justify-content: center; min-height: 12px; }
#chStaffHd > .swseg { margin: 0 auto; width: min(100%, 380px); }
#chStaffHd .sctools { position: absolute; right: 12px; top: 100%; margin-top: 4px; z-index: 3; display: flex; align-items: center; gap: 4px; max-width: calc(100% - 24px); }
#chStaffHd .sctools .scmutes { order: 0; flex: 0 1 auto; margin: 0; }
#chStaffHd:not([hidden]) + .scorebox { padding-top: 52px; }
#chStaffHd + .scorebox.chfs { padding-top: 60px; }
.scorebox.chfs { position: fixed; inset: 0; z-index: 60; border-radius: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 60px 16px 32px; display: block; }
.scorebox.chfs > svg { display: block; flex: none; margin: 0 auto 6px; }
.chfsx { position: fixed; z-index: 61; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; }
.chfsx[hidden] { display: none; }
.swdock #scoreGo, .swdock .btn.spin, .pldock #spin, .pldock #play { white-space: nowrap; }
.swdock .btn.spin { flex: 1; min-width: 0; height: 44px; border-radius: 12px; background: var(--accent-fill); color: var(--on-accent); border: 1px solid var(--accent); font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; }
.swspin { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 6px; }
.coTeach { border: 1px solid var(--line); border-radius: 12px; margin: 2px 0 12px; background: var(--tint); }
.coTeach summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; list-style: none; }
.coTeach summary::-webkit-details-marker { display: none; }
.coAv { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.coTN { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.coTN b { font-size: 15px; } .coTN small { color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.coTMore { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.coTMore svg { transition: transform .2s; } .coTeach[open] .coTMore svg { transform: rotate(180deg); }
.coTBody { padding: 0 14px 14px; font-size: 13.5px; line-height: 1.55; }
.coTBody h4 { margin: 12px 0 4px; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.coTBody ul { margin: 0; padding-left: 18px; } .coTBody li + li { margin-top: 2px; }
.coTBody a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.coTBody img { display: block; width: 100%; border-radius: 10px; margin-top: 12px; }
.coTBody .coTQ { margin: 10px 0 0; }
.coSolo { display: block; width: 100%; aspect-ratio: 16 / 9; margin-top: 12px; border-radius: 10px; background: #000; }
.coSoloCap { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); }
.sheet h3.costep { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: 0; }
.costep b { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12.5px; display: grid; place-items: center; flex: none; }
.costep .saletag { margin-left: auto; }
.couse { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--tint); font-size: 13px; line-height: 1.55; }
.couse b { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.couse ul { margin: 0; padding-left: 18px; } .couse li + li { margin-top: 3px; }
.coflowl { list-style: none; counter-reset: cf; margin: 14px 0 4px; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.coflowl li { counter-increment: cf; display: flex; gap: 8px; align-items: baseline; }
.coflowl li::before { content: '→'; flex: none; color: var(--ink-2); }
.colang { font-size: 12px; }
.coEx { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 12px; }
.coEx summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; }
.coEx summary::-webkit-details-marker { display: none; }
.coEx summary svg { transition: transform .2s; } .coEx[open] summary svg { transform: rotate(180deg); }
.coExBody, #coExBody { padding: 0 12px 14px; }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 14px 10px; background: var(--tint); border-radius: 12px; }
.chat + .chat { margin-top: 12px; }
.chat .day { align-self: center; font-size: 11.5px; color: var(--ink-2); }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.msg.me { justify-content: flex-end; }
.msg .av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.msg .col { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 84%; }
.msg.me .col { align-items: flex-end; }
.msg .who { font-size: 11.5px; color: var(--ink-2); padding: 0 4px; }
.bub { padding: 9px 12px; border-radius: 16px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg.me .bub { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; }
.msg.t .bub { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg .tm { font-size: 10.5px; color: var(--ink-2); padding: 0 4px; }
.chatAct { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.chatAct button { font: inherit; border-radius: 12px; padding: 11px 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.chatAct .ok { background: #2E9E5B; color: #fff; border: 0; font-weight: 800; font-size: 15px; }
.chatAct .more { background: transparent; color: var(--ink); border: 1px solid var(--line); font-size: 13.5px; }
.chatAct .note { font-size: 12.5px; color: var(--ink-2); text-align: center; min-height: 1em; }
.coopt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.coopt:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.coopt input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.coopt span { display: grid; gap: 2px; }
.coopt { position: relative; }
.coprice s { font-weight: 600; font-size: 12px; color: var(--ink-2); margin-right: 2px; }
.saletag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: #E0503D; color: #FFFFFF; margin-right: 4px; }
.coprice { position: absolute; right: 12px; top: 10px; font-style: normal; font-family: var(--f-display); font-weight: 800; font-size: 15px; color: var(--ink); }
.coopt span { padding-right: 96px; }
.coopt em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--accent); } .coopt b { font-size: 14px; } .coopt small { font-size: 12.5px; color: var(--ink-2); }
.cogrp { display: grid; gap: 10px; }
.cofile { cursor: pointer; }
#coUpload .advb { justify-self: start; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: #E0503D; flex: none; }
#coRec.on .recdot { animation: recBlink 1s steps(2) infinite; }
@keyframes recBlink { 50% { opacity: 0.2; } }
#coRecPlay { width: 100%; height: 36px; }
.cofinfo.bad { color: #EE6B5B; }
.cofld { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.cofld textarea, .cofld input { font: inherit; font-weight: 400; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; width: 100%; box-sizing: border-box; }
.cofld textarea { resize: vertical; }
.cocount { justify-self: end; font-size: 11px; font-weight: 400; color: var(--ink-2); font-family: var(--f-mono); }
#coachTitle .paytag { margin-left: 4px; }
#fbCoach .paytag { margin-left: 2px; }
.bkrow { display: flex; gap: 10px; flex-wrap: wrap; }
.tour { position: fixed; inset: 0; z-index: 80; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.62); transition: all 0.25s ease; pointer-events: none; outline: 2px solid var(--accent); }
.tour-card { position: fixed; background: var(--surface); color: var(--ink); border-radius: 16px; padding: 14px 16px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35); display: grid; gap: 10px; transition: top 0.25s ease, left 0.25s ease; }
.tour-card p { margin: 0; font-size: 14.5px; line-height: 1.55; }
.tour-f { display: flex; align-items: center; gap: 8px; }
.tour-f #tourN { flex: 1; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.tour-f .btn { min-height: 36px; padding-inline: 14px; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card { transition: none; } }
.secth { display: flex; align-items: center; gap: 8px; }
.infob { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 0; padding: 0; cursor: pointer; font-weight: 900; font-size: 13px; line-height: 22px;
  background: linear-gradient(135deg, #F6E1A0, #C79A45 55%, #A9812F); color: #1C1405; }
.lvprog .gold { color: #E3B54F; margin-left: 6px; }
.progbox { display: grid; gap: 5px; min-width: 200px; }
.pg-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; }
.pg-top b { font-family: var(--f-display); font-size: 18px; color: var(--accent); }
.pgbar { display: block; height: 6px; border-radius: 99px; background: var(--off); overflow: hidden; }
.pgbar i { display: block; height: 100%; width: 0; background: var(--accent-fill); border-radius: 99px; transition: width 0.4s; }
.pg-d { margin: 0; font-size: 11.5px; color: var(--ink-2); line-height: 1.4; }
.lvprog { display: grid; gap: 4px; margin-top: 6px; text-align: left; width: calc(100% - 52px); }
.fi.n::before { content: '•'; color: var(--accent); }
.lvprog em { font-style: normal; font-size: 12px; font-weight: 800; }
.lvprog small { font-size: 11px; color: var(--ink-2); }
.advb { justify-self: start; display: inline-flex; align-items: center; gap: 7px; }
.fbst { font-size: 11px; font-weight: 800; padding: 0 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); line-height: 18px; }
.fbb.on .fbst { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; }
#scFb.on, #scLoop.on { border-color: var(--accent); color: var(--accent); }
.fbmeter { display: grid; gap: 6px; min-width: 200px; }
.fbm-track { position: relative; height: 26px; border-radius: 8px; background: var(--tint); border: 1px solid var(--line); overflow: hidden; }
.fbm-c { position: absolute; left: 50%; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: var(--ink-2); opacity: 0.5; }
.fbm-l, .fbm-r { position: absolute; top: 4px; font-size: 10px; color: var(--ink-2); }
.fbm-l { left: 6px; } .fbm-r { right: 6px; }
.fbd { position: absolute; top: 8px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; }
.fbd.g { background: #5BC489; } .fbd.y { background: #E9B949; } .fbd.r { background: #EE6B5B; }
.fbd.miss { border: 2px solid #EE6B5B; background: transparent; } .fbd.ex { border: 2px dashed #E9B949; background: transparent; }
.fbm-t { margin: 0; font-size: 12px; color: var(--ink-2); font-family: var(--f-mono); }
.fblevel { display: grid; gap: 6px; }
.fbl { position: relative; height: 10px; border-radius: 99px; background: var(--off); overflow: hidden; }
.fbl i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #5BC489; transition: width 0.08s; }
.fbl b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }
#fbSens { flex: 0 1 200px; accent-color: var(--accent); }
.fbcal { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fbcalv { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.fbmsg:empty { display: none; }
.fbtips { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.fbsum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.fbc { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: grid; gap: 2px; }
.fbc span { font-size: 12px; color: var(--ink-2); }
.fbc b { font-size: 18px; font-family: var(--f-display); }
.fbc small { font-size: 11px; color: var(--ink-2); font-family: var(--f-mono); }
.fbc.r1 { border-color: #5BC489; color: #5BC489; } .fbc.r2 { border-color: #E9B949; color: #E9B949; } .fbc.r3 { border-color: #EE6B5B; color: #EE6B5B; }
.fbc.r1, .fbc.r2, .fbc.r3 { align-content: center; }
.fbchart svg { width: 100%; height: auto; display: block; }
.fbchart .ax { stroke: var(--ink-2); stroke-width: 1; opacity: 0.6; }
.fbchart .bl { stroke: var(--line); stroke-width: 1; }
.fbchart rect.g { fill: #5BC489; } .fbchart rect.y { fill: #E9B949; } .fbchart rect.r { fill: #EE6B5B; }
.fbchart rect.day { fill: var(--ink-2); opacity: 0.55; } .fbchart rect.today { fill: var(--accent); }
#logChart .hitd { fill: transparent; cursor: pointer; }
#logChart .seld { fill: var(--ink); opacity: 0.07; }
.logadd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.logadd select, .logadd input { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; }
.logadd input { width: 4.6em; }
.logadd select { max-width: 13em; }
.hrow .x { margin-left: auto; flex: none; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink-2) 22%, transparent); color: var(--ink-2); cursor: pointer; font-size: 12px; line-height: 20px; }
.hrow .tg { font-size: 11px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; }
.fbchart .ms { fill: #EE6B5B; }
.fbchart .lb { fill: var(--ink-2); font-size: 10px; text-anchor: middle; font-family: var(--f-mono); }
.fbchart .lb.e { text-anchor: start; }
.fbitems { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.fi { position: relative; padding: 8px 10px 8px 30px; border-radius: 10px; background: var(--tint); font-size: 14px; line-height: 1.45; }
.fi::before { position: absolute; left: 10px; top: 8px; font-weight: 800; }
.fi.g::before { content: '✓'; color: #5BC489; } .fi.w::before { content: '!'; color: #E9B949; } .fi.b::before { content: '✕'; color: #EE6B5B; } .fi.i::before { content: 'i'; color: var(--ink-2); }
.fi.i { color: var(--ink-2); font-size: 12.5px; }
.ibtn.fav.on { color: #E9B949; } .ibtn.fav.on svg { fill: currentColor; }
.hrow.fav { padding: 0; gap: 0; }
.favgo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: none; border: 0; text-align: left; cursor: pointer; }
.hrow.fav .mini { margin-right: 8px; }
.logreset { justify-self: start; }
.scorebox { position: relative; }
.scorebox { background-repeat: repeat; }
.sclock { position: relative; display: grid; gap: 2px; }
.sclock-in { display: grid; gap: 2px; filter: blur(5px); opacity: 0.55; pointer-events: none; user-select: none; -webkit-user-select: none; }
.lockcard { position: absolute; left: 50%; top: min(180px, 30%); transform: translateX(-50%); display: grid; justify-items: center; gap: 4px; text-align: center;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 16px 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); max-width: calc(100% - 32px); }
.lockcard b { font-size: 16px; } .lockcard span { font-size: 13px; color: var(--ink-2); }
.lockcard .soon { margin-top: 4px; font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 99px; background: var(--accent-fill); color: var(--on-accent); }
.scl .bar.lp .hit { fill: var(--accent); fill-opacity: 0.1; }
.scl .bar.lpa .hit { fill: var(--accent); fill-opacity: 0.18; }
.setrow.off .msel, .setrow.off .sel-dim { opacity: 0.45; }
#advSheet .setrow { padding: 2px 0; }
.play.gapbar .steps, .play.gapbar .staff { opacity: 0.32; transition: opacity 0.15s; }
.setrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.setrow.off .msel { opacity: 0.45; }
.msel { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); }
.msel select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 3px 8px; font-family: var(--f-mono); font-size: 12px; cursor: pointer; }
.play.practice .actions { grid-template-columns: minmax(0, 1fr); }
.fixed { font-size: 11px; font-weight: 700; padding: 0 8px; line-height: 26px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); }
.lane.rest .rl { opacity: 0.38; }
.lane.locked .steps { opacity: 0.7; }
.lane.muted .steps, .lane.muted .ico { opacity: 0.35; }

/* 滾輪：每個視窗看得到上、中、下三排，中間那排在開獎線上 */
.rl { position: relative; overflow: hidden; background: var(--reel); border-radius: 5px; --pl: 25%; --u: 50%; flex: none; }
.rl::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(var(--reel) 0%, color-mix(in srgb, var(--reel) 35%, transparent) calc(var(--pl) * 0.85), transparent var(--pl),
    transparent calc(100% - var(--pl)), color-mix(in srgb, var(--reel) 35%, transparent) calc(100% - var(--pl) * 0.85), var(--reel) 100%);
}
.rl::after {
  content: ""; position: absolute; left: 0; right: 0; top: var(--pl); bottom: var(--pl); z-index: 2; pointer-events: none;
  border-block: 1.5px solid color-mix(in srgb, var(--lane) 45%, transparent);
  transition: background-color 0.08s, border-color 0.08s;
}
.rs { position: absolute; left: 0; right: 0; top: 0; height: 100%; display: flex; flex-direction: column; will-change: transform; }
.ri { flex: none; height: var(--u); display: flex; align-items: center; justify-content: center; }
.rl.spinning .rs { filter: blur(0.6px); }
.rl .ri { transition: opacity 0.4s ease; }
.rl.solo .ri:not(.mid) { opacity: 0; }
/* 只留中間那一格：把滾輪的上下兩段（包括底色的空格）一起剪掉 */
.rl.step { clip-path: inset(0 0 0 0 round 5px); transition: clip-path 0.4s ease; }
.rl.step.solo { clip-path: inset(30.77% 0 30.77% 0 round 5px); }
#lanes.settled .steps .beat:nth-child(odd) { background: linear-gradient(transparent 29%, var(--tint) 29%, var(--tint) 71%, transparent 71%); }
@media (prefers-reduced-motion: reduce) { .rl.step { transition: none; } }
.rl.landed .ri.mid > * { animation: pop 0.24s ease-out; }
@keyframes pop { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }

.rl.step { aspect-ratio: 1 / 2.6; max-width: 100%; --pl: 30.77%; --u: 38.4615%; }
.step .ri i { width: 74%; aspect-ratio: 1; border-radius: 4px; background: var(--off); }
.step .ri.on i { background: var(--fill); background-image: linear-gradient(rgba(0,0,0,.28), rgba(255,255,255,.18) 45%, rgba(255,255,255,.18) 55%, rgba(0,0,0,.28)); }
/* 2026-11-12：跟 reel 一樣有金屬感；播放線經過時，有打的那格輕輕跳一下就好（整格不閃） */
.step .ri.acc i { width: 56%; box-shadow: 0 0 0 1.5px var(--reel), 0 0 0 3px var(--lane); }
.step .ri.op i { background: transparent !important; box-shadow: inset 0 0 0 2.5px var(--lane); border-radius: 50%; }
.step .ri.gh i { width: 40%; border-radius: 50%; background: color-mix(in srgb, var(--lane) 55%, var(--off)); }
.rl.step.now .ri.mid.on i { animation: stHit 0.22s ease-out; }
@keyframes stHit { 0% { transform: translateY(-22%); filter: brightness(1.35); } 60% { transform: translateY(4%); } 100% { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .rl.step.now .ri.mid.on i { animation: none; } }
.steps { position: relative; }
.steps::before, .steps::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; transform: translateY(-50%); border-block: 5px solid transparent; }
.steps::before { left: -9px; border-left: 6px solid var(--lane); }
.steps::after { right: -9px; border-right: 6px solid var(--lane); }

.ico { width: 30px; height: 60px; color: var(--lane); }
.ico .ri { padding: 2px; }
.ico svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ico .il { stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; fill: none; }
.ico .ilf { fill: var(--ink-2); }
.ico .if { fill: var(--surface); }
.ico .ifs { stroke: var(--surface); stroke-width: 2; stroke-linecap: round; fill: none; opacity: 0.75; }
.pick { width: 6.4em; height: 48px; border: 1px solid var(--lane); border-radius: 8px; font-family: var(--f-mono); font-size: 12px; font-weight: 500; white-space: nowrap; --pl: 29.17%; --u: 41.67%; }
.pick .ri { color: var(--ink); }
.pick.off { border-color: var(--line); font-family: var(--f-body); }
.pick.off .ri { color: var(--ink-2); }

.dotkey { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--ink-2); }
.dotkey span { display: inline-flex; align-items: center; gap: 6px; }
.dotkey i { width: 14px; height: 14px; border-radius: 4px; background: var(--snare); display: inline-block; }
.dotkey i.acc { width: 10px; height: 10px; margin: 2px; box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--snare); }
.dotkey i.gh { width: 8px; height: 8px; margin: 3px; border-radius: 50%; background: color-mix(in srgb, var(--snare) 55%, var(--off)); }

/* 鼓譜 */
.staffbox { background: var(--surface); border-radius: 18px; padding: 12px; display: grid; gap: 10px; }
.sthead { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sthead h2 { margin: 0; font-size: 14px; font-weight: 700; }
.sthead .btns2 { display: flex; gap: 6px; }
.mini { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--ink); }
.mini svg { width: 14px; height: 14px; }
.mini:hover { border-color: var(--ink-2); }
.staff { min-width: 0; }
.staff svg { display: block; width: 100%; height: auto; }
.s-ln { stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1; }
.s-ink { fill: var(--ink); }
.s-st { stroke: var(--ink); fill: none; }
.s-ts { fill: var(--ink); font-family: var(--f-display); font-weight: 800; }
.s-ct { fill: var(--ink-2); font-family: var(--f-mono); }
.s-ct.n { fill: var(--ink); font-weight: 500; }
.ph { fill: var(--accent); fill-opacity: 0.16; }
.hx { stroke: var(--ink); fill: none; stroke-linecap: round; }
.hf { fill: var(--ink); }
.pr { stroke: var(--ink); fill: none; stroke-linecap: round; }
.nt .hx, .nt .hf, .nt .pr { transition: fill 0.06s, stroke 0.06s; }
.nt.now .hx, .nt.now .pr { stroke: var(--hc); }
.nt.now .hf { fill: var(--hc); }
.bt.rolling { opacity: 0.38; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--ink-2); }
.lg { display: flex; align-items: center; gap: 6px; }
.lg svg { flex: none; }
.lg b { color: var(--ink); font-weight: 700; }

/* 控制 */
.btn {
  min-height: 52px; border-radius: 14px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; padding-inline: 14px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.spin svg, .pldock #spin svg, .swdock .btn.spin svg { width: 27px; height: 27px; flex: none; overflow: visible; transform-origin: 50% 90%; }
.btn.spin svg circle { fill: #E5484D; stroke: none; }
.btn.spin svg path { stroke-width: 2.6; }
.btn.spin.pull svg { animation: lever .5s cubic-bezier(.3,.6,.4,1); }
@keyframes lever { 0% { transform: none; } 35% { transform: scaleY(0.55) translateY(4px); } 70% { transform: scaleY(1.08); } 100% { transform: none; } }
.btn.spin { background: var(--accent-fill); border-color: var(--accent); color: var(--on-accent); font-family: var(--f-display); font-weight: 800; letter-spacing: 0.02em; }
.btn svg { flex: none; }
.btn.sm { min-height: 40px; font-size: 14px; border-radius: 11px; }
.ctl { display: grid; gap: 8px; min-width: 0; }
.ctl-h { display: flex; justify-content: space-between; align-items: baseline; }
.ctl-h label, .ctl-h span.l { font-size: 13px; font-weight: 700; }
.tempo { display: flex; align-items: center; gap: 8px; }
.tempo .l { font-size: 13px; font-weight: 700; flex: 1; }
#bpmOut { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); min-width: 5.6em; text-align: center; }
#bpmOut b { font-size: 18px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.bpm-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 10px; align-items: center; }
.stepper { width: 32px; height: 32px; border-radius: 50%; color: var(--ink); border: 0; background: var(--surface); font-size: 20px; line-height: 1; cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  min-width: 38px; height: 38px; padding-inline: 10px; border-radius: 10px; border: 0; background: var(--surface);
  font-family: var(--f-mono); font-size: 14px; cursor: pointer;
}
.chips button.rnd { font-family: var(--f-body); font-weight: 700; padding-inline: 12px; }
.chips button[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); font-weight: 700; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.note { margin: 0; min-height: 1.5em; font-size: 12px; color: var(--ink-2); }
.keys { margin: 0; font-size: 12px; color: var(--ink-2); }
@media (hover: none) { .keys { display: none; } }
/* Swing：每拍只顯示三連音的第 1、3 點（第 2 點之後才用） */
.swing .beat > :nth-child(4) { display: none !important; }
.swing .beat { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.swing .rl.step { aspect-ratio: 1.33 / 2.6; }
/* Swing 一拍只有 3 格、格子比較寬：點點縮回跟其他單元一樣大 */
.swing .step .ri i { width: 55.6%; }
.swing .step .ri.acc i { width: 42%; }
.swing .step .ri.gh i { width: 30%; }
.swing .counts .beat > :nth-child(2) { font-size: 0; }
.swing .counts .beat > :nth-child(2)::after { content: '·'; font-size: 13px; }
/* 靜音的那一排，鼓譜上的音符變淡 */
#staff.mu-rh [data-m="rh"], #staff.mu-lh [data-m="lh"], #staff.mu-lf [data-m="lf"], #staff.mu-bd [data-m="bd"],
#staff .nt.mut > :not([data-m]), #staff .bt.mut > rect { opacity: 0.2; }
#scoreBox .nt.mut > :not([data-m]), #scoreBox .bt.mut > rect,
#scoreBox.mu-rh [data-m="rh"], #scoreBox.mu-lh [data-m="lh"], #scoreBox.mu-lf [data-m="lf"], #scoreBox.mu-bd [data-m="bd"], #scoreBox.mu-tom [data-m="tom"], #scoreBox.mu-lhh [data-m="lhh"] { opacity: 0.18; }
/* 鼓譜模式：選項在五線鼓譜欄位裡，鼓譜下面 */
#stage.inbox, :root[data-scheme] #stage.inbox { background: transparent; padding: 14px 0 2px; margin-top: 4px; box-shadow: none !important; border-top: 1px solid var(--line); border-radius: 0; gap: 0; overflow: visible; }
#stage.inbox .steps, #stage.inbox .countrow, #stage.inbox .dotkey, #stage.inbox .nextbox { display: none !important; }
#stage.inbox #lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px !important; }
#stage.inbox .lane { grid-template-columns: minmax(0, 1fr) !important; }
#stage.inbox .lab { display: grid !important; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "names names" "ico tools"; gap: 6px 8px; align-items: center; min-height: 0; }
#stage.inbox .names { grid-area: names; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
#stage.inbox .limb { font-size: 13px; }
#stage.inbox .nm { font-size: 12px; }
#stage.inbox .lab .ico { grid-area: ico; width: 26px !important; height: 52px !important; }
#stage.inbox .tools { grid-area: tools; gap: 4px; min-width: 0; }
#stage.inbox .pick { flex: 1 1 auto; width: auto; min-width: 3.6em; max-width: 7em; height: 42px; }
#stage.inbox .fixed { display: none !important; }
@media (min-width: 600px) { #stage.inbox #lanes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 寬螢幕與手機橫放：左邊是滾輪和鼓譜，右邊一欄放按鈕和設定 */
@media (min-width: 600px), (orientation: landscape) and (max-height: 520px) {
  .lane, .countrow { grid-template-columns: var(--labw) minmax(0, 1fr); column-gap: 16px; align-items: center; }
  .countrow .sp { display: block; }
  .lab { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ico names" "ico tools"; column-gap: 10px; row-gap: 6px; align-items: center; }
  .lab .ico { grid-area: ico; width: 40px; height: 80px; }
  .names { grid-area: names; }
  .tools { grid-area: tools; }
}
@media (min-width: 1024px) and (min-height: 521px) {
  .play { grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "main actions" "main panel"; grid-template-rows: auto 1fr; align-items: start; column-gap: 18px; }
  .actions { position: static; grid-template-columns: minmax(0, 1fr); padding: 0; background: none; }
}
@media (orientation: landscape) and (max-height: 520px) {
  :root { --labw: 166px; }
  /* 手機橫放：鼓譜和滾輪用整個寬度，SPIN、播放、速度收進頂端一條固定的工具列 */
  .play { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "panel"; }
  .tbar {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; flex-wrap: nowrap;
    background: var(--bg); padding-block: 6px; margin-block: -6px 0;
  }
  .tright { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
  .tright .tempo .l { display: none; }
  .tright .tempo { flex-wrap: nowrap; }
  .tright .bpmbox span { display: none; }
  .tright .tapb { height: 30px; padding: 0 8px; margin-left: 0; }
  .tbar .spinno { white-space: nowrap; max-width: 6.5em; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .hist { gap: 3px; }
  .hist .ibtn { width: 26px; height: 26px; }
  .tright .tempo { gap: 4px; }
  .tright .actions { position: static; display: flex; gap: 8px; padding: 0; background: none; }
  .tright .btn { min-height: 38px; font-size: 14px; border-radius: 11px; padding-inline: 16px; }
  .tright .btn svg { width: 14px; height: 14px; }
  .tbar .seg button { padding: 5px 10px; font-size: 12px; }
  .toscore span { display: none; }
  .toscore { padding: 6px 8px; }
  .panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
  .panel .note { flex: 1 1 200px; }
  .pick { width: 5.6em; font-size: 11px; }
  .ibtn { width: 26px; height: 26px; }
  .fixed { display: none; }
  .tools { gap: 4px; }
  .bar { min-height: 50px; padding-block: 6px; }
  .bar-t h1 { font-size: 19px; }
  .lab .ico { width: 32px; height: 64px; }
  .pick { height: 42px; }
  .stage { gap: 12px; padding: 10px; }
  .car { --cw: min(46vw, 400px, calc((100vh - 160px) * 1.45)); }
  .home { padding-block: 0 16px; gap: 6px; }
  .hint { display: none; }
  .lvc { min-height: 0; padding: 16px; }
  .lvc b { font-size: 26px; }
  .btn { min-height: 44px; }
}

.pdfview {
  position: fixed; inset: 0; z-index: 70; background: #2A2A2A; overflow-y: auto; display: grid; align-content: start; gap: 12px;
  padding-top: max(10px, env(safe-area-inset-top, 0px)); padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.pv-top { position: sticky; top: 0; display: flex; align-items: center; gap: 12px; background: #2A2A2A; padding-block: 6px; }
.pv-top #pdfSave { background: #F2F2F2; color: #111111; border-color: #F2F2F2; }
.pv-top p { flex: 1; margin: 0; color: #F2F2F2; font-size: 13px; }
.pv-top .btn { color: #F2F2F2; border-color: #F2F2F2; }
.pv-imgs { display: grid; gap: 16px; justify-items: center; }
.pv-imgs img { width: min(100%, 820px); height: auto; background: #FFFFFF; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); -webkit-touch-callout: default; }
.gear svg { width: 20px; height: 20px; }
.bpmbox { display: inline-flex; align-items: baseline; gap: 3px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); }
.bpmin {
  width: 3.3em; border: 0; border-bottom: 1.5px solid var(--line); background: transparent; color: var(--ink); text-align: center;
  font-family: var(--f-mono); font-size: 18px; font-weight: 500; padding: 0 0 1px; -moz-appearance: textfield;
}
.bpmin::-webkit-outer-spin-button, .bpmin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bpmin:focus { outline: none; border-bottom-color: var(--accent); }
.tapb {
  height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--f-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; cursor: pointer; margin-left: 4px;
}
.tapb.hit { animation: tapHit 0.18s ease-out; }
@keyframes tapHit { 0% { background: var(--accent); color: var(--on-accent); } 100% { background: var(--surface); color: var(--ink); } }
.tempo { flex-wrap: wrap; }
.tempo .l { flex: 1 0 auto; white-space: nowrap; }
.cust {
  width: 4.2em; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 3px 6px;
  font-family: var(--f-mono); font-size: 12px;
}
#ciBig {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; pointer-events: none;
  font-family: var(--f-display); font-weight: 800; font-size: min(24vw, 28vh); line-height: 1; color: var(--accent); opacity: 0;
}
#ciBig.show { animation: ciPulse 0.9s ease-out forwards; }
@keyframes ciPulse { 0% { opacity: 0.45; transform: scale(1.06); } 100% { opacity: 0.16; transform: scale(1); } }
.sheet { position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, 0.5); display: grid; align-items: end; justify-items: center; }
.sheet-card {
  background: var(--surface); color: var(--ink); width: min(560px, 100%); max-height: 88vh; overflow-y: auto; border-radius: 22px 22px 0 0;
  display: grid; gap: 14px; align-content: start;
  padding-top: 16px; padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
}
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-card { border-radius: 22px; } }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-top h2 { margin: 0; font-family: var(--f-display); font-size: 20px; font-weight: 800; }
.sheet h3 { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); letter-spacing: 0.04em; }
.sheet-sub { margin: 0; font-size: 13px; color: var(--ink-2); }
.srows { display: grid; gap: 10px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 700; }
.srow select, .scf select { min-width: 0; }
.srow select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background-color: var(--bg); color: var(--ink); border-radius: 99px;
  padding: 7px 30px 7px 14px; font-size: 14px; font-family: var(--f-body); max-width: 62%; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.vols { display: grid; gap: 8px; }
.vrow { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 2.6em; align-items: center; gap: 10px; font-size: 13px; }
.vrow output { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); text-align: right; }
.hbtns { display: flex; gap: 8px; }
.hlist { display: grid; gap: 6px; }
.hrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; cursor: pointer; }
.hrow b { min-width: 4.6em; }
.hrow .d { color: var(--ink-2); font-family: var(--f-mono); font-size: 12px; min-width: 0; }
.hrow input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.sheet-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); padding-top: 8px; }
.sheet-foot .note { flex: 1; }
@media (prefers-reduced-motion: reduce) { #ciBig.show { animation: none; opacity: 0.25; } .tapb.hit { animation: none; } }
/* 鼓譜全螢幕 */
.fs {
  position: fixed; inset: 0; z-index: 50; background: var(--surface); display: flex; flex-direction: column; gap: 10px;
  padding-top: max(10px, env(safe-area-inset-top, 0px)); padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.fs-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fs-top .t { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-top .btn { min-width: 0; }
.fs-body { flex: 1; min-height: 0; display: flex; }
.fs-body #staff.seqfs { overflow-y: auto; align-items: flex-start; align-content: flex-start; justify-content: flex-start; }
.fs-body #staff.seqfs:not(.st6) { display: block; }
.fs-body #staff.seqfs svg { flex: none; display: block; }
.fs-body .staff { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; }
.rotate-tip { margin: 0; text-align: center; font-size: 12px; color: var(--ink-2); }
@media (orientation: landscape) { .rotate-tip { display: none; } }

@media (prefers-reduced-motion: reduce) {
  body, .rl::after, .nt .hx, .nt .hf, .gcard, .dots button::before { transition: none; }
  .rl.landed .ri.mid > * { animation: none; }
}

/* ===== 動態：拿掉樂器圖示和選項滾輪；點名稱才展開鎖頭、喇叭 ===== */
#stage.slim .lab .ico, #stage.slim .tools .pick { display: none !important; }
#stage.slim .lab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 0; }
#stage.slim .names { flex: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
#stage.slim .names .limb::after { content: ' ▾'; font-size: 10px; color: var(--ink-2); }
#stage.slim .lane.open .names .limb::after { content: ' ▴'; }
#stage.slim .tools { display: none; flex-wrap: wrap; gap: 4px; }
#stage.slim .lane.open .tools { display: flex; }
@media (min-width: 600px), (orientation: landscape) and (max-height: 520px) {
  #stage.slim .lane, #stage.slim .countrow { grid-template-columns: 130px minmax(0, 1fr); }
  #stage.slim:not(.inbox) .lane, #stage.slim:not(.inbox) .countrow { grid-template-columns: 112px minmax(0, 1fr); }
  #stage.slim:not(.inbox) .lab { flex-wrap: wrap !important; row-gap: 4px; }
  #stage.slim .lab { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "names" "tools"; gap: 6px; }
  #stage.slim .names { grid-area: names; }
  #stage.slim .tools { grid-area: tools; }
}
#lanes { position: relative; }
/* 動態四行排緊一點：格子只留中間那一格的高度，上下的空白收掉 */
#stage.slim #lanes { gap: 8px !important; }
/* 動態、鼓譜都不寫哪隻手腳，只寫樂器名；點名稱（▾）才出現鎖頭和喇叭 */
#stage.slim .names .limb { display: none; }
#stage.slim .names .nm { font-size: 14px; font-weight: 800; color: var(--ink); }
#stage.slim .names .nm::after { content: ' ▾'; font-size: 10px; color: var(--ink-2); }
#stage.slim .lane.open .names .nm::after { content: ' ▴'; }
#stage.slim .tomlane .names .nm::after { content: none; }
#stage.slim .tomlane .names .nm { font-size: inherit; color: inherit; }
#stage.slim .lane.open .tools { display: flex; align-items: center; }
#stage.slim:not(.inbox) .lab { display: flex !important; flex-wrap: nowrap; align-items: center; gap: 8px; }
#stage.slim .lane { gap: 4px; }
#stage.slim .steps .beat { container-type: inline-size; }
#stage.slim .rl.step { clip-path: inset(30.77% 0 30.77% 0 round 5px) !important; margin-block: calc((100cqw - 12px) / 4 * -0.8); }
#stage.slim .swing .rl.step { margin-block: calc((100cqw - 10px) / 3 * -1.064); }
#stage.slim #lanes .steps .beat:nth-child(odd) { background: var(--tint); }
#scPlay.docked .play-main { width: 100%; max-width: 900px; margin-inline: auto; }
.phline { position: absolute; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; pointer-events: none; z-index: 4; }
.phline[hidden] { display: none; }
.pldock svg[hidden], .swdock svg[hidden] { display: none !important; }

/* 每次抽 N 小節 */
.mseg { display: flex; align-items: center; gap: 4px; padding: 4px 6px; font-size: 13px; font-weight: 700; }
.mseg[hidden] { display: none; }
.mseg span { color: var(--ink-2); white-space: nowrap; }
.mseg span:first-child { margin-right: 4px; }
.mseg span:last-child { margin-left: 2px; }
.mseg button { flex: 1; min-width: 32px; height: 30px; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.mseg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.seqbar { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.seqbar[hidden] { display: none; }
.seqbar button { min-width: 28px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0 6px; }
.seqbar button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
#staff svg.seqoff { opacity: 0.45; }
#staff svg.seqhide { visibility: hidden; }
#scPlay #staff > svg { cursor: pointer; }


/* 鼓譜模式 SPIN 時跳出來的一拍一格拉霸機 */
.bslot { margin: 0 0 10px; animation: bsIn 0.25s ease-out; }
.bslot[hidden] { display: none; }
.bslot.out { animation: bsOut 0.3s ease-in forwards; }
@keyframes bsIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes bsOut { to { opacity: 0; transform: translateY(-8px); } }
.bslot .chslot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 560px; margin: 0 auto; }
.bslot .chslot { padding: 2px 0; }
.bslot .ri { overflow: hidden; }
.bslot .chslot .rl { height: 186px; width: 100%; }
.bslot .bsvg.bkit { width: 100%; height: 100%; }

/* ---- 2026-11-09 版面調整 ---- */
/* 完整教材、真人諮詢：品牌藍 #519BFF（2026-11-11 跟 logo 統一） */
#bookCta, #scBook, #toBook { background: linear-gradient(135deg, #519BFF, #3F86F2) !important; color: #FFFFFF !important; border-color: transparent !important; box-shadow: 0 6px 16px rgba(81, 155, 255, 0.34); }
#bookCta svg, #scBook svg, #toBook svg { color: #FFFFFF; }
#coachBtn { background: linear-gradient(135deg, #519BFF, #3F86F2) !important; color: #FFFFFF !important; border-color: transparent !important; box-shadow: 0 4px 12px rgba(81, 155, 255, 0.38); }
/* 練完的勾勾放到最右邊 */
.swhd .swck { margin-left: auto; }
/* 音量標題旁的「回預設」 */
.volhd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.volhd h3 { margin: 0; }
/* 從下往上的頁面：上方一條橫線，往下滑就關閉；關閉鈕收起來 */
.sheet-card { position: relative; padding-top: 22px; touch-action: pan-y; }
.sheet-grab { position: absolute; top: 0; left: 0; right: 0; height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grab::before { content: ''; width: 40px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink-2) 45%, transparent); }
@media (hover: none), (pointer: coarse) { .sheet-top > .btn.sm[id$="Close"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; } }
.sheet-card.dragging { transition: none !important; }
.sheet-card.snap { transition: transform 0.22s ease; }

/* 上方分頁依難度上色：只有字有顏色（綠＝最簡單、藍＝中等、紅＝最難），框和底跟原本一樣；選到的用灰色填滿、字維持難度顏色 */
.swtabs button.lvbas, .swtabs button.lvR { color: #2E8B57; }
.swtabs button.lvadv, .swtabs button.lvV { color: #3B6FD4; }
.swtabs button.lvP { color: #C94A48; }
.swsel.lvR, .swsel option.lvR { color: #2E8B57; } .swsel.lvV, .swsel option.lvV { color: #3B6FD4; } .swsel.lvP, .swsel option.lvP { color: #C94A48; }
:root[data-scheme="dark"] .swsel.lvR, :root[data-scheme="dark"] .swsel option.lvR { color: #7DCB9C; } :root[data-scheme="dark"] .swsel.lvV, :root[data-scheme="dark"] .swsel option.lvV { color: #8EAEEA; } :root[data-scheme="dark"] .swsel.lvP, :root[data-scheme="dark"] .swsel option.lvP { color: #E89A98; }
.swtabs button[class^="lv"][aria-selected="true"] { background: #C9CDD3; border-color: #9EA4AD; box-shadow: inset 0 0 0 1px #9EA4AD; font-weight: 800; }
:root[data-scheme="dark"] .swtabs button.lvbas, :root[data-scheme="dark"] .swtabs button.lvR { color: #7DCB9C; }
:root[data-scheme="dark"] .swtabs button.lvadv, :root[data-scheme="dark"] .swtabs button.lvV { color: #8EAEEA; }
:root[data-scheme="dark"] .swtabs button.lvP { color: #E89A98; }
:root[data-scheme="dark"] .swtabs button[class^="lv"][aria-selected="true"] { background: #43474E; border-color: #43474E; }

.chstaffhd { flex-wrap: wrap; gap: 8px; padding-bottom: 10px !important; }
.scmutes { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; justify-content: flex-end; }
@media (max-width: 599px) { .scmutes { order: 3; flex: 1 0 100%; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } }
.scmutes::-webkit-scrollbar { display: none; }
.scm { flex: none; white-space: nowrap; }
.scmutes:empty { display: none; }
.scm { border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; cursor: pointer; }
.scm[aria-pressed="false"] { color: var(--ink-2); text-decoration: line-through; opacity: 0.6; }
.scorebox.chfs > svg { width: 100% !important; height: auto !important; }
.scorebox.chfs, #fs { touch-action: pan-x pan-y; }
/* 挑戰模式聲部配色（2026-11-11）：會抽到的聲部用鮮豔色，固定的聲部用淡色 */
:root[data-level="rookie"] { --cv: #E0965A; --cp-rh: #EED6BE; --cp-lh: #E6C3A1; --cp-lf: #A27A5E; --cp-bd: #C9A184; }
:root[data-scheme="light"][data-level="rookie"] { --cv: #C8692A; --cp-rh: #C9A07E; --cp-lh: #BE9572; --cp-lf: #A98466; --cp-bd: #B8916F; }
:root[data-level="vet"] { --cv: #519BFF; --cp-rh: #C9CED9; --cp-lh: #DDE1E8; --cp-lf: #8F9AB2; --cp-bd: #9AA2B4; }
:root[data-scheme="light"][data-level="vet"] { --cv: #3F86F2; --cp-rh: #A3AAB8; --cp-lh: #ADB4C1; --cp-lf: #8E96A8; --cp-bd: #98A0B0; }
:root[data-level="pro"] { --cv: #F2C14E; --cp-rh: #F7EBC6; --cp-lh: #F2E2AE; --cp-lf: #A8935C; --cp-bd: #D4BE7E; }
:root[data-scheme="light"][data-level="pro"] { --cv: #D29A12; --cp-rh: #CDB880; --cp-lh: #C7B176; --cp-lf: #A8935C; --cp-bd: #BFA866; }
:root[data-level="rookie"] .lane[data-id="bd"], :root[data-level="vet"] .lane[data-id="bd"], :root[data-level="pro"] .lane[data-id="bd"] { --fill: var(--lane); }
:root[data-level="rookie"] .dotkey, :root[data-level="vet"] .dotkey, :root[data-level="pro"] .dotkey { --snare: var(--cv); }
:root[data-level="rookie"] .lane .limb, :root[data-level="vet"] .lane .limb, :root[data-level="pro"] .lane .limb,
:root[data-level="rookie"] #stage.slim .lane:not(.tomlane) .names .nm, :root[data-level="vet"] #stage.slim .lane:not(.tomlane) .names .nm, :root[data-level="pro"] #stage.slim .lane:not(.tomlane) .names .nm { color: var(--lane); transition: color .25s; }
.ezplay { position: relative; margin: 30px auto 6px; pointer-events: none; grid-column: 1 / -1; }
@media (min-width: 720px) and (hover: hover) and (pointer: fine) { .ezplay { display: none !important; } }
@media (max-width: 599px) {
  .bar-t:has(.lvtag:not([hidden])), .bar-t:has(.ownertag:not([hidden])) { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
  .bar-t:has(.lvtag:not([hidden])) h1 { font-size: 17px; max-width: 100%; }
  .bar-t .lvtag { font-size: 11px; padding: 0 8px; }
  .bar-t .ownertag { font-size: 10px; }
}
/* 2026-11-13：完整版鎖頭、解鎖視窗、分享成績、條款 */
.lockb { position: absolute; top: 16px; right: 16px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.6); color: #fff; letter-spacing: 0.02em; }
.lockb svg, .lvb .lk svg, .lvchip .lk svg { width: 12px; height: 12px; }
.lvc.locked > :not(.lockb):not(.go) { opacity: 0.62; }
.lvb .lk, .lvchip .lk { display: inline-flex; margin-left: 2px; opacity: 0.8; }
.lvtabs .lvb .lk svg, .lvtabs .lvb[aria-expanded="true"] .lk svg { transform: none; width: 12px; height: 12px; }
.ullist { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ullist li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; }
.ullist li::before { content: '✓'; flex: none; font-weight: 800; color: var(--hat); }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ulcta { width: 100%; min-height: 48px; font-weight: 800; }
.shchip { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(108px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 99px; border: 0; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; background: linear-gradient(135deg, #6FA8FF, #3D6FD8); color: #fff; box-shadow: 0 10px 30px rgba(20, 60, 160, 0.45); animation: shIn .35s ease-out; }
@keyframes shIn { from { opacity: 0; transform: translate(-50%, 14px); } }
@media (prefers-reduced-motion: reduce) { .shchip { animation: none; } }
.shimg { width: min(250px, 66%); justify-self: center; border-radius: 16px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35); }
.soon-eta { font-weight: 800; color: var(--hat); margin: 0; }
.shbtns { display: flex; gap: 10px; } .shbtns .btn { flex: 1; }
.lglinks { display: flex; flex-wrap: wrap; gap: 8px; }
.lgbody { display: grid; gap: 4px; }
.lgbody h4 { margin: 12px 0 2px; font-size: 15px; }
.lgbody p, .lgbody li { margin: 0; font-size: 14px; line-height: 1.7; }
.lgbody ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.lgbody a { color: inherit; }
.lgupd { font-size: 12px; color: var(--ink-2); }

.ezfoot { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: none; pointer-events: none; }
body.scr-menu .ezfoot { display: block; z-index: 29; }
/* 練習／挑戰畫面：logo 放在頁面內容最底下（跟著捲動） */
#ezPlay, #ezScore { grid-column: 1 / -1; order: 99; margin: 28px auto 4px; }

body.scr-menu .screen.home, body.scr-menu .screen.levels, body.scr-menu .screen.units { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.ezfoot, .ezplay { pointer-events: auto !important; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* 選單頁卡片縮一點，留位置給下方 logo */
.modes .mcard { max-width: calc((100svh - 200px) / 2); }
/* 主題卡片插畫的底色：一律深藍（跟挑戰模式一樣） */
body { --artA: #2a3150; --artB: #0b0b10; }
/* 挑戰模式：同一組插畫，整體再暗一點 */
body:not(.m-prac) { --artA: #171b2e; --artB: #040508; }

/* 2026-11-12 模式選擇改成 logo／reel 的風格：藍色為主 */
.mcard { position: relative; background: linear-gradient(140deg, #519BFF 0%, #407AC9 26%, #2E5891 52%, #1D385C 78%, #0B1421 100%) !important; color: #FFFFFF !important; box-shadow: 0 10px 30px rgba(81,155,255,.18) !important; grid-template-rows: auto 1fr !important; }
.mcard.ch { background: radial-gradient(120% 80% at 50% 30%, #1d2236 0%, #0b0b10 75%) !important; border: 1px solid #262833; box-shadow: 0 10px 30px rgba(0,0,0,.25) !important; }
.mcard b { font-weight: 900 !important; letter-spacing: -0.035em !important; text-transform: uppercase; color: #FFFFFF !important; background: none !important; -webkit-text-fill-color: #FFFFFF; line-height: 1 !important; }
.mcard .mchip { display: inline-block; font-weight: 800; font-size: clamp(10px, 2.6vw, 13px); letter-spacing: .16em; text-transform: uppercase; border-radius: 99px; padding: 5px 13px; border: 1.5px solid rgba(255,255,255,.85); color: #FFFFFF; white-space: nowrap; }
.mcard.ch .mchip { border-color: #519BFF; color: #8EBFFF; }
.mcard .mart { width: min(82%, 440px) !important; margin-bottom: 9%; }
.mcard .mart { align-self: center; }
.mcard .mstaff { display: block; align-self: center; width: 92% !important; height: auto; padding: 6% 4% 3%; border-radius: 18px; background: #15161c; border: 1px solid #262833; box-sizing: border-box; }
.mcard .mstaff img { display: block; width: 100%; height: auto; }

@media (min-width: 720px), (orientation: landscape) and (max-height: 520px) { .modes .mcard { max-width: calc(100svh - 190px); } }

/* ======== PWA（js/pwa.js）：新版本提示列 ======== */
.pwa-toast { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9000; display: flex; gap: 8px; align-items: center; max-width: calc(100vw - 24px); padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 0 0 1px var(--line); font-size: 14px; white-space: nowrap; }
.pwa-toast .pwa-msg { padding-right: 4px; overflow: hidden; text-overflow: ellipsis; }

/* ======== 帳號（js/cloud.js） ======== */
.acin { flex: 1 1 160px; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; }
.acin:focus { outline: 2px solid var(--accent, #519BFF); outline-offset: 1px; }

/* ======== 訂閱方案（js/billing.js） ======== */
.ulplans { display: grid; gap: 8px; margin: 12px 0 4px; }
.ulplans .plan { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; text-align: left; }
.ulplans .plan small { font-size: 12px; font-weight: 400; opacity: .8; }
.ulplans .plan-tag { position: absolute; top: 10px; right: 12px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--bg); }
.ulplans .ulfounder { margin: 0 0 4px; }
.ulplans .ulfine { font-size: 12px; margin: 4px 0 0; }
