/* =========================================================
   从难到易 · 难度评级
   视觉参考 sample.png：粗黑描边、五档纯色横条、方形封面
   ========================================================= */

:root {
  --ink: #141210;
  --ink-soft: #3a352e;
  --paper: #e9e6de;
  --paper-2: #f8f4ea;
  --paper-3: #fffdf7;
  --muted: #6f695f;
  --red: #ff2b2b;
  --orange: #f5a623;
  --yellow: #ffe500;
  --pale: #fff0b8;
  --shadow: 7px 7px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 14px;
  --dock-h: 184px;
  --font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background-color: #ddd9d0;
  background-image: radial-gradient(circle at 1px 1px, rgba(20, 18, 16, .10) 1px, transparent 0);
  background-size: 18px 18px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

body.is-dragging * { cursor: grabbing !important; }

button, input { font-family: inherit; }

button { color: var(--ink); }

img { -webkit-user-drag: none; user-select: none; }

::selection { background: var(--red); color: #fff; }

[hidden] { display: none !important; }

.app {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 20px clamp(12px, 2.2vw, 34px) calc(var(--dock-h) + 18px);
}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.masthead {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(330px, 1.05fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: var(--paper-2);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-4deg);
}

.brand-mark span {
  color: #fff;
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(4deg);
  text-shadow: 2px 2px 0 var(--ink);
}

.brand-text { min-width: 0; }

.brand-text h1 {
  margin: 0;
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1.02;
  white-space: nowrap;
}

.brand-text h1::after {
  content: "!";
  display: inline-block;
  margin-left: 4px;
  color: var(--red);
  transform: translateY(-2px);
}

.brand-text p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
}

.brand-logo {
  flex: 0 0 auto;
  display: block;
  width: auto;
  height: 78px;
  max-width: 190px;
  margin-left: auto;
  margin-right: 2px;
  object-fit: contain;
  transform: rotate(-1deg);
  filter: drop-shadow(2px 3px 0 rgba(20, 18, 16, .12));
}

.maker-card {
  min-width: 0;
  padding: 2px 4px 2px 18px;
  border-left: 2px dashed rgba(20, 18, 16, .24);
}

.maker-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.maker-label {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  color: var(--ink-soft);
}

.maker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 900;
}

.maker-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 2px 4px 4px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .02em;
}

.maker-input::placeholder {
  color: rgba(20, 18, 16, .28);
  font-weight: 700;
}

.maker-input:focus {
  border-bottom-color: var(--red);
  background: rgba(255, 43, 43, .06);
}

.maker-care {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 15px;
  transform: rotate(-8deg);
}

.maker-note {
  display: inline-block;
  margin: 8px 0 0;
  padding: 2px 8px;
  background: var(--pale);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  transform: rotate(-1.5deg);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 15px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--paper-3);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .03em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, opacity .12s ease;
}

.btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.btn.primary { background: var(--red); color: #fff; }
.btn.play { background: var(--ink); color: #fff; min-height: 46px; padding: 11px 18px; font-size: 14px; }
.btn.primary:hover:not(:disabled) { background: #e91f1f; }
.btn.play:hover:not(:disabled) { background: #2a2724; }

.btn.ghost {
  background: transparent;
  box-shadow: none;
}

.btn.ghost:hover:not(:disabled) {
  background: var(--paper-3);
  box-shadow: var(--shadow-sm);
}

.btn.tiny {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 12px;
  background: #fff;
  color: var(--ink);
}

.btn:disabled {
  opacity: .38;
  cursor: not-allowed;
  filter: saturate(.4);
}

.play-tri {
  display: inline-block;
  font-size: 11px;
  transform: translateY(-1px);
}

/* ---------------------------------------------------------
   Share banner
   --------------------------------------------------------- */

.share-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 5px 5px 0 rgba(255, 43, 43, .9);
}

.share-banner p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.share-banner strong { color: var(--yellow); }

.share-banner-badge {
  flex: 0 0 auto;
  padding: 3px 9px;
  background: var(--red);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

/* ---------------------------------------------------------
   Board
   --------------------------------------------------------- */

.workspace { position: relative; }

.board {
  background: #d5d1c7;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tier {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  min-height: 124px;
  border-bottom: 3px solid var(--ink);
  background: #d5d1c7;
  transition: background .15s ease;
}

.tier:last-child { border-bottom: 0; }

.tier-label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  background: var(--tier-color);
  color: var(--tier-ink);
  border-right: 3px solid var(--ink);
  overflow: hidden;
}

.tier-label::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .2) 0 50%, transparent 50% 100%);
  background-size: 14px 14px;
  opacity: .22;
  pointer-events: none;
}

.tier-name {
  position: relative;
  z-index: 1;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .14em;
  text-indent: .14em;
  writing-mode: horizontal-tb;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .25);
}

.tier-count {
  position: relative;
  z-index: 1;
  padding: 2px 9px;
  background: rgba(255, 255, 255, .62);
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.5;
}

.tier-drop {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 118px;
  padding: 11px 12px;
  outline: 0;
  transition: background .15s ease, box-shadow .15s ease;
}

.tier-drop:focus-visible {
  box-shadow: inset 0 0 0 4px var(--red);
}

.tier.is-over .tier-drop {
  background: rgba(255, 255, 255, .5);
  box-shadow: inset 0 0 0 3px var(--ink);
}

.tier-empty {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  border: 2px dashed rgba(20, 18, 16, .26);
  border-radius: 9px;
  color: rgba(20, 18, 16, .42);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  pointer-events: none;
}

.board-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.foot-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  background: var(--yellow);
}

/* ---------------------------------------------------------
   Song cards
   --------------------------------------------------------- */

.song-card {
  position: relative;
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: #b9b4aa;
  box-shadow: 3px 3px 0 rgba(20, 18, 16, .7);
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  will-change: transform;
}

.song-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.song-card:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 5px 6px 0 rgba(20, 18, 16, .75);
  z-index: 2;
}

.song-card:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  z-index: 3;
}

.song-card.is-selected {
  outline: 4px solid var(--red);
  outline-offset: 2px;
  transform: translateY(-3px) rotate(-1deg);
  z-index: 4;
}

.song-card.is-dragging {
  opacity: .24;
  transform: none;
  box-shadow: none;
}

.song-card.is-locked { cursor: pointer; }
.song-card.is-locked:hover { transform: translateY(-2px); }

.song-card.is-now {
  outline: 4px solid #fff;
  box-shadow: 0 0 0 7px var(--red), 4px 4px 0 var(--ink);
  z-index: 5;
}

.card-id {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 0 5px;
  background: var(--paper-3);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 17px;
  letter-spacing: .01em;
}

.card-eq {
  position: absolute;
  left: 5px;
  top: 5px;
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  padding: 3px 4px;
  background: var(--ink);
  border-radius: 4px;
}

.song-card.is-previewing .card-eq { display: flex; }

.card-eq i {
  display: block;
  width: 2px;
  height: 6px;
  background: #fff;
  animation: eq .72s ease-in-out infinite;
}

.card-eq i:nth-child(1) { animation-delay: -.5s; }
.card-eq i:nth-child(2) { animation-delay: -.15s; }
.card-eq i:nth-child(3) { animation-delay: -.35s; }
.card-eq i:nth-child(4) { animation-delay: -.05s; }

@keyframes eq {
  0%, 100% { height: 4px; }
  50% { height: 12px; }
}

.card-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  background: var(--ink-soft);
}

/* ---------------------------------------------------------
   Drag ghost + insertion line
   --------------------------------------------------------- */

.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  margin: 0;
  pointer-events: none;
  opacity: .98;
  box-shadow: 12px 14px 0 rgba(20, 18, 16, .32);
  transform-origin: 50% 50%;
  transition: none;
}

.drag-ghost .card-id { opacity: .9; }

.insert-line {
  position: fixed;
  z-index: 900;
  width: 4px;
  background: var(--ink);
  border-radius: 3px;
  pointer-events: none;
  box-shadow: 0 0 0 2px #fff;
}

.insert-line::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 12px;
  height: 12px;
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 50%;
  transform: translateX(-50%);
}

/* ---------------------------------------------------------
   Dock / tray
   --------------------------------------------------------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--paper-2);
  border-top: 3px solid var(--ink);
  box-shadow: 0 -12px 34px rgba(20, 18, 16, .18);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.dock-inner {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 10px clamp(12px, 2.2vw, 34px) 10px;
}

.dock-head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding-bottom: 4px;
}

.dock-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.dock-kicker {
  padding: 2px 7px;
  background: var(--red);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}

.dock-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .03em;
  white-space: nowrap;
}

.count-pill {
  display: inline-block;
  min-width: 26px;
  margin-left: 2px;
  padding: 1px 7px;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.dock-hint {
  flex: 1 1 auto;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tray-nav-group {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.tray-nav {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--paper-3);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.tray-nav:hover:not(:disabled) { background: var(--yellow); }
.tray-nav:disabled { opacity: .35; cursor: not-allowed; }

.dock-head .btn.play { margin-left: auto; }

.tray-track {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 92px;
  padding: 4px 2px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 18, 16, .35) transparent;
}

.tray-track::-webkit-scrollbar { height: 7px; }
.tray-track::-webkit-scrollbar-track { background: transparent; }
.tray-track::-webkit-scrollbar-thumb { background: rgba(20, 18, 16, .35); border-radius: 99px; }
.tray-track::-webkit-scrollbar-thumb:hover { background: rgba(20, 18, 16, .6); }

.tray-track .song-card {
  width: 86px;
  height: 86px;
  box-shadow: 2px 2px 0 rgba(20, 18, 16, .65);
}

.tray-done {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 78px;
  padding: 0 20px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .03em;
}

.tray-done span { font-size: 22px; }

/* ---------------------------------------------------------
   Player
   --------------------------------------------------------- */

.player {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 118px;
  padding: 8px 2px;
}

.player-cover {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: repeating-linear-gradient(45deg, #d7d2c7 0 6px, #c9c4b8 6px 12px);
  box-shadow: 3px 3px 0 var(--ink);
}

.player-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-info {
  flex: 1 1 auto;
  min-width: 0;
}

.player-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.player-kicker .dot { color: var(--red); }

.player-title {
  margin: 2px 0 7px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  background: #d8d3c8;
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.player-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--red), #ff6a3d);
  border-radius: 999px 0 0 999px;
  transition: width .08s linear;
}

.player-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.player-ticks i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(20, 18, 16, .26);
}

.player-time {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.player-actions .btn { min-height: 42px; padding: 9px 16px; }

/* ---------------------------------------------------------
   Toast
   --------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 18px);
  z-index: 1100;
  max-width: min(520px, calc(100vw - 28px));
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(255, 43, 43, .9);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------
   Dialogs
   --------------------------------------------------------- */

.dialog {
  width: min(560px, calc(100vw - 28px));
  max-width: 560px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 12px 12px 0 rgba(20, 18, 16, .8);
}

.dialog::backdrop {
  background: rgba(20, 18, 16, .48);
  backdrop-filter: blur(3px);
}

.dialog-inner {
  position: relative;
  padding: 24px;
}

.dialog-x {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.dialog-x:hover { background: var(--red); color: #fff; }
.dialog-x:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.dialog-kicker {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .22em;
}

.dialog h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .04em;
}

.dialog-desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--ink-soft);
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-link-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  outline: 0;
}

.share-link-row input:focus { border-color: var(--red); }

.share-link-row .btn { min-height: 42px; }

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.dialog-foot {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1.5px dashed rgba(20, 18, 16, .2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}

/* ---------------------------------------------------------
   View mode
   --------------------------------------------------------- */

body.is-view .maker-input { display: none; }
body.is-view .maker-care { display: none; }
body.is-view .tier.is-over .tier-drop { background: transparent; box-shadow: none; }

body.is-view .song-card:hover { transform: translateY(-2px) rotate(-1deg); }

body.is-view .board-foot { opacity: .75; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 1180px) {
  .masthead {
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px 18px;
  }

  .maker-card {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 4px 0 0;
    border-left: 0;
    border-top: 2px dashed rgba(20, 18, 16, .2);
  }

  .brand-logo { height: 66px; max-width: 170px; }

  .actions { grid-column: 2; grid-row: 1; }
}

@media (max-width: 860px) {
  :root { --dock-h: 170px; }

  .masthead {
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .brand-mark { width: 50px; height: 50px; }
  .brand-mark span { font-size: 27px; }
  .brand-logo { height: 58px; max-width: 150px; }

  .tier { grid-template-columns: 110px minmax(0, 1fr); }
  .tier-name { font-size: 25px; }
  .tier-drop { gap: 8px; padding: 10px; }
  .song-card { width: 92px; height: 92px; }
  .tier-empty { font-size: 11px; }
}

@media (max-width: 700px) {
  :root {
    --dock-h: 124px;
    --shadow: 5px 5px 0 var(--ink);
  }

  .app { padding: 10px 8px calc(var(--dock-h) + 14px); }

  .masthead {
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .brand { gap: 10px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 9px; box-shadow: 3px 3px 0 var(--ink); }
  .brand-mark span { font-size: 23px; }
  .brand-logo { display: none; }
  .brand-text h1 { font-size: 28px; letter-spacing: .06em; }
  .brand-text p { font-size: 10px; letter-spacing: .08em; margin-top: 3px; }

  .actions { gap: 6px; }
  .actions .btn { min-height: 34px; padding: 7px 9px; font-size: 11px; }
  .actions #shuffleBtn { display: none; }

  .maker-card { padding-top: 2px; }
  .maker-label { font-size: 10px; }
  .maker-input, .maker-name { font-size: 18px; }
  .maker-note { margin-top: 6px; font-size: 9px; }

  .share-banner { padding: 8px 10px; gap: 8px; }
  .share-banner p { font-size: 12px; }
  .share-banner-badge { display: none; }

  .board { border-radius: 11px; box-shadow: 4px 4px 0 var(--ink); }

  .tier {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .tier-label {
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .tier-label::before { background-size: 10px 10px; }
  .tier-name { font-size: 20px; letter-spacing: .12em; }
  .tier-count { font-size: 10px; padding: 1px 7px; }

  .tier-drop { gap: 7px; padding: 8px; min-height: 78px; }
  .tier-empty { min-height: 62px; font-size: 10px; }

  .song-card { width: 72px; height: 72px; border-radius: 7px; }
  .card-id { right: 3px; bottom: 3px; font-size: 9px; line-height: 14px; padding: 0 4px; border-width: 1px; }
  .song-card:hover { transform: none; box-shadow: 2px 2px 0 rgba(20, 18, 16, .7); }

  .board-foot { font-size: 10px; margin-top: 10px; line-height: 1.5; }

  .dock-inner { padding: 6px 8px 6px; }
  .dock-head { gap: 8px; min-height: 36px; padding-bottom: 2px; }
  .dock-kicker { font-size: 9px; padding: 1px 5px; }
  .dock-title { gap: 6px; }
  .dock-title h2 { font-size: 12px; }
  .count-pill { font-size: 10px; min-width: 22px; padding: 0 5px; }
  .dock-hint { display: none; }
  .tray-nav-group { gap: 4px; }
  .tray-nav { width: 26px; height: 26px; border-width: 1.5px; box-shadow: 1.5px 1.5px 0 var(--ink); font-size: 16px; }
  .dock-head .btn.play { min-height: 34px; padding: 7px 11px; font-size: 11px; }

  .tray-track { min-height: 66px; gap: 7px; padding: 3px 1px 5px; }
  .tray-track .song-card { width: 62px; height: 62px; }
  .tray-done { min-height: 58px; font-size: 11px; padding: 0 8px; }

  .player { gap: 10px; min-height: 100px; padding: 6px 2px; }
  .player-cover { width: 58px; height: 58px; }
  .player-title { font-size: 16px; margin-bottom: 5px; }
  .player-kicker { font-size: 9px; }
  .player-time { font-size: 9px; }
  .player-actions { gap: 6px; }
  .player-actions .btn { min-height: 34px; padding: 7px 10px; font-size: 11px; }
  .player-bar { height: 10px; }

  .toast { bottom: calc(var(--dock-h) + 12px); font-size: 12px; }

  .dialog-inner { padding: 20px 16px; }
  .dialog h2 { font-size: 22px; }
  .share-link-row { flex-direction: column; }
  .share-link-row .btn { width: 100%; }
}

@media (max-width: 390px) {
  .brand-text h1 { font-size: 25px; }
  .brand-text p { display: none; }
  .song-card { width: 66px; height: 66px; }
  .tray-track .song-card { width: 58px; height: 58px; }
}

@media (max-width: 360px) {
  .actions #resetBtn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
