:root {
  --bg: #0f0f10;
  --bg2: #141416;
  --panel: #1a1b1e;
  --panel2: #202127;
  --line: #26272b;
  --text: #f2f3f5;
  --muted: #b5bac1;
  --dim: #80848e;
  --accent: #5865f2;
  --accent2: #57f287;
  --gold: #fee75c;
  --pink: #eb459e;
  --green: #57f287;
  --blue: #00a8fc;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Arial, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 15, 16, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  font-family: "Courier New", ui-monospace, monospace;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.logo b { color: var(--accent2); }
.topnav {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
}
.topnav a:hover { color: var(--text); }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* ---------- hero ---------- */
.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 20px 8px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.2;
}
.hero h1 span { color: var(--accent2); }
.hero p { margin: 0; color: var(--muted); max-width: 720px; }
.hero .fine { margin-top: 10px; font-size: 12px; color: var(--dim); }

/* ---------- sections ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px 40px; }
section { margin-top: 30px; }
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
}
.sec-head h2 {
  margin: 0;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 17px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sec-head h2::before { content: "> "; color: var(--accent2); }
.sec-head .more {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent2);
  letter-spacing: 1px;
}
.sec-note { margin: -4px 0 14px; color: var(--muted); font-size: 13px; max-width: 760px; }
.sec-note a { color: var(--accent2); text-decoration: underline; }

/* ---------- game grid / cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.card { display: block; min-width: 0; }
.cover {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.card:hover .cover img { transform: scale(1.04); }
.cover .shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 24%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.82) 100%);
}
.cover .title {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 26px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.15;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}
.cover .subtitle {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: #d7d9dc;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cover .views {
  position: absolute;
  left: 8px;
  top: 8px;
  background: rgba(0, 0, 0, 0.72);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.rank {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(0, 0, 0, 0.78);
  font-family: "Courier New", ui-monospace, monospace;
  font-weight: 700;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.rank.r1 { color: var(--gold); }
.rank.r2 { color: var(--green); }
.rank.r3 { color: var(--pink); }
.rank.r4 { color: var(--green); }
.rank.r5 { color: var(--pink); }
.rank.r6 { color: var(--blue); }
.rank.r7 { color: var(--pink); }
.cover .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: rgba(0, 0, 0, 0.28);
}
.card:hover .cover .play { opacity: 1; }
.cover .play span {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
}
.cover.placeholder {
  background: linear-gradient(135deg, #1d2b53 0%, #0f0f10 55%, #3a1d4d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover.placeholder .ph-mark {
  font-family: "Courier New", ui-monospace, monospace;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 1px;
  border: 1px dashed #4a4d55;
  padding: 6px 10px;
  border-radius: 6px;
}
.meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 2px 0;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
}
.meta .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.meta .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .tag {
  margin-left: auto;
  flex: none;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.dot.purple { background: #a970ff; }
.dot.green { background: var(--green); }
.dot.blue { background: var(--blue); }
.dot.pink { background: var(--pink); }
.dot.gold { background: var(--gold); }

/* ---------- fable spotlight ---------- */
.spotlight {
  border: 1px solid #3d3a1e;
  background: linear-gradient(180deg, #191a12 0%, var(--bg2) 100%);
  border-radius: 12px;
  padding: 18px;
}
.spotlight .sec-head h2::before { content: "> "; color: var(--gold); }
.spotlight p { color: var(--muted); font-size: 13px; max-width: 820px; }
.spotlight p b { color: var(--text); }

/* ---------- submit form ---------- */
.submit-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  max-width: 640px;
}
.submit-box label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.submit-box label:first-child { margin-top: 0; }
.submit-box input,
.submit-box select,
.submit-box textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
}
.submit-box textarea { min-height: 74px; resize: vertical; }
.submit-box .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-status { margin-top: 12px; font-size: 13px; }
.form-status.ok { color: var(--accent2); }
.form-status.err { color: #faa61a; }

/* ---------- community list ---------- */
.sub-list { display: grid; gap: 10px; }
.sub-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.sub-item .t { font-weight: 700; }
.sub-item .u { color: var(--accent2); font-size: 13px; word-break: break-all; }
.sub-item .d { color: var(--muted); font-size: 13px; margin-top: 4px; }
.sub-item .m { color: var(--dim); font-size: 11px; margin-top: 6px; }
.empty { color: var(--dim); font-size: 13px; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
  padding: 22px 20px 34px;
}
footer .wrap { padding-bottom: 0; }
footer a { color: var(--muted); text-decoration: underline; }

@media (max-width: 640px) {
  .hero h1 { font-size: 23px; }
  .topnav { display: none; }
  .submit-box .row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
