/* Protocol Rift website: the game's menus in neon (Orbitron titles, cyan allies, magenta/red enemies, gold coins) over a living arena backdrop. */
:root {
  color-scheme: dark;
  --bg: #06070f; --surface: #0d1122; --raised: #151a33; --fg: #eef1ff; --muted: #8e95bb; --line: #232a4b;
  --cyan: #3ae8ff; --cyan-soft: #0b2a3c; --violet: #8b5cff; --magenta: #ff3ea5;
  --red: #ff4d6a; --red-soft: #3a1222; --gold: #ffc94a; --gold-soft: #3a2c0c;
  --grad: linear-gradient(100deg, var(--cyan), var(--violet) 55%, var(--magenta));
  --display: "Orbitron", "Segoe UI", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--fg); font: 17px/1.6 var(--body); background: var(--bg); overflow-x: clip; isolation: isolate; }
body > main { flex: 1; width: 100%; }

/* The backdrop: drifting aurora light over a perspective arena grid. */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  inset: -20%;
  background:
    radial-gradient(38% 32% at 18% 12%, rgba(58, 232, 255, .16), transparent 70%),
    radial-gradient(34% 30% at 85% 8%, rgba(139, 92, 255, .2), transparent 70%),
    radial-gradient(40% 34% at 70% 85%, rgba(255, 62, 165, .1), transparent 70%);
}
body::after {
  top: 45%;
  background:
    repeating-linear-gradient(90deg, rgba(58, 232, 255, .14) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(139, 92, 255, .14) 0 1px, transparent 1px 72px);
  transform: perspective(420px) rotateX(62deg); transform-origin: 50% 0;
  mask-image: linear-gradient(180deg, transparent, #000 35%, transparent 95%);
  opacity: .55;
}

a { color: var(--cyan); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h1 { font-weight: 900; font-size: clamp(34px, 7vw, 68px); line-height: 1.03; letter-spacing: .01em; }
h2 { font-weight: 800; font-size: clamp(21px, 3.5vw, 28px); line-height: 1.2; }
h3 { font-weight: 600; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
p { margin: 0; }
b { font-weight: 600; }
code { font: 500 .88em var(--mono); background: var(--cyan-soft); color: #bff6ff; padding: 1px 6px; border-radius: 4px; }
::selection { background: rgba(139, 92, 255, .45); color: #fff; }
.grad { background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(6, 7, 15, .72); backdrop-filter: blur(14px) saturate(1.4); }
.top::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: var(--grad); opacity: .55; }
.top-in { max-width: 1160px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 12px; font: 800 16px/1 var(--display); letter-spacing: .16em; color: var(--fg); text-decoration: none; margin-right: auto; }
.brand span { color: var(--cyan); text-shadow: 0 0 18px rgba(58, 232, 255, .6); }
.brand .mark { width: 22px; height: 22px; position: relative; flex: none; }
.brand .mark::before, .brand .mark::after { content: ""; position: absolute; inset: 3px; border: 2px solid var(--cyan); transform: rotate(45deg); border-radius: 3px; box-shadow: 0 0 12px rgba(58, 232, 255, .55); }
.brand .mark::after { inset: 8px 10px; border: 0; background: var(--magenta); box-shadow: 0 0 10px var(--magenta); transform: none; border-radius: 1px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.nav a { position: relative; font: 600 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 6px; }
.nav a:hover { color: var(--fg); background: rgba(255, 255, 255, .04); }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; inset: auto 12px 2px; height: 2px; border-radius: 2px; background: var(--grad); box-shadow: 0 0 10px rgba(58, 232, 255, .7); }
.top .cta { padding: 11px 18px; font-size: 12px; box-shadow: 0 0 20px -2px rgba(58, 232, 255, .45); }

/* Page column */
main { max-width: 1160px; margin: 0 auto; padding: 56px 24px 88px; display: grid; gap: 72px; align-content: start; }
.narrow { max-width: 840px; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 600 12px/1 var(--display); letter-spacing: .24em; text-transform: uppercase; color: var(--cyan); }
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--grad); box-shadow: 0 0 8px rgba(58, 232, 255, .8); }
.lead { color: #b3b9da; font-size: 19px; max-width: 62ch; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
footer { position: relative; color: var(--muted); font-size: 14px; background: rgba(6, 7, 15, .6); }
footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: var(--grad); opacity: .35; }
footer > div { max-width: 1160px; margin: 0 auto; padding: 28px 24px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
footer .brand { font-size: 13px; margin: 0; }

/* Buttons and fields */
.btn, button {
  position: relative; overflow: hidden; isolation: isolate;
  font: 700 13px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  color: #05060d; background: var(--cyan); border: 0; border-radius: 6px; padding: 15px 22px; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
}
.btn.primary { background: var(--grad); padding: 18px 28px; font-size: 14px; box-shadow: 0 8px 32px -6px rgba(139, 92, 255, .6), 0 0 24px -4px rgba(58, 232, 255, .5); }
.btn.alt, button.alt { background: rgba(58, 232, 255, .06); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(58, 232, 255, .55); }
button:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input[type="text"], input[type="password"] {
  font: 500 16px var(--body); color: var(--fg); background: rgba(6, 7, 15, .7); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; width: 100%;
}
input[type="text"]:focus, input[type="password"]:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(58, 232, 255, .15), 0 0 18px -4px rgba(58, 232, 255, .5); outline: none; }
.msg { font-size: 15px; min-height: 1.6em; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--cyan); }

/* Panels: glass with a gradient edge and HUD corner ticks. */
.panel {
  --edge: rgba(58, 232, 255, .45);
  position: relative; border-radius: 12px; padding: 26px; display: grid; gap: 16px; min-width: 0;
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(21, 26, 51, .92), rgba(10, 13, 28, .92)) padding-box,
    linear-gradient(140deg, var(--edge), rgba(255, 255, 255, .06) 38%, rgba(255, 255, 255, .04) 62%, rgba(139, 92, 255, .4)) border-box;
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .8);
}
.panel::before {
  content: ""; position: absolute; inset: 7px; pointer-events: none; border-radius: 6px;
  background:
    linear-gradient(var(--edge), var(--edge)) 0 0 / 12px 1px, linear-gradient(var(--edge), var(--edge)) 0 0 / 1px 12px,
    linear-gradient(var(--edge), var(--edge)) 100% 100% / 12px 1px, linear-gradient(var(--edge), var(--edge)) 100% 100% / 1px 12px;
  background-repeat: no-repeat; opacity: .8;
}
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.section-head { display: grid; gap: 12px; }

/* Numbers (account tiles, home counters) */
.tile { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--raised), var(--surface)); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; display: grid; gap: 4px; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--grad); opacity: .8; }
.tile .v { font: 800 32px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.tile .k { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.gold { color: var(--gold); }
.cyan { color: var(--cyan); }
.red { color: var(--red); }
.tile .v.gold { text-shadow: 0 0 20px rgba(255, 201, 74, .4); }
.tile .v.cyan { text-shadow: 0 0 20px rgba(58, 232, 255, .4); }

/* Tables */
.scroll { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { font: 600 11px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 14px; border-bottom: 1px solid var(--line); background: rgba(13, 17, 34, .85); }
td { padding: 12px 14px; border-bottom: 1px solid rgba(35, 42, 75, .7); white-space: nowrap; background: rgba(10, 13, 28, .55); }
tbody tr:hover td { background: rgba(58, 232, 255, .05); }
td.num, th.num { text-align: right; }
.pill { font: 700 11px/1 var(--display); letter-spacing: .12em; padding: 6px 10px; border-radius: 4px; }
.pill.win { color: var(--cyan); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px rgba(58, 232, 255, .35), 0 0 14px -4px rgba(58, 232, 255, .6); }
.pill.loss { color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px rgba(255, 77, 106, .35); }

/* Tabs (classement): a segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 10px; background: rgba(13, 17, 34, .85); border: 1px solid var(--line); justify-self: start; }
.seg button { background: transparent; color: var(--muted); padding: 12px 18px; }
.seg button:hover { color: var(--fg); }
.seg button[aria-selected="true"] { color: #05060d; background: var(--grad); box-shadow: 0 0 22px -4px rgba(139, 92, 255, .8); }

[hidden] { display: none !important; }

/* Rank badge: icon then name */
.rank { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.rank img { object-fit: contain; flex: none; filter: drop-shadow(0 0 6px rgba(139, 92, 255, .4)); }
.muted { color: var(--muted); font-weight: 400; }

/* Motion: hovers, the drifting backdrop and scroll reveals (site.js adds .motion only when motion is welcome). */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  body::before { animation: aurora 28s ease-in-out infinite alternate; }
  body::after { animation: grid-run 6s linear infinite; }
  .btn, button { transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s; }
  .btn::after, button::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); translate: -110% 0; transition: translate .6s var(--ease); }
  .btn:hover::after, button:hover:not(:disabled)::after { translate: 110% 0; }
  .btn:hover, button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.1); }
  .btn.primary:hover { box-shadow: 0 12px 40px -6px rgba(139, 92, 255, .8), 0 0 34px -2px rgba(58, 232, 255, .6); }
  .grad { animation: grad-shift 8s ease-in-out infinite alternate; }
  .nav a, input { transition: color .2s, background .2s, border-color .2s, box-shadow .2s; }
  .lift { transition: translate .35s var(--ease), box-shadow .35s var(--ease); }
  .lift:hover { translate: 0 -6px; box-shadow: 0 26px 60px -24px var(--edge), 0 20px 50px -24px rgba(0, 0, 0, .8); }
  .motion .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s), translate .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; }
  .motion .reveal.in { opacity: 1; transform: none; }
  tbody tr { animation: row-in .45s var(--ease) both; }
}
@keyframes aurora { to { transform: translate3d(4%, 6%, 0) rotate(8deg) scale(1.08); } }
@keyframes grid-run { to { background-position: 0 72px, 0 72px; } }
@keyframes grad-shift { to { background-position: 100% 0; } }
@keyframes row-in { from { opacity: 0; transform: translateX(-8px); } }

@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 36px 16px 64px; gap: 56px; }
  .top-in { padding: 10px 16px; gap: 6px; }
  .nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; margin-inline: -6px; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav a { padding: 9px 8px; font-size: 10.5px; letter-spacing: .06em; white-space: nowrap; }
  .nav a[aria-current="page"]::after { inset-inline: 8px; }
  .top .cta { padding: 9px 14px; font-size: 11px; }
  .nav { order: 1; }
  .panel { padding: 20px; }
  .lead { font-size: 17px; }
  footer > div { padding: 24px 16px; }
}
