:root {
  --bg: #f5f1e9;
  --panel: #fbf8f2;
  --panel-strong: #ffffff;
  --ink: #2a2118;
  --muted: #6a5c4d;
  --line: rgba(42, 33, 24, 0.12);
  --amber: #c07a3d;
  --amber-2: #9a5a28;
  --pad: #f3ebe0;
  --play: #21824a;
  --play-bg: #e5f7eb;
  --optional: #a87416;
  --optional-bg: #fbf1d6;
  --sit: #6a6a6a;
  --sit-bg: #efeee9;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  font-family: "Segoe UI", "Avenir Next", system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.94), rgba(245, 241, 233, 0.96)),
    radial-gradient(900px 420px at 8% -10%, rgba(192, 122, 61, 0.08), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(130, 160, 180, 0.08), transparent 50%),
    var(--bg);
}

header, #set-view, #pad-view, #cheat-view, footer {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

a { color: var(--amber-2); }

:focus-visible {
  outline: 3px solid #4a90d9;
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 8px;
  top: -40px;
  background: var(--amber);
  color: #fff;
  padding: 8px 12px;
  z-index: 5;
}

.skip:focus { top: 8px; }

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 6px;
  flex: 0 0 auto;
}

.brand { display: flex; gap: 14px; align-items: center; }

.vinyl {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 50% 50%, #2a2118 0 5px, var(--amber) 6px 8px, #2a2118 9px 12px, transparent 13px),
    repeating-radial-gradient(circle at 50% 50%, #d9c8b2 0 2px, #ebe4d8 3px 5px);
  box-shadow: 0 0 0 2px #c9b59a, 0 8px 18px rgba(42, 33, 24, 0.18);
  animation: spin 22s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.kicker {
  margin: 0;
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  font-size: 0.78rem;
}

h1, h2, h3, .num, .n, .hit .name {
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-weight: 600;
  letter-spacing: 0.03em;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 0.95;
}

.role, .band { margin: 4px 0 0; color: var(--muted); }

.tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

.links a { margin-right: 12px; text-decoration: none; border-bottom: 1px solid rgba(143, 79, 28, 0.35); }

.modes, .kitpicks, .transport, .grabs { display: flex; flex-wrap: wrap; gap: 8px; }

.modes button, .kitpick, .transport button, .grabbig, .showall {
  font: inherit;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid rgba(184, 107, 46, 0.45);
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
}

.modes button.on, .kitpick.on {
  background: var(--amber);
  color: #fff;
  border-color: var(--amber);
}

.vol { color: var(--muted); font-size: 0.9rem; }
.vol input { vertical-align: middle; accent-color: var(--amber); }

body:not(.gate) {
  display: flex;
  flex-direction: column;
}

#set-view, #pad-view, #cheat-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

#cheat-view {
  display: flex;
  flex-direction: column;
}

#sheets, #pad-view, aside {
  min-height: 0;
  overflow: auto;
}

footer { flex: 0 0 auto; padding: 4px 0 8px; }

.aside-label {
  margin: 8px 0 2px;
  color: var(--amber);
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.aside-help {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.status-filter {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 5px 10px;
  cursor: pointer;
}

.status-filter.on {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(192, 122, 61, 0.18);
}

.status-filter.play.on { background: var(--play-bg); color: var(--play); border-color: var(--play); }
.status-filter.optional.on { background: var(--optional-bg); color: var(--optional); border-color: var(--optional); }
.status-filter.sit.on { background: var(--sit-bg); color: var(--sit); border-color: var(--sit); }

#setlist li[hidden] { display: none !important; }

#setlist {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 0 8px;
  overflow-x: auto;
}

.songbtn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: max-content;
  font: inherit;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 4px 0 0 var(--gel, var(--amber));
}

.songbtn .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.songbtn .n { color: var(--gel, var(--amber)); font-size: 1.05rem; line-height: 1.1; }
.songbtn .t { font-weight: 650; }
.songbtn .d { color: var(--muted); font-size: 0.78rem; }
.songbtn .mini-status {
  display: inline-block;
  width: fit-content;
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.songbtn.status-play .mini-status { background: var(--play-bg); color: var(--play); }
.songbtn.status-optional .mini-status { background: var(--optional-bg); color: var(--optional); }
.songbtn.status-sit .mini-status { background: var(--sit-bg); color: var(--sit); }
.songbtn .mini-chips { display: flex; flex-wrap: wrap; gap: 2px; max-width: 220px; }
.songbtn .mini-chips .chip { font-size: 0.68rem; padding: 1px 6px; margin: 0; }
.songbtn.on {
  background: #fff;
  border-color: rgba(184, 107, 46, 0.45);
  box-shadow: inset 4px 0 0 var(--gel, var(--amber)), 0 8px 18px rgba(42, 33, 24, 0.08);
}

.gel-newwave { --gel: #c97a3a; }
.gel-journey { --gel: #4d7fd6; }
.gel-bonjovi { --gel: #d65a4a; }
.gel-gabriel { --gel: #c49a2e; }
.gel-huey { --gel: #3f9a68; }
.gel-prince { --gel: #8a5bb8; }

.sheet {
  background: var(--panel-strong);
  border: 1px solid rgba(184, 107, 46, 0.22);
  border-radius: 18px;
  padding: 16px 16px 20px;
  margin: 12px 0 18px;
  box-shadow: inset 5px 0 0 var(--gel, var(--amber)), 0 10px 24px rgba(42, 33, 24, 0.06);
}

.saybox {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 12px 0 8px;
  padding: 12px;
  border-radius: 16px;
  background: #fffdf8;
  border: 2px solid var(--play);
  box-shadow: 0 8px 18px rgba(42, 33, 24, 0.08);
}
.saybtn {
  width: 100%;
  min-height: 68px;
  font: 700 1.45rem/1 Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--play);
  border: none;
  border-radius: 14px;
  cursor: pointer;
}
.saybtn.on { background: #9a3b22; }
.sayline {
  margin: 12px 0 0;
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--ink);
}
.chip.chip-say { box-shadow: 0 0 0 3px #146c36; }
tr.row-say td { background: #e5f7eb; }
.tl-win.win-say { outline: 3px solid #146c36; z-index: 2; }

.sheethead { display: flex; gap: 14px; align-items: flex-end; }
.sheethead .num { margin: 0; font-size: 3rem; line-height: 0.85; color: var(--gel, var(--amber)); }
.sheethead h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.by { margin: 4px 0 0; }
.when { margin: 2px 0 0; color: var(--muted); }

.latin-brief {
  margin: 14px 0 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.brief-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 10px;
}

.brief-bpm {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.status-play { background: var(--play-bg); color: var(--play); }
.status-optional { background: var(--optional-bg); color: var(--optional); }
.status-sit { background: var(--sit-bg); color: var(--sit); }

.brief-chips { margin-bottom: 10px; }
.brief-label {
  display: block;
  margin-bottom: 4px;
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  font-size: 0.72rem;
}

.enter-cue {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ea;
  border: 1px solid rgba(192, 122, 61, 0.28);
  font-size: 1.02rem;
  line-height: 1.4;
  font-weight: 650;
}

.timeline {
  margin: 0 0 12px;
}

.tl-track {
  position: relative;
  height: 42px;
  border-radius: 12px;
  background: #efe8dc;
  border: 1px solid var(--line);
  overflow: hidden;
}

.tl-base {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(10% - 1px),
      rgba(42, 33, 24, 0.08) calc(10% - 1px),
      rgba(42, 33, 24, 0.08) 10%
    );
}

.tl-win {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0 4px;
}

.tl-win span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tl-sit {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--sit);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--sit-bg);
}

.tl-optional-note {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--optional);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 2px 8px;
}

.tl-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.cues {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
}

.cues p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  font-size: 0.98rem;
  line-height: 1.4;
}

.cues span {
  display: block;
  margin-bottom: 4px;
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  font-size: 0.72rem;
}

.chart h3 {
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  font-size: 0.95rem;
}

.latin-chart h3 { color: var(--play); }

.note {
  color: var(--muted);
  margin: 8px 0;
}

.more-gear {
  margin: 16px 0 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 4px 12px 10px;
}

.more-gear > summary {
  cursor: pointer;
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.04em;
  padding: 10px 0;
  color: var(--amber-2);
}

.padgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 640px;
}

.slot {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed rgba(42, 33, 24, 0.2);
}

.slot.live { border-style: solid; border-color: rgba(184, 107, 46, 0.55); }
.slot .num { color: var(--amber-2); font-size: 0.85rem; letter-spacing: 0.08em; }
.slot.empty .name { color: var(--muted); margin-top: auto; }

.hit {
  font: inherit;
  color: var(--ink);
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
  border: 1px solid rgba(184, 107, 46, 0.55);
  background: linear-gradient(180deg, #fff8ef, #f0e2d0);
  padding: 8px 10px;
}

.hit .name { display: block; font-size: 1rem; }
.hit .file { display: block; margin-top: 3px; color: var(--muted); font-size: 0.72rem; word-break: break-all; }
.hit.hot {
  background: #f0b070;
  color: #2a2118;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--amber);
}
.hit.hot .file { color: #5c4f42; }

.grab { font-size: 0.78rem; }

.trigrow, .sidehit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  max-width: 640px;
}

.trigrow .hit, .sidehit .hit { width: auto; min-width: min(100%, 280px); }

.prose {
  font-family: "Source Serif 4", Georgia, "Iowan Old Style", serif;
  font-size: 1.08rem;
  line-height: 1.55;
}

.prose p { margin: 0 0 0.75rem; }
.prose h2, .prose h3, .prose h4 { font-family: Oswald, "Arial Narrow", sans-serif; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.prose code { font-family: Consolas, ui-monospace, monospace; color: var(--amber-2); font-size: 0.92em; }
.prose strong { color: #1a140f; }

.prose p.stayout {
  background: var(--sit-bg);
  border-left: 5px solid var(--sit);
  border-radius: 10px;
  padding: 10px 12px;
  color: #3a3a3a;
}

.tablewrap { overflow-x: auto; margin: 0 0 1rem; }
.prose table { width: 100%; border-collapse: collapse; min-width: 520px; background: #fff; }
.prose th, .prose td {
  border-bottom: 1px solid #e5ddd1;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber-2);
  background: #f3ebe0;
}
.prose tbody tr:nth-child(even) td { background: #fbf8f3; }

.howto, .guides, .instr-key, .pack-list {
  margin: 8px 0 16px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
}

.instr-key h2, .pack-list h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.instr-key p, .pack-list p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pack-note {
  margin: 8px 0 0 !important;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--play-bg);
  color: #1f4f32 !important;
  font-weight: 650;
}

.inst-cell .chip {
  margin: 0;
  font-size: 0.86rem;
}

.howto summary, .legend h2, .library h2 { cursor: pointer; }

.legend h2, .library h2, .guides h2 {
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.04em;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 12px;
  padding: 0;
  list-style: none;
  max-width: 640px;
}

.legend-grid li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.legend-grid b { color: var(--amber); font-family: Oswald, sans-serif; margin-right: 6px; }

.filelist { list-style: none; margin: 0; padding: 0; }
.filelist li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.filelist .hit { width: auto; flex: 1 1 240px; }

footer { flex: 0 0 auto; padding: 4px 0 8px; color: var(--muted); }

@media (min-width: 1000px) {
  #set-view {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
  }
  aside, #sheets {
    height: 100%;
    max-height: 100%;
    overflow: auto;
  }
  #setlist { display: block; overflow: visible; }
  .songbtn { width: 100%; min-width: 0; margin: 0 0 8px; }
  .songbtn .t { flex: 1; }
  .slot { min-height: 124px; }
}

@media (max-width: 999px) {
  #set-view { display: flex; flex-direction: column; }
  aside { flex: 0 0 auto; max-height: 34vh; overflow: auto; }
  #sheets { flex: 1 1 auto; overflow: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .vinyl { animation: none; }
  html { scroll-behavior: auto; }
}

.logout {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  background: var(--panel-strong);
}

.stage-photos {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.stage-photos::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(245, 241, 233, 0.82), rgba(245, 241, 233, 0.92));
}

.stage-photos img {
  position: absolute;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(42, 33, 24, 0.1);
}

.p-rig {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  opacity: 0.1;
  filter: saturate(0.7) brightness(1.18);
}

.p-congas { width: 300px; height: 230px; top: 64px; left: -48px; opacity: 0.14; transform: rotate(-8deg); }
.p-jimbe { width: 210px; height: 300px; top: 16%; right: -36px; opacity: 0.13; transform: rotate(6deg); }
.p-bongos { width: 250px; height: 200px; bottom: -24px; left: 7%; opacity: 0.12; transform: rotate(4deg); }
.p-shakers { width: 240px; height: 210px; bottom: 4%; right: -16px; opacity: 0.12; transform: rotate(-6deg); }
.p-triangle { width: 160px; height: 140px; top: 6px; right: 16%; opacity: 0.14; transform: rotate(8deg); }

.sheet, aside, .legend, .library, .guides, .pack-list, .instr-key, header.top, footer {
  background-color: rgba(255, 253, 249, 0.94);
}

aside, header.top, footer {
  border-radius: 14px;
}

aside { padding: 4px 8px 8px; }

body.gate {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.gate-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.gate-bg {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  opacity: 0.38;
  filter: saturate(0.95) brightness(1.18);
}

.gate-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(247, 242, 234, 0.28) 0%, rgba(235, 228, 216, 0.72) 46%, rgba(235, 228, 216, 0.9) 100%);
}

.g {
  position: absolute;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 28px 60px rgba(42, 33, 24, 0.2);
  opacity: 0.55;
}

.g-congas { width: 38vw; height: 34vh; left: -6vw; top: -6vh; transform: rotate(-9deg); }
.g-jimbe { width: 24vw; height: 52vh; right: -4vw; top: 8vh; transform: rotate(7deg); }
.g-bongos { width: 32vw; height: 32vh; left: -4vw; bottom: -8vh; transform: rotate(5deg); }
.g-shakers { width: 30vw; height: 34vh; right: 2vw; bottom: -8vh; transform: rotate(-7deg); }
.g-triangle { width: 18vw; height: 22vh; right: 26vw; top: -4vh; transform: rotate(11deg); }

.gate-form {
  position: fixed;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 20px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  text-align: center;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(184, 107, 46, 0.45);
  border-radius: 28px;
  padding: 22px 26px 20px;
  box-shadow:
    0 0 0 8px rgba(235, 228, 216, 0.45),
    0 30px 70px rgba(42, 33, 24, 0.18);
  backdrop-filter: blur(10px);
}

.gate-vinyl {
  width: 52px;
  height: 52px;
  margin: 0 auto 4px;
}

.gate-form h1 {
  font-size: 2.4rem;
  color: var(--ink);
}

.gate-form .role { margin: 8px 0 0; }

.gate-form label {
  display: block;
  margin: 12px 0 0;
  text-align: left;
  color: var(--muted);
  font-size: 0.9rem;
}

.gate-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(184, 107, 46, 0.45);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.gate-form button {
  margin-top: 16px;
  width: 100%;
  font: inherit;
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #d98945, var(--amber));
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 13px 16px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(184, 107, 46, 0.22);
}

.retry {
  color: #8a2f28;
  background: #f7d9d5;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 10px 0 0;
}

@media (max-width: 860px) {
  .band, footer { display: none; }
  .p-congas, .p-jimbe, .p-bongos, .p-shakers, .p-triangle { opacity: 0.08; }
  .p-congas { width: 46vw; height: 18vh; }
  .p-jimbe { width: 28vw; height: 24vh; }
  .p-bongos { width: 40vw; height: 16vh; }
  .p-shakers { width: 36vw; height: 16vh; }
  .p-triangle { width: 24vw; height: 12vh; }
  .g-congas, .g-jimbe, .g-bongos, .g-shakers, .g-triangle { opacity: 0.4; }
  .g-congas { width: 58vw; height: 22vh; }
  .g-jimbe { width: 34vw; height: 28vh; }
  .g-bongos { width: 52vw; height: 20vh; }
  .g-shakers { width: 48vw; height: 20vh; }
  .g-triangle { width: 28vw; height: 14vh; right: 8vw; }
  .gate-form { padding: 16px 16px 14px; }
  .gate-vinyl { width: 64px; height: 64px; }
}

.booklink { color: var(--amber-2); text-decoration: none; border-bottom: 1px solid rgba(143, 79, 28, 0.35); }

body.book header.bookbar {
  width: auto;
  max-width: none;
  margin: 0;
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  overflow-x: auto;
  background: rgba(247, 242, 234, 0.96);
}

body.book .bookbar a, body.book .bookbar span {
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
}

body.book .bookbar a.on, body.book .bookbar a:hover { border-color: var(--amber); color: var(--amber-2); }
body.book .bookbar .back { background: var(--amber); color: #fff; border-color: var(--amber); }
body.book iframe { flex: 1 1 auto; min-height: 0; width: 100%; border: 0; background: #ebe4d8; }

.cheatscreen {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: #fffdf9;
  color: #1a1a1a;
  padding: 8px 12px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.cheatlegend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.cheatscroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.cheatscreen h1 {
  margin: 0;
  color: #161616;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.cheatnote {
  margin: 4px 0 8px;
  color: #444;
  font-size: 0.85rem;
}

.cheatwrap { min-width: 980px; }

table.cheat {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: #1a1a1a;
  font-size: 0.92rem;
  line-height: 1.35;
}

table.cheat th, table.cheat td {
  border-bottom: 1px solid #e3ddd2;
  padding: 8px 8px;
  text-align: left;
  vertical-align: top;
}

table.cheat thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #3d3228;
  color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

table.cheat tbody tr:nth-child(even) { background: #f8f5f0; }
table.cheat .n { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
table.cheat .song b { font-weight: 700; }
table.cheat .who { display: block; color: #666; font-size: 0.8rem; }
table.cheat .bpm, table.cheat .kit { white-space: nowrap; }
table.cheat .warn { font-weight: 700; color: #9a6a12; }
table.cheat .none { color: #777; }
table.cheat .swap { color: #5b2d8e; font-weight: 650; }
table.cheat .latin-cell .status { font-size: 0.78rem; padding: 4px 8px; }

.chip {
  display: inline-block;
  margin: 0 3px 3px 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

button.cheatgo {
  font: inherit;
  font-weight: 700;
  color: #161616;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

table.cheat tr.on td { background: #fff1c9; }

.chip-spd, .chip.chip-spd { background: #7f9fd6; color: #102033; }
.chip-tri, .chip.chip-tri { background: #f5e09a; color: #1a0c08; }
.chip-soft, .chip.chip-soft { background: #c5dff5; color: #102033; }
.chip-wind, .chip.chip-wind { background: #b6e8ef; color: #102033; }
.chip-hex, .chip.chip-hex { background: #f6c08a; color: #1a0c08; }
.chip-ganza, .chip.chip-ganza { background: #c2dfa0; color: #102010; }
.chip-rain, .chip.chip-rain { background: #9dceca; color: #102033; }
.chip-sm, .chip.chip-sm { background: #f0a090; color: #1a0c08; }
.chip-congas, .chip.chip-congas { background: #d7b08a; color: #1a0c08; }
.chip-bongos, .chip.chip-bongos { background: #efd4b0; color: #1a0c08; }
.chip-loud, .chip.chip-loud { background: #d4b0e2; color: #1a0c08; }
.chip-lg, .chip.chip-lg { background: #dda0a0; color: #1a0c08; }
.chip-lp, .chip.chip-lp { background: #f6d0e4; color: #1a0c08; }
.chip-jimbe, .chip.chip-jimbe { background: #c5c98a; color: #1a0c08; }

.tl-win.chip-spd { background: #7f9fd6; color: #102033; }
.tl-win.chip-tri { background: #f5e09a; color: #1a0c08; }
.tl-win.chip-soft { background: #c5dff5; color: #102033; }
.tl-win.chip-wind { background: #b6e8ef; color: #102033; }
.tl-win.chip-hex { background: #f6c08a; color: #1a0c08; }
.tl-win.chip-ganza { background: #c2dfa0; color: #102010; }
.tl-win.chip-rain { background: #9dceca; color: #102033; }
.tl-win.chip-sm { background: #f0a090; color: #1a0c08; }
.tl-win.chip-congas { background: #d7b08a; color: #1a0c08; }
.tl-win.chip-bongos { background: #efd4b0; color: #1a0c08; }
.tl-win.chip-loud { background: #d4b0e2; color: #1a0c08; }
.tl-win.chip-lg { background: #dda0a0; color: #1a0c08; }
.tl-win.chip-lp { background: #f6d0e4; color: #1a0c08; }
.tl-win.chip-jimbe { background: #c5c98a; color: #1a0c08; }

.cheatscreen a { color: #0d47a1; }
.cheatscreen table.cheat a { text-decoration: none; border-bottom: 1px solid rgba(13, 71, 161, 0.35); }

@media print {
  html, body, body:not(.gate) {
    height: auto;
    max-height: none;
    overflow: visible;
    display: block;
  }
  body { background: white; color: black; }
  .vinyl, .tools, aside, .transport, #pad-view, footer, .grab, .hit,
  .stage-photos, .logout, .saybox { display: none !important; }
  .sheet, .sheet[hidden] { display: block !important; break-before: page; box-shadow: none; background: white; color: black; }
  .prose, .by, .when { color: black; }
  a { color: black; }
}
