[hidden] { display: none !important; }
:root {
  --bg: #050805; --bg2: #0a120a; --panel: #0d170d; --line: #1d3a1d;
  --neon: #39ff14; --neon-dim: #1f8f0b; --cyan: #2ee6ff; --pink: #ff3bd4; --text: #dfffd6; --muted: #8fb889;
  --glow: 0 0 6px rgba(57,255,20,.7), 0 0 18px rgba(57,255,20,.35);
  --radius: 14px; --tap: 52px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); }
body {
  margin: 0; min-height: 100vh; font-size: 17px; line-height: 1.45;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(57,255,20,.14), transparent 55%),
    radial-gradient(ellipse at 110% 10%, rgba(46,230,255,.08), transparent 45%),
    repeating-linear-gradient(0deg, rgba(57,255,20,.035) 0 1px, transparent 1px 4px),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--neon); }
h1, h2, h3 { font-family: "Arial Black", "Segoe UI Black", Impact, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 .4em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); color: var(--neon); text-shadow: var(--glow); }
h2 { font-size: 1.3rem; color: var(--neon); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-left)); background: rgba(5,8,5,.88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); box-shadow: 0 2px 20px rgba(57,255,20,.12);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { filter: drop-shadow(0 0 6px rgba(57,255,20,.6)); }
.brand-text { font-family: "Arial Black", Impact, sans-serif; letter-spacing: .08em; line-height: 1; }
.brand-name { color: var(--neon); text-shadow: var(--glow); font-size: 1.25rem; }
.brand-sub { color: var(--text); font-size: .85rem; }
.nav { display: flex; gap: 6px; }
.nav a { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: .9rem; }
.nav a.active, .nav a:hover { color: var(--bg); background: var(--neon); box-shadow: var(--glow); }
.account { display: flex; gap: 8px; align-items: center; }
.user-name { color: var(--cyan); font-weight: 700; }
.btn {
  min-height: var(--tap); min-width: var(--tap); padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 2px solid var(--neon); background: var(--neon); color: #031003; font-weight: 800; font-size: 1rem;
  letter-spacing: .03em; text-decoration: none; cursor: pointer; box-shadow: var(--glow); transition: transform .08s, box-shadow .15s;
  font-family: inherit; white-space: nowrap;
}
.btn:hover { box-shadow: 0 0 10px rgba(57,255,20,.9), 0 0 30px rgba(57,255,20,.45); }
.btn:active { transform: scale(.97); }
.btn-ghost { background: transparent; color: var(--neon); box-shadow: none; }
.btn-ghost[aria-pressed="true"] { background: var(--neon); color: #031003; box-shadow: var(--glow); }
.btn-danger { border-color: var(--pink); color: var(--pink); background: transparent; box-shadow: none; }
.btn-small { min-height: 40px; padding: 0 12px; font-size: .9rem; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
main { padding: 20px max(16px, env(safe-area-inset-left)) 80px; max-width: 1280px; margin: 0 auto; outline: none; }
.loading, .empty { color: var(--muted); text-align: center; padding: 40px 10px; }
.empty .big { font-size: 3.5rem; filter: drop-shadow(0 0 10px rgba(57,255,20,.6)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
input, select, textarea {
  min-height: var(--tap); font: inherit; color: var(--text); background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--neon); box-shadow: 0 0 10px rgba(57,255,20,.35); outline: none; }
.toolbar input[type=search] { flex: 1 1 220px; width: auto; }
.toolbar select { flex: 0 1 180px; width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--panel);
  border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover, .card:focus-visible { border-color: var(--neon); box-shadow: var(--glow); transform: translateY(-3px); }
.cover { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; display: block; background: var(--bg2); }
.cover-ph { aspect-ratio: 3 / 4; display: grid; place-items: center; font-family: "Arial Black", Impact, sans-serif; font-size: 4rem; color: var(--neon); text-shadow: var(--glow);
  background: linear-gradient(135deg, #0b1f0b, #050805 60%, #082028); }
.card-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-weight: 800; font-size: 1.08rem; }
.fav { position: absolute; top: 8px; right: 8px; font-size: 1.4rem; color: var(--pink); text-shadow: 0 0 8px var(--pink); }
.stars { color: var(--neon); letter-spacing: 2px; text-shadow: 0 0 6px rgba(57,255,20,.6); white-space: nowrap; }
.stars .off { color: #244a24; text-shadow: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--cyan); color: var(--cyan); }
.muted { color: var(--muted); }
.detail { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 28px; align-items: start; }
.detail .cover, .detail .cover-ph { border-radius: var(--radius); border: 2px solid var(--neon); box-shadow: var(--glow); }
.detail .stars { font-size: 1.8rem; }
.review-text { white-space: pre-wrap; font-size: 1.12rem; background: var(--panel); border-left: 4px solid var(--neon); padding: 14px 18px; border-radius: 8px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; } .grow { flex: 1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
/* Tier lists */
.list-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.list-tabs a { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 18px; border-radius: 12px; border: 2px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; }
.list-tabs a.active { border-color: var(--neon); color: var(--neon); box-shadow: var(--glow); }
.tiers { display: flex; flex-direction: column; gap: 8px; }
.tier { display: flex; min-height: 104px; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tier-label { flex: 0 0 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px;
  font-family: "Arial Black", Impact, sans-serif; font-size: 2.2rem; color: #041004; text-shadow: none; }
.tier-label .tools { display: flex; gap: 4px; }
.tier-label .tools button { width: 40px; height: 40px; min-width: 0; padding: 0; border-radius: 10px; border: 0; background: rgba(0,0,0,.35); color: #fff; font-size: 1rem; cursor: pointer; }
.drop { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; align-content: flex-start; min-height: 100px; transition: background .12s; }
.drop.over, .tier.target .drop { background: rgba(57,255,20,.12); box-shadow: inset 0 0 0 2px var(--neon); }
.pool { margin-top: 18px; }
.pool .drop { border: 2px dashed var(--neon-dim); border-radius: var(--radius); min-height: 120px; }
.tile { position: relative; width: 84px; height: 112px; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: var(--bg2); flex: 0 0 auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tile .ph { width: 100%; height: 100%; display: grid; place-items: center; font-family: "Arial Black", Impact, sans-serif; font-size: 2rem; color: var(--neon); }
.tile .tname { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px; font-size: .7rem; font-weight: 700; background: linear-gradient(transparent, rgba(0,0,0,.92)); color: #fff; line-height: 1.15; max-height: 3.6em; overflow: hidden; }
a.tile { text-decoration: none; }
.editing .tile { cursor: grab; touch-action: none; }
.tile.selected { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan), 0 0 18px var(--cyan); }
.tile.dragging { opacity: .3; }
.ghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -50%) scale(1.08) rotate(-3deg); box-shadow: 0 0 22px var(--neon); border-color: var(--neon); }
.hint { color: var(--muted); font-size: .95rem; margin: 6px 0 14px; }
/* Dialog / form */
dialog { width: min(640px, 96vw); max-height: 94vh; overflow: auto; background: var(--panel); color: var(--text); border: 2px solid var(--neon); border-radius: 18px; box-shadow: 0 0 40px rgba(57,255,20,.4); padding: 22px; }
dialog::backdrop { background: rgba(0,0,0,.75); backdrop-filter: blur(3px); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; font-weight: 700; border: 0; padding: 0; }
legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { min-height: 46px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--cyan); color: #021216; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.star-picker { display: flex; gap: 6px; }
.star-picker button { width: var(--tap); height: var(--tap); font-size: 2rem; border: 0; background: transparent; color: #244a24; cursor: pointer; border-radius: 10px; line-height: 1; }
.star-picker button.on { color: var(--neon); text-shadow: var(--glow); }
.toggle { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; min-height: var(--tap); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { width: 60px; height: 34px; border-radius: 999px; background: var(--bg2); border: 2px solid var(--line); position: relative; flex: 0 0 auto; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.toggle input:checked + .toggle-ui { border-color: var(--pink); box-shadow: 0 0 10px var(--pink); }
.toggle input:checked + .toggle-ui::after { left: 29px; background: var(--pink); }
.toggle input:focus-visible + .toggle-ui { outline: 3px solid var(--cyan); }
.cover-edit { display: flex; gap: 14px; align-items: flex-start; }
.cover-preview { width: 96px; flex: 0 0 96px; aspect-ratio: 3/4; border-radius: 10px; border: 2px solid var(--line); background: var(--bg2) center/cover no-repeat; overflow: hidden; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-inputs { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.file-btn { align-self: flex-start; }
.error { color: var(--pink); min-height: 1.2em; font-weight: 700; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; pointer-events: none; }
#toast .msg { background: var(--panel); border: 2px solid var(--neon); color: var(--text); padding: 12px 20px; border-radius: 12px; box-shadow: var(--glow); font-weight: 700; }
#toast .msg.err { border-color: var(--pink); box-shadow: 0 0 14px var(--pink); }
@media (max-width: 700px) {
  body { font-size: 16px; }
  .brand-sub { display: none; }
  .nav { order: 3; width: 100%; } .nav a { flex: 1; justify-content: center; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .detail { grid-template-columns: 1fr; }
  .detail .cover, .detail .cover-ph { max-width: 280px; margin: 0 auto; }
  .tier-label { flex-basis: 64px; font-size: 1.6rem; }
  .tier-label .tools button { width: 34px; height: 34px; }
  .tile { width: 66px; height: 88px; }
  .toolbar select { flex: 1 1 45%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
#editToggle { white-space: nowrap; }
@media (max-width: 700px) {
  .user-name { display: none; }
  .account .btn { padding: 0 14px; }
}
