:root {
  --nouryon-blue: #0F2C5F;
  --nouryon-blue-2: #19407D;
  --nouryon-bright: #2E6BCE;
  --nouryon-green: #6CB33F;
  --nouryon-green-2: #4F9426;
  --paper: #F4F6FA;
  --ink: #1B2540;
  --ink-soft: #4A5878;
  --line: rgba(255, 255, 255, 0.12);

  /* Type colors (match infinite explorer) */
  --type-climate: #FFB948;
  --type-eco-premium: #6CB33F;
  --type-safety: #5BC0E8;
  --type-innovation: #B68CE5;
  --type-earth: #4FE0AD;
}

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

html, body {
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
  background: radial-gradient(circle at 20% 20%, #102350 0%, #0A1635 50%, #060E25 100%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 24%, rgba(108, 179, 63, 0.18), transparent 50%),
    radial-gradient(circle at 84% 78%, rgba(46, 107, 206, 0.20), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

.stage {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 24px;
  overflow: hidden;
}

/* ───── HUD ───── */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(6, 14, 37, 0.85) 0%, rgba(6, 14, 37, 0) 100%);
  backdrop-filter: blur(8px);
}
.hud-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.hud-logo { width: 32px; height: 32px; }
.hud-stats { display: flex; gap: 8px; align-items: center; }
.hud-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  font-feature-settings: "tnum";
}
.hud-icon { font-size: 14px; opacity: 0.9; }
.hud-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hud-btn:hover { background: rgba(255, 255, 255, 0.18); }
.hud-btn-city {
  background: linear-gradient(135deg, var(--nouryon-green) 0%, var(--nouryon-green-2) 100%);
  border-color: var(--nouryon-green);
  color: #0B1F45;
  box-shadow: 0 4px 10px rgba(108, 179, 63, 0.32);
}
.hud-btn-city:hover { background: linear-gradient(135deg, var(--nouryon-green) 0%, var(--nouryon-green) 100%); transform: translateY(-1px); }

/* ───── Title scene ───── */
.title-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  max-width: 640px;
}
.title-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.6;
}
.title-headline {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #fff 0%, var(--nouryon-green) 60%, var(--nouryon-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 6px 0 4px;
}
.title-tagline { font-size: 16px; opacity: 0.78; line-height: 1.5; max-width: 480px; }
.title-buttons {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 320px;
  max-width: 100%;
}
.btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--nouryon-green) 0%, var(--nouryon-green-2) 100%);
  border-color: var(--nouryon-green);
  color: #0B1F45;
  box-shadow: 0 14px 30px rgba(108, 179, 63, 0.32);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(108, 179, 63, 0.44); }
.btn-ghost { background: transparent; }
.btn-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.title-foot { margin-top: 18px; font-size: 11px; opacity: 0.45; }

/* ───── Card ───── */
.card {
  width: 240px;
  height: 340px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0E1E47 0%, #0A1635 100%);
  border: 2px solid var(--card-type-color, var(--nouryon-green));
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform-style: preserve-3d;
  transition: transform 0.18s, box-shadow 0.18s;
  flex-shrink: 0;
  cursor: pointer;
}
.card:hover { transform: translateY(-4px) rotate(0.5deg); box-shadow: 0 18px 32px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.10); }
.card-art {
  position: absolute;
  top: 38px;
  left: 8px;
  right: 8px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  background: #0A1635;
}
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-frame-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 30%, var(--card-type-color, transparent) 0%, transparent 50%);
  opacity: 0.18;
}
.card-rarity-3 .card-frame-glow {
  background: linear-gradient(115deg,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0) 70%);
  background-size: 220% 100%;
  animation: foilSlide 3.4s linear infinite;
  opacity: 1;
}
@keyframes foilSlide { from { background-position: 200% 0; } to { background-position: -120% 0; } }
.card-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, var(--card-type-color, var(--nouryon-green)), transparent);
}
.card-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.card-rarity {
  font-size: 11px;
  letter-spacing: 1px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.card-type-badge {
  position: absolute;
  top: 198px;
  left: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #0B1F45;
  background: var(--card-type-color, var(--nouryon-green));
  padding: 3px 8px;
  border-radius: 4px;
}
.card-stats {
  position: absolute;
  top: 222px;
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.card-stat-cell {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card-stat-label { font-size: 8px; letter-spacing: 1.2px; text-transform: uppercase; opacity: 0.55; }
.card-stat-value { font-size: 16px; font-weight: 900; font-feature-settings: "tnum"; color: #fff; }
.card-move {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.card-move-name { font-size: 11px; font-weight: 800; color: var(--card-type-color); letter-spacing: 0.4px; }
.card-move-text { font-size: 9.5px; opacity: 0.78; line-height: 1.3; margin-top: 2px; }

/* Card sizes */
.card-sm { width: 180px; height: 256px; }
.card-sm .card-art { height: 110px; top: 32px; }
.card-sm .card-type-badge { top: 150px; }
.card-sm .card-stats { top: 172px; }
.card-sm .card-stat-value { font-size: 14px; }
.card-sm .card-move { bottom: 8px; padding: 5px 7px; }

/* ───── Encounter / Battle ───── */
.combat-scene {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.combat-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  background: linear-gradient(160deg, rgba(15, 44, 95, 0.55), rgba(8, 18, 38, 0.55));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  min-height: 360px;
}
.combat-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.combat-vs {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 2px;
  opacity: 0.5;
}
.combat-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-align: center;
}
.combat-sub { font-size: 11px; opacity: 0.7; }
.hp-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  overflow: hidden;
}
.hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4FE0AD 0%, var(--nouryon-green) 100%);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.hp-bar-fill.warn { background: linear-gradient(90deg, #FFB948, #FF7A48); }
.hp-bar-fill.critical { background: linear-gradient(90deg, #FF5050, #C92020); }

/* Quiz */
.quiz {
  background: rgba(8, 18, 38, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  backdrop-filter: blur(8px);
}
.quiz-prompt {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  line-height: 1.45;
}
.quiz-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(108, 179, 63, 0.15);
  color: var(--nouryon-green);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 12px;
  display: inline-block;
}
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-option {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: #fff;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.quiz-option:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--nouryon-bright);
  transform: translateY(-1px);
}
.quiz-option.correct {
  background: rgba(108, 179, 63, 0.30);
  border-color: var(--nouryon-green);
  color: #fff;
}
.quiz-option.wrong {
  background: rgba(229, 75, 75, 0.30);
  border-color: #E54B4B;
}
.quiz-option:disabled { cursor: not-allowed; }
.quiz-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}
.quiz-feedback.correct {
  background: rgba(108, 179, 63, 0.12);
  border: 1px solid rgba(108, 179, 63, 0.32);
  color: var(--nouryon-green);
}
.quiz-feedback.wrong {
  background: rgba(229, 75, 75, 0.12);
  border: 1px solid rgba(229, 75, 75, 0.32);
  color: #FF8080;
}

/* Capture vial animation */
.capture-vial {
  width: 80px;
  height: 110px;
  position: relative;
  margin: 0 auto;
}
.capture-vial-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(108, 179, 63, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: vialGlow 2s ease-in-out infinite;
}
@keyframes vialGlow {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.18); opacity: 1; }
}

/* ───── Dex grid ───── */
.dex-scene {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100%;
  overflow-y: auto;
  padding: 8px 4px 0;
}
.dex-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 6px 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dex-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -1.2px;
  background: linear-gradient(135deg, #fff 0%, var(--nouryon-green) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.05;
}
.dex-progress { font-size: 14px; opacity: 0.78; margin-top: 6px; font-weight: 600; }
.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
  align-items: start;
  padding-bottom: 40px;
}
.dex-cell {
  display: flex;
  justify-content: center;
}
.dex-cell .card {
  width: 220px;
  height: 312px;
}
.dex-cell .card-art { height: 138px; top: 36px; }
.dex-cell .card-type-badge { top: 184px; }
.dex-cell .card-stats { top: 208px; }
.dex-cell .card-stat-value { font-size: 16px; }
.dex-cell .card-move { bottom: 10px; padding: 6px 8px; }
.card-locked {
  cursor: default;
  background: linear-gradient(160deg, #0E1E47 0%, #0A1635 100%);
  border-color: rgba(255, 255, 255, 0.08);
}
.card-locked:hover { transform: none; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); }
.card-locked .card-frame-glow { display: none; }
/* Hide all content on locked cards — no leaking the answers */
.card-locked .card-header,
.card-locked .card-art,
.card-locked .card-type-badge,
.card-locked .card-stats,
.card-locked .card-move { visibility: hidden; }
/* Re-show only the rarity stars (a hint at what tier you're missing) */
.card-locked .card-header { visibility: visible; }
.card-locked .card-header .card-title { visibility: hidden; }
.card-locked .card-header { background: transparent; }
.card-locked::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 90px;
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  color: rgba(255, 255, 255, 0.10);
  pointer-events: none;
}
.card-locked::before {
  content: "Undiscovered";
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  pointer-events: none;
}

/* Dex cards: tight inner sizing matched to the larger 220×312 frame */
.dex-cell .card-stats { top: 208px; gap: 4px; }
.dex-cell .card-stat-cell { padding: 4px 6px; }
.dex-cell .card-stat-value { font-size: 16px; }
.dex-cell .card-stat-label { font-size: 8px; letter-spacing: 1.2px; }
.dex-cell .card-move { bottom: 10px; padding: 6px 8px; }
.dex-cell .card-move-name { font-size: 11px; }
.dex-cell .card-move-text {
  font-size: 10px;
  line-height: 1.36;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ───── Trainer hub ───── */
.hub-scene {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
  overflow-y: auto;
  padding: 8px 4px 0;
}
.hub-header {
  text-align: center;
  padding: 6px 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hub-header .dex-title { display: inline-block; }
.hub-subtitle {
  opacity: 0.78;
  font-size: 15px;
  margin-top: 8px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}
.hub-progress {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.85;
  color: var(--nouryon-green);
}
.hub-foot { text-align: center; padding-bottom: 28px; }
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  padding-bottom: 8px;
}
.trainer-card {
  background: linear-gradient(160deg, rgba(15, 44, 95, 0.55), rgba(8, 18, 38, 0.55));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 18px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.trainer-card:hover { transform: translateY(-4px); border-color: var(--nouryon-bright); box-shadow: 0 18px 40px rgba(46, 107, 206, 0.20); }
.trainer-portrait {
  width: 144px;
  height: 144px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--type-color), var(--nouryon-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
  overflow: hidden;
  border: 3px solid var(--type-color);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.trainer-portrait img { width: 100%; height: 100%; object-fit: cover; }
.trainer-name { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.trainer-pillar {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  opacity: 0.78;
  margin-bottom: 10px;
}
.trainer-status {
  font-size: 13px;
  margin-top: 8px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  display: inline-block;
}
.trainer-status.defeated { color: var(--nouryon-green); border-color: rgba(108, 179, 63, 0.45); background: rgba(108, 179, 63, 0.12); }
.trainer-status.locked { color: rgba(255, 255, 255, 0.4); }
.trainer-card.defeated::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--nouryon-green);
  color: #0B1F45;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
}

/* Hand selection for battle */
.hand-select {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px;
}
.hand-select .card {
  transition: all 0.18s;
  width: 150px;
  height: 210px;
}
.hand-select .card.picked {
  border-color: var(--nouryon-green);
  box-shadow: 0 0 0 3px rgba(108, 179, 63, 0.5), 0 14px 28px rgba(0, 0, 0, 0.5);
  transform: translateY(-6px);
}
.hand-select .card-art { height: 88px; top: 28px; }
.hand-select .card-type-badge { top: 122px; font-size: 8px; }
.hand-select .card-stats { top: 142px; gap: 3px; }
.hand-select .card-stat-value { font-size: 12px; }
.hand-select .card-stat-label { font-size: 7px; }
.hand-select .card-move { bottom: 6px; padding: 4px 6px; }
.hand-select .card-move-name { font-size: 9px; }
.hand-select .card-move-text { font-size: 8px; line-height: 1.2; }

/* ───── Toast ───── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: linear-gradient(135deg, var(--nouryon-green), var(--nouryon-green-2));
  color: #fff;
  padding: 12px 20px 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 18px 40px rgba(108, 179, 63, 0.5);
  opacity: 0;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 88vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-emoji { font-size: 20px; }

/* ───── Particle bursts ───── */
.fx-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 220;
}

/* ───── Victory ───── */
.victory-scene {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.victory-trophy {
  font-size: 96px;
  filter: drop-shadow(0 18px 36px rgba(108, 179, 63, 0.5));
  animation: trophyFloat 3.6s ease-in-out infinite;
}
@keyframes trophyFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.victory-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff, var(--nouryon-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.victory-stats {
  display: flex;
  gap: 24px;
  margin: 10px 0;
}
.victory-stat-cell {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 22px;
}
.victory-stat-value {
  font-size: 32px;
  font-weight: 900;
  font-feature-settings: "tnum";
  color: var(--nouryon-green);
}
.victory-stat-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 2px;
}

/* ───── Quiz extras: head bar + hint button + entrance + dimmed options ───── */
.quiz-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.quiz-hint-btn {
  background: linear-gradient(135deg, rgba(255, 185, 72, 0.18), rgba(255, 185, 72, 0.08));
  border: 1px solid rgba(255, 185, 72, 0.45);
  color: #FFE7B0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.quiz-hint-btn:hover { background: linear-gradient(135deg, rgba(255, 185, 72, 0.30), rgba(255, 185, 72, 0.15)); transform: translateY(-1px); }
.quiz-hint-btn.disabled { opacity: 0.4; pointer-events: none; }
.quiz-hint-count {
  background: rgba(255, 185, 72, 0.30);
  padding: 1px 8px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.quiz-option.dimmed {
  opacity: 0.30;
  pointer-events: none;
  filter: grayscale(0.6);
}
.quiz-enter { opacity: 0; transform: translateY(14px); transition: opacity 0.34s ease, transform 0.34s cubic-bezier(0.16, 1, 0.3, 1); }
.quiz-enter-active { opacity: 1; transform: translateY(0); }

/* Scene fade transition */
.scene-fader {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #060E25, #0A1635);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 300;
}
.scene-fader.show { opacity: 1; pointer-events: auto; }

/* ───── Mini-games menu + games ───── */
.minigames-scene { width: 100%; max-width: 880px; display: flex; flex-direction: column; gap: 18px; }
.minigames-header { text-align: center; }
.minigames-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

/* ─── Arcade cabinet card ─── */
.arcade-cabinet {
  position: relative;
  background: linear-gradient(180deg, #0E1E47 0%, #060E25 100%);
  border: 2px solid var(--ac-color, var(--nouryon-green));
  border-radius: 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.18),
    0 18px 30px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: cabinetIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cabinetIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.arcade-cabinet:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.25),
    0 0 32px var(--ac-color, var(--nouryon-green)),
    0 22px 40px rgba(0, 0, 0, 0.55);
}
.arcade-cabinet::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 36px;
  background: var(--ac-color, var(--nouryon-green));
  border-radius: 18px 18px 0 0;
  box-shadow: 0 0 18px var(--ac-color, var(--nouryon-green));
  z-index: 0;
  opacity: 0.85;
}
.arcade-cabinet-screen {
  position: relative;
  height: 110px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 60%),
    linear-gradient(180deg, #061029 0%, #03081C 100%);
  border-bottom: 2px solid var(--ac-color, var(--nouryon-green));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  margin-top: 28px;
  border-radius: 4px 4px 0 0;
  margin-left: 10px;
  margin-right: 10px;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.arcade-cabinet-icon {
  font-size: 56px;
  filter: drop-shadow(0 0 16px var(--ac-color, var(--nouryon-green)));
  z-index: 2;
}
.arcade-cabinet-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}
.arcade-cabinet-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 6px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  animation: cabinetSweep 4s linear infinite;
  pointer-events: none;
}
@keyframes cabinetSweep {
  from { transform: translateY(0); }
  to   { transform: translateY(118px); }
}
.arcade-cabinet-body {
  padding: 14px 16px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.arcade-cabinet-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--ac-color, var(--nouryon-green));
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}
.arcade-cabinet-sub { font-size: 12px; opacity: 0.75; line-height: 1.4; min-height: 32px; }
.arcade-cabinet-stats {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.arcade-best, .arcade-plays {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.arcade-best span, .arcade-plays span { font-size: 8px; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.55; }
.arcade-best b, .arcade-plays b { font-size: 18px; font-weight: 900; font-feature-settings: "tnum"; color: #fff; }
.arcade-best b { color: var(--ac-color, var(--nouryon-green)); text-shadow: 0 0 8px var(--ac-color, var(--nouryon-green)); }
.arcade-cabinet-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 22px;
  margin-top: 4px;
}
.arcade-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.arcade-badge.new    { background: linear-gradient(135deg, #FFB948, #FF7A48); color: #1B2540; }
.arcade-badge.streak { background: rgba(255, 80, 80, 0.20); color: #FF8080; border: 1px solid rgba(255, 80, 80, 0.4); }
.arcade-badge.gold   { background: linear-gradient(135deg, #FFD700, #FFB948); color: #1B2540; }
.arcade-cabinet-cta {
  background: var(--ac-color, var(--nouryon-green));
  color: #0B1F45;
  text-align: center;
  padding: 10px 0;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 2px;
  border-top: 2px solid rgba(255, 255, 255, 0.18);
  transition: filter 0.18s;
}
.arcade-cabinet:hover .arcade-cabinet-cta {
  filter: brightness(1.18);
}

/* ─── Spot the Greenwash ─── */
.mg-greenwash { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 14px; }
.gw-progress { display: flex; gap: 6px; justify-content: center; }
.gw-pip { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); transition: background 0.18s; }
.gw-pip.done { background: var(--nouryon-green); box-shadow: 0 0 8px rgba(108, 179, 63, 0.55); }
.gw-card {
  background: rgba(8, 18, 38, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.gw-prompt { font-size: 14px; font-weight: 700; opacity: 0.85; margin-bottom: 14px; line-height: 1.5; }
.gw-claims { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gw-claim {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--line);
  color: #fff;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
  transition: all 0.15s;
}
.gw-claim:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--nouryon-bright);
  transform: translateY(-1px);
}
.gw-claim:disabled { cursor: not-allowed; }
.gw-claim.gw-fake {
  background: rgba(108, 179, 63, 0.20);
  border-color: var(--nouryon-green);
  box-shadow: 0 0 16px rgba(108, 179, 63, 0.35);
}
.gw-claim.gw-wrong {
  background: rgba(229, 75, 75, 0.18);
  border-color: #E54B4B;
}
.gw-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}
.gw-feedback.correct { background: rgba(108, 179, 63, 0.12); border: 1px solid rgba(108, 179, 63, 0.32); color: var(--nouryon-green); }
.gw-feedback.wrong   { background: rgba(229, 75, 75, 0.12); border: 1px solid rgba(229, 75, 75, 0.32); color: #FF8080; }
.gw-end { text-align: center; }
.gw-actions { display: flex; gap: 10px; justify-content: center; }

/* Old minigame-card shim — keep so older deployments still work */
.minigame-card {
  background: linear-gradient(160deg, rgba(15, 44, 95, 0.55), rgba(8, 18, 38, 0.55));
  border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  display: grid; grid-template-columns: 64px 1fr auto; grid-template-rows: auto auto;
  gap: 4px 16px; align-items: center; text-align: left; color: #fff;
  cursor: pointer; font-family: inherit; transition: all 0.18s;
}
.minigame-card:hover { transform: translateY(-3px); border-color: var(--nouryon-bright); box-shadow: 0 14px 28px rgba(46, 107, 206, 0.32); }
.minigame-icon { grid-row: 1 / span 2; font-size: 38px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--nouryon-blue), var(--nouryon-bright)); border-radius: 14px; width: 64px; height: 64px; }
.minigame-name { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }
.minigame-sub  { font-size: 12px; opacity: 0.7; line-height: 1.4; }
.minigame-arrow { grid-row: 1 / span 2; font-size: 20px; opacity: 0.5; }

.mg-header { text-align: center; }

/* Daily Word */
.mg-word { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.word-board { display: flex; flex-direction: column; gap: 6px; }
.word-row { display: flex; gap: 6px; }
.word-tile { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 26px; letter-spacing: 0.5px;
  border: 2px solid rgba(255, 255, 255, 0.15); border-radius: 8px; text-transform: uppercase; color: #fff; background: transparent; }
.word-tile.filled { border-color: rgba(255, 255, 255, 0.4); }
.word-tile.correct { background: var(--nouryon-green); border-color: var(--nouryon-green); color: #0B1F45; }
.word-tile.present { background: #FFB948; border-color: #FFB948; color: #0B1F45; }
.word-tile.absent { background: rgba(80, 90, 110, 0.55); border-color: rgba(80, 90, 110, 0.55); color: rgba(255,255,255,0.7); }
.word-keyboard { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.word-kb-row { display: flex; gap: 4px; }
.word-key { min-width: 28px; height: 44px; border: none; border-radius: 6px; background: rgba(255, 255, 255, 0.10);
  color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; padding: 0 10px; font-family: inherit; }
.word-key:hover { background: rgba(255, 255, 255, 0.18); }
.word-key-wide { padding: 0 14px; font-size: 11px; letter-spacing: 1px; }
.word-key.correct { background: var(--nouryon-green); color: #0B1F45; }
.word-key.present { background: #FFB948; color: #0B1F45; }
.word-key.absent { background: rgba(80, 90, 110, 0.40); color: rgba(255,255,255,0.5); }
.word-actions { display: flex; gap: 10px; }
.word-status { font-size: 12px; opacity: 0.78; }

/* Pillar Sort */
.mg-grouping { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 14px; }
.grouping-strikes { display: flex; gap: 6px; justify-content: center; }
.grouping-strike { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.grouping-strike.used { background: #E54B4B; box-shadow: 0 0 8px rgba(229, 75, 75, 0.55); }
.grouping-solved { display: flex; flex-direction: column; gap: 6px; }
.grouping-solved-row { padding: 12px 14px; border-radius: 10px; color: #0B1F45; font-weight: 700; }
.grouping-solved-name { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.grouping-solved-items { font-size: 13px; margin-top: 3px; opacity: 0.85; }
.grouping-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grouping-cell { background: rgba(255, 255, 255, 0.06); border: 1.5px solid rgba(255, 255, 255, 0.10);
  color: #fff; padding: 16px 10px; border-radius: 10px; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit; text-align: center; line-height: 1.3; min-height: 64px; transition: all 0.15s; }
.grouping-cell:hover { background: rgba(255, 255, 255, 0.14); }
.grouping-cell.picked { background: var(--nouryon-bright); color: #fff; border-color: var(--nouryon-bright); transform: scale(0.96); }
.grouping-actions { display: flex; gap: 10px; justify-content: center; }

/* Pair Match */
.mg-memory { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 14px; }
.memory-stats { display: flex; gap: 14px; justify-content: center; }
.memory-stat { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); padding: 8px 16px;
  border-radius: 10px; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.memory-stat span { opacity: 0.6; letter-spacing: 1.5px; text-transform: uppercase; font-size: 10px; }
.memory-stat b { font-feature-settings: "tnum"; font-size: 16px; }
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.memory-card { background: transparent; border: none; cursor: pointer; perspective: 800px; aspect-ratio: 1 / 1.25; }
.memory-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.memory-card-inner.flipped { transform: rotateY(180deg); }
.memory-card-back, .memory-card-front { position: absolute; inset: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; backface-visibility: hidden;
  -webkit-backface-visibility: hidden; font-size: 12px; font-weight: 700; text-align: center; padding: 8px; line-height: 1.3; }
.memory-card-back { background: linear-gradient(135deg, var(--nouryon-blue), var(--nouryon-bright));
  border: 2px solid rgba(255, 255, 255, 0.18); }
.memory-card-back::before { content: "?"; font-size: 28px; font-family: 'Space Grotesk', sans-serif; font-weight: 900; color: rgba(255, 255, 255, 0.7); }
.memory-card-front { background: linear-gradient(135deg, var(--nouryon-green), var(--nouryon-green-2));
  color: #0B1F45; transform: rotateY(180deg); border: 2px solid var(--nouryon-green); }
.memory-actions { display: flex; gap: 10px; justify-content: center; }

/* 60s Sprint */
.mg-sprint { width: 100%; max-width: 700px; display: flex; flex-direction: column; gap: 14px; }
.sprint-hud { display: flex; gap: 12px; justify-content: center; }
.sprint-stat { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 18px; text-align: center; min-width: 90px; }
.sprint-stat-label { font-size: 9px; letter-spacing: 1.8px; text-transform: uppercase; opacity: 0.65; }
.sprint-stat-value { font-size: 28px; font-weight: 900; font-feature-settings: "tnum"; color: var(--nouryon-green); }
.sprint-bar { width: 100%; height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; }
.sprint-bar-fill { height: 100%; background: linear-gradient(90deg, var(--nouryon-green), var(--nouryon-bright));
  transition: width 1s linear, background 0.4s; }
.sprint-bar-fill.warn { background: linear-gradient(90deg, #FFB948, #FF7A48); }
.sprint-bar-fill.critical { background: linear-gradient(90deg, #FF5050, #C92020); }
.sprint-question-card { background: rgba(8, 18, 38, 0.7); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.sprint-prompt { font-size: 17px; font-weight: 700; line-height: 1.45; margin-bottom: 16px; }
.sprint-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sprint-option { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: #fff;
  padding: 12px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; text-align: left; transition: all 0.12s; }
.sprint-option:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.sprint-end { text-align: center; }
.sprint-actions { display: flex; gap: 10px; justify-content: center; }

@media (max-width: 720px) {
  .arcade-title { letter-spacing: 6px; }
  .gw-claims { grid-template-columns: 1fr; }
  .arcade-cabinet-screen { height: 90px; }
  .arcade-cabinet-icon { font-size: 44px; }
  .minigames-grid { grid-template-columns: 1fr; }
  .grouping-grid { grid-template-columns: repeat(2, 1fr); }
  .word-tile { width: 44px; height: 44px; font-size: 22px; }
  .word-key { min-width: 24px; height: 40px; font-size: 13px; padding: 0 8px; }
  .sprint-options { grid-template-columns: 1fr; }
  .sprint-stat-value { font-size: 22px; }
  .memory-card-back::before { font-size: 22px; }
  .memory-card-back, .memory-card-front { font-size: 10px; padding: 4px; }
}

/* ───── Briefing scene ───── */
.briefing-scene {
  width: 100%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.briefing-trainer { display: flex; align-items: center; gap: 14px; }
.briefing-trainer-portrait,
.briefing-trainer-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--nouryon-bright);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}
.briefing-trainer-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: linear-gradient(135deg, var(--nouryon-blue), var(--nouryon-bright));
}
.briefing-trainer-name { font-size: 18px; font-weight: 800; letter-spacing: -0.2px; }
.briefing-trainer-pillar {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.65;
  margin-top: 2px;
}
.briefing-quote {
  background: rgba(8, 18, 38, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 14px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}
.briefing-quote.flash { animation: quoteFlash 0.5s ease; }
@keyframes quoteFlash {
  0%   { background: rgba(108, 179, 63, 0.20); }
  100% { background: rgba(8, 18, 38, 0.7); }
}

.cred-bar-wrap {
  background: rgba(8, 18, 38, 0.55);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cred-bar-track {
  position: relative;
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}
.cred-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFB948 0%, var(--nouryon-bright) 60%, var(--nouryon-green) 100%);
  transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s;
  box-shadow: 0 0 12px rgba(108, 179, 63, 0.25);
}
.cred-bar-fill.warn { background: linear-gradient(90deg, #E54B4B 0%, #FFB948 100%); }
.cred-bar-fill.ok   { background: linear-gradient(90deg, var(--nouryon-bright) 0%, var(--nouryon-green) 100%); }
.cred-bar-threshold {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: rgba(255, 255, 255, 0.55);
  z-index: 2;
}
.cred-bar-threshold::after {
  content: "PASS";
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.55);
}
.cred-bar-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.cred-bar-label { color: #fff; }
.cred-bar-label span {
  color: var(--nouryon-green);
  font-feature-settings: "tnum";
  margin-left: 4px;
}
.cred-bar-target { opacity: 0.6; font-size: 11px; }

.briefing-progress { display: flex; gap: 6px; justify-content: center; }
.briefing-pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.18s;
}
.briefing-pip.done {
  background: var(--nouryon-green);
  border-color: var(--nouryon-green);
  box-shadow: 0 0 10px rgba(108, 179, 63, 0.6);
}

.briefing-back { font-size: 12px; padding: 8px 14px; }

@media (max-width: 720px) {
  .briefing-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .briefing-trainer-portrait, .briefing-trainer-fallback { width: 52px; height: 52px; }
  .briefing-trainer-name { font-size: 16px; }
  .briefing-quote { font-size: 13px; padding: 12px 14px; }
}

/* ───── City scene ───── */
.city-scene {
  width: 100%;
  max-width: 1500px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}
.city-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.city-canvas {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  background: #0A1635;
  aspect-ratio: 16 / 9;
  max-height: 75vh;
  flex: 1 1 auto;
  min-height: 380px;
}
.city-bg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.city-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.city-hotspot {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--hs-color, var(--nouryon-green));
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.18), 0 8px 18px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-family: inherit;
  padding: 0;
  transition: transform 0.18s, box-shadow 0.18s;
  color: #0B1F45;
}
.city-hotspot:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.25), 0 12px 22px rgba(0, 0, 0, 0.55);
  z-index: 5;
}
.city-hotspot-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: inherit;
  background: var(--hs-color, var(--nouryon-green));
  opacity: 0.55;
  animation: cityHotPulse 2.2s ease-out infinite;
  z-index: -1;
}
@keyframes cityHotPulse {
  0% { transform: scale(1); opacity: 0.55; }
  60% { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
.city-hotspot-icon {
  font-size: 17px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}
.city-hotspot-label {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 18, 38, 0.94);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.city-hotspot-label-name { letter-spacing: 0.3px; }
.city-hotspot-label-sub { font-size: 10px; font-weight: 500; opacity: 0.78; }
.city-hotspot:hover .city-hotspot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Walking avatar */
.city-avatar {
  position: absolute;
  width: 28px;
  height: 42px;
  transform: translate(-50%, -100%);
  z-index: 4;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  transition: left 0.6s ease-in-out, top 0.6s ease-in-out;
}
.city-avatar.flipped { transform: translate(-50%, -100%) scaleX(-1); }
.city-avatar .arm, .city-avatar .leg { transform-origin: 50% 0; transition: transform 0.18s; }
.city-avatar.walking .arm-l { animation: armSwing 0.5s ease-in-out infinite alternate; }
.city-avatar.walking .arm-r { animation: armSwing 0.5s ease-in-out infinite alternate-reverse; }
.city-avatar.walking .leg-l { animation: legSwing 0.5s ease-in-out infinite alternate; }
.city-avatar.walking .leg-r { animation: legSwing 0.5s ease-in-out infinite alternate-reverse; }
@keyframes armSwing {
  from { transform: rotate(-12deg); }
  to   { transform: rotate(12deg);  }
}
@keyframes legSwing {
  from { transform: rotate(-18deg); }
  to   { transform: rotate(18deg);  }
}

.city-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 18, 38, 0.5);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
}
.city-foot-tip { opacity: 0.78; flex: 1; }

@media (max-width: 720px) {
  .city-canvas { aspect-ratio: 4 / 3; }
  .city-hotspot { width: 32px; height: 32px; font-size: 16px; }
  .city-hotspot-icon { font-size: 14px; }
  .city-hotspot-label { display: none; }
  .city-hotspot:hover .city-hotspot-label { display: none; }
  .city-foot { flex-direction: column; gap: 8px; align-items: stretch; }
  .city-avatar { width: 22px; height: 34px; }
}

/* ───── Lume (companion sprite) ───── */
.lume {
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: 64px;
  height: 64px;
  z-index: 90;
  cursor: pointer;
  transition: transform 0.18s;
  filter: drop-shadow(0 6px 14px rgba(108, 179, 63, 0.45));
}
.lume:hover { transform: translateY(-3px) scale(1.06); }
.lume.active { transform: translateY(-4px) scale(1.10); }
.lume-glow {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(108, 179, 63, 0.45), transparent 70%);
  border-radius: 50%;
  animation: lumePulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lumePulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.18); opacity: 1; }
}
.lume-body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: lumeBob 4.2s ease-in-out infinite, lumeSpin 18s linear infinite;
  transform-origin: center;
}
@keyframes lumeBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes lumeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.lume-bubble {
  position: absolute;
  bottom: 76px;
  right: 0;
  background: linear-gradient(160deg, rgba(8, 18, 38, 0.95), rgba(15, 44, 95, 0.92));
  border: 1px solid rgba(108, 179, 63, 0.4);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  width: 280px;
  max-width: 76vw;
  line-height: 1.5;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.lume-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.lume-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 16px;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, transparent 50%, rgba(15, 44, 95, 0.92) 50%);
  transform: rotate(45deg);
  border-right: 1px solid rgba(108, 179, 63, 0.4);
  border-bottom: 1px solid rgba(108, 179, 63, 0.4);
}

/* ───── Ambient particles (title screen) ───── */
.ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  filter: blur(0.5px);
  box-shadow: 0 0 12px currentColor;
}

/* ───── Score floater ───── */
.score-float {
  position: fixed;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 800;
  font-feature-settings: "tnum";
  pointer-events: none;
  z-index: 240;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 0);
}

/* ───── Card 3D tilt — preserve transforms via JS ───── */
.card { transform-style: preserve-3d; transition: transform 0.18s ease-out, box-shadow 0.18s; }

/* Card flip-in on first reveal */
@keyframes cardFlipIn {
  0%   { opacity: 0; transform: perspective(900px) rotateY(95deg) translateY(20px) scale(0.85); }
  60%  { opacity: 1; transform: perspective(900px) rotateY(-8deg)  translateY(-4px) scale(1.04); }
  100% { opacity: 1; transform: perspective(900px) rotateY(0deg)   translateY(0)    scale(1); }
}
.card-flip-in { animation: cardFlipIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Card hit flash */
@keyframes cardHitFlash {
  0%   { filter: brightness(1) saturate(1); }
  30%  { filter: brightness(1.7) saturate(1.5); }
  100% { filter: brightness(1) saturate(1); }
}
.card.hit-flash { animation: cardHitFlash 0.45s ease; }
.card.hit-flash::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 80, 80, 0.35);
  z-index: 2;
  pointer-events: none;
  animation: hitFlashFade 0.45s ease;
}
@keyframes hitFlashFade {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Container shake when its side takes damage */
@keyframes combatShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-7px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.combat-side.hit { animation: combatShake 0.4s ease; }

/* HP bar pulse on damage */
@keyframes hpPulse {
  0%, 100% { box-shadow: none; }
  40%      { box-shadow: 0 0 0 4px rgba(255, 80, 80, 0.45); }
}
.hp-bar.hit { animation: hpPulse 0.5s ease; }

/* ───── Daily streak chip on title ───── */
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255, 185, 72, 0.15), rgba(108, 179, 63, 0.10));
  border: 1px solid rgba(255, 185, 72, 0.32);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #FFB948;
  margin-bottom: 10px;
}
.streak-chip-flame { font-size: 16px; filter: drop-shadow(0 0 6px rgba(255, 185, 72, 0.55)); }

/* ───── Combo banner ───── */
.combo-banner {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 95;
  background: linear-gradient(135deg, rgba(255, 185, 72, 0.25), rgba(229, 75, 75, 0.20));
  border: 1px solid rgba(255, 185, 72, 0.45);
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  color: #FFE7B0;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  text-shadow: 0 0 8px rgba(255, 185, 72, 0.4);
}
.combo-banner.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ───── Lume mobile ───── */
@media (max-width: 720px) {
  .lume { width: 50px; height: 50px; bottom: 12px; right: 12px; }
  .lume-bubble { width: 240px; bottom: 60px; font-size: 12px; padding: 10px 13px; }
  .combo-banner { top: 70px; right: 8px; font-size: 11px; padding: 6px 10px; }
}

/* Mobile */
@media (max-width: 720px) {
  .stage { padding: 70px 12px 12px; }
  .hud { padding: 10px 12px; }
  .hud-stat { font-size: 11px; padding: 5px 9px; }
  .hud-brand span { display: none; }
  .combat-arena {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 12px;
    padding: 14px;
    min-height: 0;
  }
  .combat-vs { font-size: 18px; }
  .quiz-options { grid-template-columns: 1fr; }
  .card { width: 200px; height: 286px; }
  .card-art { height: 122px; }
  .card-type-badge { top: 168px; }
  .card-stats { top: 190px; }
  .dex-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
  .dex-cell .card { width: 165px; height: 234px; }
  .dex-cell .card-art { height: 100px; top: 30px; }
  .dex-cell .card-type-badge { top: 138px; }
  .dex-cell .card-stats { top: 158px; }
  .dex-cell .card-stat-value { font-size: 13px; }
  .dex-cell .card-move { bottom: 8px; }
  .dex-cell .card-move-name { font-size: 10px; }
  .dex-cell .card-move-text { font-size: 9px; }
  .hub-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .trainer-card { padding: 18px 14px 16px; min-height: 220px; }
  .trainer-portrait { width: 110px; height: 110px; font-size: 50px; }
  .trainer-name { font-size: 16px; }
}

/* ───────────────────────────────────────────────────────────
   Persona — playable, level-up-able trainer card + scene
   ─────────────────────────────────────────────────────────── */

/* Persona card override: emoji avatar fills the art slot */
.card-persona .card-art-persona {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--card-type-color, var(--nouryon-green)) 0%, rgba(15, 44, 95, 0.8) 100%);
}
.persona-card-avatar {
  font-size: 96px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}
.card-sm .persona-card-avatar { font-size: 64px; }
.persona-card-level {
  position: absolute;
  top: 6px;
  right: 8px;
  background: rgba(8, 18, 38, 0.85);
  border: 1px solid var(--card-type-color, var(--nouryon-green));
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Hub persona strip — sits above the trainer grid */
.hub-persona-strip { display: flex; justify-content: center; }
.hub-persona-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  background: linear-gradient(135deg, rgba(108, 179, 63, 0.10), rgba(46, 107, 206, 0.10));
  border: 1px solid rgba(108, 179, 63, 0.30);
  border-radius: 22px;
  padding: 18px 22px;
  width: 100%;
  max-width: 720px;
  box-shadow: 0 18px 40px rgba(108, 179, 63, 0.10);
}
.hub-persona-card-empty {
  grid-template-columns: auto 1fr auto;
}
.hub-persona-empty-icon { font-size: 40px; }
.hub-persona-empty-title { font-weight: 800; font-size: 16px; }
.hub-persona-empty-sub { font-size: 13px; opacity: 0.75; margin-top: 2px; }
.hub-persona-meta { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hub-persona-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-persona-sub { font-size: 12px; opacity: 0.75; }
.hub-persona-actions { display: flex; gap: 8px; margin-top: 4px; }
.hub-persona-actions .btn { padding: 9px 14px; font-size: 13px; }

/* XP bar (used in hub strip + persona scene meta) */
.persona-xp-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.persona-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--nouryon-green), var(--nouryon-bright));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* HUD persona button — distinct from generic hud-btn */
.hud-btn-persona {
  background: linear-gradient(135deg, rgba(108, 179, 63, 0.30), rgba(46, 107, 206, 0.30));
  border-color: rgba(108, 179, 63, 0.50);
}
.hud-btn-persona:hover { background: linear-gradient(135deg, rgba(108, 179, 63, 0.45), rgba(46, 107, 206, 0.45)); }

/* ─── Persona scene v2 — hero + build + feedback ─── */
.persona-scene {
  width: 100%;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100%;
  overflow-y: auto;
  padding: 4px 4px 0;
}

/* Hero block: portrait + name + traits + XP — the page's headline */
.persona-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px 32px;
  background:
    radial-gradient(circle at 18% 30%, color-mix(in srgb, var(--p-color, var(--nouryon-green)) 28%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, rgba(15, 44, 95, 0.65), rgba(8, 18, 38, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.persona-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 90% 110%, rgba(255, 255, 255, 0.06), transparent 50%);
  pointer-events: none;
}
.persona-hero-back {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 14px !important;
  font-size: 12px !important;
  z-index: 2;
}
.persona-hero-portrait {
  --p-color: var(--type-eco-premium);
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--p-color), rgba(15, 44, 95, 0.9));
  border: 3px solid var(--p-color);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    inset 0 0 0 4px rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.persona-hero-glow {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--p-color) 60%, transparent) 0%, transparent 70%);
  filter: blur(8px);
  z-index: -1;
  animation: personaPulse 3.6s ease-in-out infinite;
}
.persona-hero-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--p-color) 60%, transparent);
  animation: personaSpin 22s linear infinite;
  pointer-events: none;
}
.persona-hero-emoji {
  font-size: 92px;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
  animation: personaBob 4.2s ease-in-out infinite;
}
.persona-hero-level {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: linear-gradient(135deg, var(--nouryon-green), var(--nouryon-green-2));
  color: #0B1F45;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 3px solid #0A1635;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}
.persona-hero-portrait.level-up { animation: personaLevelUp 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes personaPulse { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes personaSpin { to { transform: rotate(360deg); } }
@keyframes personaBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes personaLevelUp {
  0% { transform: scale(1); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
  50% { transform: scale(1.18); box-shadow: 0 0 60px rgba(108, 179, 63, 0.85); }
  100% { transform: scale(1); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
}

.persona-hero-text {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.persona-hero-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  opacity: 0.6;
  text-transform: uppercase;
}
.persona-hero-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1.2px;
  background: linear-gradient(135deg, #fff 0%, color-mix(in srgb, var(--p-color, var(--nouryon-green)) 80%, white) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}
.persona-hero-bubble {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 560px;
  font-style: normal;
  color: #fff;
  align-self: flex-start;
}
.persona-hero-bubble::before {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 14px;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(-45deg);
}
.persona-hero-bubble-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-style: dashed;
  font-style: italic;
  opacity: 0.65;
}
.persona-hero-bubble-ghost::before { background: rgba(255, 255, 255, 0.03); }

.persona-hero-traits {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.trait-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.trait-chip-pillar {
  background: color-mix(in srgb, var(--p-color, var(--nouryon-green)) 20%, transparent);
  border-color: color-mix(in srgb, var(--p-color, var(--nouryon-green)) 50%, transparent);
}
.trait-chip-trait { background: rgba(108, 179, 63, 0.18); border-color: rgba(108, 179, 63, 0.42); color: #C8E8A4; }
.trait-chip-rank { background: rgba(255, 185, 72, 0.18); border-color: rgba(255, 185, 72, 0.42); color: #FFD79A; }
.trait-chip-voice { background: rgba(46, 107, 206, 0.18); border-color: rgba(46, 107, 206, 0.42); color: #B5CFFF; }

.persona-hero-xp {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 460px;
}
.persona-hero-xpbar {
  height: 10px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.persona-hero-xpfill {
  height: 100%;
  background: linear-gradient(90deg, var(--nouryon-green), var(--nouryon-bright));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(108, 179, 63, 0.5);
}
.persona-hero-xpmeta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.78;
}

/* Build section */
.persona-build { display: flex; flex-direction: column; gap: 14px; }
.persona-build-head { padding: 0 4px; }
.persona-build-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
}
.persona-build-sub { font-size: 13px; opacity: 0.7; margin: 0; max-width: 580px; }
.persona-build-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.persona-build-card {
  background: rgba(8, 18, 38, 0.55);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.persona-build-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.persona-build-icon {
  font-size: 24px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(108, 179, 63, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.persona-build-card-title { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; }
.persona-build-card-sub { font-size: 12px; opacity: 0.7; margin-top: 2px; }
.persona-build-card-card {
  align-items: center;
  text-align: center;
  background: linear-gradient(160deg, rgba(108, 179, 63, 0.08), rgba(46, 107, 206, 0.08));
  border-color: rgba(108, 179, 63, 0.30);
}
.persona-build-card-card .persona-build-card-head { width: 100%; }
.persona-card-mount { display: flex; justify-content: center; padding: 4px 0 8px; }

.persona-field { display: flex; flex-direction: column; gap: 6px; }
.persona-field span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.6;
}
.persona-field input,
.persona-field textarea,
.persona-feedback-form textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.persona-field input:focus,
.persona-field textarea:focus,
.persona-feedback-form textarea:focus {
  border-color: var(--nouryon-green);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(108, 179, 63, 0.18);
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.persona-avatar-cell {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--line);
  border-radius: 14px;
  font-size: 28px;
  height: 56px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.persona-avatar-cell:hover { border-color: var(--nouryon-bright); transform: translateY(-2px) scale(1.05); }
.persona-avatar-cell.selected {
  border-color: var(--nouryon-green);
  background: rgba(108, 179, 63, 0.20);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 14px rgba(108, 179, 63, 0.30);
}

.persona-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.persona-pillar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--line);
  color: #fff;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s;
  text-align: left;
}
.persona-pillar-cell:hover { border-color: var(--p-color); transform: translateY(-1px); }
.persona-pillar-cell.selected {
  border-color: var(--p-color);
  background: color-mix(in srgb, var(--p-color) 18%, transparent);
}
.persona-pillar-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--p-color);
  box-shadow: 0 0 10px var(--p-color);
  flex-shrink: 0;
}
.persona-pillar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.persona-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.persona-actions .btn { flex: 1; min-width: 140px; }

/* Feedback section */
.persona-feedback {
  background: rgba(8, 18, 38, 0.55);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px 26px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.persona-feedback-head { padding: 0; }
.persona-feedback-form { display: flex; flex-direction: column; gap: 10px; }
.persona-feedback-form textarea { width: 100%; min-height: 80px; }
.persona-feedback-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.persona-feedback-hint { font-size: 12px; opacity: 0.65; flex: 1; }
.persona-feedback-preview {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--nouryon-green);
  background: rgba(108, 179, 63, 0.15);
  border: 1px solid rgba(108, 179, 63, 0.40);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.persona-feedback-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.persona-feedback-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-left: 3px solid var(--nouryon-green);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.persona-feedback-text { font-size: 13px; line-height: 1.5; flex: 1; }
.persona-feedback-when {
  font-size: 11px;
  opacity: 0.55;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.persona-feedback-empty {
  font-size: 13px;
  opacity: 0.55;
  text-align: center;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.persona-feedback .hidden { display: none; }

@media (max-width: 880px) {
  .persona-build-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .persona-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px 18px;
    justify-items: center;
  }
  .persona-hero-portrait { width: 132px; height: 132px; }
  .persona-hero-emoji { font-size: 72px; }
  .persona-hero-text { align-items: center; }
  .persona-hero-bubble { border-radius: 14px; }
  .persona-hero-bubble::before { left: 50%; transform: translateX(-50%) rotate(-45deg); }
  .persona-hero-back { position: static; align-self: flex-start; margin-bottom: 8px; }
  .persona-hero-traits { justify-content: center; }
  .persona-hero-xpmeta { font-size: 10px; }
  .persona-grid { grid-template-columns: repeat(4, 1fr); }
  .hub-persona-card { grid-template-columns: auto 1fr; padding: 14px 16px; max-width: 100%; }
  .hub-persona-card-empty { grid-template-columns: auto 1fr; }
  .hub-persona-card-empty .btn { grid-column: 1 / -1; }
  .dex-title { font-size: 28px; }
}
