/*
 * LiveList hosting styles.
 * Light/dark tokens mirror free standard themes in the Flutter app
 * (AccentThemePalette.standardLight / standardDark).
 */

:root,
[data-theme='light'] {
  --bg: #f4efec;
  --bg-accent: #d8ccc5;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --text: #3b2f28;
  --muted: #4a5568;
  --primary: #805774;
  --primary-soft: #c9b5c0;
  --on-primary: #ffffff;
  --secondary: #d8ccc5;
  --on-secondary: #4d3b32;
  --border: #e2e8f0;
  --link: #805774;
  --shadow: rgba(59, 47, 40, 0.12);
  --qr-bg: #ffffff;
  --glow: rgba(128, 87, 116, 0.18);
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #20232a;
  --bg-accent: #1d4044;
  --surface: #171923;
  --surface-elevated: #1e222b;
  --text: #e2e8f0;
  --muted: #a0aec0;
  --primary: #2c7a7b;
  --primary-soft: #3a5c5d;
  --on-primary: #e6fffa;
  --secondary: #1d4044;
  --on-secondary: #b2f5ea;
  --border: #3a4556;
  --link: #81e6d9;
  --shadow: rgba(0, 0, 0, 0.35);
  --qr-bg: #ffffff;
  --glow: rgba(44, 122, 123, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  --page-pad-x: 16px;
  --page-pad-y: 20px;
  --main-pad: 22px 18px;
  --content-max: 40rem;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  min-height: 100vh;
  padding: var(--page-pad-y) var(--page-pad-x) calc(var(--page-pad-y) + 16px);
  padding-left: max(var(--page-pad-x), env(safe-area-inset-left));
  padding-right: max(var(--page-pad-x), env(safe-area-inset-right));
  padding-bottom: max(calc(var(--page-pad-y) + 16px), env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 1rem;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.is-landing {
  background:
    radial-gradient(120% 80% at 10% -10%, var(--glow), transparent 55%),
    radial-gradient(90% 70% at 100% 0%, var(--bg-accent), transparent 50%),
    var(--bg);
}

.page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 18px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.2;
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: block;
  flex-shrink: 0;
}

body.is-landing .brand-logo {
  width: 42px;
  height: 42px;
}

nav.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.95rem;
}

nav a {
  color: var(--link);
  text-decoration: none;
  padding: 4px 0;
}

nav a:hover,
nav a[aria-current='page'] {
  text-decoration: underline;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.85rem;
}

.lang-switch a {
  color: var(--muted);
  text-decoration: none;
  padding: 2px 0;
}

.lang-switch a:hover {
  color: var(--link);
  text-decoration: underline;
}

.lang-switch a[aria-current='true'] {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px var(--shadow);
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--primary-soft);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme='light'] .theme-toggle .icon-sun,
[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}

main.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--main-pad);
  box-shadow: 0 10px 28px var(--shadow);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

body.is-landing main.card {
  padding: 28px 20px;
  box-shadow:
    0 18px 40px var(--shadow),
    0 0 0 1px color-mix(in srgb, var(--primary-soft) 35%, transparent);
}

body.page-legal main.card {
  box-shadow: 0 6px 18px var(--shadow);
}

h1 {
  font-size: 1.45rem;
  margin: 0 0 8px;
  line-height: 1.25;
}

h2 {
  font-size: 1.08rem;
  margin: 22px 0 8px;
  line-height: 1.3;
}

p,
ul {
  margin: 0 0 12px;
}

ul {
  padding-left: 1.15rem;
}

li {
  margin-bottom: 6px;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

a {
  color: var(--link);
}

footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.875rem;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--link);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Landing hero */
.hero-mark {
  display: flex;
  justify-content: center;
  margin: 0 auto 14px;
}

.hero-mark img {
  width: 88px;
  height: 88px;
  display: block;
  filter: drop-shadow(0 8px 16px var(--shadow));
}

body.is-landing .hero h1 {
  text-align: center;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero > p.lead {
  text-align: center;
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.actions a {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}

.actions a:hover {
  transform: translateY(-1px);
}

.actions a.primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 18px var(--glow);
}

.actions a.secondary {
  background: color-mix(in srgb, var(--secondary) 75%, var(--surface));
  color: var(--on-secondary);
}

.operator {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Store QR section (landing only) */
.store-section {
  margin-top: 22px;
}

.store-section h2 {
  text-align: center;
  font-size: 1.2rem;
  margin: 0 0 6px;
}

.store-section .store-lead {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.store-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 28rem;
  margin: 0 auto;
  justify-items: stretch;
}

.store-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 12px;
  box-shadow: 0 10px 24px var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.store-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-soft);
  box-shadow: 0 16px 32px var(--shadow);
}

.store-card .qr {
  width: min(128px, 100%);
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 14px;
  background: var(--qr-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.store-card .qr img {
  display: block;
  width: 100%;
  height: 100%;
}

.store-badge {
  display: block;
  height: 40px;
  width: auto;
  max-width: 100%;
}

.store-badge-google {
  /* Official Play badge PNG includes generous transparent padding */
  height: 58px;
  margin: -8px 0;
}

@media (min-width: 768px) {
  body {
    --page-pad-x: 32px;
    --page-pad-y: 40px;
    --main-pad: 36px 40px;
    --content-max: 45rem;
    font-size: 1.02rem;
    line-height: 1.6;
  }

  body.is-landing {
    --content-max: 48rem;
  }

  header {
    margin-bottom: 24px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  body.is-landing .brand-logo {
    width: 46px;
    height: 46px;
  }

  nav.legal-nav {
    gap: 12px 18px;
    font-size: 0.98rem;
  }

  .lang-switch {
    font-size: 0.9rem;
    gap: 8px 12px;
  }

  body.is-landing main.card {
    padding: 40px 44px;
  }

  h1 {
    font-size: 1.75rem;
  }

  body.is-landing .hero h1 {
    font-size: 2.25rem;
  }

  .hero > p.lead {
    font-size: 1.1rem;
  }

  h2 {
    font-size: 1.18rem;
    margin: 28px 0 10px;
  }

  .meta {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }

  footer {
    margin-top: 24px;
    font-size: 0.9rem;
  }

  .hero-mark img {
    width: 104px;
    height: 104px;
  }

  .actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 26px;
  }

  .actions a {
    display: inline-block;
    width: auto;
    min-width: 10.5rem;
    padding: 12px 20px;
  }

  .store-section {
    margin-top: 28px;
  }

  .store-grid {
    max-width: 36rem;
    gap: 16px;
  }

  .store-card {
    padding: 18px 16px;
  }

  .store-card .qr {
    width: 148px;
  }

  .store-badge {
    height: 40px;
  }

  .store-badge-google {
    height: 60px;
  }
}
