@import url('https://api.fontshare.com/v2/css?f[]=excon@400,700,900&f[]=roboto@400,500,700,900&display=swap');

/* ============================================================
   1on1 Night — design tokens (KEGNA teal/gold palette)
   ============================================================ */
:root {
  /* KEGNA palette */
  --brand-primary: #F2C481;
  --brand-gold: #FFD166;
  --brand-champagne: #F7EFD5;
  --brand-antique-gold: #C5A45D;
  --bg-primary: #011E21;
  --bg-secondary: #012D32;
  --bg-elevated: #073839;
  --bg-input: #062F33;
  --bg-navigation: #052A2D;
  --border-default: #174448;
  --border-gold: #C5A45D;
  --text-primary: #FFFFFF;
  --text-secondary: #E8EEEE;
  --text-muted: #B5C7C7;
  --color-success: #32D6A0;
  --color-notification: #E94343;

  /* Semantic aliases consumed across the app */
  --color-primary: #F2C481;          /* gold accents / focus */
  --color-secondary: #073839;        /* elevated surfaces */
  --color-tertiary: #B5C7C7;         /* muted labels */
  --color-neutral: #011E21;          /* main app background */
  --color-surface: #012D32;          /* cards / secondary surfaces */
  --color-surface-hover: #073839;
  --color-on-surface: #FFFFFF;
  --color-accent: #FFD166;           /* bright gold accent */
  --color-gold: #C5A45D;             /* antique gold (gradient end) */
  --color-border: #174448;
  --color-border-subtle: rgba(23, 68, 72, 0.6);
  --color-error: #FF646B;

  --font-tile: 'Montserrat', 'Excon', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-display: 'Excon', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;

  /* Compact, dense type scale (regular/medium weights) */
  --text-display: 700 30px/38px var(--font-display);
  --text-headline-lg: 700 22px/28px var(--font-display);
  --text-headline-md: 700 18px/24px var(--font-display);
  --text-headline-sm: 600 16px/22px var(--font-display);
  --text-body-lg: 500 14px/20px var(--font-display);
  --text-body-md: 500 13px/18px var(--font-display);
  --text-body-sm: 500 12px/16px var(--font-display);
  --text-label-lg: 600 13px/18px var(--font-display);
  --text-label-md: 600 12px/16px var(--font-display);
  --text-label-sm: 600 11px/15px var(--font-display);
  --text-caption: 500 10px/14px var(--font-display);

  --r-none: 0px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* Compact spacing */
  --sp-xs: 2px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 20px;
  --sp-xxl: 40px;

  --btn-h: 36px;
  --tabbar-h: 58px;
}

/* ============================================================
   Base
   ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background: var(--color-neutral);
  color: var(--color-on-surface);
  font: var(--text-body-md);
  font-family: var(--font-display);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--color-tertiary); text-decoration: none; transition: color 140ms ease; }
a:hover { color: var(--color-accent); }
img { display: block; max-width: 100%; }

::selection { background: var(--color-accent); color: var(--color-neutral); }

/* Scrollbars — dark teal */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-neutral); }
::-webkit-scrollbar-thumb { background: var(--color-secondary); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-gold); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  font: var(--text-label-md);
  border-radius: var(--r-md);
  padding: 8px 14px;
  min-height: var(--btn-h);
  height: var(--btn-h);
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 100ms ease, box-shadow 140ms ease;
  white-space: nowrap;
  user-select: none;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-primary) 55%, var(--brand-antique-gold) 130%);
  color: #171B17;
  box-shadow: 0 2px 10px rgba(242, 196, 129, 0.28);
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 4px 14px rgba(255, 209, 102, 0.36);
}

.btn-gold {
  background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-primary) 55%, var(--brand-antique-gold) 130%);
  color: #171B17;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 0 rgba(0,0,0,.18), 0 2px 10px rgba(242, 196, 129, .32);
  font-weight: 700;
}
.btn-gold:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.2), 0 4px 16px rgba(255, 209, 102, .4);
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-on-surface);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--brand-antique-gold);
}

.btn-ghost {
  background: transparent;
  color: var(--color-tertiary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--color-on-surface);
  border-color: var(--brand-antique-gold);
  background: rgba(242, 196, 129, .07);
}

.btn-link {
  background: transparent;
  color: var(--color-tertiary);
  font: var(--text-body-md);
  border-radius: 0;
  padding: 0;
  height: auto;
  min-height: auto;
}
.btn-link:hover { color: var(--color-accent); }

.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); }

.btn-sm { min-height: 30px; height: 30px; padding: 5px 12px; font: var(--text-label-sm); }
.btn-block { width: 100%; }

/* ============================================================
   Cards / surfaces
   ============================================================ */
.card {
  background: var(--color-surface);
  color: var(--color-on-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--color-border);
  padding: var(--sp-md);
}
.card-raised {
  background: var(--color-secondary);
  color: var(--color-on-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--color-border);
  padding: var(--sp-md);
}

/* ============================================================
   Inputs
   ============================================================ */
.input {
  background: var(--bg-input);
  color: var(--color-on-surface);
  font: var(--text-body-lg);
  font-size: 16px; /* Prevents iOS auto-zoom on input focus */
  border-radius: var(--r-md);
  border: 1px solid var(--color-border);
  padding: 8px 12px;
  height: var(--btn-h);
  min-height: var(--btn-h);
  width: 100%;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: var(--brand-antique-gold);
  background: var(--color-secondary);
  box-shadow: 0 0 0 2px rgba(242, 196, 129, 0.22);
}
.input.invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 2px rgba(255, 100, 107, 0.22);
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font: var(--text-label-sm);
  color: var(--color-tertiary);
  text-transform: none;
  letter-spacing: 0.02em;
}

/* ============================================================
   Chips
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-secondary);
  color: var(--color-tertiary);
  font: var(--text-body-sm);
  font-weight: 500;
  border-radius: var(--r-full);
  padding: 5px 11px;
  white-space: nowrap;
  user-select: none;
  border: 1px solid var(--color-border);
  transition: background-color 140ms ease, color 140ms ease, transform 80ms ease, border-color 140ms ease;
}
.chip:active { transform: scale(0.96); }
.chip.active {
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-primary));
  color: #171B17;
  font-weight: 700;
  border-color: var(--brand-gold);
  box-shadow: 0 2px 8px rgba(242, 196, 129, 0.28);
}
.chip-accent {
  background: var(--brand-gold);
  color: #171B17;
  font-weight: 700;
  border-color: var(--brand-gold);
}
.chip-gold {
  background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-primary) 100%);
  color: #171B17;
  font-weight: 700;
  border-color: var(--brand-antique-gold);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(3, 4, 12, .82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: var(--sp-md);
  animation: fade-in 160ms ease;
}
.modal {
  background: var(--color-surface);
  color: var(--color-on-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-gold);
  padding: var(--sp-md);
  width: min(440px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  animation: modal-pop 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-xs);
  border-bottom: 1px solid var(--color-border-subtle);
}
.modal-title { font: var(--text-headline-sm); font-weight: 700; }

/* ============================================================
   Toast
   ============================================================ */
#toasts {
  position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; left: 14px;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-sm);
  z-index: 300;
  pointer-events: none;
}
.toast {
  background: rgba(1, 45, 50, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--brand-antique-gold);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font: var(--text-body-sm);
  font-weight: 500;
  color: var(--color-on-surface);
  width: min(380px, 100%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  animation: toast-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}
.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-error); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Utilities
   ============================================================ */
.hidden { display: none !important; }
.text-accent { color: var(--color-accent); }
.text-tertiary { color: var(--color-tertiary); }
.text-error { color: var(--color-error); }
.mt-xs { margin-top: var(--sp-xs); }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.row { display: flex; align-items: center; gap: var(--sp-sm); }
.grow { flex: 1; }

/* Gold shine sweep for hero moments */
@keyframes shine {
  from { background-position: 200% center; }
  to { background-position: -200% center; }
}
.gold-text {
  background: linear-gradient(90deg, var(--brand-antique-gold), var(--brand-champagne), var(--brand-primary), var(--brand-antique-gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 4s linear infinite;
  font-weight: 700;
}

/* ---------------------------------------------------------------- tile art ---
   Artwork for a game whose provider ships no image. A single generic
   placeholder made every such game look broken (and the old one still said
   "COMING SOON / 1ON1 NIGHT"), so each tile now carries its own initial over a
   hue derived from the provider: a missing image reads as a deliberate cover,
   and each studio keeps a consistent colour across the app. */
.tile-art {
  position: relative;
  /* matches the composed tile (400x340) so an initials cover and a real
     artwork tile are the same shape in the same grid */
  aspect-ratio: 20 / 17;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(130% 85% at 50% 0%, hsl(var(--h, 168) 52% 24% / 0.95), transparent 72%),
    linear-gradient(158deg, hsl(var(--h, 168) 40% 17%), hsl(var(--h, 168) 52% 7%));
}
.tile-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(242, 196, 129, 0.16) 1px, transparent 1px);
  background-size: 13px 13px;
  opacity: 0.55;
}
.tile-art span {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  color: rgba(242, 196, 129, 0.92);
  text-shadow: 0 3px 22px rgba(242, 196, 129, 0.38);
}
@media (max-width: 600px) {
  .tile-art { aspect-ratio: 20 / 17; }
  .tile-art span { font-size: 26px; }
}

/* ============================================================
   Game tile — corner flags
   ------------------------------------------------------------
   Shared by the lobby grid and the home grids (both pages load
   this file). Vocabulary copied from the reference site: NEW
   ribbon across the top-left corner, RACE / INSTANT chip in the
   top-right. "New" is the curated head of the lineup, not a
   release date — the aggregator ships none.
   ============================================================ */
.tile-flag {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  text-transform: uppercase;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}
.tile-flag-new {
  top: 8px;
  left: -34px;
  width: 112px;
  padding: 4px 0;
  transform: rotate(-45deg);
  background: linear-gradient(180deg, #3ddc74, #1eb257);
  color: #04230e;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.tile-flag-race {
  top: 8px;
  right: 8px;
  padding: 4px 7px;
  border-radius: 5px;
  background: linear-gradient(180deg, #f43f5e, #c8102e);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.tile-flag-instant {
  top: 8px;
  right: 8px;
  padding: 4px 7px;
  border-radius: 5px;
  background: #f6b21b;
  color: #1a1200;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Game tile — typography
   ------------------------------------------------------------
   The reference layout: the title in heavy white type, centred,
   up to two lines, with the studio name in small tracked caps
   underneath. Montserrat is self-hosted (37 KB latin subset; the
   file is variable so one request covers 700 and 800). The rest
   of the app keeps its Excon/system stack — this only dresses the
   game cards, which is where the owner wanted that look.
   ============================================================ */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
.tile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7px 10px 9px;
  min-height: var(--tile-band-h, 0px);
}
/* The band never meets the artwork on a hard line: a 26px strip above it fades
   into the same colour, so the art dissolves into the card instead of ending on
   a pasted edge. On composed tiles that strip is already the flat field, so it
   changes nothing; it earns its keep on provider art that has not been composed
   yet (a game added between catalogue syncs) and on phone layouts where the
   band is absolutely positioned over the bottom of the art. */
.tile-body { position: relative; }
.tile-body::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 100%;
  height: 26px;
  background: linear-gradient(to bottom, transparent, var(--tile-accent, transparent));
  pointer-events: none;
}
.tile-title {
  font-family: var(--font-tile);
  font-weight: 800;
  font-size: var(--tile-title-size, 15px);
  line-height: 1.04;
  letter-spacing: -0.005em;
  color: var(--tile-ink, #ffffff);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
}
.tile-provider {
  font-family: var(--font-tile);
  font-weight: 700;
  font-size: var(--tile-provider-size, 8.5px);
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tile-ink, #ffffff);
  opacity: 0.7;
  text-align: center;
  margin-top: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
