/* The Alley — Games Hub by Buddy's Bodega */
:root {
  --ink: #0b0a09;
  --ink-2: #141210;
  --ink-3: #1d1a17;
  --line: #2c2823;
  --cream: #efe6d2;
  --cream-dim: #b9b0a0;
  --muted: #847b6e;
  --gold: #e8b23a;
  --gold-deep: #b9861d;
  --red: #e0664f;
  --green: #7fbf6a;
  --radius: 14px;
  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --marker: 'Permanent Marker', 'Comic Sans MS', cursive;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --checker: repeating-conic-gradient(var(--gold) 0 25%, transparent 0 50%) 0 0 / 14px 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(232,178,58,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(232,178,58,.05), transparent 60%),
    var(--ink);
  color: var(--cream);
  font: 16px/1.55 var(--body);
  min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(14px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(11,10,9,.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 56px; width: auto; }
.brand-tag { font: 12px/1 var(--body); font-weight: 700; letter-spacing: .14em; color: var(--ink); background: var(--gold); padding: 5px 8px; border-radius: 6px; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--cream); font-weight: 600; font-size: 15px; }
.nav a.muted { color: var(--muted); }
.nav a.btn { color: var(--ink); }
.who { color: var(--cream-dim); font-size: 15px; }
.crown { color: var(--gold); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(18px, 4vw, 36px) clamp(14px, 4vw, 40px) 48px; flex: 1; }

/* ---------- type ---------- */
.h-display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: 1.02; margin: 0 0 10px; }
.h-section { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 26px; letter-spacing: .02em; margin: 34px 0 14px; }
.h-section .muted { font-family: var(--body); text-transform: none; font-size: 15px; letter-spacing: 0; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.checker-chip { width: 28px; height: 14px; background: var(--checker); display: inline-block; }
.lead { color: var(--cream-dim); font-size: 18px; margin: 0 0 18px; }
.meta { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; color: var(--cream-dim); }
.center { text-align: center; justify-content: center; }

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gold); color: var(--ink); border: 2px solid var(--gold);
  font: 700 15px/1 var(--body); letter-spacing: .02em;
  padding: 12px 18px; border-radius: 10px; cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 0 var(--gold-deep);
}
.btn:hover { text-decoration: none; background: #f2c457; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-deep); }
.btn .crown { color: var(--ink); }
.btn-ghost { background: transparent; color: var(--cream); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--ink-3); border-color: var(--cream-dim); }
.btn-ghost .crown { color: var(--gold); }
.btn-lg { padding: 16px 22px; font-size: 16px; }
.btn-sm { padding: 8px 12px; font-size: 14px; box-shadow: 0 3px 0 var(--gold-deep); }
.btn-block { width: 100%; }
.btn-danger { background: transparent; border-color: #5a2a22; color: var(--red); box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.form { display: grid; gap: 14px; margin: 14px 0; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--cream-dim); }
input, select, textarea {
  width: 100%; background: var(--ink); color: var(--cream); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; font: 16px var(--body);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
input[type=checkbox] { width: auto; }
textarea { min-height: 110px; resize: vertical; }

.card { background: linear-gradient(180deg, var(--ink-2), #100e0c); border: 1px solid var(--line); border-radius: var(--radius); }

.flash { padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; font-weight: 600; font-size: 15px; border: 1px solid; }
.flash-ok { background: rgba(127,191,106,.1); border-color: rgba(127,191,106,.35); color: #bfe3b2; }
.flash-err { background: rgba(224,102,79,.1); border-color: rgba(224,102,79,.4); color: #f2b3a6; }
.flash-warn { background: rgba(232,178,58,.1); border-color: rgba(232,178,58,.4); color: #f3d38c; }

/* ---------- landing / auth ---------- */
.landing { text-align: center; max-width: 980px; margin: 2vh auto 0; }
.landing-logo { margin: 0 auto 22px; width: 100%; border-radius: var(--radius); -webkit-mask-image: radial-gradient(ellipse 75% 85% at 50% 50%, #000 60%, transparent 100%); mask-image: radial-gradient(ellipse 75% 85% at 50% 50%, #000 60%, transparent 100%); }
.landing .lead { font-size: 20px; }
.auth { max-width: 460px; margin: 3vh auto; padding: 30px clamp(18px, 5vw, 34px); text-align: center; }
.auth .form { text-align: left; }
.auth-badge { width: 112px; margin: -4px auto 12px; border-radius: 50%; }
.auth .h-display { font-size: 36px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 22px 0 4px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.notice { max-width: 560px; margin: 6vh auto; padding: 30px; text-align: center; }
.notice .actions { justify-content: center; }
.notice .h-display { font-size: 38px; }

/* ---------- hub home ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; min-height: 340px; }
.hero-art { background: var(--ink-3) center / cover no-repeat; min-height: 240px; position: relative; }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, var(--ink-2)); }
.hero-body { padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; justify-content: center; }
.hero-title { font-size: clamp(40px, 6vw, 68px); }
.hero-empty { grid-template-columns: 1fr; background: url('/assets/img/alley-scene.jpg') right center / contain no-repeat, var(--ink-2); }
.hero-empty .hero-body { max-width: 560px; }

.next { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 24px; margin-top: 18px; flex-wrap: wrap; }
.next-title { font-size: 26px; margin: 0; color: var(--cream-dim); }
.countdown { font-family: var(--display); font-size: 34px; color: var(--gold); letter-spacing: .03em; }
.countdown span { color: var(--cream); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.tile { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--cream); transition: transform .12s ease, border-color .12s ease; }
.tile:hover { transform: translateY(-3px); border-color: var(--gold); text-decoration: none; }
.tile-art { aspect-ratio: 16 / 9; background: var(--ink-3) center / cover no-repeat; }
.tile-body { padding: 14px 16px; display: grid; gap: 2px; }
.tile-body strong { font-family: var(--display); font-weight: 400; font-size: 22px; text-transform: uppercase; }
.tile-body .meta { margin: 0; }

/* ---------- play ---------- */
.play-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.play-title { font-size: clamp(34px, 5vw, 52px); margin: 0; }
.play-layout { display: grid; grid-template-columns: 1fr 310px; gap: 18px; align-items: start; }
.stage { position: relative; aspect-ratio: 16 / 10; background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage:fullscreen { aspect-ratio: auto; border: 0; border-radius: 0; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.board { padding: 18px 20px; }
.board .h-section { margin: 0 0 4px; font-size: 24px; }
.board ol { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.board li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--ink); font-size: 15px; }
.board li:nth-child(1) .rank { color: var(--gold); }
.board li.me { outline: 1px solid var(--gold); }
.board li.empty { display: block; color: var(--muted); background: none; padding: 4px 0; }
.rank { font-family: var(--display); color: var(--muted); font-size: 18px; }
.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.howto { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.howto h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.howto p { margin: 0; color: var(--cream-dim); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--cream); color: var(--ink); font-weight: 700; padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer ---------- */
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 0 28px; }
.foot .checker { height: 10px; background: var(--checker); opacity: .55; margin-bottom: 18px; background-size: 10px 10px; }

/* ---------- CMS ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { padding: 18px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 38px; line-height: 1; color: var(--cream); }
.stat span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .14em; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t th, .t td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.t td .meta { margin: 0; }
.t img.thumb { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--ink-3); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--cream-dim); white-space: nowrap; }
.pill-gold { border-color: var(--gold); color: var(--gold); }
.pill-green { border-color: rgba(127,191,106,.5); color: var(--green); }
.pill-red { border-color: rgba(224,102,79,.5); color: var(--red); }
.cms-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.cms-head .h-display { font-size: 40px; margin: 0; }
.panel { padding: 22px 24px; margin-bottom: 18px; }
.panel h2 { margin-top: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inline-form { display: inline; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.big-state { font-family: var(--display); font-size: 30px; text-transform: uppercase; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--cream-dim); font-size: 14px; }
.filters a.on { border-color: var(--gold); color: var(--gold); }
code { background: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 13px; color: var(--cream); word-break: break-all; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art::after { background: linear-gradient(180deg, transparent 55%, var(--ink-2)); }
  .play-layout { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 3 / 4; max-height: 78vh; }
  .row2 { grid-template-columns: 1fr; }
  .brand img { height: 38px; }
}
