:root {
  --bg: #09060c;
  --panel: #16101c;
  --panel-2: #1f1628;
  --ink: #f7eef5;
  --muted: #b89ab0;
  --accent: #ff4d8d;
  --accent-2: #ffd166;
  --ok: #5dffb1;
  --danger: #ff6b6b;
  --line: #3a2a44;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #4a1233 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #24104a 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 6, 12, 0.78);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 22px; letter-spacing: 0.04em; }
.brand span { color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

button, .btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #1a0b14;
  background: var(--accent);
}
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button.gold, a.btn.gold {
  background: var(--accent-2);
  color: #2a1600;
  text-decoration: none;
  display: inline-block;
}
.login-steps {
  color: var(--muted);
  line-height: 1.6;
  padding-left: 1.3em;
  margin: 16px 0 0;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; }
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
  margin-bottom: 28px;
}
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h1, .card h2 { margin: 0 0 10px; }
.card p { color: var(--muted); line-height: 1.6; }
.login-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.status { margin-top: 12px; color: var(--ok); min-height: 1.4em; }
.status.err { color: var(--danger); }

.grid-3 { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr; gap: 18px; }
section h2 { font-size: 20px; margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #2a1830;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}
.chip b { color: var(--accent); margin-left: 6px; }

.illust-list, .rank-list { display: flex; flex-direction: column; gap: 12px; }
.illust {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}
.illust img {
  width: 96px; height: 96px; object-fit: cover; border-radius: 10px; background: #000;
}
.illust h3 { margin: 0 0 6px; font-size: 16px; }
.vote-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.vote-row button { padding: 7px 14px; font-size: 13px; }
.vote-row b { margin-left: 4px; }
.paste-label { display: block; margin-top: 16px; color: var(--muted); font-size: 13px; }
textarea {
  width: 100%;
  margin-top: 8px;
  background: #120a16;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.gated[hidden], #login-panel[hidden], #logout[hidden] { display: none !important; }
.meta { color: var(--muted); font-size: 13px; }
.badge {
  display: inline-block;
  background: var(--accent);
  color: #1a0b14;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  margin-right: 6px;
}
.rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 0; }
.rank-num { font-weight: 800; color: var(--accent-2); font-size: 20px; }
.empty { color: var(--muted); padding: 20px 0; }

.overlay {
  position: fixed; inset: 0;
  background: rgba(4, 0, 8, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.overlay.show { display: flex; }
.overlay .card { max-width: 420px; text-align: center; }
.overlay h2 { font-size: 42px; color: var(--accent); }
.tatakai-flash {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--accent-2);
  color: #2a1600;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 800;
  display: none;
  z-index: 21;
  box-shadow: var(--shadow);
}
.tatakai-flash.show { display: block; }

@media (max-width: 960px) {
  .hero, .grid-3 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
