/* School skins taken from the classrooms' own sites and rhythm-practice tool.
   節奏感: sage paper, deep green, Playfair + Source Sans.
   慕尼克: warm gray, gold, navy, Noto Sans TC, black-and-gold header. */

html[data-school="rhythm"] {
  --bg: #e7f3ea;
  --text: #1d3429;
  --muted: #3d5248;
  --paper: #fffdf8;
  --ink: #1d3429;
  --accent: #e07a3d;
  --accent-press: #2f6b4a;
  --accent-text: #fffdf8;
  --notice: #c4532a;
  --bar: #fffdf8;
  --bar-text: #1d3429;
  --switch-track: rgba(47, 107, 74, 0.1);
  --top-bg: #3f8f62;
  --top-text: #f7faf4;
  --player-bg: #2f6b4a;
  --player-text: #f4fbf6;
  --rail-bg: #1b3a2c;
  --rail-text: #f6f3ea;
  --rail-on: #ffe08a;
  --rail-on-text: #1b3a2c;
  --tool-bg: #2f6b4a;
  --spot: rgba(255, 214, 120, 0.45);
  --dot: rgba(47, 107, 74, 0.1);
  --font-display: "Playfair Display", "PMingLiU", "Songti TC", serif;
  --font-body: "Source Sans 3", "Source Sans Pro", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --brand-h: 56px;
  --rail: 84px;
  --top: 42px;
  --player: 64px;
  color-scheme: light;
}

html[data-school="moonick"] {
  --bg: #f6f1e8;
  --text: #111111;
  --muted: #8a8a85;
  --paper: #ffffff;
  --ink: #111111;
  --accent: #b7804c;
  --accent-press: #9a6a3a;
  --accent-text: #111111;
  --notice: #9a6a3a;
  --bar: #111111;
  --bar-text: #ffffff;
  --switch-track: rgba(255, 255, 255, 0.08);
  --top-bg: #2a2a2a;
  --top-text: #e6e3dc;
  --player-bg: #111111;
  --player-text: #e6e3dc;
  --rail-bg: #241c14;
  --rail-text: #f6f1e7;
  --rail-on: #f2c14e;
  --rail-on-text: #1a140c;
  --tool-bg: #3a4256;
  --spot: rgba(242, 193, 78, 0.35);
  --dot: rgba(58, 66, 86, 0.1);
  --top-bg: #3a4256;
  --player-bg: #2c3344;
  --font-display: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --brand-h: 56px;
  --rail: 84px;
  --top: 42px;
  --player: 64px;
  color-scheme: light;
}

html[data-school] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 0%, var(--spot), transparent 28%),
    radial-gradient(var(--dot) 1.4px, transparent 1.5px);
  background-size: auto, 22px 22px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
}

html[data-school] #rail {
  background: var(--rail-bg);
  border-right-color: #000;
}
html[data-school] .brand {
  height: 72px;
  background: transparent;
  border-bottom-color: transparent;
}
html[data-school] .brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
html[data-school] .rail-btn {
  min-height: 58px;
  color: var(--rail-text);
  font-size: 14px;
  font-family: var(--font-body);
}
html[data-school] .rail-btn .frac,
html[data-school] .rail-sub,
html[data-school] .rail-btn:hover .frac,
html[data-school] .rail-btn:hover .rail-sub,
html[data-school] .rail-btn:focus-visible .frac,
html[data-school] .rail-btn:focus-visible .rail-sub {
  color: var(--rail-text);
}
html[data-school] .rail-btn.on,
html[data-school] .rail-btn.on:hover,
html[data-school] .rail-btn.on:focus-visible {
  background: var(--rail-on);
  color: var(--rail-on-text);
}
html[data-school] .rail-btn.on .frac,
html[data-school] .rail-btn.on .rail-sub,
html[data-school] .rail-btn.on:hover .frac,
html[data-school] .rail-btn.on:hover .rail-sub {
  color: var(--rail-on-text);
}
html[data-school] .rail-btn:hover,
html[data-school] .rail-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

html[data-school] #brandbar {
  position: fixed;
  top: 0;
  left: var(--rail);
  right: 0;
  height: var(--brand-h);
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--bar);
  color: var(--bar-text);
  border-bottom: 4px solid var(--accent);
}
html[data-school] .brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
html[data-school] .brand-lockup img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
html[data-school="moonick"] .brand-lockup img,
html[data-school="moonick"] .brand img {
  background: #111;
}
html[data-school] .brand-lockup strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.1;
}
html[data-school] .brand-lockup em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 15px;
  letter-spacing: 0.08em;
  opacity: 0.8;
}
html[data-school] .home-back {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}
html[data-school] .home-back:hover,
html[data-school] .home-back:focus-visible {
  background: var(--accent-press);
  color: #fff;
  outline: 2px solid var(--bar-text);
  outline-offset: 2px;
}
html[data-school] #top {
  top: var(--brand-h);
  height: var(--top);
  background: var(--top-bg);
  color: var(--top-text);
}
html[data-school] .metro-label,
html[data-school] .metro button,
html[data-school] .top-links button {
  color: var(--top-text);
  font-size: 16px;
  min-height: 40px;
}
html[data-school] .metro button.on {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
html[data-school] #player {
  top: calc(var(--brand-h) + var(--top));
  height: var(--player);
  background: var(--player-bg);
  color: var(--player-text);
}
html[data-school] #playBtn,
html[data-school] #loopBtn {
  width: 42px;
  height: 42px;
}
html[data-school] #playBtn {
  background: var(--accent);
  color: var(--accent-text);
}
html[data-school] #playBtn.playing {
  background: var(--notice);
  color: #fff;
}
html[data-school] #loopBtn.on {
  color: var(--accent);
  background: #1a1a1a;
}
html[data-school] .slider {
  color: var(--player-text);
  font-size: 15px;
  grid-template-columns: 52px 1fr 58px;
}
html[data-school] .slider input[type="range"] { accent-color: var(--accent); }
html[data-school] #tempoNum {
  color: var(--player-text);
  background: transparent;
  font-size: 18px;
  width: 58px;
}
html[data-school] #stage {
  margin-top: calc(var(--brand-h) + var(--top) + var(--player));
}
html[data-school] .paper { background: var(--paper); color: var(--ink); }
html[data-school] #sheetWrap {
  margin: 6px 6px 0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 10px 28px rgba(36, 49, 43, 0.08);
}
html[data-school] #meta { margin: 0 6px; }
html[data-school] #grid {
  margin: 0 6px 4px;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 12px 24px rgba(36, 49, 43, 0.06);
}
html[data-school] .tool { border-radius: 16px; }
html[data-school] #playBtn,
html[data-school] #loopBtn { box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12); }
html[data-school] #stage {
  min-height: calc(100vh - var(--brand-h) - var(--top) - var(--player));
}
html[data-school] #toolbar { background: transparent; padding: 12px 16px 20px; gap: 8px; }
html[data-school] .tool {
  background: var(--tool-bg);
  min-height: 56px;
  min-width: 0;
  flex: 1 1 120px;
  font-size: 16px;
  border-radius: 12px;
}
html[data-school] .tool small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
}
html[data-school] #meta label,
html[data-school] .mix-key,
html[data-school] .hint,
html[data-school] .lyric-spacer {
  font-family: var(--font-body);
}
html[data-school] #legendBtn,
html[data-school] .abc-actions button,
html[data-school] .modal button.primary {
  background: var(--accent);
  color: var(--accent-text);
  min-height: 44px;
  font-size: 16px;
}
html[data-school] #abcToggle { color: var(--accent-press); font-size: 16px; }

@media (min-width: 521px) {
  html[data-school] #toolbar { padding: 2px 8px 2px; gap: 6px; }
  html[data-school] .tool {
    min-height: 32px;
    padding: 2px 8px;
    font-size: 13px;
    border-radius: 8px;
  }
  html[data-school] .tool small { font-size: 10px; }
  html[data-school] #abcPanel { padding: 0 10px 0; }
  html[data-school] #abcToggle { font-size: 13px; }
  html[data-school] #stage { min-height: 0; }
  html[data-school] #legendBtn {
    min-height: 28px;
    height: 28px;
    padding: 0 12px;
    font-size: 14px;
  }
  html[data-school] #toolbar .tool {
    min-height: 0;
    padding: 3px 8px 4px;
    line-height: 1.15;
  }
  html[data-school] #toolbar .tool b { font-weight: 700; line-height: 1.15; }
  html[data-school] #toolbar .tool small { display: block; font-size: 10px; line-height: 1.15; }
}

@media (min-width: 521px) and (max-height: 760px) {
  html[data-school] { --brand-h: 48px; --player: 50px; }
  html[data-school] #brandbar { padding: 2px 16px; }
  html[data-school] .brand-lockup img { width: 32px; height: 32px; }
  html[data-school] .brand-lockup strong { font-size: 18px; }
  html[data-school] .brand-lockup em { font-size: 12px; margin-top: 0; }
  html[data-school] .home-back { height: 30px; padding: 0 12px; font-size: 14px; }
  html[data-school] .brand { height: 44px; }
  html[data-school] .brand img { width: 36px; height: 36px; }
  html[data-school] .rail-btn { min-height: 46px; padding: 2px; }
  html[data-school] .slider { font-size: 13px; }
}
html[data-school] .add-measure { color: var(--accent); background: transparent; }
html[data-school] .close-measure { color: var(--accent-press); }

@media (max-width: 860px) {
  html[data-school] #rail,
  html[data-school] #brandbar,
  html[data-school] #top,
  html[data-school] #player {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
  }
  html[data-school] #rail { height: 76px; }
  html[data-school] #brandbar { height: auto; min-height: 76px; flex-wrap: wrap; }
  html[data-school] .brand-lockup strong { font-size: 22px; }
  html[data-school] #top { height: auto; }
  html[data-school] #player { height: auto; }
  html[data-school] #stage { margin: 0; }
}

@media (max-width: 520px) {
  html[data-school] #brandbar {
    height: 52px;
    min-height: 0;
    flex-wrap: nowrap;
    padding: 0 12px;
    border-bottom-width: 3px;
  }
  html[data-school] .brand-lockup { gap: 8px; }
  html[data-school] .brand-lockup img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }
  html[data-school] .brand-lockup strong { font-size: 18px; }
  html[data-school] .brand-lockup em {
    margin-top: 0;
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  html[data-school] .home-back {
    height: 30px;
    padding: 0 10px;
    font-size: 13px;
    letter-spacing: 0;
  }
  html[data-school] #rail,
  html[data-school] #top,
  html[data-school] #player {
    background: var(--player-bg);
    color: var(--player-text);
    border: 0;
  }
  html[data-school] #rail { height: 42px; }
  html[data-school] .rail-btn {
    min-height: 0;
    height: 30px;
    color: var(--player-text);
    background: rgba(255, 255, 255, 0.1);
    font-size: 13px;
  }
  html[data-school] .rail-btn .frac,
  html[data-school] .rail-sub { color: var(--player-text); }
  html[data-school] .rail-btn.on,
  html[data-school] .rail-btn.on .frac,
  html[data-school] .rail-btn.on .rail-sub {
    background: var(--rail-on);
    color: var(--rail-on-text);
  }
  html[data-school] #top { height: 36px; }
  html[data-school] .metro-label,
  html[data-school] .metro button,
  html[data-school] .top-links button {
    font-size: 13px;
    min-height: 28px;
  }
  html[data-school] #player { height: auto; }
  html[data-school] #playBtn,
  html[data-school] #loopBtn {
    width: 40px;
    height: 40px;
    box-shadow: none;
  }
  html[data-school] .kit-switch button {
    min-height: 32px;
    font-size: 12px;
    border-radius: 999px;
  }
  html[data-school] .slider {
    font-size: 12px;
    grid-template-columns: 28px minmax(0, 1fr) 34px;
  }
  html[data-school] #tempoNum { font-size: 15px; width: 34px; }
  html[data-school] #sheetWrap {
    margin: 0;
    padding: 2px 0 0;
    border-radius: 16px 16px 0 0;
    box-shadow: none;
  }
  html[data-school] #grid {
    margin: 0;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 24px rgba(36, 49, 43, 0.08);
  }
  html[data-school] #meta {
    margin: 10px 0 0;
    border-radius: 14px;
  }
  html[data-school] #toolbar { padding: 10px 0 0; gap: 8px; }
  html[data-school] .tool { min-height: 48px; border-radius: 12px; }
}
