:root {
  --bg-1: #f6f1e7;
  --bg-2: #f0e1c6;
  --ink: #1f1b16;
  --accent: #ff5c39;
  --accent-2: #0da7a1;
  --card: #fff9f2;
  --shadow: rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at top left, var(--bg-1), var(--bg-2));
  font-family: "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

.hero {
  padding: 6px 16px;
  background: linear-gradient(135deg, #f9d7b3, #f5b1a5);
  border-bottom: 3px solid #111;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tag {
  display: inline-block;
  font-family: "ZCOOL KuaiLe", cursive;
  background: #111;
  color: #fff;
  padding: 6px 12px;
  border-radius: 99px;
  letter-spacing: 1px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-sub {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
}

.lang-toggle {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  gap: 14px;
  padding: 10px 16px 14px;
  max-width: 1300px;
  margin: 0 auto;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 2px solid #111;
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 12px;
  border-radius: 16px;
  position: sticky;
  top: 10px;
}

.field-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

input {
  flex: 1;
  padding: 8px 10px;
  border: 2px solid #111;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

button {
  border: 2px solid #111;
  background: #111;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  transform: translateY(-1px);
}

button.ghost {
  background: transparent;
  color: #111;
}

button.primary {
  background: var(--accent);
}

.hint {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.pool {
  border: 2px dashed #111;
  border-radius: 12px;
  min-height: 180px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  background: #fffefc;
}

.pool-title {
  grid-column: 1 / -1;
  font-weight: 700;
  margin-bottom: 6px;
}

.board-area {
  display: grid;
  gap: 8px;
  background: #fff;
  border: 2px solid #111;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 6px 6px 0 var(--shadow);
}

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

.board-title-section {
  display: grid;
  gap: 6px;
  text-align: center;
}

.board-title {
  font-family: "ZCOOL KuaiLe", cursive;
  font-size: clamp(20px, 2.8vw, 30px);
  outline: none;
  padding: 4px 6px;
  border: 2px dashed transparent;
  border-radius: 10px;
  display: inline-block;
  margin: 0 auto;
}

.board-title:focus {
  border-color: #111;
  background: #fff8ef;
}

.board-sub {
  margin: 0;
  font-size: 12px;
  opacity: 0.75;
}

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

.tier {
  border: 2px solid #111;
  background: var(--tier-bg, #fff8ef);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--shadow);
  overflow: hidden;
}

.tier-label {
  padding: 6px 10px;
  background: var(--tier-accent, #111);
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tier-label span {
  pointer-events: none;
}

.tier-delete {
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.tier-delete:hover {
  background: #fff;
  color: #111;
}

.tier-drop {
  min-height: 50px;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
  background: var(--tier-bg, linear-gradient(135deg, #ffe9c7, #fff4de));
}

.tier-dragging {
  opacity: 0.75;
  transform: translateY(1px);
}

.card {
  background: #fff;
  border: 2px solid #111;
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:active {
  cursor: grabbing;
}

.card.dragging {
  opacity: 0.6;
  transform: rotate(-2deg) scale(1.02);
  box-shadow: 4px 4px 0 var(--shadow);
}

.drop-hover {
  outline: 3px dashed var(--accent-2);
  outline-offset: -6px;
}

.footer {
  max-width: 1200px;
  margin: 0 auto 16px;
  padding: 0 16px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.author {
  font-size: 12px;
  opacity: 0.6;
  margin-left: 12px;
  color: inherit;
  text-decoration: none;
}

.author:hover {
  opacity: 0.9;
}

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

  .panel {
    position: static;
  }

  .footer {
    justify-content: center;
  }
}
