:root {
  color-scheme: dark;
  --bg: #030303;
  --surface: rgba(10, 10, 11, 0.86);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f5f0;
  --muted: #a6a6a0;
  --signal: #e9ff70;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgba(233, 255, 112, 0.08), transparent 28rem),
    linear-gradient(245deg, rgba(255, 255, 255, 0.06), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

button,
input { font: inherit; }

.app {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 0 72px;
}

.hero {
  display: grid;
  justify-items: center;
  padding: 28px 0 clamp(34px, 6vw, 58px);
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
}

.brand-mark {
  width: 17px;
  height: 17px;
  border: 2px solid var(--text);
  border-radius: 50%;
  box-shadow: inset 6px 0 0 var(--signal);
}

.kicker {
  margin: 0;
  color: var(--signal);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 860;
  letter-spacing: 0;
}

h1 {
  max-width: 980px;
  margin-top: 14px;
  font-size: clamp(58px, 11vw, 132px);
  line-height: 0.86;
}

h2 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.9;
}

.lede {
  max-width: 780px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.22;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(520px, 1.3fr);
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 70%),
    var(--surface);
  padding: clamp(18px, 4vw, 28px);
}

.controls,
.section-heading {
  display: grid;
  align-content: start;
  gap: 14px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.image-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0 16px;
  outline: none;
}

.file-picker {
  display: inline-flex;
  min-height: 44px;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  cursor: pointer;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 780;
  overflow: hidden;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  min-height: 44px;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 780;
  white-space: nowrap;
}

.button-light {
  border: 1px solid #eff2d6;
  background: #f5f7e9;
  color: #11120e;
}

.button-dark {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 720;
}

.board-panel {
  display: grid;
  gap: 16px;
}

.board-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.title-field {
  display: grid;
  min-width: min(300px, 100%);
  gap: 8px;
}

.title-field span {
  color: var(--signal);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.tier-board {
  display: grid;
  gap: 8px;
}

.tier-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  min-height: 88px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.tier-label {
  display: grid;
  place-items: center;
  background: var(--tier-color);
  color: #11120e;
  font-size: 34px;
  font-weight: 950;
  text-transform: uppercase;
}

.drop-zone,
.item-pool {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 86px;
  padding: 10px;
}

.drop-zone.drag-over,
.item-pool.drag-over {
  outline: 2px solid rgba(233, 255, 112, 0.55);
  outline-offset: -4px;
}

.tier-actions {
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 8px;
}

.mini-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.item {
  display: inline-grid;
  min-height: 44px;
  max-width: 180px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(233, 255, 112, 0.14), transparent),
    rgba(255, 255, 255, 0.065);
  color: var(--text);
  cursor: grab;
  padding: 8px 11px;
  font-size: 14px;
  font-weight: 820;
  overflow-wrap: anywhere;
  text-align: center;
}

.item:active {
  cursor: grabbing;
}

.drag-ghost {
  position: fixed;
  top: -1000px;
  left: -1000px;
  width: 72px;
  height: 72px;
  opacity: 0.85;
  pointer-events: none;
}

.item-image {
  width: 72px;
  height: 72px;
  max-width: 72px;
  padding: 0;
  overflow: hidden;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.item-pool {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app {
    width: min(100% - 28px, 1240px);
  }

  h1 {
    font-size: clamp(46px, 16vw, 72px);
  }

  .board-heading {
    align-items: start;
    flex-direction: column;
  }

  .tier-row {
    grid-template-columns: 70px 1fr;
  }

  .tier-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, auto);
    justify-content: end;
  }

  .inline-form,
  .image-form {
    grid-template-columns: 1fr;
  }
}
