/* =========================================================
   Gang Shit – minimal design system (dark + light)
   Single source of truth for index.html, dashboard.php, medal.php
   ========================================================= */

:root {
  --bg:        #0B0B0F;
  --bg-2:      #0E0E13;
  --surface:   #141419;
  --surface-2: #1C1C23;
  --line:      rgba(255, 255, 255, 0.08);
  --line-2:    rgba(255, 255, 255, 0.18);
  --text:      #ECECEF;
  --muted:     #8C8C95;
  --accent:    #7C6CFF;
  --accent-12: rgba(124, 108, 255, 0.12);
  --ink:       #0B0B0F;     /* text on accent */
  --online:    #3FB950;
  --idle:      #D29922;
  --dnd:       #F85149;
  --nav-bg:    rgba(11, 11, 15, 0.72);
  color-scheme: dark;

  --maxw: 1120px;
  --radius: 12px;
  --radius-lg: 16px;
  --nav-h: 64px;

  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="light"] {
  --bg:        #FAFAFB;
  --bg-2:      #F1F1F5;
  --surface:   #FFFFFF;
  --surface-2: #EFEFF3;
  --line:      rgba(0, 0, 0, 0.10);
  --line-2:    rgba(0, 0, 0, 0.20);
  --text:      #16161B;
  --muted:     #62626C;
  --accent:    #6B54F0;
  --accent-12: rgba(107, 84, 240, 0.10);
  --ink:       #FFFFFF;
  --nav-bg:    rgba(250, 250, 251, 0.80);
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* smooth theme cross-fade (also covers hover transforms so they keep animating) */
body, .nav, .game, .frame, .member, .footer, .drawer__panel, .btn, .theme-toggle, .empty {
  transition: background-color 0.25s ease, border-color 0.18s ease, color 0.2s ease, transform 0.18s ease;
}

body.no-scroll { overflow: hidden; }

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

img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------- Section scaffolding ---------- */

.section { padding-block: clamp(56px, 9vw, 104px); }
.section + .section { border-top: 1px solid var(--line); }

.kicker {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
}

.section h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}

.section .lead {
  color: var(--muted);
  max-width: 56ch;
  margin: 18px 0 0;
  font-size: clamp(15px, 1.6vw, 17px);
}

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 15px;
  color: var(--text);
}
.wordmark span { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
}

.nav__links a:not(.btn) {
  color: var(--muted);
  font-size: 14px;
  transition: color 0.15s ease;
}
.nav__links a:not(.btn):hover,
.nav__links a.is-active { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--ink); }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.nav__burger,
.nav__close {
  display: none;
  background: none; border: 0; padding: 6px;
  color: var(--text); cursor: pointer;
}
.nav__burger svg, .nav__close svg { width: 26px; height: 26px; }

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* ---------- Mobile drawer ---------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.drawer.is-open { opacity: 1; pointer-events: auto; }

.drawer__panel {
  position: absolute;
  top: 0; right: 0;
  height: 100%;
  width: min(78%, 320px);
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  padding: 26px 24px;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__panel a {
  color: var(--text);
  font-size: 17px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.drawer__panel .btn { margin-top: 18px; justify-content: center; }
.nav__close { display: inline-flex; align-self: flex-end; margin-bottom: 10px; }

/* ---------- Hero (landing) ---------- */

.hero {
  position: relative;
  min-height: min(86vh, 760px);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(8, 8, 11, 0.55) 0%, rgba(8, 8, 11, 0.80) 100%),
    var(--hero-img, none);
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero__bg::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 60% at 50% 40%, var(--accent-12), transparent 70%);
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  flex-direction: column;
  text-align: center;
  width: 100%;
}
@media (min-width: 880px) {
  .hero__inner { flex-direction: row; text-align: left; }
}
.hero__logo {
  width: clamp(132px, 18vw, 196px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid var(--accent);
  padding: 6px;
  background: var(--surface);
  object-fit: cover;
  flex: none;
}
.hero__title {
  font-size: clamp(34px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 14px 0 0;
  color: #fff;
}
.hero__title span { color: var(--accent); }
.hero__lead { color: rgba(255, 255, 255, 0.72); margin: 18px 0 26px; max-width: 46ch; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
@media (min-width: 880px) { .hero__cta { justify-content: flex-start; } }
/* hero sits on a dark photo in both themes, so keep its ghost button light */
.hero .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.hero .btn--ghost:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Compact page header (dashboard / medal) ---------- */

.page-header {
  position: relative;
  padding-block: clamp(48px, 9vw, 96px);
  border-bottom: 1px solid var(--line);
  text-align: center;
  background:
    radial-gradient(70% 120% at 50% -10%, var(--accent-12), transparent 60%),
    var(--bg);
}
.page-header h1 {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 10px 0 0;
}
.page-header .lead { color: var(--muted); margin: 14px auto 0; max-width: 52ch; }

/* ---------- Games: clean staggered grid ---------- */

.games {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;            /* every tile keeps its own height */
  gap: clamp(14px, 2vw, 20px);
  margin-top: clamp(28px, 4vw, 44px);
}
@media (min-width: 600px) { .games { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
  .games { grid-template-columns: repeat(3, 1fr); column-gap: clamp(16px, 2vw, 22px); }
  /* lift the middle column via transform so all heights stay equal */
  .games > .game:nth-child(3n + 2) { transform: translateY(-32px); }
  .games > .game:nth-child(3n + 2):hover { transform: translateY(-36px); }
}

.game {
  display: flex;
  flex-direction: column;
  min-height: 138px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.game:hover { border-color: var(--accent); transform: translateY(-4px); }
.game:focus-visible { border-color: var(--accent); }

.game__top { display: flex; align-items: center; }
.game__mono {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  transition: background 0.18s ease, color 0.18s ease;
}
.game:hover .game__mono { background: var(--accent); color: var(--ink); }
/* logo variant: white chip so mixed (transparent + white-bg) logos look consistent */
.game__mono--logo { background: #fff; padding: 5px; }
.game__mono--logo img { width: 100%; height: 100%; object-fit: contain; }
.game:hover .game__mono--logo { background: #fff; }

.game__meta { margin-top: auto; padding-top: 18px; }
.game__name { font-size: 15px; font-weight: 500; }
.game__genre { color: var(--muted); font-size: 13px; margin-top: 3px; }
.game__arrow {
  margin-left: auto; color: var(--muted);
  opacity: 0; transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}
.game:hover .game__arrow { opacity: 1; transform: translateX(0); color: var(--accent); }

/* ---------- Media grids (spotify / streams / clips) ---------- */

.media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.5vw, 28px);
  margin-top: clamp(28px, 4vw, 44px);
}
@media (min-width: 860px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }

.frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.frame:hover { border-color: var(--line-2); transform: translateY(-3px); }
.frame--video { aspect-ratio: 16 / 9; }
.frame--audio { height: 380px; }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Dashboard: member cards ---------- */

.members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: clamp(12px, 2vw, 18px);
  margin-top: clamp(28px, 4vw, 44px);
}
.member {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
}
.member:hover { border-color: var(--line-2); transform: translateY(-3px); }
.member__avatar {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  object-fit: cover;
}
.member__name {
  font-size: 15px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member__status {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px;
  color: var(--muted); font-size: 13px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot--online { background: var(--online); box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.16); }
.dot--idle   { background: var(--idle);   box-shadow: 0 0 0 4px rgba(210, 153, 34, 0.16); }
.dot--dnd    { background: var(--dnd);    box-shadow: 0 0 0 4px rgba(248, 81, 73, 0.16); }

.empty {
  margin-top: 36px;
  padding: 36px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 28px;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 640px) { .footer__inner { flex-direction: row; } }
.footer p { color: var(--muted); font-size: 13px; margin: 0; }
.footer nav { display: flex; gap: 20px; }
.footer nav a { color: var(--muted); font-size: 13px; transition: color 0.15s ease; }
.footer nav a:hover { color: var(--accent); }

/* ---------- Responsive nav switch ---------- */

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__burger { display: inline-flex; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
