/* Shared design tokens for the WhatTheEmoji platform */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f7f7fb;
  --surface:   #ffffff;
  --surface2:  #f0f0f6;
  --border:    #e2e2ec;
  --text:      #1a1a2e;
  --text2:     #6b6b8a;
  --accent:    #6c5ce7;
  --accent-h:  #5a4bd1;
  --accent-lt: #a29bfe;
  --green:     #00b894;
  --red:       #e17055;
  --orange:    #fdcb6e;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 2px 16px rgba(108,92,231,0.10);
  --shadow-lg: 0 8px 40px rgba(108,92,231,0.16);
  --t:         0.18s ease;
}

body.dark {
  --bg:       #0e0e1a;
  --surface:  #16162a;
  --surface2: #1e1e36;
  --border:   #2a2a44;
  --text:     #f0f0ff;
  --text2:    #8888aa;
  --shadow:   0 2px 16px rgba(0,0,0,0.4);
  --shadow-lg:0 8px 40px rgba(0,0,0,0.5);
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--t), color var(--t);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Shared button base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success  { background: var(--green); color: #fff; }
.btn-success:hover { background: #00a381; }
.btn-full { width: 100%; padding: 14px; font-size: 1rem; }

/* Shared card */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Copy toast */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a2e;
  color: #fff;
  padding: 10px 22px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .safe-bottom { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ── Growth Loop UI ──────────────────────────────────────────────────────── */
.gl-challenge-card {
  padding: 20px;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, rgba(108,92,231,0.08) 0%, rgba(162,155,254,0.04) 100%);
  animation: fadeUp 0.3s ease both;
}
.gl-challenge-header {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 6px;
}
.gl-challenge-target {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}
.gl-challenge-sub {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 4px;
}

.gl-growth-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 4px;
}
.gl-title-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-lt));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 99px;
  width: fit-content;
  letter-spacing: 0.2px;
}
.gl-stat-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(108,92,231,0.08);
  border: 1px solid rgba(108,92,231,0.2);
  padding: 5px 12px;
  border-radius: 99px;
  width: fit-content;
}
.gl-challenge-win {
  font-size: 0.9rem;
  font-weight: 800;
  color: #00b894;
  background: rgba(0,184,148,0.08);
  border: 1px solid rgba(0,184,148,0.25);
  padding: 8px 14px;
  border-radius: 12px;
  text-align: center;
}

.gl-live {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
  padding: 6px 0;
  text-align: center;
}

.gl-streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 99px;
}

.gl-counter-strip {
  display: flex;
  justify-content: center;
  margin: 4px 0 2px;
}

/* ── Shared Title Ladder (all games) ─────────────────────────────────────── */
.title-ladder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 16px;
}
.title-ladder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.title-ladder-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
}
.title-ladder-sub {
  font-size: 0.68rem;
  color: var(--text2);
}
.ladder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-radius: 10px;
  margin-bottom: 2px;
  transition: background var(--t);
}
.ladder-icon  { font-size: 1.2rem; width: 28px; text-align: center; flex-shrink: 0; }
.ladder-name  { flex: 1; font-size: 0.84rem; font-weight: 700; color: var(--text); }
.locked-name  { color: var(--text2); font-weight: 600; }
.ladder-badge { font-size: 0.7rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; white-space: nowrap; flex-shrink: 0; }
.current-badge { background: linear-gradient(135deg,#6c5ce7,#a29bfe); color: #fff; }
.earned-badge  { background: rgba(34,197,94,0.14); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.ladder-hint   { font-size: 0.66rem; color: var(--text2); white-space: nowrap; flex-shrink: 0; }
.ladder-current { background: rgba(108,92,231,0.08); border: 1px solid rgba(108,92,231,0.2); }
.ladder-earned  { background: transparent; }
.ladder-locked  { opacity: 0.7; }
.ladder-locked:hover { opacity: 1; background: var(--surface2); cursor: default; }

/* Homepage profile chip */
.gl-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  cursor: default;
}
