/* =========================================================
   从夯到拉 · Tier List Maker
   ========================================================= */

:root {
  --ink: #17140f;
  --ink-soft: #3f3a32;
  --muted: #777066;
  --paper: #f2eee5;
  --paper-light: #fffdf7;
  --paper-deep: #e8e1d4;
  --red: #ad0002;
  --gold: #f5c60b;
  --yellow: #feff0e;
  --beige: #fdf4ce;
  --green: #1b9b65;
  --white: #ffffff;
  --border: 2.5px solid var(--ink);
  --radius: 12px;
  --shadow-hard: 4px 5px 0 rgba(23, 20, 15, 0.14);
  --font-cn: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-display: "Arial Black", "Arial Bold", "Microsoft YaHei UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-cn);
  background:
    radial-gradient(circle at 8% -8%, rgba(245, 198, 11, 0.2), transparent 34%),
    radial-gradient(circle at 98% 3%, rgba(173, 0, 2, 0.075), transparent 31%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

[hidden] {
  display: none !important;
}

::selection {
  color: var(--ink);
  background: var(--yellow);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.33;
  background-image: radial-gradient(rgba(23, 20, 15, 0.19) 0.65px, transparent 0.65px);
  background-size: 17px 17px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.55) 62%, transparent 100%);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 19px;
  border-bottom: 1.5px solid rgba(23, 20, 15, 0.22);
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 43px;
  height: 48px;
  padding: 4px;
  border: var(--border);
  border-radius: 9px;
  background: var(--ink);
  box-shadow: 3px 3px 0 rgba(23, 20, 15, 0.18);
  transform: rotate(-2.2deg);
}

.brand-bar {
  display: block;
  flex: 1;
  border-radius: 1.5px;
}

.brand-bar--red { background: var(--red); }
.brand-bar--gold { background: var(--gold); }
.brand-bar--yellow { background: var(--yellow); }
.brand-bar--beige { background: var(--beige); }

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.brand-kicker,
.eyebrow {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.19em;
}

.brand-title {
  margin-top: -1px;
  font-size: 29px;
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.brand-period {
  color: var(--red);
}

.tagline {
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 43px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.015em;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--quiet {
  border-color: rgba(23, 20, 15, 0.24);
  background: transparent;
  color: var(--ink-soft);
}

.btn--quiet:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}

.btn--primary {
  padding-left: 7px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--gold);
}

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

.btn--primary:active {
  box-shadow: 1px 1px 0 var(--gold);
  transform: translate(1px, 1px);
}

.btn:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}

.btn:disabled:hover {
  box-shadow: none;
  transform: none;
}

.btn-plus {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--gold);
  color: var(--ink);
  place-items: center;
}

.btn-plus svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}

/* ---------------------------------------------------------
   Workspace / stage
   --------------------------------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 19px;
}

.stage {
  min-width: 0;
}

.stage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.stage-heading {
  display: flex;
  align-items: baseline;
  gap: 13px;
}

.stage-heading .eyebrow {
  position: relative;
  top: -3px;
}

.stage-heading h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
}

.stage-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 1px;
}

.auto-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 10px;
  border: 1.5px solid rgba(23, 20, 15, 0.25);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.74);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.auto-pill span {
  color: rgba(23, 20, 15, 0.32);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 155, 101, 0.14);
  animation: livePulse 2.4s ease-in-out infinite;
}

.board-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.board-count strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

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

.board {
  --row-h: clamp(76px, 9.4vh, 96px);
  --label-w: clamp(82px, 14%, 150px);

  position: relative;
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr);
  height: calc(var(--row-h) * 5);
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  box-shadow: 5px 6px 0 rgba(23, 20, 15, 0.12);
  transition: box-shadow 180ms ease;
}

body.is-dragging .board {
  box-shadow:
    5px 6px 0 rgba(23, 20, 15, 0.12),
    0 0 0 5px rgba(245, 198, 11, 0.36);
}

.label-col {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  height: 100%;
  border-right: 2px solid var(--ink);
}

.tier-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-size: clamp(22px, 2.65vw, 34px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.015em;
  text-align: center;
  white-space: nowrap;
}

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

.tier-label span {
  display: block;
  transform: translateY(-1px);
}

.tier--hang { background: var(--red); }
.tier--top { background: var(--gold); }
.tier--mid { background: var(--yellow); }
.tier--npc { background: var(--beige); }
.tier--low { background: var(--white); }

.board-viewport {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.board-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.board-canvas {
  position: relative;
  height: 100%;
  min-width: 100%;
  isolation: isolate;
}

.row-bg {
  position: relative;
  width: 100%;
  height: 20%;
  border-bottom: 2px solid var(--ink);
  background: var(--white);
  transition: filter 140ms ease;
}

.row-bg[data-row="4"] {
  border-bottom: 0;
}

.row-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(245, 198, 11, 0);
  transition: background-color 150ms ease;
}

.row-bg.is-target::after {
  background: rgba(245, 198, 11, 0.12);
}

.empty-hint {
  position: absolute;
  top: calc(var(--row-h) / 2);
  left: 22px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px 0 7px;
  border: 1.5px dashed rgba(23, 20, 15, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: rgba(23, 20, 15, 0.68);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
  backdrop-filter: blur(4px);
}

.empty-hint__mark {
  display: grid;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  place-items: center;
}

.empty-hint__mark svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

body.is-dragging .empty-hint {
  opacity: 0;
  transition: opacity 100ms ease;
}

.snap-guide {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 4;
  height: 0;
  border-top: 2px dashed rgba(23, 20, 15, 0.62);
  pointer-events: none;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.38));
}

.snap-guide::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 19px;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
}

.items-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.board-empty {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Board image cards */
.board-card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  height: 64px;
  width: 64px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--white);
  box-shadow: none;
  cursor: grab;
  touch-action: none;
  will-change: transform, width, height;
  pointer-events: auto;
  transition:
    transform 220ms cubic-bezier(0.22, 0.78, 0.27, 1),
    filter 140ms ease,
    opacity 120ms ease;
}

.board-card:hover {
  z-index: 3;
  filter: brightness(1.035);
}

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

.board-card.is-origin {
  opacity: 0;
  pointer-events: none;
}

.board-card.is-new {
  animation: cardPop 260ms cubic-bezier(0.2, 0.95, 0.35, 1.25);
}

.board-card.is-dropped {
  animation: cardDrop 260ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.card-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 3;
  display: grid;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.76);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background-color 120ms ease,
    color 120ms ease;
  place-items: center;
}

.board-card:hover .card-remove,
.board-card:focus-within .card-remove,
.tray-card:hover .card-remove,
.tray-card:focus-within .card-remove {
  opacity: 1;
  transform: scale(1);
}

.card-remove:hover {
  background: var(--red);
  color: var(--white);
}

/* Snap preview */
.snap-placeholder {
  position: absolute;
  z-index: 30;
  display: flex;
  min-width: 24px;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(23, 20, 15, 0.78);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.32),
    0 0 0 3px rgba(245, 198, 11, 0.3);
  pointer-events: none;
  backdrop-filter: blur(2.5px);
  transition:
    left 70ms linear,
    top 70ms linear,
    width 110ms ease,
    height 110ms ease;
}

.snap-placeholder__label {
  display: block;
  max-width: 220px;
  overflow: hidden;
  padding: 4px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(1px);
}

.snap-placeholder.is-slim .snap-placeholder__label {
  writing-mode: vertical-rl;
  max-height: calc(100% - 4px);
  padding: 5px 3px;
  font-size: 8px;
}

/* Board footer */
.board-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 3px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.55;
}

.board-foot p {
  margin: 0;
}

.hint-tag {
  display: inline-block;
  margin-right: 5px;
  padding: 2px 6px;
  border: 1px solid rgba(23, 20, 15, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.025em;
}

.ratio-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ratio-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 10px;
  border: 1.2px solid currentColor;
  border-radius: 2px;
}

.ratio-icon::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 3px 0 currentColor;
}

/* ---------------------------------------------------------
   Sidebar
   --------------------------------------------------------- */

.sidebar {
  position: static;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 15px;
  align-items: stretch;
}

.tray-panel {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 230px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 15px;
  row-gap: 12px;
  padding: 17px;
  border: var(--border);
  border-radius: 15px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow-hard);
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}

.tray-panel.is-over {
  box-shadow:
    0 0 0 4px rgba(245, 198, 11, 0.4),
    var(--shadow-hard);
  transform: translateY(-1px);
}

.panel-head {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-head h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
}

.count-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  height: 29px;
  padding: 0 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
}

.count-pill b {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
}

.count-pill span {
  font-size: 9px;
  font-weight: 700;
}

.upload-zone {
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 2px dashed rgba(23, 20, 15, 0.43);
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(245, 198, 11, 0.09), transparent 58%),
    rgba(242, 238, 229, 0.6);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.tray-panel > .upload-zone {
  grid-column: 1;
  grid-row: 2;
  min-height: 104px;
}

.upload-zone:hover {
  border-color: var(--ink);
  background-color: rgba(245, 198, 11, 0.13);
  transform: translateY(-1px);
}

.upload-zone.is-over {
  border-color: var(--red);
  border-style: solid;
  background-color: rgba(245, 198, 11, 0.22);
}

.upload-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--gold);
  box-shadow: 2px 2px 0 rgba(23, 20, 15, 0.2);
  place-items: center;
}

.upload-icon svg,
.tray-note svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.upload-copy strong {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.upload-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.tray-list {
  display: flex;
  min-width: 0;
  min-height: 104px;
  max-height: 104px;
  flex-wrap: nowrap;
  align-items: center;
  gap: 9px;
  padding: 3px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 20, 15, 0.28) transparent;
}

.tray-panel > .tray-list {
  grid-column: 2;
  grid-row: 2;
}

.tray-list::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.tray-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(23, 20, 15, 0.25);
}

.tray-empty {
  display: flex;
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 96px;
  align-items: center;
  justify-content: center;
  flex: 0 0 100%;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(23, 20, 15, 0.1);
  border-radius: 9px;
  background: rgba(242, 238, 229, 0.35);
  text-align: center;
}

.tray-empty__art {
  position: relative;
  display: block;
  width: 54px;
  height: 42px;
  margin-bottom: 3px;
}

.tray-empty__art i {
  position: absolute;
  display: block;
  width: 28px;
  height: 33px;
  border: 1.5px solid rgba(23, 20, 15, 0.5);
  border-radius: 4px;
  background: var(--white);
  box-shadow: 2px 2px 0 rgba(23, 20, 15, 0.08);
}

.tray-empty__art i:nth-child(1) {
  left: 1px;
  bottom: 2px;
  background: var(--beige);
  transform: rotate(-11deg);
}

.tray-empty__art i:nth-child(2) {
  left: 14px;
  bottom: 0;
  background: var(--gold);
  transform: rotate(2deg);
}

.tray-empty__art i:nth-child(3) {
  right: 1px;
  bottom: 3px;
  background: var(--red);
  transform: rotate(12deg);
}

.tray-empty p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.tray-empty small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.tray-note {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 3;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding-top: 0;
  border-top: 0;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.6;
}

.tray-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  stroke-width: 1.8;
}

.tray-note b {
  color: var(--ink-soft);
  font-weight: 800;
  white-space: nowrap;
}

/* Tray image cards */
.tray-card {
  position: relative;
  flex: 0 0 auto;
  height: 62px;
  border-radius: 6px;
  cursor: grab;
  touch-action: none;
}

.tray-card img {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--white);
  box-shadow: 2px 2px 0 rgba(23, 20, 15, 0.17);
  object-fit: cover;
  pointer-events: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.tray-card:hover img {
  box-shadow: 4px 5px 0 rgba(23, 20, 15, 0.15);
  transform: translateY(-2px) rotate(-0.8deg);
}

.tray-card.is-origin {
  opacity: 0.24;
}

.tray-card .card-remove {
  top: 3px;
  right: 3px;
  opacity: 0;
}

.tray-card:hover .card-remove,
.tray-card:focus-within .card-remove {
  opacity: 1;
}

/* Trash panel */
.trash-panel {
  display: flex;
  min-height: 178px;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px;
  border: 2.5px dashed rgba(173, 0, 2, 0.55);
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0%, rgba(173, 0, 2, 0.08), transparent 42%),
    rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow-hard);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.trash-panel__head {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.trash-panel__head .eyebrow {
  color: var(--red);
}

.trash-panel__head h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
}

.trash-panel__body {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  padding-top: 10px;
  text-align: center;
}

.trash-panel__icon {
  display: grid;
  width: 48px;
  height: 48px;
  border: 2px dashed rgba(173, 0, 2, 0.55);
  border-radius: 12px;
  background: var(--white);
  color: var(--red);
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
  place-items: center;
}

.trash-panel__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trash-panel__body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.trash-panel__body small {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1.2;
}

body.is-dragging .trash-panel {
  border-style: solid;
  box-shadow:
    0 0 0 4px rgba(173, 0, 2, 0.1),
    var(--shadow-hard);
}

.trash-panel.is-over {
  border-color: #7d0001;
  background: var(--red);
  color: var(--white);
  box-shadow:
    0 0 0 5px rgba(173, 0, 2, 0.17),
    5px 7px 0 rgba(23, 20, 15, 0.16);
  transform: scale(1.02) rotate(-0.6deg);
  animation: trashWiggle 300ms ease-in-out infinite alternate;
}

.trash-panel.is-over .eyebrow,
.trash-panel.is-over .trash-panel__body p,
.trash-panel.is-over .trash-panel__body small {
  color: rgba(255, 255, 255, 0.85);
}

.trash-panel.is-over .trash-panel__head h2 {
  color: var(--white);
}

.trash-panel.is-over .trash-panel__icon {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  transform: rotate(-7deg) scale(1.08);
}

/* ---------------------------------------------------------
   Drag ghost / trash / overlays
   --------------------------------------------------------- */

.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--white);
  box-shadow:
    0 22px 46px rgba(23, 20, 15, 0.3),
    4px 5px 0 rgba(23, 20, 15, 0.18);
  pointer-events: none;
  opacity: 0.97;
  transform: rotate(1.7deg) scale(1.02);
  transform-origin: 50% 60%;
  will-change: left, top;
}

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

.drag-ghost.is-trashing {
  opacity: 0.42;
  transform: rotate(8deg) scale(0.72);
}

body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

.file-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  padding: 24px;
  background: rgba(23, 20, 15, 0.72);
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(8px);
  transition:
    opacity 160ms ease,
    visibility 160ms ease;
  place-items: center;
}

.file-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.file-overlay__card {
  display: flex;
  width: min(390px, 100%);
  min-height: 265px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  border: 3px dashed var(--ink);
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.7), transparent 35%),
    var(--gold);
  box-shadow:
    7px 8px 0 rgba(0, 0, 0, 0.24),
    0 24px 90px rgba(0, 0, 0, 0.2);
  text-align: center;
  transform: translateY(8px) rotate(-1deg);
  transition: transform 200ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.file-overlay.is-visible .file-overlay__card {
  transform: translateY(0) rotate(-1deg);
}

.file-overlay__icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 18px;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: var(--paper-light);
  box-shadow: 3px 3px 0 rgba(23, 20, 15, 0.25);
  place-items: center;
}

.file-overlay__icon svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-overlay__card h2 {
  margin: 0 0 8px;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.file-overlay__card p {
  margin: 0;
  color: rgba(23, 20, 15, 0.68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.045em;
}

.toast {
  position: fixed;
  bottom: 27px;
  left: 50%;
  z-index: 600;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 15px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 3px 4px 0 rgba(23, 20, 15, 0.15);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity 170ms ease,
    transform 170ms cubic-bezier(0.2, 0.8, 0.3, 1.1);
}

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

.toast.is-error {
  background: var(--red);
}

/* ---------------------------------------------------------
   Animations
   --------------------------------------------------------- */

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(27, 155, 101, 0.13); }
  50% { box-shadow: 0 0 0 5px rgba(27, 155, 101, 0.07); }
}

@keyframes cardPop {
  0% { opacity: 0; scale: 0.82; }
  70% { opacity: 1; scale: 1.04; }
  100% { opacity: 1; scale: 1; }
}

@keyframes cardDrop {
  0% { scale: 1.08; }
  55% { scale: 0.97; }
  100% { scale: 1; }
}

@keyframes trashWiggle {
  from { rotate: -1.2deg; }
  to { rotate: 1.2deg; }
}

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

@media (max-width: 1240px) {
  .tagline {
    display: none;
  }
}

@media (max-width: 980px) {
  .sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .trash-panel {
    min-height: 88px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    padding: 14px 18px;
  }

  .trash-panel__head {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }

  .trash-panel__head .eyebrow {
    display: none;
  }

  .trash-panel__body {
    flex: 1;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding-top: 0;
    text-align: left;
  }

  .trash-panel__icon {
    width: 42px;
    height: 42px;
  }

  .trash-panel__icon svg {
    width: 21px;
    height: 21px;
  }

  .trash-panel__body small {
    display: none;
  }
}

@media (max-width: 700px) {
  .app {
    width: calc(100% - 28px);
    padding-top: 14px;
    padding-bottom: 38px;
  }

  .topbar {
    gap: 14px;
    padding-bottom: 14px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 37px;
    height: 41px;
    padding: 3px;
    border-width: 2px;
    border-radius: 8px;
  }

  .brand-kicker {
    font-size: 7px;
    letter-spacing: 0.14em;
  }

  .brand-title {
    font-size: 24px;
  }

  .btn {
    height: 39px;
    padding: 0 13px;
  }

  .btn--quiet {
    width: 39px;
    padding: 0;
  }

  .btn--quiet span {
    display: none;
  }

  .btn--primary {
    padding-left: 6px;
  }

  .btn-plus {
    width: 25px;
    height: 25px;
  }

  .stage-head {
    align-items: center;
    margin-bottom: 9px;
  }

  .stage-heading {
    gap: 8px;
  }

  .stage-heading .eyebrow {
    display: none;
  }

  .stage-heading h1 {
    font-size: 19px;
  }

  .auto-pill {
    height: 24px;
    padding: 0 8px;
    font-size: 8.5px;
  }

  .board-count {
    display: none;
  }

  .board {
    --row-h: clamp(76px, 9.2vh, 94px);
    --label-w: 80px;
    border-width: 2.5px;
    border-radius: 0;
    box-shadow: 4px 5px 0 rgba(23, 20, 15, 0.1);
  }

  .label-col {
    border-right-width: 1px;
  }

  .tier-label {
    font-size: clamp(16px, 4.7vw, 22px);
    border-bottom-width: 1.5px;
    letter-spacing: 0;
  }

  .row-bg {
    border-bottom-width: 1.5px;
  }

  .empty-hint {
    left: 12px;
    height: 28px;
    padding-right: 10px;
    font-size: 9.5px;
  }

  .empty-hint__mark {
    width: 17px;
    height: 17px;
  }

  .board-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
    font-size: 9px;
  }

  .ratio-note {
    display: none;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 13px;
  }

  .tray-panel {
    display: block;
    padding: 14px;
    border-width: 2px;
    border-radius: 13px;
  }

  .panel-head {
    margin-bottom: 13px;
  }

  .panel-head h2 {
    font-size: 21px;
  }

  .tray-panel > .upload-zone {
    min-height: 66px;
  }

  .tray-panel > .tray-list {
    min-height: 104px;
    max-height: 104px;
    margin-top: 12px;
  }

  .tray-note {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px dashed rgba(23, 20, 15, 0.16);
  }

  .trash-panel {
    min-height: 64px;
    gap: 12px;
    padding: 11px 14px;
    border-width: 2px;
    border-radius: 13px;
  }

  .trash-panel__head h2 {
    font-size: 19px;
  }

  .trash-panel__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .trash-panel__icon svg {
    width: 19px;
    height: 19px;
  }

  .trash-panel__body p {
    font-size: 10px;
  }

  .trash-panel__body small {
    display: none;
  }

  .toast {
    bottom: 72px;
    font-size: 10px;
  }

  .file-overlay__card {
    min-height: 235px;
    border-width: 2.5px;
  }

  .file-overlay__card h2 {
    font-size: 23px;
  }
}

@media (max-width: 480px) {
  .brand-kicker {
    display: none;
  }

  .brand-copy {
    gap: 0;
  }

  .brand-title {
    font-size: 22px;
  }

  .top-actions {
    gap: 7px;
  }

  .top-actions .btn--primary span:last-child {
    font-size: 12px;
  }

  .tray-panel {
    box-shadow: 3px 4px 0 rgba(23, 20, 15, 0.13);
  }

  .upload-zone {
    min-height: 66px;
  }

  .upload-icon {
    width: 36px;
    height: 36px;
  }

  .tray-card {
    height: 56px;
  }
}

@media (max-width: 380px) {
  .btn--quiet {
    display: none;
  }

  .brand-title {
    font-size: 20px;
  }

  .btn--primary {
    padding: 0 10px 0 6px;
  }
}

@media (hover: none) {
  .card-remove {
    opacity: 1;
    transform: scale(0.9);
  }
}

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