/* PianoKite web player. Theme with --pt-accent (default #4f46e5). */
.pt-player {
  --pt-a: var(--pt-accent, #4f46e5);
  --pt-bg: #ffffff;
  --pt-fg: #0f172a;
  --pt-muted: #64748b;
  --pt-line: #e2e8f0;
  --pt-btn: #f1f5f9;
  --pt-btn-h: #e2e8f0;
  --pt-seg-on: #ffffff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Fixed height reserved before the script runs: no layout shift. */
  height: 460px;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--pt-line);
  border-radius: 16px;
  background: var(--pt-bg);
  color: var(--pt-fg);
  font: 13px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  container-type: inline-size;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pt-player {
    --pt-bg: #0f172a;
    --pt-fg: #e2e8f0;
    --pt-muted: #94a3b8;
    --pt-line: #1e293b;
    --pt-btn: #1e293b;
    --pt-btn-h: #334155;
    --pt-seg-on: #334155;
  }
}
:root[data-theme="dark"] .pt-player {
  --pt-bg: #0f172a;
  --pt-fg: #e2e8f0;
  --pt-muted: #94a3b8;
  --pt-line: #1e293b;
  --pt-btn: #1e293b;
  --pt-btn-h: #334155;
  --pt-seg-on: #334155;
}
@media (max-width: 600px) {
  .pt-player { height: 480px; padding: 10px; border-radius: 14px; gap: 7px; }
}
.pt-player:not(.pt-on) {
  background: linear-gradient(#0b1020, #0b1020) 12px 50px / calc(100% - 24px) 55% no-repeat, var(--pt-bg);
}
.pt-player *, .pt-player *::before, .pt-player *::after { box-sizing: border-box; }
.pt-player [hidden] { display: none !important; }
.pt-player button, .pt-player select, .pt-player input { font: inherit; color: inherit; margin: 0; }
.pt-player :focus-visible { outline: 2px solid var(--pt-a); outline-offset: 2px; }

.pt-head { display: flex; align-items: center; gap: 8px; min-height: 28px; flex: none; }
.pt-title { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-vlabel { flex: none; color: var(--pt-muted); font-size: 12px; }
.pt-version {
  flex: 0 1 auto;
  max-width: 60%;
  height: 28px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--pt-line);
  border-radius: 8px;
  background: var(--pt-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center / 10px 6px;
  -webkit-appearance: none;
  appearance: none;
  font-size: 12px;
  cursor: pointer;
  text-overflow: ellipsis;
}

.pt-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 120px;
  overflow: hidden;
  border-radius: 12px;
  background: #0b1020;
}
.pt-roll, .pt-keys { position: absolute; left: 0; display: block; }
.pt-roll { top: 0; cursor: pointer; }
.pt-keys { bottom: 0; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }

.pt-big {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pt-a);
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.pt-big:hover { transform: translate(-50%, -50%) scale(1.06); }
.pt-big .pt-ico { width: 30px; height: 30px; margin-left: 3px; }
.pt-msg {
  position: absolute;
  inset: 0 0 auto;
  top: 36%;
  transform: translateY(-50%);
  padding: 0 16px;
  text-align: center;
  color: #e2e8f0;
  font-size: 14px;
  pointer-events: none;
}
.pt-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

.pt-over {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(11, 16, 32, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.pt-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: var(--pt-bg);
  color: var(--pt-fg);
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.pt-card strong { display: block; font-size: 18px; margin-bottom: 4px; }
.pt-card p { margin: 0 0 12px; color: var(--pt-muted); }
.pt-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pt-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pt-muted) !important;
  cursor: pointer;
}
.pt-x:hover { background: var(--pt-btn); }
.pt-x .pt-ico { width: 18px; height: 18px; }

.pt-progress {
  --pt-p: 0%;
  flex: none;
  width: 100%;
  height: 18px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.pt-progress::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--pt-a) var(--pt-p), var(--pt-btn-h) var(--pt-p));
}
.pt-progress::-moz-range-track { height: 4px; border-radius: 2px; background: var(--pt-btn-h); }
.pt-progress::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--pt-a); }
.pt-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--pt-a);
  box-shadow: 0 0 0 3px var(--pt-bg);
}
.pt-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--pt-a);
  box-shadow: 0 0 0 3px var(--pt-bg);
}

.pt-controls { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pt-grp { display: flex; align-items: center; gap: 6px; }
.pt-grp:last-child { margin-left: auto; }
.pt-time { min-width: 84px; padding: 0 4px; color: var(--pt-muted); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }

.pt-btn, .pt-tog, .pt-segb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--pt-btn);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pt-btn:hover, .pt-tog:hover { background: var(--pt-btn-h); }
.pt-grp .pt-btn { width: 34px; padding: 0; }
.pt-play { background: var(--pt-a) !important; color: #fff !important; }
.pt-play:hover { filter: brightness(1.08); }
.pt-tog[aria-pressed="true"] { background: var(--pt-a); color: #fff; }
.pt-primary { background: var(--pt-a); color: #fff !important; padding: 0 16px; }
.pt-primary:hover { background: var(--pt-a); filter: brightness(1.08); }
.pt-ghost { padding: 0 16px; }

.pt-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 10px; background: var(--pt-btn); }
.pt-segb { height: 30px; padding: 0 9px; border-radius: 8px; background: transparent; color: var(--pt-muted) !important; font-size: 12px; }
.pt-segb:hover { color: var(--pt-fg) !important; }
.pt-segb[aria-pressed="true"] { background: var(--pt-seg-on); color: var(--pt-fg) !important; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }

.pt-ico { width: 20px; height: 20px; flex: none; fill: currentColor; }
.pt-ico .pt-stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pt-foot {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  min-height: 15px;
  color: var(--pt-muted);
  font-size: 11px;
}
.pt-status a, .pt-credit { color: inherit; }
.pt-status a { color: var(--pt-a); font-weight: 600; }
.pt-credit { margin-left: auto; text-decoration: none; opacity: 0.85; }
.pt-credit:hover { text-decoration: underline; }

@container (max-width: 600px) {
  .pt-btn, .pt-tog { height: 32px; padding: 0 10px; }
  .pt-grp .pt-btn { width: 32px; }
  .pt-segb { height: 28px; padding: 0 8px; }
  .pt-time { min-width: 76px; }
  .pt-grp:last-child { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-player * { transition: none !important; }
}
.pt-badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pt-a) 14%, transparent);
  color: var(--pt-a);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
