/* ============================================================
   COREPIXEL — Design System Core
   Light "Prism" theme: clean paper, vivid gradient accents.
   Shared by all pages. Page-specific styles live elsewhere.
   ============================================================ */

:root {
  /* palette */
  --bg: #f4f6fb;
  --paper: #ffffff;
  --ink: #14172b;
  --ink-soft: #333a55;
  --muted: #69718e;
  --line: #e3e7f2;

  --violet: #7c3aed;
  --blue: #2f6bff;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --amber: #f59e0b;

  --grad-brand: linear-gradient(115deg, #7c3aed 0%, #2f6bff 52%, #06b6d4 100%);
  --grad-warm: linear-gradient(115deg, #f59e0b 0%, #ec4899 100%);
  --grad-text: linear-gradient(100deg, #7c3aed 0%, #2f6bff 55%, #06b6d4 100%);

  /* shape & depth */
  --radius-s: 10px;
  --radius: 18px;
  --radius-l: 28px;
  --shadow-s: 0 6px 18px -8px rgba(23, 26, 43, 0.14);
  --shadow: 0 24px 48px -24px rgba(23, 26, 43, 0.22);
  --shadow-glow: 0 18px 44px -16px rgba(79, 70, 229, 0.38);
  --container: 1160px;

  /* type */
  --font-display: "Space Grotesk", "Manrope", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.45s;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; }

::selection { background: rgba(124, 58, 237, 0.18); }

/* ---------- aurora backdrop ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(52rem 34rem at 8% -8%, rgba(124, 58, 237, 0.14), transparent 62%),
    radial-gradient(46rem 32rem at 96% 6%, rgba(6, 182, 212, 0.16), transparent 60%),
    radial-gradient(40rem 30rem at 78% 88%, rgba(236, 72, 153, 0.10), transparent 62%),
    radial-gradient(36rem 26rem at 12% 92%, rgba(245, 158, 11, 0.09), transparent 60%),
    linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 26, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 26, 43, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 0%, transparent 78%);
}

/* ---------- layout ---------- */
.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  transform: translateY(-240%);
  transition: transform 0.25s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(23, 26, 43, 0.07);
  transition: box-shadow 0.3s ease;
}
.site-header.is-scrolled { box-shadow: 0 12px 32px -18px rgba(23, 26, 43, 0.28); }

.header-inner {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
}

/* pixel mark: 3x3 blocks built from box-shadows */
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    var(--grad-brand) border-box;
  border: 1.5px solid transparent;
  position: relative;
  box-shadow: var(--shadow-s);
}
.brand-mark::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--violet);
  box-shadow:
    7px 0 0 var(--blue),
    14px 0 0 var(--cyan),
    0 7px 0 var(--blue),
    14px 7px 0 var(--pink),
    0 14px 0 var(--cyan),
    7px 14px 0 var(--violet),
    14px 14px 0 var(--amber);
}

.brand-name { font-weight: 700; font-size: 13.5px; letter-spacing: 0.01em; display: block; }
.brand-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 2.5px 9px;
  border-radius: 999px;
  color: transparent;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  border: 1px solid rgba(124, 58, 237, 0.32);
}

.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  position: relative;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease-out);
}
.site-nav a:hover {
  color: var(--ink);
  background: rgba(124, 58, 237, 0.08);
  transform: translateY(-1px);
}
.site-nav a:focus-visible {
  outline: 2px solid rgba(47, 107, 255, 0.55);
  outline-offset: 2px;
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--grad-brand);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.015em;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s ease, filter 0.28s ease;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.5) 50%, transparent 68%);
  transform: translateX(-120%);
  transition: transform 0.65s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 22px 52px -16px rgba(79, 70, 229, 0.5); }
.btn:hover::after { transform: translateX(120%); }
.btn:focus-visible { outline: 3px solid rgba(47, 107, 255, 0.4); outline-offset: 3px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  transition: transform 0.28s var(--ease-out), border-color 0.25s ease, box-shadow 0.28s ease;
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: var(--shadow);
}

/* ---------- shared bits ---------- */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--grad-brand);
}

/* ---------- doc shell (content & legal pages) ---------- */
.page-main { padding: 56px 0 72px; }

.doc-shell {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.doc-hero {
  position: relative;
  padding: 52px 48px 40px;
  background:
    radial-gradient(30rem 14rem at 88% -40%, rgba(6, 182, 212, 0.16), transparent 65%),
    radial-gradient(26rem 14rem at 6% -30%, rgba(124, 58, 237, 0.14), transparent 65%);
  border-bottom: 1px solid var(--line);
}
.doc-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--grad-brand);
  opacity: 0.9;
}
.doc-hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.doc-hero p { margin: 0; color: var(--muted); font-size: 1.02rem; max-width: 56ch; }

.doc-body { padding: 40px 48px 48px; }
.doc-body h2 {
  position: relative;
  margin: 2.2rem 0 0.85rem;
  padding-left: 1rem;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.doc-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 4px;
  border-radius: 4px;
  background: var(--grad-brand);
}
.doc-body h2:first-of-type { margin-top: 0; }
.doc-body p { margin: 0 0 1rem; color: var(--ink-soft); }
.doc-body ul { margin: 0.7rem 0 1.3rem; padding-left: 1.3rem; }
.doc-body li { margin-bottom: 0.5rem; color: var(--ink-soft); }
.doc-body li::marker { color: var(--violet); }
.doc-body a {
  color: var(--blue);
  font-weight: 700;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s var(--ease-out);
}
.doc-body a:hover { background-size: 100% 1.5px; }
.doc-body strong { color: var(--ink); }

/* info panel / highlight box */
.panel, .note, .highlight-box {
  margin: 1.3rem 0;
  padding: 1.05rem 1.25rem;
  border-radius: var(--radius);
  color: var(--ink-soft);
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)) padding-box,
    var(--grad-brand) border-box;
  border: 1.5px solid transparent;
  box-shadow: var(--shadow-s);
}
.note, .highlight-box {
  background:
    linear-gradient(115deg, rgba(245, 158, 11, 0.09), rgba(236, 72, 153, 0.07)) padding-box,
    var(--grad-warm) border-box;
}

/* tags */
.tag {
  display: inline-flex;
  align-items: center;
  margin: 0 8px 8px 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--violet);
  background: rgba(124, 58, 237, 0.09);
  border: 1px solid rgba(124, 58, 237, 0.24);
}
.tag:nth-child(3n + 1) { color: var(--blue); background: rgba(47, 107, 255, 0.08); border-color: rgba(47, 107, 255, 0.24); }
.tag:nth-child(3n + 2) { color: #0e7490; background: rgba(6, 182, 212, 0.09); border-color: rgba(6, 182, 212, 0.28); }

/* card grid (contact page) */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 1.2rem 0; }
.card {
  padding: 1.3rem 1.4rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.card p { margin: 0 0 0.5rem; }

/* tables (cookie notice) */
.doc-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0 1.4rem;
  font-size: 0.94rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-s);
}
.doc-body th, .doc-body td {
  padding: 0.8rem 0.95rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.doc-body th {
  background: linear-gradient(115deg, rgba(124, 58, 237, 0.07), rgba(6, 182, 212, 0.07));
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.doc-body tr:last-child td { border-bottom: 0; }
.doc-body tbody tr { transition: background 0.2s ease; }
.doc-body tbody tr:hover { background: rgba(124, 58, 237, 0.04); }

/* footer note inside docs */
.footer-note {
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- site footer ---------- */
.site-footer {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-brand);
  opacity: 0.75;
}
.footer-inner {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}
.footer-inner p { margin: 0; }
.footer-inner p:first-child { font-family: var(--font-display); font-weight: 700; color: var(--ink); }

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
  .doc-hero { padding: 38px 26px 30px; }
  .doc-body { padding: 30px 26px 36px; }
  .page-main { padding: 34px 0 52px; }
  .header-inner { min-height: 64px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- online placeholder page ---------- */
.online-stage {
  min-height: calc(100vh - 74px);
  display: grid;
  place-items: center;
  padding: 48px 20px 64px;
}
.online-placeholder {
  position: relative;
  width: min(720px, 100%);
  padding: 46px 46px 42px;
  border-radius: var(--radius-l);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.online-placeholder::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--grad-brand);
}
.online-placeholder::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -90px;
  bottom: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12), transparent 68%);
  pointer-events: none;
}
.online-placeholder h1 {
  margin: 14px 0 12px;
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  letter-spacing: -0.02em;
}
.online-placeholder p { margin: 0 0 18px; color: var(--muted); line-height: 1.7; }
.online-placeholder ul { margin: 0; padding: 0; list-style: none; }
.online-placeholder li {
  position: relative;
  padding: 9px 0 9px 28px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
}
.online-placeholder li + li { border-top: 1px dashed var(--line); }
.online-placeholder li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--grad-brand);
}

.online-game-stage {
  min-height: calc(100vh - 74px);
  min-height: calc(100dvh - 74px);
  display: block;
  padding: 0;
  background: #05070d;
}

.online-game-frame {
  width: 100%;
  height: calc(100vh - 74px);
  height: calc(100dvh - 74px);
  min-height: 620px;
  display: block;
  border: 0;
  background: #05070d;
}

.online-page {
  overflow: hidden;
  background: #05070d;
}

.online-page .site-header {
  display: none;
}

.online-page .online-game-stage {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
}

.online-page .online-game-frame {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

@media (max-width: 800px) {
  .online-game-stage {
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
  }

  .online-game-frame {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    min-height: 560px;
  }

  .online-page .online-game-stage {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .online-page .online-game-frame {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }
}
