@font-face {
  font-family: "MinecraftTen";
  src: url("/fonts/MinecraftTen.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #0b0714;
  --panel: #150c26;
  --panel-2: #1c1133;
  --line: #2c1d4d;
  --text: #ece6ff;
  --muted: #a99ec8;
  --violet: #9b6bff;
  --violet-deep: #6a34e0;
  --violet-side: #2e1466;
  --ok: #4fd18b;
  --ok-side: #1c5c3b;
  --no: #ff5d73;
  --no-side: #6b1d2a;
  --display: "MinecraftTen", "Rubik", system-ui, sans-serif;
  --body: "Rubik", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg) url("/bg.png") repeat;
  background-size: 384px;
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(106,52,224,.22), transparent 60%),
              radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.75));
  pointer-events: none;
  z-index: -1;
}
a { color: var(--violet); }
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px 80px; }

/* nav */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1040px; margin: 0 auto; padding: 18px 20px; width: 100%;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--display); font-size: 22px; letter-spacing: 1px; }
.nav-brand img { width: 38px; height: 38px; image-rendering: pixelated; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a.btn, .nav-links a.btn:hover { color: #fff; }

/* 3D block: face on top, shaded extrusion straight down, one black outline around both.
   --d = extrusion depth, --e1..--e3 = extrusion shades from near the face to the bottom. */
.block, .btn, .panel, .player, .step .num, .tab, .app-card, .place {
  --d: 10px;
  border: 3px solid #07040d;
  border-bottom: 0;
  box-shadow:
    0 calc(3px + var(--d) * .34) 0 -3px var(--e1),
    0 calc(3px + var(--d) * .67) 0 -3px var(--e2),
    0 calc(3px + var(--d)) 0 -3px var(--e3),
    0 calc(3px + var(--d)) 0 0 #07040d;
  margin-bottom: calc(var(--d) + 3px);
}

.btn {
  --e1: #4d24b0; --e2: #3b1a8c; --e3: #2a1266;
  display: inline-block;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(20, 6, 50, .45);
  background: linear-gradient(#b995ff, #7b45ee);
  padding: 11px 22px 10px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .06s, box-shadow .06s, margin .06s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { --d: 3px; transform: translateY(7px); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { --d: 7px; font-size: 15px; padding: 7px 14px 6px; }
.btn-sm:active { --d: 2px; transform: translateY(5px); }
.btn-ok { --e1: #25955a; --e2: #1d7648; --e3: #145233; background: linear-gradient(#8ef0bb, #34b872); }
.btn-no { --e1: #c02b43; --e2: #992236; --e3: #6b1826; background: linear-gradient(#ff9dac, #e8435a); }
.btn-discord { --e1: #4752c4; --e2: #3a43a6; --e3: #2c3380; background: linear-gradient(#8f97f8, #5865f2); }
.btn-icon { display: inline-grid; place-items: center; padding: 7px 9px 6px; line-height: 0; }
.btn-icon svg { width: 22px; height: 22px; filter: drop-shadow(0 2px 0 rgba(20, 6, 50, .45)); }
.btn-ghost { --e1: #20133c; --e2: #180e2f; --e3: #100a21; background: linear-gradient(#2c1b4f, #1d1136); }

/* hero */
.hero { text-align: center; padding: 40px 0 30px; }
.hero img { width: min(760px, 100%); height: auto; }
.hero p { font-size: 20px; color: var(--muted); max-width: 560px; margin: 0 auto 28px; }
.spots { font-family: var(--display); color: var(--muted); margin-top: 10px; font-size: 15px; letter-spacing: 1px; }
.spots b { color: var(--text); font-weight: normal; }

/* panels */
.panel {
  --d: 16px; --e1: #150c2a; --e2: #100820; --e3: #0b0517;
  background: linear-gradient(rgba(42,26,76,.95), rgba(30,19,56,.95));
  padding: 28px;
}
.panel + .panel, .panel { margin-bottom: 40px; }
h1, h2, h3 { font-family: var(--display); font-weight: normal; letter-spacing: 1px; line-height: 1.2; }
h1 { font-size: 40px; margin: 30px 0 10px; }
h2 { font-size: 28px; margin: 0 0 14px; }
h3 { font-size: 20px; margin: 0 0 6px; }
.lead { color: var(--muted); font-size: 19px; margin: 0 0 30px; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 10px 0 40px; }
.fact { text-align: center; padding: 24px 16px; margin-bottom: 0 !important; }
.fact .big { font-family: var(--display); font-size: 44px; color: var(--violet); line-height: 1; margin-bottom: 8px; }
.fact p { margin: 0; color: var(--muted); }

.steps { display: grid; gap: 22px; }
.step { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.step .num { --d: 8px; --e1: #33176f; --e2: #26105a; --e3: #1a0a40; font-family: var(--display); font-size: 22px; width: 48px; height: 45px; display: grid; place-items: center; background: linear-gradient(#6a3ad8, #4a22a8); }
.step p { margin: 0; color: var(--muted); }

.cta { text-align: center; padding: 20px 0; }
.prose p { color: var(--muted); margin: 0 0 12px; max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }

/* prize podium */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; max-width: 560px; margin: 24px auto 0; }
.place { --d: 12px; text-align: center; padding: 18px 10px 14px; display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 15px !important; }
.place .rank { font-family: var(--body); font-weight: 700; font-size: 17px; opacity: .8; }
.place .amount { font-family: var(--display); font-size: 34px; line-height: 1.1; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.place.first  { min-height: 170px; --e1: #a87a12; --e2: #855f0c; --e3: #5e4307; background: linear-gradient(#ffe27a, #e9ac1f); color: #4a3205; }
.place.first .amount { font-size: 44px; }
.place.second { min-height: 130px; --e1: #6e7790; --e2: #565e74; --e3: #3e4455; background: linear-gradient(#e3e8f2, #a5aec2); color: #2b3040; }
.place.third  { min-height: 105px; --e1: #8a4a1e; --e2: #6c3916; --e3: #4d280e; background: linear-gradient(#f0a868, #c06a2c); color: #3d1f08; }

/* forms */
form { display: grid; gap: 20px; }
label { display: grid; gap: 6px; font-weight: 500; }
label small { color: var(--muted); font-weight: 400; }
input, textarea {
  font: inherit; color: var(--text);
  background: #0d0719;
  border: 3px solid #07040d;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.4);
  padding: 12px 14px;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--violet); outline-offset: 0; }
textarea { min-height: 170px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.counter { text-align: right; font-size: 14px; color: var(--muted); }
.msg { padding: 14px 16px; border: 3px solid #07040d; display: none; }
.msg.show { display: block; }
.msg.err { background: #3a0f1a; color: #ffc2cb; }
.msg.ok { background: #0f3a24; color: #bff5d6; }

.btn .ico { width: 22px; height: 22px; vertical-align: -5px; margin-right: 6px; filter: drop-shadow(0 2px 0 rgba(20, 6, 50, .45)); }
.discord-step { display: grid; gap: 18px; background: #0d0719; border: 3px solid #07040d; padding: 20px; }
.discord-step h3 { margin: 0 0 4px; }
.discord-step p { margin: 0 0 16px; color: var(--muted); }
.discord-step .btn { margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: 14px; font-weight: 500; cursor: pointer; padding: 12px 14px; background: #1a1030; border: 3px solid #07040d; transition: background .1s; }
.check:hover { background: #21143e; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  background: #2a1a4c; border: 3px solid #07040d; box-shadow: inset 0 -4px 0 #1a0f33, inset 0 2px 0 rgba(255,255,255,.08);
  color: #fff;
}
.check .box svg { width: 21px; height: 18px; margin-top: -3px; opacity: 0; transform: scale(.5); transition: opacity .12s, transform .12s; filter: drop-shadow(0 3px 0 #0f4a2b); }
.check input:checked + .box { background: #2a9f60; box-shadow: inset 0 -4px 0 #18693e, inset 0 3px 0 #4fd18b; }
.check input:checked + .box svg { opacity: 1; transform: none; }
.check:has(input:checked) { background: #0f2a1d; }
.check input:focus-visible + .box { outline: 3px solid #fff; outline-offset: 2px; }

/* players */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.player { --d: 12px; --e1: #150c2a; --e2: #100820; --e3: #0b0517; background: linear-gradient(#2c1b50, #21143e); padding: 16px 10px 12px; text-align: center; }
.player img { width: 64px; height: 64px; image-rendering: pixelated; display: block; margin: 0 auto 10px; }
.player .name { display: block; font-weight: 500; word-break: break-all; }
.player.dead { --e1: #120c1c; --e2: #0e0916; --e3: #0a0610; background: linear-gradient(#1c1528, #151020); }
.player.dead img { filter: grayscale(1) brightness(.6); }
.player.dead .name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.player.loser_realm { --e1: #5e3a1a; --e2: #4a2d14; --e3: #34200e; background: linear-gradient(#3d2a4a, #2e1d38); }
.state-badge { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; padding: 1px 7px; border: 2px solid #07040d; }
.player.dead .state-badge { background: var(--no-side); color: #ffc2cb; }
.player.loser_realm .state-badge { background: #6b3a12; color: #ffd6a8; }

.group-title { margin: 34px 0 16px; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.group-title .count { font-family: var(--body); font-weight: 700; font-size: 15px; letter-spacing: 0; color: var(--muted); background: #1a1030; border: 2px solid #07040d; padding: 0 9px; }
.tally { display: flex; flex-wrap: wrap; gap: 12px; margin: -12px 0 10px; }
.tally-item { display: flex; align-items: baseline; gap: 8px; padding: 8px 14px; border: 3px solid #07040d; background: #1a1030; }
.tally-item b { font-family: var(--display); font-weight: normal; font-size: 22px; letter-spacing: 1px; }
.tally-item span { color: var(--muted); }
.tally-item.alive b { color: var(--ok); }
.tally-item.loser_realm b { color: #f0a868; }
.tally-item.dead b { color: var(--no); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* admin */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.tab { --d: 6px; --e1: #150c2a; --e2: #100820; --e3: #0b0517; font: inherit; color: var(--muted); background: linear-gradient(#2c1b50, #21143e); padding: 8px 14px; cursor: pointer; }
.tab[aria-selected="true"] { --e1: #33176f; --e2: #26105a; --e3: #1a0a40; color: #fff; background: linear-gradient(#6a3ad8, #4a22a8); }
.app-card { --d: 12px; --e1: #150c2a; --e2: #100820; --e3: #0b0517; background: linear-gradient(#2a1a4c, #1f1339); padding: 20px; margin-bottom: 22px; display: grid; grid-template-columns: 64px 1fr; gap: 18px; }
.app-card img { width: 64px; height: 64px; image-rendering: pixelated; }
.app-meta { color: var(--muted); font-size: 15px; margin: 2px 0 10px; }
.app-motivation { white-space: pre-wrap; background: #0d0719; border-left: 4px solid var(--violet-side); padding: 12px 14px; margin: 0 0 14px; }
.app-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.badge { font-size: 13px; padding: 2px 8px; border: 2px solid #07040d; }
.badge.pending { background: #4a3a10; color: #ffe08a; }
.badge.accepted { background: var(--ok-side); color: #c6f7da; }
.badge.denied { background: var(--no-side); color: #ffc2cb; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

footer { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 20px 40px; }

@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; }
  .podium { gap: 10px; }
  .place .amount { font-size: 26px; }
  .place.first .amount { font-size: 32px; }
  .row { grid-template-columns: 1fr; }
  .nav-links { gap: 14px; }
  .nav-brand span { display: none; }
  h1 { font-size: 32px; }
  .app-card { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .nav { padding: 14px 16px; gap: 10px; }
  .nav-links { gap: 10px; }
  main { padding: 0 16px 60px; }
}
@media (prefers-reduced-motion: reduce) { .btn, .check, .check .box svg { transition: none; } }
