/* ==========================================================================
   Arcadia — design system
   ========================================================================== */

:root {
  --bg: #08080f;
  --bg-soft: #0e0e1a;
  --surface: #14142199;
  --surface-solid: #141421;
  --border: #262640;
  --border-soft: #1c1c2e;

  --text: #ececf5;
  --text-dim: #9a9ab5;
  --text-faint: #63637d;

  --accent: #7c5cff;
  --accent-2: #00e5c0;
  --gold: #ffb020;
  --danger: #ff4d6d;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1160px;

  --shadow: 0 10px 40px -12px #000c;
  --glow: 0 0 32px -6px #7c5cff66;

  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* Ambient background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 15% -5%, #7c5cff26, transparent 60%),
    radial-gradient(800px 500px at 90% 0%, #00e5c01f, transparent 55%),
    radial-gradient(700px 600px at 50% 110%, #ffb0200f, transparent 60%);
}

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: .875rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: #08080fd9;
  border-bottom: 1px solid var(--border-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08080f;
  font-size: 17px;
}

.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }

.nav a {
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: .93rem;
  font-weight: 500;
  transition: .18s;
}
.nav a:hover { color: var(--text); background: #ffffff0d; }
.nav a.active { color: var(--text); background: #ffffff12; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: .18s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9d7bff);
  color: #fff;
  box-shadow: var(--glow);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.08); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #ffcd63);
  color: #2b1c00;
  box-shadow: 0 0 30px -8px #ffb02088;
}
.btn-gold:hover { transform: translateY(-1px); filter: brightness(1.06); }

.btn-ghost {
  background: #ffffff0a;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: #ffffff14; border-color: #3a3a5c; }

.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-free { background: #00e5c01f; color: var(--accent-2); }
.badge-premium { background: #ffb0201f; color: var(--gold); }
.badge-soon { background: #ffffff12; color: var(--text-faint); }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
}

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ---------- Game cards ---------- */

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: .2s;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: #3a3a5c;
  box-shadow: var(--shadow);
}

.game-art {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  position: relative;
  border-bottom: 1px solid var(--border-soft);
}
.game-art::after {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, #0000 0 3px, #00000026 3px 4px);
  pointer-events: none;
}

.game-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.game-body h3 { margin: 0; }
.game-body p { font-size: .88rem; color: var(--text-dim); margin: 0; flex: 1; }
.game-meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.game-meta .btn { margin-left: auto; }

/* ---------- Filtres du catalogue ---------- */

.filters {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff08;
  color: var(--text-dim);
  font: inherit;
  font-size: .89rem;
  font-weight: 600;
  cursor: pointer;
  transition: .16s;
}
.chip:hover { color: var(--text); border-color: #3a3a5c; }
.chip span {
  font-size: .72rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ffffff12;
  color: var(--text-faint);
}
.chip.on {
  background: linear-gradient(135deg, var(--accent), #9d7bff);
  border-color: transparent;
  color: #fff;
}
.chip.on span { background: #00000033; color: #ffffffcc; }

.filters input[type=text] { width: auto; flex: 1; min-width: 200px; max-width: 280px; margin-left: auto; }

.premium-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; padding: 36px; }

@media (max-width: 760px) {
  .premium-card { grid-template-columns: 1fr; padding: 26px; }
  .filters input[type=text] { margin-left: 0; max-width: none; }
}

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
.section-head { margin-bottom: 32px; }
.section-head p { color: var(--text-dim); max-width: 62ch; margin: 0; }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 10px;
}

/* ---------- Hero ---------- */

.hero { padding: 90px 0 60px; text-align: center; }
.hero h1 { max-width: 16ch; margin-inline: auto; }
.hero h1 .grad {
  background: linear-gradient(110deg, var(--accent-2), var(--accent) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--text-dim); font-size: 1.1rem; max-width: 58ch; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stats { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; margin-top: 56px; }
.stat b { display: block; font-size: 1.9rem; letter-spacing: -0.03em; }
.stat span { color: var(--text-faint); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Pricing ---------- */

.plans { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); align-items: start; }

.plan {
  position: relative;
  background: var(--surface-solid);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
}
.plan.featured {
  border-color: #7c5cff66;
  box-shadow: var(--glow);
}
.plan-tag {
  position: absolute; top: -11px; left: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08080f;
  font-size: .7rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
}
.plan h3 { margin-bottom: 4px; }
.plan .price { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.04em; }
.plan .price small { font-size: .95rem; font-weight: 500; color: var(--text-faint); letter-spacing: 0; }
.plan .per { color: var(--text-faint); font-size: .85rem; margin-bottom: 20px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 9px; font-size: .92rem; color: var(--text-dim); }
.plan li::before { content: "✓"; color: var(--accent-2); font-weight: 800; }
.plan li.off { color: var(--text-faint); }
.plan li.off::before { content: "—"; color: var(--text-faint); }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }

input[type=text], input[type=email], input[type=password], select {
  width: 100%;
  padding: 11px 13px;
  background: #0a0a14;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  transition: .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #7c5cff26; }
input::placeholder { color: #4b4b66; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Paywall / modal ---------- */

.paywall {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  place-items: center;
  background: #04040acc;
  backdrop-filter: blur(6px);
  padding: 20px;
}
.paywall.open { display: grid; }
.paywall-box {
  background: var(--surface-solid);
  border: 1px solid #ffb02040;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 430px;
  text-align: center;
  box-shadow: 0 0 60px -10px #ffb02033;
}
.paywall-box .lock { font-size: 2.6rem; }

/* ---------- Game shell ---------- */

.game-shell { padding: 32px 0 72px; }
.game-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.game-top h1 { font-size: 1.7rem; margin: 0; }

.game-layout { display: grid; grid-template-columns: 1fr 280px; gap: 22px; align-items: start; }

.stage {
  background: var(--surface-solid);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  place-items: center;
  position: relative;
  min-height: 300px;
}
canvas { max-width: 100%; height: auto; border-radius: var(--radius-sm); touch-action: none; }

.panel {
  background: var(--surface-solid);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
}
.panel + .panel { margin-top: 16px; }
.panel h4 { margin: 0 0 12px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }

.scoreboard { display: flex; gap: 8px; }
.score-box {
  flex: 1;
  background: #0a0a14;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}
.score-box b { display: block; font-size: 1.35rem; font-family: var(--mono); }
.score-box span { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }

/* minmax(0, 1fr) empêche la colonne de s'élargir au contenu : sans cela, une
   option au libellé long déborde du panneau et passe sous la barre de défilement. */
.opt-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: #0a0a14;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  cursor: pointer;
  transition: .15s;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  width: 100%;
}
.opt:hover { border-color: #3a3a5c; }
.opt > span:first-child { white-space: nowrap; }
.opt > .faint {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opt.selected { border-color: var(--accent); background: #7c5cff1a; }
.opt.locked { color: var(--text-faint); cursor: pointer; }
.opt.locked:hover { border-color: #ffb02055; }
.opt .tag { margin-left: auto; font-size: .68rem; }

.overlay-msg {
  position: absolute; inset: 18px;
  display: none;
  place-items: center;
  background: #08080fe6;
  border-radius: var(--radius-sm);
  text-align: center;
  padding: 20px;
}
.overlay-msg.show { display: grid; }
.overlay-msg h3 { font-size: 1.6rem; }

.touch-pad { display: none; gap: 8px; margin-top: 14px; justify-content: center; }
.touch-pad button {
  width: 54px; height: 54px;
  border-radius: var(--radius-sm);
  background: #ffffff0d;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  background: #0a0a14;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: .78rem;
}

/* ---------- Account ---------- */

.status-strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #7c5cff1f, #00e5c014);
  border: 1px solid var(--border-soft);
}
.status-strip .btn { margin-left: auto; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border-soft); }
.table th { color: var(--text-faint); font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

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

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 44px 0 32px;
  margin-top: 40px;
  color: var(--text-faint);
  font-size: .88rem;
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 32px; }
.footer-grid h5 { margin: 0 0 12px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); }
.footer-grid a { display: block; padding: 3px 0; transition: .15s; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--border-soft); }

/* ---------- Notice ---------- */

.notice {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #ffb0201a;
  border: 1px solid #ffb02033;
  color: #ffd694;
  font-size: .88rem;
}
.notice.info { background: #00e5c014; border-color: #00e5c033; color: #9df3e2; }

.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 120%);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  box-shadow: var(--shadow);
  z-index: 200;
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
  font-size: .92rem;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: #0b0b16f7;
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(14px);
  }
  .nav.open { display: flex; }
  .nav .btn { margin-top: 8px; }
  .section { padding: 52px 0; }
  .hero { padding: 56px 0 40px; }
  .field-row { grid-template-columns: 1fr; }
  .touch-pad { display: grid; grid-template-columns: repeat(3, 54px); }
}
