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

:root {
  --bg: #121212;          /* surface_bg */
  --surface: #1e1e1e;     /* surface_card */
  --surface2: #2a2a2a;    /* surface_elevated */
  --border: #333333;      /* surface_divider */
  --text: #f5f5f5;
  --text2: #9e9e9e;       /* view_text_secondary */
  --accent: #ff5722;      /* scan_accent */
  --accent-dark: #bf360c;
  --gold: #ffb300;        /* CP / section-title gold */
  --success: #00c853;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Screens ───────────────────────────────────────────────────────────────── */

.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* ── Sign-in ────────────────────────────────────────────────────────────────── */

#screen-signin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.signin-box {
  text-align: center;
  padding: 2.5rem;
  background: var(--surface);
  border-radius: 16px;
  width: 340px;
}

.logo {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.tagline {
  color: var(--text2);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

#google-btn-container {
  display: flex;
  justify-content: center;
}

.signin-error {
  margin-top: 1rem;
  color: #f87171;
  font-size: 0.85rem;
}

/* "or" divider between Google and passkey sign-in. */
.signin-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0;
  color: var(--text2);
  font-size: 0.8rem;
}
.signin-or::before,
.signin-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.passkey-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.passkey-btn:hover { border-color: var(--text2); background: var(--surface); }

/* ── Header ─────────────────────────────────────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.count-badge {
  font-size: 0.8rem;
  color: var(--text2);
}

.btn-signout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.15s, border-color 0.15s;
}
.btn-signout:hover { color: var(--text); border-color: var(--text2); }

/* ── Toolbar ────────────────────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.search-input,
.select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
}
.search-input { flex: 1; min-width: 160px; }
.select { cursor: pointer; }
.search-input:focus, .select:focus { border-color: #6b7280; }

/* ── Status bar ──────────────────────────────────────────────────────────────── */

.status {
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text2);
}
.status.error { color: #f87171; }

/* ── Grid ───────────────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.5rem 3rem;
}

/* ── Card ───────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid var(--border);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  border-color: var(--surface2);
}

.card-img-wrap {
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
}
.card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  image-rendering: auto;
}
.card-img-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--border);
  opacity: 0.4;
}

.card-body {
  padding: 0.65rem 0.75rem 0.75rem;
}

.card-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-species {
  font-size: 0.72rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.1rem;
}
.card-cp {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.15rem 0;
  color: var(--gold);
}
.card-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.3rem 0;
}
.card-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  margin-top: 0.3rem;
}
.card-level { color: var(--text2); }
.card-iv { font-weight: 600; }

.card-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.35rem;
}

/* ── Type badges ────────────────────────────────────────────────────────────── */

.type-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  letter-spacing: 0.02em;
}

/* ── Flag badges ────────────────────────────────────────────────────────────── */

.flag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
.flag.shiny    { background: #78350f; color: #fcd34d; }
.flag.lucky    { background: #14532d; color: #86efac; }
.flag.shadow   { background: #312e81; color: #c4b5fd; }
.flag.purified { background: #1e3a5f; color: #93c5fd; }
.flag.dynamax  { background: #7f1d1d; color: #fca5a5; }
.flag.gigantamax { background: #4c1d95; color: #d8b4fe; }
.flag.bff      { background: #831843; color: #fbcfe8; }
.flag.xxl      { background: #1c1917; color: #d6d3d1; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}
.modal-close:hover { color: var(--text); }

/* ── Detail content ─────────────────────────────────────────────────────────── */

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.detail-img-wrap {
  width: 100px;
  height: 100px;
  background: var(--surface2);
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.detail-info { flex: 1; }
.detail-name {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}
.detail-species {
  font-size: 0.82rem;
  color: var(--text2);
  margin-bottom: 0.4rem;
}
.detail-types { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0; }
.detail-flags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.35rem; }

.detail-stats {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.stat-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.stat-row + .stat-row { border-top: 1px solid var(--border); }
.stat-label { color: var(--text2); font-size: 0.82rem; min-width: 48px; }
.stat-value { font-weight: 700; font-size: 1rem; }
.iv-breakdown { font-size: 0.78rem; color: var(--text2); margin-left: auto; }

.detail-moves { margin-bottom: 1rem; }
.moves-label { font-size: 0.75rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.move-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.move {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 500;
}
.move.fast { background: #1e3a5f; color: #93c5fd; }
.move.charged { background: #1f2937; border: 1px solid var(--border); color: var(--text); }

.detail-catch {
  font-size: 0.82rem;
  color: var(--text2);
  margin-bottom: 1rem;
}
.catch-location { font-weight: 500; color: var(--text); }

.detail-base-stats { margin-top: 0.5rem; }
.base-stat-label { font-size: 0.75rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.base-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.2rem 0;
  color: var(--text2);
}
.base-stat-row span:last-child { color: var(--text); font-weight: 600; }

/* ── Tabs & bottom nav ──────────────────────────────────────────────────────── */

.tab-panel { padding-bottom: 4.5rem; }   /* clear the fixed bottom nav */

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.nav-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 0.85rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-top: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-btn.active { color: var(--accent); border-top-color: var(--accent); }
.nav-btn:hover { color: var(--text); }

.num-input {
  width: 92px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */

.btn {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, border-color 0.15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface2); }
.btn-danger { background: #7f1d1d; border-color: #991b1b; color: #fecaca; }
.btn-tiny { padding: 0.2rem 0.5rem; font-size: 0.72rem; }

.muted { color: var(--text2); font-size: 0.85rem; }
.error { color: #f87171; font-size: 0.9rem; }

/* ── Modal actions / edit form ──────────────────────────────────────────────── */

.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.25rem; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1rem; }
.flag.tag { background: var(--surface2); color: var(--text); }

.edit-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.edit-form { display: flex; flex-direction: column; gap: 0.7rem; }
.edit-row { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--text2); }
.edit-field {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}
.edit-field:focus { border-color: #6b7280; }
.iv-inputs { display: flex; gap: 0.5rem; }
.iv-inputs .edit-field { width: 100%; }
.edit-flags { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem; margin-top: 0.3rem; }
.flag-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text); }

/* ── Toast ──────────────────────────────────────────────────────────────────── */

#toast {
  position: fixed;
  bottom: 5rem; left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: var(--surface2);
  color: var(--text);
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-left: 3px solid #4ade80; }
#toast.error { border-left: 3px solid #f87171; }

/* ── Pokédex list ───────────────────────────────────────────────────────────── */

.dex-count { color: var(--text2); font-size: 0.8rem; align-self: center; }
.dex-list { padding: 0.5rem 1.5rem 3rem; max-width: 720px; margin: 0 auto; }
.dex-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.dex-row:hover { background: var(--surface); }
.dex-num { color: var(--text2); font-size: 0.78rem; width: 44px; flex-shrink: 0; }
.dex-thumb { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.dex-name { font-weight: 600; flex: 1; }
.dex-types { display: flex; gap: 0.25rem; }

/* ── Pokédex detail ─────────────────────────────────────────────────────────── */

.dex-section { margin-top: 1rem; }
.dex-section-title {
  font-size: 0.75rem; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.06em; margin: 0.6rem 0 0.4rem;
}
.move.elite { background: #422006; color: #fcd34d; }
.evo-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.evo-chip {
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.3rem 0.6rem; cursor: pointer; color: var(--text);
  font-size: 0.82rem;
}
.evo-chip img { width: 28px; height: 28px; object-fit: contain; }
.evo-chip:hover { filter: brightness(1.2); }

.pvp-row { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.8rem; padding: 0.25rem 0; border-top: 1px solid var(--border); }
.pvp-league { width: 54px; color: var(--text2); }
.pvp-rank { font-weight: 700; width: 60px; }
.pvp-score { color: var(--text2); width: 44px; }
.pvp-moves { flex: 1; color: var(--text2); font-size: 0.74rem; }

.matchup-label { font-size: 0.72rem; color: var(--text2); margin: 0.4rem 0 0.2rem; }
.matchup-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.matchup { display: inline-flex; align-items: center; gap: 0.15rem; }
.matchup small { color: var(--text2); font-size: 0.66rem; }

/* ── Battles ────────────────────────────────────────────────────────────────── */

.battles-engine { padding: 0.6rem 1.5rem 0; }
.card-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 1.5rem;
  padding: 1rem 1.25rem;
}
.block-title { font-size: 0.95rem; font-weight: 700; color: var(--gold); margin-bottom: 0.75rem; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; }
.config-grid label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; color: var(--text2); }

.counter-controls, .result-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.85rem; }
.counter-results, .result-output { overflow-x: auto; }

.rank-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.rank-table th { text-align: left; color: var(--text2); font-weight: 600; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.rank-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); }
.rank-table tr.recommended { background: rgba(74,222,128,0.12); }
.moves-cell { color: var(--text2); font-size: 0.75rem; }

.team-list { display: flex; flex-direction: column; gap: 0.4rem; }
.team-member { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; background: var(--surface2); border-radius: 8px; padding: 0.5rem 0.75rem; }
.tm-name { font-weight: 600; }
.tm-moves { color: var(--text2); font-size: 0.75rem; flex: 1; min-width: 120px; }
.tm-flag { display: flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: var(--text2); }

.result-headline { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; display: flex; align-items: baseline; gap: 0.6rem; }
.result-headline span { font-size: 0.85rem; font-weight: 500; color: var(--text2); }
.result-headline.win { color: #4ade80; }
.result-headline.loss { color: #f87171; }
.mc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0.75rem; }
.mc-stat { display: flex; flex-direction: column; align-items: center; background: var(--surface2); border-radius: 8px; padding: 0.75rem; gap: 0.2rem; font-size: 0.72rem; color: var(--text2); }
.mc-val { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.sweep-note { margin-top: 0.6rem; font-size: 0.85rem; color: var(--text2); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .toolbar { padding: 0.75rem 1rem; }
  .grid { padding: 1rem 1rem 3rem; gap: 0.75rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .card-block { margin: 0.75rem 1rem; }
  .dex-list { padding: 0.5rem 1rem 3rem; }
  .edit-flags { grid-template-columns: 1fr; }
  .profile-card { padding: 1.5rem 1rem; }
  .profile-name { font-size: 1.4rem; }
  .phl-stage { width: 144px; height: 144px; }
  .phl-img { width: 126px; height: 126px; }
}

/* ── Public profile page (/t/<code>) ── */
.muted { color: var(--text2); }
.small { font-size: 0.85rem; }

.profile-wrap {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.profile-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* Identity block */
.profile-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.15);
}
.profile-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.profile-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.profile-level-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 179, 0, 0.12);
  border: 1px solid rgba(255, 179, 0, 0.3);
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  letter-spacing: 0.02em;
}
.profile-since { font-size: 0.85rem; color: var(--text2); }

/* Stats dashboard */
.profile-stats {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.pstat {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: var(--surface2);
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
}
.pstat-val { font-size: 1.35rem; font-weight: 800; color: var(--text); }
.pstat-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Highlight (showcase) Pokémon — the hero of the page */
.phl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
  padding: 1.5rem 1rem 1.25rem;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--type) 22%, transparent), transparent 70%),
    var(--bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--type);
  border-radius: var(--radius);
  overflow: hidden;
}
.phl-eyebrow {
  position: absolute;
  top: 0.7rem;
  left: 0.85rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text2);
}
.phl-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 218px;
  height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--type) 40%, transparent), transparent 65%);
}
.phl-img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  border-radius: 10px;
}
.phl-name { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.phl-species { font-size: 0.8rem; color: var(--text2); margin-top: -0.25rem; }
.phl-cp { font-size: 1.05rem; font-weight: 800; color: var(--gold); }
.phl-types, .phl-flags, .phl-moves {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
}
.phl-moves { margin-top: 0.15rem; }
.phl-stats {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.phl-iv { font-weight: 800; }

/* Friend-code QR */
.profile-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
}
.profile-qr svg {
  width: 148px;
  height: 148px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.profile-qr-caption { font-size: 0.78rem; color: var(--text2); }
.profile-friendcode {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
}

.btn-primary {
  margin-top: 1rem;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: translateY(1px); }

/* "Get the app" footer */
.profile-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.profile-footer-link {
  font-size: 0.8rem;
  color: var(--text2);
  text-decoration: none;
}
.profile-footer-link strong { color: var(--accent); }
.profile-footer-link:hover { color: var(--text); }
