/* Undertree Games — Play online.
   Self-contained: every path here is relative to this file, so the folder
   works uploaded straight into public_html/playonline/ with no edits. */

@import url("fonts.css");

:root {
  --bg: #0b0812;
  --surface-a: #1d1534;
  --surface-b: #120c21;
  --ink: #f4ecdc;
  --ink-dim: #d9cdb6;
  --ink-faint: #8a7c62;
  --ink-ghost: #5d4a2a;
  --gold: #d9a84a;
  --gold-light: #f6dc9a;
  --edge: rgba(217, 168, 74, .34);
  --edge-soft: rgba(217, 168, 74, .2);
  --display: "Cinzel", "Times New Roman", Georgia, serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--gold-light); text-decoration: none; }
a:hover { color: #fff3d6; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
::selection { background: rgba(217, 168, 74, .35); color: #fff3d6; }

/* The game build loads full-window in this frame. Hidden until it exists. */
#game { display: none; width: 100%; height: 100%; border: 0; }
body.playing { overflow: hidden; }
body.playing #shell { display: none; }
body.playing #game { display: block; }

.shell {
  min-height: 100vh;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) clamp(16px, 4vw, 28px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 22px);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.back:hover { color: var(--gold-light); }
.back img { width: 26px; height: 26px; object-fit: contain; }

.kicker {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.sub {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(15px, 2vw, 22px);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.meta {
  margin: 0;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.panel {
  margin-top: 6px;
  padding: clamp(18px, 3vw, 26px);
  border: 2px solid var(--edge);
  background: linear-gradient(180deg, var(--surface-a), var(--surface-b));
}
.panel p { margin: 0; max-width: 56ch; font-size: 17px; line-height: 1.75; color: var(--ink-dim); }
.panel code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .9em;
  color: var(--gold-light);
  word-break: break-word;
}

.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 22px;
  border: 2px solid var(--edge);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.btn:hover { border-color: var(--gold-light); color: var(--gold-light); }

.btn-primary {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-color: var(--gold);
  color: #1a1129;
  font-weight: 900;
}
.btn-primary:hover { background: var(--gold-light); color: #1a1129; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(12px, 2vw, 18px);
  margin-top: clamp(18px, 3vw, 30px);
}

.card {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--edge);
  background: linear-gradient(180deg, var(--surface-a), var(--surface-b));
  color: var(--ink);
  transition: border-color .25s ease, transform .25s ease;
}
.card:hover { border-color: var(--gold); transform: translateY(-3px); }

.card-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-b); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-img img { transform: scale(1.05); }

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.card-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.card-sub { font-size: 14px; line-height: 1.6; color: var(--ink-dim); }
.card-meta { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }

.card-state {
  align-self: flex-start;
  margin-top: 4px;
  padding: 5px 9px;
  border: 1px solid var(--edge);
  font-family: var(--display);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.card-state.live { border-color: var(--gold); background: var(--gold); color: #1a1129; }

.others {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--edge-soft);
}
.others-label {
  width: 100%;
  margin-bottom: 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-ghost);
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid rgba(217, 168, 74, .28);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.chip:hover { border-color: var(--gold-light); color: var(--gold-light); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
