:root {
  --bg: #0b0c0f;
  --panel: #15171b;
  --panel-hover: #1c1f24;
  --border: #24272d;
  --text: #ececef;
  --text-dim: #8b8f98;
  --text-faint: #55585f;
  --accent: #e8e6df;
  --high: #e2725b;
  --medium: #d8b04a;
  --low: #6fa8c9;
  --danger: #c9564a;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body {
  -webkit-font-smoothing: antialiased;
}

/* ---------- Gate (setup / login) ---------- */

.gate-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
  padding: 32px;
}

.gate-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.28em;
  margin: 0 0 28px;
  color: var(--accent);
  text-align: center;
}

.gate-sub {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 16px;
  text-align: center;
}

.gate-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
}

.gate-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gate-input:focus {
  border-color: var(--text-dim);
  background: var(--panel-hover);
}

.gate-input::placeholder {
  color: var(--text-faint);
}

.gate-button {
  margin-top: 6px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #14161a;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.gate-button:hover {
  opacity: 0.88;
}

.gate-error {
  margin-top: 16px;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

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

.board-page {
  display: flex;
  flex-direction: column;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(16px, 5vw, 48px) 8px;
}

.board-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.28em;
  margin: 0;
  color: var(--accent);
}

.logout-button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.logout-button:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.board {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px clamp(16px, 5vw, 48px) 80px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.tier-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin: 0 0 12px 2px;
}

.tier-high { color: var(--high); }
.tier-medium { color: var(--medium); }
.tier-low { color: var(--low); }

.tier-list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 4px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.item:hover {
  background: var(--panel-hover);
  border-color: var(--border);
}

.item-handle {
  color: var(--text-faint);
  cursor: grab;
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
  user-select: none;
}

.item-text {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  outline: none;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: text;
  word-break: break-word;
}

.item-text:focus {
  background: rgba(255, 255, 255, 0.04);
}

.item-delete {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
}

.item:hover .item-delete,
.item:focus-within .item-delete {
  opacity: 1;
}

.item-delete:hover {
  color: var(--danger);
}

.sortable-ghost {
  opacity: 0.35;
}

.sortable-chosen .item-text {
  background: rgba(255, 255, 255, 0.04);
}

.sortable-drag {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.add-form {
  margin-top: 8px;
}

.add-input {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.add-input::placeholder {
  color: var(--text-faint);
}

.add-input:focus {
  border-style: solid;
  border-color: var(--text-dim);
  background: var(--panel);
}

@media (max-width: 420px) {
  .gate-title { font-size: 24px; letter-spacing: 0.22em; }
}
