/* Shared visual foundation — loaded by index.html, auth.html, dashboard.html, game.html.
   Page-specific rules live in each page's own <style> block, using these tokens/classes. */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:ital,wght@0,400;0,500;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --orange: #E8521A;
  --orange-dk: #B83E10;
  --orange-lt: #FDE8DC;
  --blue: #3B5BDB;
  --bg: #FFF7F2;
  --card: #FFFFFF;
  --text: #1A1010;
  --muted: #7A6060;
  --border: rgba(0,0,0,0.09);
  --radius: 10px;
}

html, body {
  height: 100%; width: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ── Layout ── */
.page {
  display: flex; flex-direction: column;
  min-height: 100dvh;
  max-width: 480px; margin: 0 auto;
  padding: 0 0 env(safe-area-inset-bottom, 12px);
}

/* ── Header ── */
.header {
  text-align: center;
  padding: 14px 16px 10px;
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--border);
}
.header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.55rem; font-weight: 800;
  color: var(--orange); letter-spacing: -0.02em; line-height: 1;
}
.header p { font-size: 0.75rem; color: var(--muted); margin-top: 3px; }
.header-sub {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
}

/* ── Buttons ── */
.btn {
  font-family: 'Syne', sans-serif; font-size: 0.7rem; font-weight: 700;
  padding: 5px 12px; border-radius: 99px; border: none; cursor: pointer;
  transition: background 0.15s, transform 0.1s; -webkit-user-select: none;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.94); }
.btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--muted); }
.btn-ghost:active { background: #f0e8e4; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:active { background: var(--orange-dk); }
.btn-primary:disabled, .btn-large:disabled { background: #ccc; cursor: not-allowed; transform: none; }

.btn-large {
  font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 800;
  padding: 14px; border-radius: 12px; border: none; cursor: pointer; width: 100%;
  background: var(--orange); color: #fff; touch-action: manipulation;
  transition: background 0.15s, transform 0.1s;
}
.btn-large:active { background: var(--orange-dk); transform: scale(0.98); }

/* Google sign-in button */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px; border-radius: 12px; border: 1.5px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 0.92rem; font-weight: 500;
  touch-action: manipulation; transition: background 0.15s, transform 0.1s;
}
.btn-google:active { background: #f5f0ee; transform: scale(0.98); }
.btn-google img { width: 20px; height: 20px; }

/* ── Cards ── */
.card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px;
}

/* ── Bottom sheet / overlay (dialogs) ── */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  align-items: flex-end; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.overlay.open { display: flex; }

.sheet {
  background: #fff; border-radius: 20px 20px 0 0;
  width: 100%; max-width: 480px;
  padding: 20px 20px 28px;
  animation: slide-up 0.25s cubic-bezier(.32,.72,0,1) both;
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-handle {
  width: 36px; height: 4px; background: #ddd; border-radius: 99px;
  margin: 0 auto 16px;
}
.sheet h3 {
  font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700;
  color: var(--orange); margin-bottom: 3px;
}
.sheet p.sub {
  font-size: 0.8rem; color: var(--muted); margin-bottom: 14px;
  line-height: 1.4;
}
.sheet-actions { display: flex; gap: 8px; margin-top: 12px; }
.sheet-actions .btn { flex: 1; padding: 12px; font-size: 0.8rem; border-radius: 12px; }

/* Full-screen overlay variant (used for QR code display) */
.full-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.92);
  flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
}
.full-overlay.open { display: flex; }
.full-overlay-close {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: none;
  color: #fff; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1A1010; color: #fff; border-radius: 99px; padding: 10px 22px;
  font-size: 0.82rem; font-weight: 500;
  transition: transform 0.28s cubic-bezier(.32,.72,0,1), opacity 0.28s;
  opacity: 0; white-space: nowrap; z-index: 999; pointer-events: none;
  max-width: 90vw; text-align: center; white-space: normal;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Spinner ── */
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--orange-lt); border-top-color: var(--orange);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer link ── */
.footer-link {
  text-align: center; padding: 10px 0 6px;
  font-size: 0.7rem; color: var(--muted);
}
.footer-link a { color: var(--muted); text-decoration: underline; opacity: 0.6; }

/* ── App title "g" figure-ground reversal ── */
.title-g {
  color: #FFF7F2;
  background: #E8521A;
  border-radius: 6px;
  padding: 0 6px 3px;
  display: inline;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
