:root {
  --bg: #17142b;
  --bg2: #201c3a;
  --card: #262145;
  --line: #3a3363;
  --text: #f3efff;
  --muted: #b3a9d6;
  --pink: #ff9de2;
  --gold: #ffd36e;
  --aqua: #7fe3ff;
  --green: #8ff0b0;
  --red: #ff8a8a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #2c2257 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 16px/1.55 Nunito, system-ui, sans-serif;
  min-height: 100vh;
}
a { color: var(--aqua); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: Fredoka, Nunito, sans-serif; font-weight: 600; line-height: 1.2; margin: .2em 0 .5em; }
h1 { font-size: 2rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
code { background: #ffffff14; padding: .1em .35em; border-radius: 6px; font-size: .92em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; } .mono { font-family: ui-monospace, monospace; }

.top { border-bottom: 1px solid var(--line); background: #17142bcc; backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { font-family: Fredoka, sans-serif; font-size: 1.25rem; color: var(--text); font-weight: 700; }
.brand-mark { color: var(--pink); }
.tag { font-size: .7rem; background: var(--pink); color: #2a1240; border-radius: 99px; padding: 2px 8px; vertical-align: middle; }
nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
nav a { color: var(--muted); font-weight: 600; } nav a:hover { color: var(--text); text-decoration: none; }
nav .who { color: var(--gold); }
main { padding-top: 24px; padding-bottom: 48px; }
.foot { color: var(--muted); font-size: .85rem; padding-bottom: 32px; }

.btn { display: inline-block; background: linear-gradient(135deg, var(--pink), #c89bff); color: #2a1240; border: 0; border-radius: 999px; padding: .6em 1.2em; font: 700 .95rem Nunito, sans-serif; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.small { padding: .4em .9em; font-size: .85rem; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.btn.discord { background: #5865f2; color: #fff; }
.btn.twitch { background: #9146ff; color: #fff; }
button.link { background: none; border: 0; color: var(--aqua); cursor: pointer; font: inherit; padding: 0; }
.danger-text { color: var(--red) !important; }
form.inline { display: inline; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card.narrow { max-width: 520px; margin: 40px auto; }
.link-card { display: block; color: var(--text); } .link-card:hover { border-color: var(--pink); text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 28px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.stat strong { font-size: 1.15rem; }
.big-num { font-family: Fredoka, sans-serif; font-size: 2rem; font-weight: 700; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } h1 { font-size: 1.6rem; } }

.hero { text-align: center; padding: 18px 0 28px; }
.hero .lead { font-size: 1.2rem; color: var(--gold); margin: 0; }
.hero .desc { max-width: 680px; margin: 18px auto; color: var(--text); white-space: pre-line; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; line-height: 1.6; }
.timeline { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin: 18px 0; font-size: .95rem; }
.note { max-width: 680px; margin: 10px auto; color: var(--muted); }

.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: #ffffff1a; color: var(--text); }
.phase-building { background: #7fe3ff33; color: var(--aqua); }
.phase-voting { background: #8ff0b033; color: var(--green); }
.phase-results { background: #ffd36e33; color: var(--gold); }
.phase-locked, .phase-closed { background: #ff9de233; color: var(--pink); }
.phase-draft, .phase-archived { color: var(--muted); }

.entry-card { padding: 0; overflow: hidden; color: var(--text); }
.entry-card:hover { border-color: var(--pink); text-decoration: none; transform: translateY(-2px); transition: .15s; }
.thumb { aspect-ratio: 16 / 9; background: var(--bg2); position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: .9rem; }
.medal { position: absolute; top: 10px; left: 10px; background: var(--gold); color: #3a2600; font-weight: 800; border-radius: 99px; padding: 2px 10px; font-size: .85rem; }
.place-2 .medal { background: #e3e3f0; } .place-3 .medal { background: #e0a46a; }
.winner { border-color: #ffd36e88; }
.entry-meta { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.entry-meta > div:nth-child(2) { flex: 1; min-width: 0; }
.head { width: 32px; height: 32px; border-radius: 6px; image-rendering: pixelated; }
.head.big { width: 64px; height: 64px; border-radius: 10px; }
.score { text-align: right; font-weight: 800; color: var(--gold); white-space: nowrap; }
.score.mine { color: var(--pink); }

.entry-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.entry-head > div:nth-child(2) { flex: 1; }
.result-box { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px; }
.result-box.winner { border-color: var(--gold); }
.vote-card { text-align: center; }
.stars { display: flex; justify-content: center; gap: 6px; }
.star { font-size: 2.4rem; background: none; border: 0; color: #5d5390; cursor: pointer; line-height: 1; padding: 0 2px; transition: transform .1s; }
.star.on { color: var(--gold); }
.stars:hover .star { color: var(--gold); }
.stars .star:hover ~ .star { color: #5d5390; }
.star:hover { transform: scale(1.15); }
.map { margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-bar { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--card); }
.map iframe { width: 100%; height: 520px; border: 0; display: block; background: #000; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; } .gallery img { width: 100%; border-radius: 10px; display: block; }
.gallery figcaption { color: var(--muted); font-size: .85rem; padding-top: 4px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid var(--line); }
.flash.ok { background: #8ff0b01f; border-color: #8ff0b066; }
.flash.warn { background: #ff9de21f; border-color: #ff9de266; }
.token { white-space: pre-wrap; word-break: break-all; background: #0005; padding: 10px; border-radius: 8px; user-select: all; }

.form { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .92rem; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea { background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .55em .7em; font: inherit; width: 100%; }
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pink); outline-offset: 0; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 8px 0; }
.row input, .row select { width: auto; flex: 1; min-width: 140px; }
.row.tight { margin: 0; flex-wrap: nowrap; }
.small-input { min-width: 90px !important; padding: .3em .5em; font-size: .85rem; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cols4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 800px) { .cols3, .cols4 { grid-template-columns: 1fr 1fr; } }
.tier-row { display: grid; grid-template-columns: 48px 1fr 90px; gap: 10px; align-items: center; }
.tier-label { color: var(--muted); font-weight: 700; }
fieldset.scopes { border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 6px; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-size: 1.3rem; text-align: center; max-width: 220px; }
.steps { color: var(--muted); }
.stack { display: grid; gap: 10px; max-width: 320px; margin: 18px auto; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
table.card { padding: 0; overflow: hidden; display: table; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tr.removed td { opacity: .45; }
tr.suspect td { background: #ff9de214; }
tr.win-row td { background: #ffd36e12; }
.rarity { font-weight: 700; font-size: .8rem; text-transform: uppercase; }
.rarity.common { color: var(--muted); } .rarity.rare { color: var(--aqua); } .rarity.epic { color: #d59bff; } .rarity.legendary { color: var(--gold); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 10px; }
.thumb-admin img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
details { margin-top: 12px; } summary { cursor: pointer; color: var(--muted); }
.row input[type=checkbox] { flex: 0 0 auto; min-width: 0; }
.gallery { margin-bottom: 28px; }
