/* Sheet Studio */

.ss-body [hidden] {
  display: none !important;
}

.ss-page {
  width: 94%;
  max-width: 1180px;
  margin: 28px auto 48px;
  flex-grow: 1;
  box-sizing: border-box;
}

.ss-hero {
  text-align: center;
  margin-bottom: 22px;
}
.ss-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.5px;
}
.ss-hero p {
  margin: 0 auto;
  max-width: 680px;
  opacity: 0.75;
  line-height: 1.5;
}
.ss-badge {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.42em;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #22c55e);
  color: #fff;
  letter-spacing: 1px;
}

.ss-card {
  background: #1e1e1e;
  border: 1px solid #2c2c2c;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.ss-gate {
  text-align: center;
}
.ss-gate h2 {
  margin-top: 0;
}
.ss-gate-msg {
  color: #f87171;
  margin: 14px 0 0;
}.ss-gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.ss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 9px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
}
.ss-btn:active {
  transform: translateY(1px);
}
.ss-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ss-btn-primary {
  background: #3b82f6;
  color: #fff;
}
.ss-btn-primary:not(:disabled):hover {
  background: #2f72e0;
}
.ss-btn-ghost {
  background: #2a2a2a;
  color: #e5e7eb;
  border: 1px solid #3a3a3a;
}
.ss-btn-ghost:hover {
  background: #333;
}
.ss-btn-warn {
  background: rgba(250, 204, 21, 0.14);
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, 0.35);
  padding: 8px 14px;
}
.ss-link {
  background: none;
  border: none;
  color: #7fb2ff;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Upload */
.ss-drop {
  border: 2px dashed #3d4a63;
  border-radius: 12px;
  padding: 30px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: rgba(59, 130, 246, 0.04);
  transition: border-color 0.15s, background 0.15s;
}
.ss-drop:hover,
.ss-drop:focus-visible,
.ss-drop.ss-drag {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  outline: none;
}
.ss-drop span {
  opacity: 0.65;
  font-size: 14px;
}
.ss-drop-icon {
  color: #7fb2ff;
}
.ss-link-text {
  color: #7fb2ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ss-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.ss-thumb {
  position: relative;
  width: 132px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #3a3a3a;
}
.ss-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ss-thumb-num {
  position: absolute;
  left: 6px;
  top: 6px;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}
.ss-thumb-remove {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.ss-upload-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.ss-input {
  flex: 1 1 260px;
  min-width: 0;
  background: #141414;
  border: 1px solid #333;
  border-radius: 9px;
  color: #fff;
  padding: 11px 14px;
  font: inherit;
}
.ss-input:focus {
  outline: none;
  border-color: #3b82f6;
}
.ss-upload-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 14px;
  gap: 10px;
  flex-wrap: wrap;
}
#ss-usage {
  opacity: 0.65;
}

.ss-progress {
  margin-top: 16px;
}
.ss-progress-bar {
  height: 6px;
  background: #2a2a2a;
  border-radius: 999px;
  overflow: hidden;
}
.ss-progress-bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  animation: ssSlide 1.4s ease-in-out infinite;
}
@keyframes ssSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}
#ss-progress-text {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.8;
}
.ss-error {
  margin-top: 14px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 14px;
}

/* Studio */
.ss-studio-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ss-studio-head h2 {
  margin: 0;
  font-size: 24px;
}
.ss-meta {
  opacity: 0.65;
  font-size: 14px;
  margin-top: 4px;
}
.ss-head-actions {
  display: flex;
  gap: 8px;
}
.ss-warnings {
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.ss-sheet-scroll {
  background: #fbfaf6;
  border-radius: 12px;
  max-height: min(58vh, 640px);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 8px 18px rgba(0, 0, 0, 0.35);
  scroll-behavior: smooth;
}
.ss-sheet {
  padding: 4px 0;
}
.ss-svg {
  display: block;
}

/* Lettered noteheads */
.ss-hidden-head {
  opacity: 0;
}
.ss-head {
  cursor: pointer;
}
.ss-head ellipse {
  stroke: #111;
  stroke-width: 1.3;
  transition: fill 0.12s, stroke 0.12s;
}
.ss-head text {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  pointer-events: none;
  transition: fill 0.12s;
}
.ss-filled ellipse {
  fill: #111;
}
.ss-filled text {
  fill: #fff;
}
.ss-hollow ellipse {
  fill: #fff;
  stroke-width: 1.6;
}
.ss-hollow text {
  fill: #111;
}
.ss-head:hover ellipse {
  stroke: #3b82f6;
}
.ss-rh.ss-attack ellipse {
  fill: #2563eb;
  stroke: #1e3a8a;
}
.ss-lh.ss-attack ellipse {
  fill: #16a34a;
  stroke: #14532d;
}
.ss-attack text {
  fill: #fff;
}
.ss-rh.ss-held ellipse {
  fill: #bfdbfe;
  stroke: #3b82f6;
}
.ss-lh.ss-held ellipse {
  fill: #bbf7d0;
  stroke: #22c55e;
}
.ss-held text {
  fill: #0f172a;
}

.ss-beatbox {
  fill: rgba(59, 130, 246, 0.13);
  stroke: rgba(59, 130, 246, 0.55);
  stroke-width: 1.2;
  transition: x 0.18s ease, y 0.18s ease, width 0.18s ease;
}
.ss-playhead {
  stroke: #ef4444;
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.85;
  pointer-events: none;
}

/* Transport */
.ss-transport {
  display: grid;
  grid-template-columns: minmax(170px, auto) 1fr auto;
  align-items: center;
  gap: 14px;
  background: #1e1e1e;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0 10px;
}
.ss-counter {
  display: flex;
  flex-direction: column;
}
.ss-counter-main {
  font-size: 19px;
  font-weight: 800;
}
#ss-beat-label {
  color: #7fb2ff;
}
.ss-counter small {
  opacity: 0.6;
  margin-top: 2px;
}
.ss-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.ss-tbtn {
  background: #2a2a2a;
  color: #e5e7eb;
  border: 1px solid #3a3a3a;
  border-radius: 9px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, transform 0.08s;
}
.ss-tbtn:hover {
  background: #343434;
}
.ss-tbtn:active {
  transform: translateY(1px);
}
.ss-tbtn-primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.ss-tbtn-primary:hover {
  background: #2f72e0;
}
.ss-tbtn-ghost {
  background: transparent;
}
.ss-tbtn.ss-active {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.ss-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.ss-tempo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ss-tempo input {
  width: 110px;
  accent-color: #3b82f6;
}
#ss-tempo-val {
  min-width: 52px;
  font-weight: 700;
}
.ss-check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.ss-check input {
  accent-color: #3b82f6;
}

.ss-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  opacity: 0.85;
  margin: 4px 2px 10px;
  align-items: center;
}
.ss-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ss-sw {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.ss-sw-rh { background: #3b82f6; }
.ss-sw-lh { background: #22c55e; }
.ss-sw-held { background: linear-gradient(90deg, rgba(59, 130, 246, 0.45), rgba(34, 197, 94, 0.45)); box-shadow: 0 0 6px rgba(120, 190, 255, 0.8); }
.ss-fn {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0f172a;
  border: 1px solid #7fb2ff;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* Piano */
.ss-piano {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  border-radius: 12px;
  background: #101014;
  padding: 10px 0 0;
}
.ssp-stage {
  position: relative;
  width: max-content;
  min-width: 100%;
}
.ssp-keys {
  position: relative;
  width: 100%;
}
.ssp-white,
.ssp-black {
  position: absolute;
  top: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: background 0.1s, box-shadow 0.15s;
}
.ssp-white {
  height: 100%;
  background: linear-gradient(#f4f4f4, #fff 70%, #e8e8e8);
  border: 1px solid #222;
  border-radius: 0 0 6px 6px;
  z-index: 1;
  padding-bottom: 6px;
}
.ssp-black {
  background: linear-gradient(#2a2a2a, #0b0b0b);
  border: 1px solid #000;
  border-radius: 0 0 4px 4px;
  z-index: 2;
  padding-bottom: 6px;
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.08);
}
.ssp-name {
  font-size: 10px;
  color: #6b7280;
  font-weight: 700;
  pointer-events: none;
}
.ssp-black .ssp-name {
  display: none;
}
.ssp-middle-c .ssp-name {
  color: #2563eb;
}
.ssp-finger {
  font-size: 13px;
  font-weight: 900;
  min-height: 20px;
  min-width: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.ssp-finger:empty {
  visibility: hidden;
}
.ssp-white.ssp-rh.ssp-attack { background: linear-gradient(#60a5fa, #3b82f6); }
.ssp-black.ssp-rh.ssp-attack { background: linear-gradient(#3b82f6, #1d4ed8); }
.ssp-white.ssp-lh.ssp-attack { background: linear-gradient(#4ade80, #22c55e); }
.ssp-black.ssp-lh.ssp-attack { background: linear-gradient(#22c55e, #15803d); }
.ssp-white.ssp-rh.ssp-held { background: linear-gradient(#e6f0ff, #bcd6ff); box-shadow: inset 0 0 14px rgba(59, 130, 246, 0.75), 0 0 10px rgba(59, 130, 246, 0.55); }
.ssp-black.ssp-rh.ssp-held { background: linear-gradient(#3a4f78, #23324f); box-shadow: 0 0 10px rgba(59, 130, 246, 0.8); }
.ssp-white.ssp-lh.ssp-held { background: linear-gradient(#e8fff0, #bff2d2); box-shadow: inset 0 0 14px rgba(34, 197, 94, 0.75), 0 0 10px rgba(34, 197, 94, 0.55); }
.ssp-black.ssp-lh.ssp-held { background: linear-gradient(#2f5a41, #1d3a2a); box-shadow: 0 0 10px rgba(34, 197, 94, 0.8); }
.ssp-rh .ssp-finger { background: #0f172a; color: #fff; border: 2px solid #93c5fd; }
.ssp-lh .ssp-finger { background: #052e16; color: #fff; border: 2px solid #86efac; }
.ssp-attack .ssp-name { color: #fff; }

/* With neon hands, the badges on the hand carry the finger numbers. */
.ssp-stage.nh-on .ssp-finger { display: none; }

.nh-hand.nh-prep { opacity: 0.55; }
.nh-boost-held {
  fill: rgba(150, 215, 255, 0.24);
  stroke: rgba(210, 238, 255, 0.7);
  stroke-width: 1.2;
}
.nh-green .nh-boost-pressed { fill: rgba(140, 240, 180, 0.4); stroke: rgba(230, 255, 240, 0.95); }
.nh-green .nh-boost-held { fill: rgba(140, 240, 180, 0.22); stroke: rgba(210, 255, 228, 0.7); }
.nh-green .nh-boost-target { fill: rgba(140, 240, 180, 0.16); stroke: rgba(190, 255, 215, 0.85); }
.nh-green .nh-press-ring { stroke: #bdf5d2; }
.nh-green .nh-badge circle { stroke: rgba(150, 240, 190, 0.75); fill: rgba(6, 34, 20, 0.82); }
.nh-green .nh-badge text { fill: #dcffe9; }
.nh-green .nh-badge-pressed circle { fill: #22c55e; stroke: #eafff2; filter: drop-shadow(0 0 5px rgba(60, 220, 130, 0.95)); }
.nh-badge-held circle { fill: rgba(59, 130, 246, 0.55); stroke: #cfe6ff; }
.nh-green .nh-badge-held circle { fill: rgba(34, 197, 94, 0.5); stroke: #d4ffe4; }

.ss-shortcuts {
  text-align: center;
  font-size: 12px;
  opacity: 0.5;
  margin-top: 10px;
}

@media (max-width: 860px) {
  .ss-transport {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .ss-counter {
    align-items: center;
  }
  .ss-options {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }
}
@media (max-width: 520px) {
  .ss-card { padding: 16px; }
  .ss-tbtn { padding: 9px 10px; font-size: 14px; }
  .ss-shortcuts { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-beatbox { transition: none; }
  .ss-progress-bar span { animation: none; }
}
