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

/* Hide scrollbar visually but keep scroll functionality */
html {
  overflow-y: scroll;
  scrollbar-width: none; /* Firefox */
}
html::-webkit-scrollbar { display: none; /* Chrome, Safari, Edge */ }

:root {
  --ink:    #1a1a2e;
  --slate:  #2d3561;
  --steel:  #445084;
  --silver: #8892b0;
  --mist:   #f0f2f8;
  --cloud:  #e8ebf4;
  --white:  #ffffff;
  --rule:   #c5cade;
  --accent: #6b80c4;
  --accent2: #6b80c4;
  --t1: #2e6b4f;
  --t2: #3d7a3d;
  --t3: #7a6b1a;
  --t4: #8b4513;
  --t5: #7a1f1f;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(26,26,46,0.10);
  --shadow-lg: 0 8px 32px rgba(26,26,46,0.16);
}

/* ── Guild Themes ── */
/* All themes share the same neutral base. Only --accent (primary guild color),
   --accent2 (secondary guild color), and the nav bar change per guild. */

/* Azorius: White + Blue */
[data-theme="azorius"] { --accent: #1a5cc8; --accent2: #c8b040; }
[data-theme="azorius"] nav { background: #0f2850; border-bottom: 4px solid #c8b040; }

/* Dimir: Blue + Black */
[data-theme="dimir"] { --accent: #4838a0; --accent2: #2a2a40; }
[data-theme="dimir"] nav { background: #12102e; border-bottom: 4px solid #4838a0; }

/* Rakdos: Black + Red */
[data-theme="rakdos"] { --accent: #c41828; --accent2: #2a1a1a; }
[data-theme="rakdos"] nav { background: #1e0a0e; border-bottom: 4px solid #c41828; }

/* Gruul: Red + Green */
[data-theme="gruul"] { --accent: #c85010; --accent2: #38801a; }
[data-theme="gruul"] nav { background: #1a1008; border-bottom: 4px solid #38801a; }

/* Selesnya: Green + White */
[data-theme="selesnya"] { --accent: #2e8818; --accent2: #c8b840; }
[data-theme="selesnya"] nav { background: #122810; border-bottom: 4px solid #c8b840; }

/* Orzhov: White + Black */
[data-theme="orzhov"] { --accent: #8a7a50; --accent2: #2a2a2a; }
[data-theme="orzhov"] nav { background: #161616; border-bottom: 4px solid #8a7a50; }

/* Izzet: Blue + Red */
[data-theme="izzet"] { --accent: #3030c0; --accent2: #d03020; }
[data-theme="izzet"] nav { background: #141030; border-bottom: 4px solid #d03020; }

/* Golgari: Black + Green */
[data-theme="golgari"] { --accent: #4a7018; --accent2: #2a2818; }
[data-theme="golgari"] nav { background: #101408; border-bottom: 4px solid #4a7018; }

/* Boros: Red + White */
[data-theme="boros"] { --accent: #c83020; --accent2: #d0a020; }
[data-theme="boros"] nav { background: #201008; border-bottom: 4px solid #d0a020; }

/* Simic: Green + Blue */
[data-theme="simic"] { --accent: #10887a; --accent2: #2060a0; }
[data-theme="simic"] nav { background: #081e22; border-bottom: 4px solid #2060a0; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--mist);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.15s ease;
}
body.ready { opacity: 1; }


/* ── Nav ── */
nav {
  background: var(--ink);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 58px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
  gap: 0.25rem;
  flex-wrap: nowrap;
}
.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  text-decoration: none;
  margin-right: 1.5rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.nav-brand .brand-sub { color: var(--silver); font-weight: 400; font-size: 0.8rem; }
.nav-links {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0.25rem;
}
nav a.nav-link {
  color: #a0aec8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 0.85rem;
  height: 58px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
nav a.nav-link:hover { color: var(--white); }
nav a.nav-link.active { color: var(--white); border-bottom-color: var(--accent2); }
.nav-spacer { flex: 1; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--silver);
}
.nav-user strong { color: var(--white); }
.btn-nav {
  background: var(--slate);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-nav:hover { background: var(--steel); }

/* ── Nav Groups (desktop dropdowns) ── */
.nav-group {
  position: relative;
}
.nav-group-label {
  color: #a0aec8;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 0.85rem;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-group-label:hover { color: var(--white); }
.nav-group-label.active { color: var(--white); border-bottom-color: var(--accent2); }
.nav-group-label .chevron {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.2s;
}
.nav-group.open .nav-group-label .chevron,
.nav-group:hover .nav-group-label .chevron { transform: rotate(180deg); }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--ink);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 0.35rem 0;
  z-index: 110;
}
.nav-group:hover .nav-dropdown,
.nav-group.open .nav-dropdown { display: block; }
.nav-dropdown a.nav-link {
  height: auto;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  border-bottom: none;
}
.nav-dropdown a.nav-link:hover { background: rgba(255,255,255,0.08); }
.nav-dropdown a.nav-link.active {
  color: var(--white);
  border-bottom: none;
  background: rgba(255,255,255,0.06);
  border-left: 3px solid var(--accent2);
}

/* ── Hamburger (hidden on desktop) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
  z-index: 110;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Page layout ── */
main { flex: 1; padding: 2.5rem 2rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}
.page-sub {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  color: var(--silver);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}

/* ── Forms ── */
.form-row { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 180px; }
label { font-size: 0.78rem; font-weight: 600; color: var(--steel); text-transform: uppercase; letter-spacing: 0.05em; }
input, select, textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--mist);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107,128,196,0.15);
  background: var(--white);
}
select { cursor: pointer; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  user-select: none;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px) scale(0.98); opacity: 0.88; transition: none; }
.btn-primary { background: var(--slate); color: var(--white); }
.btn-primary:hover { background: var(--steel); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { background: var(--ink); transform: translateY(1px); box-shadow: none; opacity: 1; }
.btn-ghost { background: transparent; color: var(--steel); border: 1.5px solid var(--rule); }
.btn-ghost:hover { border-color: var(--slate); color: var(--slate); }
.btn-ghost:active { background: var(--mist); transform: translateY(1px); }
.btn-danger { background: #c0392b; color: var(--white); }
.btn-danger:hover { background: #a93226; }
.btn-danger:active { background: #922b21; transform: translateY(1px); opacity: 1; }
.btn-success { background: var(--t1); color: var(--white); }
.btn-success:hover { background: #245a40; }
.btn-success:active { background: #1a3d2f; transform: translateY(1px); opacity: 1; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }

/* ── Tier badge ── */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
}
.tier-1 { background: var(--t1); }
.tier-2 { background: var(--t2); }
.tier-3 { background: var(--t3); }
.tier-4 { background: var(--t4); }
.tier-5 { background: var(--t5); }

/* ── Score display ── */
.score-display {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--ink) 0%, var(--slate) 100%);
  border-radius: var(--radius);
  color: var(--white);
  margin-bottom: 1.5rem;
}
.score-number { font-size: 4rem; font-weight: 700; line-height: 1; color: #c8d4f0; }
.score-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--silver); margin-top: 0.25rem; }
.score-tier { font-size: 1.1rem; font-weight: 600; margin-top: 0.75rem; }

/* ── Category scorer ── */
.category-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.category-row:last-child { border-bottom: none; }
.cat-info {}
.cat-name { font-weight: 700; font-size: 0.95rem; color: var(--slate); }
.cat-weight { font-size: 0.78rem; color: var(--silver); margin-top: 0.15rem; }
.cat-desc {
  font-size: 0.8rem;
  color: var(--silver);
  margin-top: 0.4rem;
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  line-height: 1.5;
  min-height: 2.5rem;
}
.cat-select-wrap select {
  width: 100%;
  background: var(--white);
}

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  background: var(--ink);
  color: var(--white);
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--mist); }
.data-table .own-row td { background: #f0f2ff; }
.data-table .own-row:hover td { background: #e8ebfa; }

/* ── Auth page ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ink) 0%, var(--slate) 100%);
  padding: 2rem;
}
.auth-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo h1 { font-size: 1.6rem; font-weight: 700; color: var(--slate); letter-spacing: -0.02em; }
.auth-logo p { font-family: 'Crimson Pro', serif; font-style: italic; color: var(--silver); margin-top: 0.25rem; }
.auth-tabs { display: flex; margin-bottom: 1.75rem; border-bottom: 1px solid var(--rule); }
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 0.65rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--silver);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.auth-tab.active { color: var(--slate); border-bottom-color: var(--slate); }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form .form-group { min-width: unset; }
.auth-error { background: #fef0f0; border: 1px solid #fca5a5; color: #c0392b; border-radius: var(--radius); padding: 0.65rem 0.85rem; font-size: 0.85rem; display: none; }
.auth-error.show { display: block; }
.auth-success { background: #f0faf4; border: 1px solid #86efac; color: #166534; border-radius: var(--radius); padding: 0.65rem 0.85rem; font-size: 0.85rem; display: none; }
.auth-success.show { display: block; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(120%);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 320px;
}
.toast.show { transform: translateY(0); }
.toast.success { border-left: 4px solid var(--t1); }
.toast.error   { border-left: 4px solid var(--t5); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,26,46,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  transform: translateY(16px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--slate); }
.modal-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--silver); line-height: 1; }
.modal-close:hover { color: var(--ink); }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ── Stat cards ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent2); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--silver); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 0.3rem; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--silver); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-family: 'Crimson Pro', serif; font-style: italic; font-size: 1.05rem; }

/* ── Responsive ── */

/* Tablet */
@media (max-width: 900px) {
  nav a.nav-link { padding: 0 0.5rem; font-size: 0.8rem; }
  .nav-group-label { padding: 0 0.5rem; font-size: 0.8rem; }
  main { padding: 2rem 1.25rem; }
}

/* Mobile */
@media (max-width: 680px) {
  nav {
    padding: 0 1rem;
    height: 54px;
    flex-wrap: wrap;
  }

  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--ink);
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    padding: 0.5rem 0 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 105;
    gap: 0;
    align-items: stretch;
    max-height: calc(100vh - 54px);
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links .nav-spacer { display: none; }

  /* Nav groups become accordion on mobile */
  .nav-group { position: static; }
  .nav-group-label {
    height: auto;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
    justify-content: space-between;
    min-height: 44px;
    border-bottom: none;
    color: var(--white);
    font-weight: 600;
  }
  .nav-group-label.active { border-bottom: none; border-left: 3px solid var(--accent2); background: rgba(255,255,255,0.05); }
  .nav-group:hover .nav-dropdown { display: none; }
  .nav-dropdown {
    position: static;
    min-width: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    background: rgba(255,255,255,0.03);
  }
  .nav-group.open .nav-dropdown { display: block; }
  .nav-dropdown a.nav-link {
    padding: 0.65rem 1.5rem 0.65rem 2.5rem;
    font-size: 0.88rem;
    min-height: 44px;
    border-left: 3px solid transparent;
  }
  .nav-dropdown a.nav-link.active {
    border-left-color: var(--accent2);
    background: rgba(255,255,255,0.05);
  }

  nav > .nav-links > a.nav-link {
    height: auto;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-bottom: none;
    border-left: 3px solid transparent;
    min-height: 44px;
  }
  nav > .nav-links > a.nav-link.active {
    border-bottom: none;
    border-left-color: var(--accent2);
    background: rgba(255,255,255,0.05);
  }

  .nav-links #nav-user-area {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 0.5rem;
  }

  main { padding: 1.25rem 0.75rem; max-width: 100%; }

  .page-title { font-size: 1.35rem; }
  .page-sub { font-size: 0.9rem; margin-bottom: 1.25rem; }

  .card { padding: 1.25rem; margin-bottom: 1rem; }

  .category-row { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .form-group { min-width: 0; }

  /* Tables: horizontal scroll with hint */
  .data-table { font-size: 0.8rem; }
  .data-table th { padding: 0.6rem 0.65rem; font-size: 0.68rem; }
  .data-table td { padding: 0.6rem 0.65rem; }

  /* Stats row */
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.5rem; }

  /* Score display */
  .score-display { padding: 1.5rem 1rem; }
  .score-number { font-size: 2.5rem; }

  /* Auth */
  .auth-card { padding: 1.5rem; }
  .auth-logo h1 { font-size: 1.3rem; }

  /* Hero */
  .hero { padding: 2rem 1.25rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.95rem; }

  /* Feature grid */
  .feature-grid { grid-template-columns: 1fr; gap: 0.75rem; }

  /* Modal — !important overrides inline max-width on individual modals */
  .modal { padding: 1.25rem; max-width: calc(100vw - 2rem) !important; }
  .modal-header h2 { font-size: 1rem; }

  /* Toast */
  .toast { bottom: 1rem; right: 1rem; left: 1rem; max-width: none; }

  /* Session grid */
  .sessions-grid { grid-template-columns: 1fr; }

  /* Deck scorer sidebar */
  .decks-sidebar { grid-template-columns: 1fr; }

  /* Lineup rows */
  .lineup-row { font-size: 0.8rem; gap: 0.5rem; }

  /* Buttons — 44px minimum touch target */
  .btn { padding: 0.55rem 1rem; font-size: 0.8rem; min-height: 44px; }
  .btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; min-height: 44px; }

  /* Inputs — 44px minimum touch target, full width */
  input, select, textarea { min-height: 44px; width: 100%; }

  /* Inbox items */
  .inbox-item { padding: 0.85rem 0.75rem; gap: 0.65rem; flex-wrap: wrap; }
  .inbox-actions { width: 100%; justify-content: flex-end; }
}


/* ── Page Tooltips (dismissible hints) ── */
.page-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
  background: var(--ink); color: var(--white); border-radius: var(--radius);
  padding: 0.6rem 0.85rem; font-size: 0.8rem; line-height: 1.5;
  box-shadow: var(--shadow-lg); z-index: 100;
  transition: opacity 0.2s;
  display: flex; align-items: flex-start; gap: 0.5rem;
}
.page-tooltip span { flex: 1; }
.page-tooltip-close {
  background: none; border: none; color: var(--silver); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0; flex-shrink: 0;
}
.page-tooltip-close:hover { color: var(--white); }

/* ── Achievement Badges ── */
.achievement-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.1rem 0.4rem; border-radius: 999px; font-size: 0.75rem;
  border: 1.5px solid var(--rule); background: var(--white);
  cursor: default;
}
.achievement-badge.rarity-common   { border-color: var(--rule); }
.achievement-badge.rarity-uncommon { border-color: var(--t2); }
.achievement-badge.rarity-rare     { border-color: var(--accent); }
.achievement-badge.rarity-legendary { border-color: #fbbf24; background: linear-gradient(135deg, #fffbeb, #fef3c7); }

.badge-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}
.badge-item {
  background: var(--white); border: 1.5px solid var(--rule); border-radius: var(--radius);
  padding: 0.85rem; text-align: center; transition: border-color 0.15s, box-shadow 0.15s;
}
.badge-item:hover { box-shadow: var(--shadow); }
.badge-item.locked { opacity: 0.4; filter: grayscale(0.8); }
.badge-item-icon { font-size: 1.5rem; margin-bottom: 0.3rem; }
.badge-item-icon.rarity-common   { }
.badge-item-icon.rarity-uncommon { filter: drop-shadow(0 0 2px var(--t2)); }
.badge-item-icon.rarity-rare     { filter: drop-shadow(0 0 3px var(--accent)); }
.badge-item-icon.rarity-legendary { filter: drop-shadow(0 0 4px #fbbf24); }
.badge-item-name { font-size: 0.82rem; font-weight: 700; color: var(--slate); margin-bottom: 0.15rem; }
.badge-item-desc { font-size: 0.72rem; color: var(--silver); line-height: 1.4; }
.badge-item-date { font-size: 0.68rem; color: var(--silver); margin-top: 0.25rem; font-style: italic; }

@media (max-width: 600px) {
  .tour-tooltip { width: calc(100vw - 24px); }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
}
