/* ==========================================================================
   ChargedSMP - shared styles (all pages)
   ========================================================================== */

:root {
  --bg: #050912;
  --bg-2: #0a1120;
  --panel: #0c1426;
  --panel-2: #111c33;
  --line: #1c2a48;
  --line-2: #2a3c63;
  --text: #e8f1fb;
  --muted: #9aabc6;
  --dim: #64759a;

  --ice: #6fd8ff;
  --ice-2: #38bdf3;
  --ice-dark: #1a6cbd;
  --online: #4ade80;
  --danger: #ff5b6e;
  --gold: #f6bd2a;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;

  --font-display: "Jersey 10", ui-monospace, monospace;
  --font-body: "Rubik", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --nav-h: 72px;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* sprite colours for data-mat="theme" (default: Charged ice blue) */
  --t1: #e8fbff;
  --t2: #8fe6ff;
  --t3: #38bdf3;
  --t4: #1a6cbd;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Jersey 10 has one weight: never fake-bold it. font-size-adjust scales
     it up to match Rubik's x-height, so both fonts read at the same size. */
  font-synthesis-weight: none;
  font-size-adjust: 0.52;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

::selection {
  background: rgba(56, 189, 243, 0.4);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.accent {
  color: var(--ice);
}


/* Shared internal-page banner for Rules and My Account. */
.page-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  width: 100%;
  min-height: clamp(310px, 29vw, 390px);
  padding: calc(var(--nav-h) + 36px) 0 40px;
  background: #081121;
  overflow: hidden;
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.page-hero-bg img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 47%;
}
.page-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5,9,18,.65) 0%, rgba(5,9,18,.28) 62%, rgba(5,9,18,.32) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(5,9,18,.25) 47%, rgba(5,9,18,.17) 100%);
}
.page-hero > .container { position: relative; z-index: 1; }
.page-hero-inner {
  display: grid;
  justify-items: start;
  gap: 10px;
}
.page-hero-inner h1 {
  font-size: clamp(48px, 6vw, 76px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 3px 18px rgba(0,0,0,.65);
}
.page-hero-inner p {
  max-width: 720px;
  color: #e1eaf6;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.65;
  text-shadow: 0 2px 8px rgba(0,0,0,.65);
}
.page-hero-inner .updated { display: block; margin-top: 2px; color: #a9bad5; }
@media (max-width: 600px) {
  .page-hero { min-height: 300px; padding: calc(var(--nav-h) + 35px) 0 32px; }
  .page-hero-bg img { object-position: center center; }
}

/* ---------- background ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(80vw 40vh at 50% -10%, rgba(56, 189, 243, 0.08), transparent 70%),
    linear-gradient(180deg, #071022 0%, var(--bg) 60%);
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

main,
.footer {
  position: relative;
  z-index: 2;
}

/* ---------- pixel sprites ---------- */

.px {
  width: 100%;
  height: 100%;
}
[data-px] {
  display: inline-block;
  width: 32px;
  height: 32px;
  flex: none;
}

/* crate colour themes: --c* for UI, --t* for theme-coloured sprites */


/* Season 3 crate palette. Keep .theme-overcharged for legacy checkout IDs and
   old key records; both names render the new SuperCharged blue styling. */
.theme-overcharged,
.theme-supercharged {
  --c1: #38bdf3;
  --c2: #a6ecff;
  --c3: #0e4f8e;
  --accent: #6fd8ff;
  --lore: #79ddff;
  --t1: #e8fbff;
  --t2: #8fe6ff;
  --t3: #38bdf3;
  --t4: #1a6cbd;
}
/* Charged Tools: warm orange for the crate, floating key and purchase buttons. */
.theme-tools {
  --c1: #f5a545;
  --c2: #ffdf97;
  --c3: #9f4b12;
  --accent: #ffc078;
  --lore: #ffca81;
  --t1: #fff5de;
  --t2: #ffdd93;
  --t3: #f1a640;
  --t4: #b55b17;
}
/* Weapon crate: purple, distinct from both SuperCharged and Charged Tools. */
.theme-weapon {
  --c1: #a77bf5;
  --c2: #e0c9ff;
  --c3: #542a91;
  --accent: #c5a2ff;
  --lore: #d3b0ff;
  --t1: #f7efff;
  --t2: #dfcaff;
  --t3: #a67af3;
  --t4: #6635a0;
}

.theme-rank {
  --c1: #f6bd2a;
  --c2: #ffe58a;
  --c3: #8a5a06;
  --accent: #ffd257;
  --lore: #ffaa00;
  --t1: #fffbe0;
  --t2: #ffe066;
  --t3: #f2b51e;
  --t4: #a8690a;
}

/* ---------- typography helpers ---------- */

.kicker {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--ice);
}

.section {
  padding: clamp(72px, 10vw, 120px) 0;
  position: relative;
}

.section-head {
  display: grid;
  gap: 14px;
  max-width: 700px;
  margin-bottom: clamp(32px, 5vw, 52px);
}
.section-head.center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}
.section-head h2 {
  font-size: clamp(32px, 5vw, 52px);
}
.section-head p {
  color: var(--muted);
  font-size: 17px;
  max-width: 580px;
}

/* ---------- buttons (chunky, game-style) ---------- */

.btn {
  --h: 48px;
  --btn-bg: #18233b;
  --btn-edge: #2b3a5e;
  --btn-shadow: #0a1020;
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--h);
  padding: 0 20px;
  margin-bottom: 4px;
  border-radius: var(--radius);
  border: 2px solid var(--btn-edge);
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    0 4px 0 var(--btn-shadow);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  white-space: nowrap;
  transition:
    transform 0.08s,
    box-shadow 0.08s,
    filter 0.15s;
}
.btn:hover {
  filter: brightness(1.1);
}
.btn:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    0 0 0 var(--btn-shadow);
}
.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.btn-sm {
  --h: 40px;
  padding: 0 14px;
  font-size: 16px;
}
.btn-lg {
  --h: 56px;
  padding: 0 26px;
  font-size: 19px;
}
.btn-block {
  width: 100%;
}

.btn-primary {
  --btn-bg: #38bdf3;
  --btn-edge: #1c86c8;
  --btn-shadow: #0f5b91;
  --btn-fg: #04131f;
}
.btn-ghost {
  --btn-bg: #141e33;
  --btn-edge: #2b3a5e;
  --btn-shadow: #080d1a;
}
.btn-discord {
  --btn-bg: #5865f2;
  --btn-edge: #4450d6;
  --btn-shadow: #2e379c;
  --btn-fg: #fff;
}

.btn[disabled],
.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- live status dot ---------- */

.live-dot {
  position: relative;
  width: 9px;
  height: 9px;
  background: var(--online);
  flex: none;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--online);
  opacity: 0;
  animation: ping 2s ease-out infinite;
}
@keyframes ping {
  0% {
    transform: scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}
.is-offline .live-dot {
  background: var(--dim);
}
.is-offline .live-dot::after {
  display: none;
}

/* ---------- navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition:
    background-color 0.25s,
    border-color 0.25s;
}
.nav.is-scrolled {
  background: rgba(6, 10, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav .container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
}
.brand img {
  width: 40px;
  height: 40px;
  transition: transform 0.3s var(--ease-out);
}
.brand:hover img {
  transform: rotate(-8deg);
}
.brand b {
  color: var(--ice);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}
.nav-links a {
  position: relative;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  color: var(--muted);
  transition: color 0.15s;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-links a[aria-current="page"] {
  color: var(--text);
}
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 3px;
  background: var(--ice-2);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-online {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 2px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.nav-online strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* user chip (logged in) */
.user-menu {
  position: relative;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 4px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 2px solid var(--line-2);
  font-weight: 500;
  font-size: 15px;
}
.user-chip:hover {
  background: var(--panel-2);
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--ice-2);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  color: #04131f;
  flex: none;
}
.user-chip svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 2px solid var(--line-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.2s var(--ease-out);
}
.user-menu.is-open .user-dropdown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.user-dropdown .who {
  padding: 8px 10px 10px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}
.user-dropdown .who strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}
.user-dropdown a,
.user-dropdown button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--muted);
  text-align: left;
}
.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--panel-2);
  color: var(--text);
}

.nav-burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--panel);
  place-items: center;
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 3px;
  background: var(--text);
  position: relative;
}
.nav-burger span::before,
.nav-burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 3px;
  background: var(--text);
  transition: transform 0.2s;
}
.nav-burger span::before {
  top: -6px;
}
.nav-burger span::after {
  top: 6px;
}
.nav.is-menu-open .nav-burger span {
  background: transparent;
}
.nav.is-menu-open .nav-burger span::before {
  transform: translateY(6px) rotate(45deg);
}
.nav.is-menu-open .nav-burger span::after {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 900px) {
  .nav-burger {
    display: grid;
  }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 12px var(--gutter) 20px;
    background: rgba(6, 10, 20, 0.98);
    border-bottom: 2px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.2s,
      transform 0.25s var(--ease-out);
  }
  .nav.is-menu-open {
    background: rgba(6, 10, 20, 0.98);
  }
  .nav.is-menu-open .nav-links {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a {
    padding: 12px;
    font-size: 19px;
  }
  .nav-links a[aria-current="page"]::after {
    left: 12px;
    right: auto;
    width: 24px;
    bottom: 6px;
  }
}
@media (max-width: 560px) {
  .nav-online .label,
  .brand span,
  .user-chip .name {
    display: none;
  }
  .user-chip {
    padding-right: 8px;
  }
}

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.03);
}

/* inventory-style slot */
.slot {
  display: grid;
  place-items: center;
  background: #080d19;
  border: 2px solid;
  border-color: #03060d #1f2c4a #1f2c4a #03060d;
}

/* ---------- in-game style tooltip ---------- */

.mc-tip {
  --tip-bg: rgba(16, 2, 20, 0.95);
  position: relative;
  padding: 16px 18px;
  background: var(--tip-bg);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.45;
  color: #e6e6e6;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
  clip-path: polygon(0 3px, 3px 3px, 3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px));
}
.mc-tip::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 3px solid;
  border-image: linear-gradient(180deg, #5a1aff, #2a0a80) 1;
  opacity: 0.75;
  pointer-events: none;
}
.mc-title {
  font-size: 19px;
  font-weight: 500;
}
.c-aqua { color: #55ffff; }
.c-gold { color: #ffaa00; }
.c-yellow { color: #ffff55; }
.c-green { color: #55ff55; }
.c-gray { color: #aaaaaa; }
.c-dgray { color: #6f6f6f; }
.c-purple { color: #ff6bff; }
.c-red { color: #ff6b6b; }
.c-white { color: #ffffff; }

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
}
.reveal.is-in {
  opacity: 1;
  animation: reveal-in 0.7s var(--ease-out) var(--d, 0s) backwards;
}
@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* ---------- toast ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  border: 2px solid var(--line-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  font-size: 15px;
  animation: toast-in 0.3s var(--ease-out);
  pointer-events: auto;
}
.toast.is-out {
  animation: toast-out 0.25s ease-in forwards;
}
.toast .ico {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: rgba(74, 222, 128, 0.15);
  color: var(--online);
  flex: none;
}
.toast.error .ico {
  background: rgba(255, 91, 110, 0.15);
  color: var(--danger);
}
.toast.info .ico {
  background: rgba(56, 189, 243, 0.15);
  color: var(--ice);
}
.toast .ico svg {
  width: 15px;
  height: 15px;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- footer ---------- */

.footer {
  border-top: 2px solid var(--line);
  padding: 52px 0 36px;
  background: #040810;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.footer p {
  color: var(--muted);
  font-size: 15px;
  max-width: 340px;
  margin-top: 12px;
}
.footer h4 {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
}
.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.footer ul a {
  color: var(--muted);
  font-size: 15px;
}
.footer ul a:hover {
  color: var(--ice);
}
.footer-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 2px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--dim);
}
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

/* ---------- IP copy chip ---------- */

.ip-chip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  margin-bottom: 4px;
  padding: 0 6px 0 18px;
  border-radius: var(--radius);
  background: rgba(8, 13, 25, 0.85);
  border: 2px solid var(--line-2);
  box-shadow: 0 4px 0 #070b16;
  transition: border-color 0.15s;
  max-width: 100%;
}
.ip-chip:hover {
  border-color: var(--ice-2);
}
.ip-chip .ip-label {
  font-size: 12px;
  color: var(--dim);
  text-align: left;
}
.ip-chip .ip {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ip-chip .copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--ice);
  flex: none;
}
.ip-chip .copy svg {
  width: 16px;
  height: 16px;
}
.ip-chip.is-copied {
  border-color: var(--online);
}
.ip-chip.is-copied .copy {
  color: var(--online);
  background: rgba(74, 222, 128, 0.12);
}

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 4, 10, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 2px solid var(--line-2);
  z-index: 2;
}
.modal-close svg {
  width: 16px;
  height: 16px;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
  }
  #snow {
    display: none;
  }
}
