/* ==========================================================================
   GlitchHue - Global stylesheet
   Minimalist / Apple-esque gaming portal
   ========================================================================== */

:root {
  --white: #ffffff;
  --ink: #111114;
  --ink-soft: #6e6e73;
  --line: #e8e8ed;
  --page: #ffffff;
  --surface: #f5f5f7;
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.site-nav .nav-inner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.logo span { color: var(--ink-soft); font-weight: 400; }

.nav-right { position: relative; display: flex; align-items: center; gap: 10px; }

.language-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 104px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  letter-spacing: 0;
}
.language-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.language-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.profile-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.profile-btn svg { width: 18px; height: 18px; }

.user-menu {
  position: absolute;
  right: 0;
  top: 46px;
  width: 210px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 6px;
  display: none;
}

.user-menu.open { display: block; }

.user-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink);
}

.user-menu a:hover { background: var(--surface); }

.user-menu .menu-label {
  padding: 10px 12px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.user-menu .divider {
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}

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

.page-head {
  padding: 56px 0 28px;
}

.page-head h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -1.4px;
  font-weight: 600;
}

.page-head p {
  margin: 12px 0 0;
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 620px;
}

/* ------------------------------ Game grid -------------------------------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  grid-auto-flow: dense;
  gap: 18px;
  padding-bottom: 64px;
}

.game-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--white);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  will-change: transform;
}

.game-card:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-hover);
  z-index: 5;
}

.game-card .thumb {
  height: 60%;
  position: relative;
  overflow: hidden;
}

.game-card .thumb .glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.9);
  text-indent: 0.12em;
}

.game-card .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 20% 10%, rgba(255,255,255,0.22), rgba(255,255,255,0) 60%);
}

.game-card .body {
  height: 40%;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
}

.game-card .title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--white);
}

.game-card .meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
}

.play-now {
  display: inline-block;
  background: var(--white);
  color: #111114;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
}

.play-now:hover { background: #f0f0f2; }

/* Hero / span helpers */
.span-2x2 { grid-column: span 2; grid-row: span 2; }
.span-2x1 { grid-column: span 2; }

.span-2x2 .thumb .glyph { font-size: 78px; }
.span-2x2 .title { font-size: 24px; }
.span-2x2 .body { padding: 22px 26px 26px; }

/* Card color themes */
.c-navy    { background: linear-gradient(160deg, #0b1b3a, #142c5e); }
.c-violet  { background: linear-gradient(160deg, #23104a, #4a1d8a); }
.c-emerald { background: linear-gradient(160deg, #04231a, #0d5c40); }
.c-black   { background: linear-gradient(160deg, #0a0a0c, #23232a); }
.c-teal    { background: linear-gradient(160deg, #04222b, #0b5566); }
.c-plum    { background: linear-gradient(160deg, #2b0a22, #6a1245); }
.c-indigo  { background: linear-gradient(160deg, #10123a, #2c2f7a); }
.c-forest  { background: linear-gradient(160deg, #0b2412, #1d5a2a); }
.c-crimson { background: linear-gradient(160deg, #2c0710, #7a1226); }
.c-slate   { background: linear-gradient(160deg, #10161c, #2c3b49); }

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

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.panel-narrow { max-width: 460px; margin: 0 auto; }

.panel h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.5px;
  font-weight: 600;
}

.panel .sub {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 14px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: #b9b9c1; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--white);
}

.btn:hover { background: #2a2a2e; }

.btn-block { display: block; width: 100%; }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover { background: #ececf0; }

.form-foot {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

.form-foot a { color: var(--ink); font-weight: 500; }

.inline-links {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 16px;
}

.hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

.alert {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  background: #fdecec;
  color: #8a1220;
}

.alert.ok { background: #e9f7ef; color: #12603a; }

/* ------------------------------- Recharge -------------------------------- */

.recharge-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
  padding-bottom: 64px;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.pack {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
  background: var(--white);
}

.pack:hover { transform: translateY(-2px); }

.pack.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }

.pack .amount { font-size: 22px; font-weight: 600; letter-spacing: -0.5px; }
.pack .time { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.pack .bonus {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  color: var(--ink-soft);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.summary-row.total {
  border-bottom: none;
  font-size: 18px;
  font-weight: 600;
  padding-top: 14px;
}

.preview-time {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
  text-align: center;
}

.preview-time .big {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.8px;
}

.preview-time .cap { font-size: 12px; color: var(--ink-soft); }

/* -------------------------------- Tables --------------------------------- */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th {
  text-align: left;
  background: var(--surface);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 12px 16px;
}

table.data td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.badge.success { background: #e9f7ef; color: #12603a; }
.badge.fail { background: #fdecec; color: #8a1220; }

/* ------------------------------ User center ------------------------------ */

.uc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding-bottom: 64px;
}

.uc-nav {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  align-self: start;
}

.uc-nav a {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.uc-nav a:hover { background: var(--surface); }
.uc-nav a.active { background: var(--ink); color: var(--white); font-weight: 500; }

/* -------------------------------- Legal ---------------------------------- */

.legal { max-width: 780px; padding-bottom: 72px; }
.legal h2 { font-size: 20px; letter-spacing: -0.3px; margin: 32px 0 8px; }
.legal p, .legal li { font-size: 15px; line-height: 1.7; color: #3a3a40; }
.legal ul { padding-left: 20px; }

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 44px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.footer-inner h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.footer-inner a,
.company-info p {
  display: block;
  font-size: 13px;
  line-height: 2;
  color: #3a3a40;
}

.footer-inner a:hover { color: var(--ink); }

.company-info p { margin: 0; line-height: 1.9; }

.company-info .name { font-weight: 600; color: var(--ink); font-size: 15px; margin-bottom: 6px; }

.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}

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

@media (max-width: 1100px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
  .recharge-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 190px; }
  .uc-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 32px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .pack-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------- Glitch Bonus ladder --------------------------- */

.bonus-ladder {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}

.bonus-ladder h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

table.ladder {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.ladder td { padding: 7px 0; border-bottom: 1px dashed var(--line); }
table.ladder tr:last-child td { border-bottom: none; font-weight: 600; }
table.ladder td:last-child { text-align: right; color: var(--ink-soft); }
table.ladder tr:last-child td:last-child { color: var(--ink); }
