/* Rizumu's website: dark, in the game's colours (scripts/ui/ui_theme.gd) and its font, Outfit. */

@font-face {
  font-family: "Outfit";
  src: url("/assets/fonts/Outfit-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg0: #110f15;
  --bg1: #18161e;
  --bg2: #201d28;
  --bg3: #2a2633;
  --bg4: #353040;
  --bg5: #433c50;
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --dim: #b6afc6;
  --muted: #7b748c;
  --pink: #ff66aa;
  --pink-dark: #d64a8c;
  --blue: #66ccff;
  --green: #a3e05b;
  --yellow: #ffcc22;
  --orange: #ff9a4a;
  --red: #ff5f6d;
  --purple: #a58cff;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg0); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg0);
  color: var(--text);
  font: 400 16px/1.5 "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main { flex: 1; padding: 28px 0 56px; outline: none; }
main > .wrap > * + * { margin-top: 20px; }

/* --- The header --------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(17, 15, 21, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 800; font-size: 21px; letter-spacing: -0.2px; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; filter: drop-shadow(0 0 6px rgba(255, 102, 170, 0.45)); }
.links { display: flex; gap: 4px; }
.links a, .me .link { color: var(--dim); font-weight: 500; padding: 7px 11px; border-radius: 8px; }
.links a:hover, .me .link:hover { color: var(--text); background: var(--bg2); text-decoration: none; }
.links a.here { color: var(--text); background: var(--bg2); }
.search { margin-left: auto; }
.search input { width: 220px; }
.me { display: flex; align-items: center; gap: 8px; }
.me .who { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; padding: 4px 10px 4px 4px; border-radius: 999px; }
.me .who:hover { background: var(--bg2); text-decoration: none; }

.menu { position: relative; }
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.menu-list a, .menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 7px;
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.menu-list a:hover, .menu-list button:hover { background: var(--bg4); text-decoration: none; }

@media (max-width: 760px) {
  .bar { height: auto; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; }
  .links { order: 3; width: 100%; justify-content: space-between; }
  .search { order: 4; width: 100%; margin: 0; }
  .search input { width: 100%; }
  .me { margin-left: auto; }
  .wrap { padding: 0 14px; }
  h1 { font-size: 25px; }
}

/* --- Pieces ------------------------------------------------------------- */

.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card.flat { padding: 0; overflow: hidden; }
.card h2 { margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack-tight { display: inline-flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.row.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  color: #22121b;
  background: var(--pink);
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  text-decoration: none;
}
.btn:hover { background: #ff7fb8; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.big { font-size: 19px; padding: 14px 28px; border-radius: 12px; }
.btn.ghost { background: var(--bg3); color: var(--text); }
.btn.ghost:hover { background: var(--bg4); }
.btn.danger { background: var(--red); color: #2a0e12; }
.btn.small { padding: 6px 12px; font-size: 14px; border-radius: 8px; }
.btn.discord { background: #5865f2; color: #fff; }
.btn.discord:hover { background: #6d78f5; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg1);
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 9px 12px;
  outline: none;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--pink); }
input::placeholder { color: var(--muted); }
label { display: block; font-size: 14px; color: var(--dim); margin-bottom: 5px; font-weight: 500; }
.field { margin-bottom: 14px; }
.field input, .field select { width: 100%; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 5px; }

.notice { color: var(--dim); }
.error { color: var(--red); }
.ok { color: var(--green); }
.box-error { background: rgba(255, 95, 109, 0.1); border: 1px solid rgba(255, 95, 109, 0.35); color: #ffc4ca; border-radius: 10px; padding: 10px 14px; }
.box-ok { background: rgba(163, 224, 91, 0.1); border: 1px solid rgba(163, 224, 91, 0.35); color: #dcf5bf; border-radius: 10px; padding: 10px 14px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button, .tabs a {
  font: inherit;
  font-weight: 600;
  color: var(--dim);
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
}
.tabs button:hover, .tabs a:hover { color: var(--text); background: var(--bg3); text-decoration: none; }
.tabs .on { color: var(--text); background: var(--bg4); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg4);
  color: var(--text);
  white-space: nowrap;
}
.chip.mods { background: rgba(255, 204, 34, 0.14); color: var(--yellow); }
.chip.nomod { background: var(--bg3); color: var(--muted); }
.chip.online { background: rgba(163, 224, 91, 0.14); color: var(--green); }
.chip.status { background: rgba(102, 204, 255, 0.12); color: var(--blue); }

.grade { font-weight: 800; font-size: 18px; letter-spacing: -0.5px; }
.grade.big { font-size: 64px; line-height: 1; }

.avatar { border-radius: 22%; object-fit: cover; background: var(--bg4); flex: none; }
.avatar.none { display: grid; place-items: center; color: var(--dim); font-weight: 700; }
.flag { width: 22px; height: 15px; border-radius: 3px; object-fit: cover; flex: none; background: var(--bg4); }
.flag-text { font-size: 11px; font-weight: 700; color: var(--dim); background: var(--bg4); border-radius: 3px; padding: 0 4px; }
.player { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; min-width: 0; }
.player:hover { color: var(--pink); text-decoration: none; }
.player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.spinner {
  width: 30px;
  height: 30px;
  margin: 40px auto;
  border-radius: 9px;
  border: 4px solid var(--pink);
  animation: spin 1.1s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}
.spinner.small { width: 16px; height: 16px; margin: 0; border-width: 3px; border-radius: 5px; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

/* --- Tables ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 12px 8px; white-space: nowrap; }
.board td { padding: 10px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.board tr.link-row { cursor: pointer; }
.board tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.board tr.mine td { background: rgba(255, 102, 170, 0.07); }
.board .r { text-align: right; }
.board .rank { color: var(--muted); width: 1%; font-weight: 600; }
.board .wide { width: 99%; white-space: normal; min-width: 180px; }
.board .main { font-weight: 600; }
.pager { display: flex; justify-content: center; gap: 8px; padding: 14px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .board th, .board td { padding: 8px 6px; }
  .board .wide { min-width: 150px; }
  .board td { font-size: 14px; }
}

/* --- Pages -------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 56px 40px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 102, 170, 0.22), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(165, 140, 255, 0.16), transparent 50%),
    var(--bg1);
  border: 1px solid var(--line);
}
.hero h1 { font-size: 46px; font-weight: 800; letter-spacing: -1px; }
.hero p { font-size: 19px; color: var(--dim); max-width: 560px; margin: 12px 0 26px; }
.hero .logo-big { position: absolute; right: 48px; top: 50%; transform: translateY(-50%) rotate(-8deg); width: 220px; height: 220px; opacity: 0.95; }
@media (max-width: 760px) { .hero { padding: 36px 22px; } .hero h1 { font-size: 36px; } .hero .logo-big { display: none; } }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.features .card h3 { margin-bottom: 6px; }
.features .card p { color: var(--dim); margin: 0; }

.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.profile-head .who { flex: 1; min-width: 220px; }
.profile-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--bg1); border-radius: 10px; padding: 10px 14px; }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.level-bar { height: 6px; border-radius: 3px; background: var(--bg4); overflow: hidden; margin-top: 6px; }
.level-bar div { height: 100%; background: var(--pink); }
.grades { display: flex; gap: 14px; }
.grades span { font-weight: 700; }

.map-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.map-head .cover { width: 150px; height: 150px; border-radius: 12px; object-fit: cover; background: var(--bg3); flex: none; }
.map-head .what { flex: 1; min-width: 240px; }
.map-head h1 { font-size: 26px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--dim); margin-top: 10px; }
.facts b { color: var(--text); font-weight: 600; }

.mod-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mod-picker button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--dim);
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
}
.mod-picker button:hover { color: var(--text); }
.mod-picker button.on { color: #2a2205; background: var(--yellow); }
.mod-picker select { padding: 5px 8px; font-size: 14px; }

.score-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
@media (max-width: 640px) { .score-head { grid-template-columns: 1fr; } }

.download-box { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.steps { margin: 0; padding-left: 22px; color: var(--dim); }
.steps li { margin-bottom: 8px; }
.notes { white-space: pre-wrap; color: var(--dim); font-size: 15px; background: var(--bg1); border-radius: 10px; padding: 14px 16px; margin: 0; max-height: 520px; overflow: auto; font-family: inherit; }

.auth { max-width: 420px; margin: 0 auto; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line2); }

.setting { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.setting:first-of-type { border-top: 0; padding-top: 4px; }
.setting > .what { width: 220px; flex: none; }
.setting > .what p { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.setting > .how { flex: 1; min-width: 240px; }
.danger-zone { border-color: rgba(255, 95, 109, 0.35); }

/* --- The replay --------------------------------------------------------- */

.viewer { background: #000; border-radius: var(--radius); overflow: hidden; position: relative; user-select: none; }
.viewer canvas { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--bg0); cursor: pointer; }
.viewer:fullscreen { border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
.viewer:fullscreen canvas { max-height: calc(100vh - 56px); object-fit: contain; }
.viewer .controls { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg1); flex-wrap: wrap; }
.viewer .controls button {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--bg3);
  border: 0;
  border-radius: 8px;
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  cursor: pointer;
}
.viewer .controls button:hover { background: var(--bg4); }
.viewer .controls select { height: 34px; padding: 0 8px; }
.viewer .seek { flex: 1; min-width: 160px; accent-color: var(--pink); }
.viewer .vol { width: 90px; accent-color: var(--pink); }
.viewer .time { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 14px; min-width: 92px; text-align: center; }
.viewer .overlay {
  position: absolute;
  inset: 0 0 54px 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  background: rgba(17, 15, 21, 0.72);
  color: var(--dim);
}
.viewer .overlay .btn { margin-top: 12px; }
.viewer-note { color: var(--muted); font-size: 14px; }

/* --- The footer --------------------------------------------------------- */

.foot { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 16px; }
.foot a { color: var(--dim); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--bg4);
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 10px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
}
