/* ============================================================
   HW Family — Minimal Luxury design system
   ============================================================ */
:root {
  --bg:         #f5f2ec;   /* warm ivory */
  --surface:    #ffffff;
  --surface-2:  #fbf9f5;
  --ink:        #18171c;   /* near black */
  --ink-soft:   #38353f;
  --muted:      #807b70;   /* warm gray */
  --line:       #e8e2d6;   /* hairline */
  --line-2:     #d9d2c4;
  --primary:    #4b46c4;   /* refined indigo */
  --primary-deep:#2f2b86;
  --accent:     #bd9a4e;   /* gold */
  --accent-soft:#efe6ce;
  --ok:         #2f9e6f;
  --err:        #c0492f;
  --radius:     18px;
  --radius-sm:  11px;
  --shadow:     0 1px 2px rgba(18,16,28,.04), 0 18px 40px -24px rgba(18,16,28,.22);
  --shadow-sm:  0 1px 2px rgba(18,16,28,.05), 0 8px 20px -14px rgba(18,16,28,.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .005em;
}
h1, h2, h3, .display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
}
a { color: var(--primary-deep); text-decoration: none; }
.muted { color: var(--muted); }
.eyebrow {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: var(--accent);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,242,236,.82);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: .85rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.25rem;
}
.brand-text { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.2rem; color: var(--ink); display: flex; flex-direction: column; line-height: 1.05; }
.brand-text small { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-size: .6rem; color: var(--muted); letter-spacing: .16em; text-transform: uppercase; margin-top: 2px; }
.mainnav { margin-left: auto; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.mainnav a {
  padding: .5rem .85rem; border-radius: 9px; font-weight: 600; color: var(--ink-soft);
  font-size: .92rem; transition: color .15s, background .15s;
}
.mainnav a:hover { color: var(--ink); background: rgba(0,0,0,.04); }
.nav-profile { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line-2); }
.nav-ava { font-size: 1.1rem; }
.nav-admin { color: var(--primary); }
.nav-muted { color: var(--muted); }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--line-2); background: var(--surface); font-size: 1.2rem;
  width: 44px; height: 44px; border-radius: 11px; cursor: pointer; color: var(--ink); }

/* ---------- Layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 2.4rem 1.5rem 4rem; }
.section-title { font-size: 1.7rem; margin: .2rem 0 1.2rem; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.center { text-align: center; }
.mt { margin-top: 1rem; } .mt2 { margin-top: 2.4rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.5rem; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  font-family: 'Plus Jakarta Sans'; font-weight: 700; font-size: .95rem; color: #fff;
  background: var(--ink); transition: transform .14s ease, opacity .15s, background .15s; text-decoration: none;
  letter-spacing: .01em;
}
.btn:hover { transform: translateY(-2px); opacity: .94; }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); }
.btn-orange  { background: var(--accent); color: #fff; }
.btn-green   { background: var(--ok); }
.btn-lg { padding: .95rem 1.9rem; font-size: 1.02rem; }
.btn-sm { padding: .45rem 1rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(0,0,0,.03); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); padding: 1.8rem;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.grid { display: grid; gap: 1.3rem; }
.grid-games { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- Hero (dark luxe) ---------- */
.hero {
  background: radial-gradient(120% 140% at 0% 0%, #2a2740 0%, #18171c 55%, #100f14 100%);
  color: #f3efe6; border-radius: 28px; padding: 4rem 3rem; box-shadow: var(--shadow);
  position: relative; overflow: hidden; border: 1px solid #26242e;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(40% 60% at 100% 0%, rgba(189,154,78,.20), transparent 70%);
  pointer-events: none;
}
.hero .eyebrow { color: var(--accent); }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin: .6rem 0 .8rem; color: #fff; font-weight: 600; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { font-size: 1.12rem; max-width: 36rem; margin: 0 0 1.8rem; color: #cfcabf; }
.hero .btn-ghost { color: #f3efe6; border-color: rgba(255,255,255,.25); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.08); }
.emoji-rain { display: none; }

/* ---------- Game cards ---------- */
.game-card {
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .16s ease, border-color .16s, box-shadow .16s; text-decoration: none; color: var(--ink);
}
.game-card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow); }
.game-cover { height: 150px; display: flex; align-items: center; justify-content: center; font-size: 3.2rem;
  border-bottom: 1px solid var(--line); position: relative; }
.game-cover::after { content: ""; position: absolute; left: 1.6rem; bottom: 1rem; width: 28px; height: 2px; background: var(--accent); opacity: .8; }
.game-body { padding: 1.3rem 1.5rem 1.6rem; }
.game-body h3 { margin: 0 0 .3rem; font-size: 1.28rem; }
.game-body p { margin: 0; font-size: .92rem; color: var(--muted); }
.badge { display: inline-block; padding: .28rem .75rem; border-radius: 999px; font-size: .72rem;
  font-weight: 700; background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
  margin-top: .9rem; letter-spacing: .03em; }
.badge-soon { background: var(--accent-soft); color: #8a6d25; border-color: transparent; }

/* ---------- Forms ---------- */
.auth-wrap { max-width: 440px; margin: 2rem auto; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; color: var(--ink-soft); }
.input {
  width: 100%; padding: .85rem 1rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface-2); transition: border-color .15s, box-shadow .15s; color: var(--ink);
}
.input:focus { outline: 0; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px rgba(75,70,196,.12); }
.form-hint { font-size: .82rem; color: var(--muted); margin-top: .35rem; }

/* ---------- Flash ---------- */
.flash { padding: .85rem 1.15rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 600; font-size: .92rem;
  border: 1px solid var(--line); background: var(--surface); }
.flash-success { background: #edf7f1; color: #1d6b4a; border-color: #cdeadd; }
.flash-error   { background: #fbecea; color: #a23925; border-color: #f3d4cd; }
.flash-info    { background: #eef0fb; color: #3b3a86; border-color: #d9dbf3; }

/* ---------- Profiles ---------- */
.profile-grid { display: flex; flex-wrap: wrap; gap: 1.3rem; justify-content: center; }
.profile-pick {
  width: 168px; padding: 1.6rem 1rem; border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line); cursor: pointer; text-align: center;
  transition: transform .16s, border-color .16s; text-decoration: none; color: var(--ink);
}
.profile-pick:hover { transform: translateY(-4px); border-color: var(--primary); }
.profile-ava { font-size: 3.2rem; line-height: 1; }
.profile-pick .pname { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.15rem; margin-top: .5rem; }
.profile-add { border: 1px dashed var(--line-2); box-shadow: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--muted); background: transparent; }

/* ---------- Stats ---------- */
.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat { flex: 1 1 130px; background: var(--surface); border-radius: var(--radius); padding: 1.4rem 1rem; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.stat .num { font-family: 'Fraunces', serif; font-size: 2.1rem; font-weight: 600; color: var(--ink); }
.stat .lbl { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.progressbar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progressbar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .4s ease; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 3rem; padding: 3rem 1.5rem; text-align: center; border-top: 1px solid var(--line); }
.footer-inner .brand-logo { margin: 0 auto .8rem; }
.footer-inner p { margin: .25rem 0; }

/* ---------- Admin ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem; }
.table th { background: var(--surface-2); font-weight: 700; color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.table code { background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; font-size: .82rem; }
.admin-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.admin-tabs a { padding: .55rem 1.1rem; border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .9rem;
  border: 1px solid var(--line); color: var(--ink-soft); }
.admin-tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .mainnav { display: none; width: 100%; flex-direction: column; align-items: stretch; margin-top: .7rem; }
  body.nav-open .mainnav { display: flex; }
  .topbar-inner { flex-wrap: wrap; }
  .mainnav a { padding: .8rem 1rem; }
  .hero { padding: 2.8rem 1.6rem; }
  .container { padding: 1.8rem 1.2rem 3rem; }
}
