/* ============================================================================
   Luck Vantelo — foundations
   Warm purple / blue identity: deep violet surfaces, bright blue and lilac
   highlights, clean white type, with faint pitch lines as the football layer.
   ========================================================================== */

:root {
  --bg: #120A2A;
  --bg-2: #180F36;
  --surface: #201545;
  --surface-2: #281A55;
  --surface-3: #31215F;
  --stroke: #3A2870;
  --stroke-soft: #2E1F5C;

  --brand: #7C5CFF;
  --brand-2: #4EA8FF;
  --lilac: #9B7BFF;
  --accent: var(--brand);

  --text: #F4F1FF;
  --muted: #B4A9DC;
  --dim: #8577B8;

  --good: #56E0B4;
  --bad: #FF6BC4;
  --gold: #FFE08A;
  --warm: #FFB35C;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --pad: 16px;
  --gap: 12px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --shadow: 0 12px 32px rgba(8, 4, 24, 0.55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  /* Deep violet ground with two soft light sources and faint pitch lines. */
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(124, 92, 255, 0.30), transparent 60%),
    radial-gradient(90% 55% at 85% 8%, rgba(78, 168, 255, 0.16), transparent 62%),
    linear-gradient(180deg, #1A1038 0%, #140B2E 42%, #0E0722 100%);
  background-attachment: fixed;
}

/* The football layer: a halfway line and centre circle, barely visible. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(to bottom, transparent calc(50% - 1px), rgba(255, 255, 255, 0.035) 50%, transparent calc(50% + 1px)),
    radial-gradient(circle at 50% 50%, transparent 88px, rgba(255, 255, 255, 0.035) 89px, rgba(255, 255, 255, 0.035) 90px, transparent 91px);
}

.app {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* --- screen shell --------------------------------------------------------- */

/* A screen is visible the moment it is in the DOM. Nothing animates the screen
   root: an entrance that fades or slides the whole screen leaves it invisible or
   displaced whenever the browser pauses animations and frame callbacks, which is
   exactly what happens to a backgrounded tab and inside a paused compositor.
   Motion lives on individual elements instead, where a frozen animation can
   never hide a whole screen. */
.screen {
  min-height: 100%;
  opacity: 1;
  transform: none;
}

.screen__body {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 10px) var(--pad) calc(var(--safe-bottom) + 32px);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.screen__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 6px;
}
.screen__headtext { flex: 1; min-width: 0; }
.screen__title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.screen__sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* --- primitives ------------------------------------------------------------ */

.ico { display: block; fill: currentColor; }

.iconbtn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--stroke-soft);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.iconbtn:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.12); }

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-lg);
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card__title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.muted { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.footnote { margin: 6px 0 0; color: var(--dim); font-size: 11.5px; text-align: center; line-height: 1.5; }
.empty { margin: 24px 0; color: var(--dim); font-size: 13.5px; text-align: center; }

.sectionhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.sectionhead__t { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }

.linkbtn {
  border: 0;
  background: rgba(255, 255, 255, 0.07);
  color: var(--brand-2);
  font: 600 12px var(--font);
  /* Kept at 34px so it stays a comfortable tap target on a phone. */
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
}

/* --- buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-md);
  font: 700 15px var(--font);
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.btn--wide { width: 100%; }
.btn:active { transform: scale(0.985); filter: brightness(1.08); }
.btn__ico { display: grid; place-items: center; }

.btn--primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 10px 22px rgba(124, 92, 255, 0.32);
}
.btn--secondary {
  background: var(--surface-3);
  border: 1px solid var(--stroke);
}
.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  min-height: 46px;
  font-weight: 600;
}
.btn--danger {
  background: linear-gradient(135deg, #FF6BC4, #C0399A);
  box-shadow: 0 10px 22px rgba(255, 107, 196, 0.24);
}
.btn.is-disabled { opacity: 0.45; pointer-events: none; }

/* --- rows and lists --------------------------------------------------------- */

.list { display: flex; flex-direction: column; gap: 10px; }
.list--tight { gap: 8px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.row:active { transform: scale(0.99); border-color: var(--stroke); }
.row.is-locked { opacity: 0.55; }
.row.is-done { border-color: rgba(86, 224, 180, 0.35); }
.row.is-hot { border-color: rgba(255, 224, 138, 0.5); }
.row.is-you { border-color: var(--brand); background: linear-gradient(180deg, #33236B, #241857); }

.row__ico {
  --puck: var(--brand);
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--puck);
  background: color-mix(in srgb, var(--puck) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--puck) 34%, transparent);
}
.row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row__title { font-size: 14.5px; font-weight: 700; }
.row__sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.row__trail { text-align: right; flex: 0 0 auto; }
.row__value { font-size: 14px; font-weight: 800; }
.row__vlabel { font-size: 10.5px; color: var(--dim); }
.row__chev, .row__lock { flex: 0 0 auto; color: var(--dim); display: grid; place-items: center; }

.row--toggle, .row--slider { cursor: pointer; }
.row--slider .row__body { gap: 8px; }

.bullet { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.5; }
.bullet__dot { color: var(--accent); flex: 0 0 auto; margin-top: 1px; }

.bullets { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.bullets li { margin-bottom: 6px; }

/* --- switch and slider ------------------------------------------------------ */

.switch {
  --accent: var(--brand);
  flex: 0 0 auto;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  transition: background 0.18s ease;
}
.switch.is-on { background: var(--accent); }
.switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s cubic-bezier(0.3, 0.9, 0.3, 1);
}
.switch.is-on .switch__knob { transform: translateX(19px); }

.slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-2);
  border: 3px solid #fff;
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-2); border: 3px solid #fff; cursor: pointer;
}
.slider__value { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 34px; text-align: right; }

/* --- bars, chips, stats ------------------------------------------------------ */

.bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
}
.bar--thick { height: 9px; }
.bar__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--stroke-soft);
  font-size: 12.5px;
  font-weight: 700;
}
.chip--coin { color: var(--gold); }
.chip--gem { color: var(--brand-2); }
.chip--star { color: var(--warm); }
.chip__val { color: var(--text); }
.chip__ico { display: grid; place-items: center; }

.wallet { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  --pill: var(--brand);
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--pill);
  background: color-mix(in srgb, var(--pill) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill) 32%, transparent);
  cursor: default;
}
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.chiprow--tabs .pill { cursor: pointer; }
.chiprow--tabs .pill.is-on { color: #fff; }

.kitchip {
  --accent: var(--brand);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat__value { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.stat__label { font-size: 11px; color: var(--dim); }

.statgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.careersum__row { display: flex; gap: 12px; }
.careersum__row .stat { flex: 1; }

.starrow { display: inline-flex; gap: 3px; }
.starrow__s { color: rgba(255, 255, 255, 0.18); display: grid; place-items: center; }
.starrow__s.is-on { color: var(--gold); filter: drop-shadow(0 2px 6px rgba(255, 224, 138, 0.4)); }

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

.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.kv--row dd { color: var(--muted); font-weight: 500; }

.tilechip {
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}
.tilechip.is-dim { filter: grayscale(1) brightness(0.42); }

.ranklet { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ranklet__name { font-size: 10.5px; color: var(--muted); }

.rewards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rewards__i {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 800;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--stroke-soft);
}
.rewards__i--coin { color: var(--gold); }
.rewards__i--gem { color: var(--brand-2); }
.rewards__i--xp { color: var(--good); }
.rewards__i--boost { color: var(--lilac); }

/* --- toast and modal --------------------------------------------------------- */

.toast-host {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--safe-bottom) + 18px);
  z-index: 60;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(20, 11, 46, 0.96);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-in { opacity: 1; transform: none; }
.toast--good { border-color: rgba(86, 224, 180, 0.5); color: var(--good); }
.toast--bad { border-color: rgba(255, 107, 196, 0.5); color: var(--bad); }
.toast__text { color: var(--text); }
.toast--good .toast__text, .toast--bad .toast__text { color: var(--text); }

.modal-host { position: fixed; inset: 0; z-index: 70; display: none; }
.modal-host.is-open { display: block; }
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 24, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.scrim.is-in { opacity: 1; }
.sheet {
  width: 100%;
  max-width: 520px;
  margin: 16px;
  margin-bottom: calc(var(--safe-bottom) + 16px);
  padding: 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  transform: translateY(14px);
  transition: transform 0.22s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.scrim.is-in .sheet { transform: none; }
.sheet__title { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.sheet__body { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.sheet__actions { display: flex; flex-direction: column; gap: 8px; }

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