:root {
  /* Inherit Pokémon Champions tokens from champion.css; override per-app needs below. */
  --bg: #0a0a14;
  --bg-mid: #15151f;
  --panel: rgba(28,28,42,0.85);
  --panel-solid: #1c1c2a;
  --primary: #ffcb05;       /* championship gold = primary action */
  --success: #5cc060;
  --danger: #ee1515;        /* pokéball red = danger */
  --warning: #ffcb05;
  --text: #f5f7ff;
  --text-mute: #9aa0b8;
  --border-card: rgba(255,255,255,0.08);
  --border-ink: #000;       /* chunky game border */
}
html { scroll-behavior: smooth; }
/* App-mode body sits inside champion-theme; only constrain width and add app-specific tweaks. */
body.app-mode {
  max-width: 1100px; margin: 0 auto;
  padding: 0 16px 80px;
  user-select: none;
}
/* Fall-back for users who hit app.html without champion.css (shouldn't happen but safe) */
body:not(.champion-theme) {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 900px; margin: 0 auto;
  padding: 0 10px 50px;
}

/* ─── top bar (lang toggle + BMC) ─── */
.top-bar { position: fixed; top: 8px; right: 10px; z-index: 200; display: flex; gap: 6px; align-items: center; }
.bmc-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; background: rgba(255,221,0,0.15); border: 1px solid #fbbf24; color: #fbbf24; font-size: 14px; border-radius: 6px; text-decoration: none; transition: 0.15s; cursor: pointer; }
.bmc-btn:hover { background: #fbbf24; color: #000; transform: scale(1.05); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: #1e293b; border: 1px solid #475569; color: #94a3b8; font-size: 13px; border-radius: 6px; cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--primary); color: #000; }

/* ─── first-time setup banner ─── */
.first-time-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin: 16px 0;
  background: linear-gradient(135deg, rgba(255,203,5,0.10), rgba(255,203,5,0.04));
  border: 2px solid var(--primary); border-radius: 12px;
  box-shadow: 0 0 24px rgba(255,203,5,0.15);
  flex-wrap: wrap;
}
.ftb-icon { font-size: 32px; }
.ftb-text { flex: 1; min-width: 240px; line-height: 1.5; font-size: 13px; color: var(--text); }
.ftb-text strong { display: block; color: var(--primary); margin-bottom: 4px; font-size: 15px; }
.ftb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ftb-primary {
  font-family: 'Bungee', sans-serif; font-size: 12px; letter-spacing: 0.04em;
  background: var(--primary); color: #000;
  padding: 10px 16px; border: none; border-radius: 8px; cursor: pointer;
  box-shadow: 0 0 16px rgba(255,203,5,0.4);
  transition: 0.15s;
}
.ftb-primary:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(255,203,5,0.6); }
.ftb-skip {
  background: transparent; color: #94a3b8; font-size: 12px;
  border: 1px solid #475569; padding: 9px 14px; border-radius: 8px; cursor: pointer;
}
.ftb-skip:hover { color: var(--danger); border-color: var(--danger); }

/* ─── team builder modal ─── */
.edit-team-btn {
  display: block; width: 100%; padding: 12px; margin-bottom: 16px;
  background: rgba(0,0,0,0.4); color: var(--primary);
  border: 3px dashed var(--primary); border-radius: 10px;
  font-family: 'Bungee', sans-serif; font-size: 12px; letter-spacing: 0.05em;
  cursor: pointer; transition: 0.15s; text-shadow: 1px 1px 0 #000;
}
.edit-team-btn:hover { background: rgba(255,203,5,0.08); transform: translateY(-1px); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px; }
.modal-content { background: var(--panel-solid); border: 3px solid #000; border-radius: 14px; max-width: 720px; width: 100%; padding: 22px; box-shadow: 5px 5px 0 #000, 7px 7px 0 var(--primary); }
.modal-header h2 { font-family: 'Bungee', sans-serif; letter-spacing: 0.03em; color: #fff; text-shadow: 2px 2px 0 #000; }
.builder-add-btn { font-family: 'Bungee', sans-serif; font-size: 13px; letter-spacing: 0.04em; background: var(--success); color: #000; border: 3px solid #000 !important; box-shadow: 3px 3px 0 #000; }
.builder-add-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #000; }
.builder-reset-btn { font-family: 'Outfit', sans-serif; border: 2px solid #000 !important; box-shadow: 2px 2px 0 #000; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #334155; }
.modal-header h2 { margin: 0; font-size: 18px; color: var(--text); }
.modal-close { background: transparent; border: 1px solid #475569; color: #94a3b8; padding: 4px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.modal-close:hover { color: var(--danger); border-color: var(--danger); }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; }
.modal-hint { font-size: 11px; color: #64748b; text-align: center; margin-top: 12px; }

.builder-card { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.builder-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed #334155; }
.builder-card-head strong { font-size: 15px; color: var(--primary); }
.builder-del { background: transparent; border: 1px solid #475569; color: #94a3b8; padding: 2px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.builder-del:hover { color: var(--danger); border-color: var(--danger); }
.builder-row { display: grid; grid-template-columns: 80px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.builder-row label { font-size: 11px; color: #64748b; text-transform: uppercase; font-weight: bold; }
.builder-row input[type="text"] { padding: 6px 8px; font-size: 12px; border-radius: 4px; border: 1px solid #334155; background: #1e293b; color: var(--text); width: 100%; box-sizing: border-box; }
.builder-row input[type="text"]:focus { border-color: var(--primary); outline: none; }
.builder-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.builder-add-btn { flex: 1; padding: 10px; background: var(--success); color: #000; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }
.builder-reset-btn { flex: 1; padding: 10px; background: transparent; color: #94a3b8; border: 1px solid #475569; border-radius: 6px; cursor: pointer; }
.builder-reset-btn:hover { color: var(--danger); border-color: var(--danger); }

@media (max-width: 600px) {
  .modal-content { padding: 14px; }
  .builder-row { grid-template-columns: 60px 1fr; }
  .builder-moves { grid-template-columns: 1fr; }
}

/* ─── footer (compact) ─── */
.site-footer { margin-top: 32px; padding: 16px 12px 12px; border-top: 1px solid #1e293b; color: #64748b; font-size: 11px; line-height: 1.5; }
.footer-details { margin-bottom: 8px; }
.footer-details summary { color: #94a3b8; font-size: 11px; cursor: pointer; padding: 4px 0; outline: none; }
.footer-details summary:hover { color: var(--primary); }
.footer-details p { margin: 6px 0; color: #64748b; }
.footer-copy { text-align: center; font-size: 10px; color: #475569; margin: 0; padding-top: 8px; border-top: 1px dashed #1e293b; }
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ─── Field Effects & Strategic Value ─── */
.field-badge-container { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; justify-content: flex-end; }
.f-badge { font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 4px; border: 1.5px solid #000; box-shadow: 1px 1px 0 #000; text-transform: uppercase; }
.f-reflect { background: var(--pkc-blue); color: #fff; }
.f-lightscreen { background: var(--t-psychic); color: #fff; }
.f-tailwind { background: var(--t-water); color: #fff; }
.f-weather { background: #475569; color: #fff; }

.archetype-banner {
  background: rgba(255,203,5,0.10); border: 2px solid var(--primary);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px;
  font-size: 13px; color: var(--text); line-height: 1.6;
}
.archetype-banner strong { color: var(--primary); display: block; margin-bottom: 4px; font-family: 'Bungee', sans-serif; font-size: 13px; letter-spacing: 0.04em; }

.resource-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0;
  padding: 8px 12px; background: rgba(0,0,0,0.4);
  border: 2px solid #000; border-radius: 8px;
  box-shadow: 2px 2px 0 #000; font-size: 11px;
}
.res-pill {
  padding: 3px 8px; border-radius: 999px; font-weight: 700;
  border: 1.5px solid; line-height: 1.4;
}
.res-pill.spent { background: rgba(239,68,68,0.15); color: #ef4444; border-color: #ef4444; }
.res-pill.ready { background: rgba(92,192,96,0.15); color: var(--success); border-color: var(--success); }
.res-pill.timer { background: rgba(255,203,5,0.15); color: var(--primary); border-color: var(--primary); }

.val-glow-high { box-shadow: 0 0 12px var(--primary), 2px 2px 0 #000 !important; border-color: var(--primary) !important; }
.val-glow-low { opacity: 0.6; filter: grayscale(0.5); }
.val-label { position: absolute; bottom: -4px; right: -4px; font-size: 9px; background: #000; color: var(--primary); padding: 0 4px; border-radius: 4px; border: 1px solid var(--primary); z-index: 5; font-weight: 900; }

.switch-dmg-tag { font-size: 10px; font-weight: bold; margin-top: 2px; display: block; }
.switch-dmg-danger { color: var(--danger); }
.switch-dmg-safe { color: var(--success); }

/* ─── AI loading skeleton ─── */
.ai-skeleton { color: #94a3b8; font-style: italic; }
.ai-skeleton .dot { animation: ai-blink 1.4s infinite both; }
.ai-skeleton .dot:nth-child(2) { animation-delay: 0.2s; }
.ai-skeleton .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }
.ai-cmd-box.loading { border-color: #475569; }
.ai-cmd-box.loading::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: ai-shimmer 1.6s infinite;
}
@keyframes ai-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ─── hero / intro (compact) ─── */
.hero-section { background: linear-gradient(135deg, rgba(56,189,248,0.04), rgba(15,23,42,0.6)); border: 1px solid #334155; border-radius: 10px; padding: 16px 18px 14px; margin: 44px 0 14px; position: relative; }
.hero-title { font-size: clamp(18px, 4vw, 24px); margin: 0 0 6px; color: var(--text); font-weight: bold; line-height: 1.3; }
.hero-accent { color: var(--primary); }
.hero-tagline { color: #94a3b8; font-size: clamp(12px, 2.2vw, 13px); margin: 0 0 10px; line-height: 1.5; }
.hero-howto { background: rgba(16,185,129,0.06); border-left: 3px solid var(--success); padding: 8px 12px; border-radius: 0 6px 6px 0; font-size: 12px; color: #cbd5e1; line-height: 1.6; margin: 0; }
.hero-dismiss { position: absolute; top: 8px; right: 10px; background: transparent; border: 1px solid #334155; color: #64748b; width: 24px; height: 24px; border-radius: 4px; font-size: 12px; cursor: pointer; padding: 0; line-height: 1; }
.hero-dismiss:hover { color: var(--danger); border-color: var(--danger); }

.title-bar {
  position: sticky; top: 0; background: rgba(10,10,20,0.92); backdrop-filter: blur(12px);
  padding: 16px 0 14px; margin-bottom: 14px;
  border-bottom: 3px solid #000; box-shadow: 0 4px 0 var(--primary);
  z-index: 100;
}
.status-text {
  text-align: center; font-family: 'Bungee', sans-serif; font-size: 12px;
  color: var(--primary); font-weight: 400; margin-bottom: 12px;
  letter-spacing: 0.1em; text-shadow: 2px 2px 0 #000;
}
.action-btn {
  font-family: 'Bungee', sans-serif; font-size: 15px; letter-spacing: 0.04em;
  background: var(--primary); color: #000;
  padding: 14px; border-radius: 12px;
  border: 3px solid #000; box-shadow: 5px 5px 0 #000;
  cursor: pointer; display: block; width: 100%;
  transition: 0.1s; margin-top: 15px;
}
.action-btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 #000; }
.action-btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 #000; }
.action-btn:disabled { background: #2a2a3a; color: var(--text-mute); box-shadow: 5px 5px 0 #000 !important; cursor: not-allowed; transform: none !important; opacity: 0.6; }

.slot-container { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 15px; min-height: 45px;}
.slot { background: rgba(28,28,42,0.7); border: 2px dashed #475569; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #64748b; cursor: pointer; padding: 10px 14px; }
.slot.filled { background: linear-gradient(180deg, var(--danger), #b81212); color: white; border: 3px solid #000; box-shadow: 3px 3px 0 #000; }
.slot.filled::after { content: " ✖"; font-size: 12px; margin-left: 6px; opacity: 0.7;}

.search-bar {
  width: 100%; padding: 14px; font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 700; border-radius: 10px;
  border: 3px solid #000; background: rgba(0,0,0,0.5); color: #fff;
  text-align: center; box-sizing: border-box;
  box-shadow: 3px 3px 0 #000;
}
.search-bar:focus { border-color: var(--primary); outline: none; box-shadow: 3px 3px 0 var(--primary); }

.az-nav { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 20px 0;}
.az-nav a { background: rgba(28,28,42,0.85); color: var(--primary); padding: 0 12px; height: 32px; line-height: 30px; border-radius: 6px; border: 2px solid #000; text-decoration: none; font-weight: 800; font-size: 13px; box-shadow: 2px 2px 0 #000; transition: 0.1s; }
.az-nav a:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #000; color: #fff; }
.section-title { font-family: 'Bungee', sans-serif; font-size: 16px; letter-spacing: 0.05em; color: var(--primary); border-bottom: 3px solid #000; padding-bottom: 6px; margin-top: 24px; margin-bottom: 14px; text-shadow: 2px 2px 0 #000; }
.pkmn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px;}
.pkmn-btn { background: rgba(28,28,42,0.7); color: #e2e8f0; border: 2px solid #000; padding: 6px 5px 8px; border-radius: 10px; font-size: 13px; cursor: pointer; text-align: center; word-break: keep-all; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 2px 2px 0 #000; transition: 0.1s; font-weight: 600; }
.pkmn-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--primary); }
.pkmn-sprite { width: 68px; height: 68px; image-rendering: pixelated; pointer-events: none; }
.draft-sprite { width: 72px; height: 72px; image-rendering: pixelated; pointer-events: none; display: block; margin: 0 auto 2px; }
.slot-sprite { width: 40px; height: 40px; vertical-align: middle; margin-right: 4px; image-rendering: pixelated; }
.live-sprite { width: 56px; height: 56px; image-rendering: pixelated; pointer-events: none; display: block; margin: 0 auto; }
.pkmn-btn.active { background: linear-gradient(180deg, var(--danger), #b81212); color: #fff; border-color: #000; font-weight: 800; box-shadow: 2px 2px 0 #000, 0 0 16px rgba(238,21,21,0.4); }

.panel-box {
  display: none; padding: 26px 22px;
  background: var(--panel); backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
  margin-top: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8), inset 0 0 20px rgba(255,255,255,0.02);
}
.panel-box h2, #phase2-title {
  font-family: 'Bungee', sans-serif !important;
  letter-spacing: 0.03em;
  color: #fff !important;
  text-shadow: 2px 2px 0 #000;
}

.advice-box { background: rgba(0,0,0,0.4); border: 2px solid #000; border-left: 6px solid var(--primary); padding: 18px 18px 14px; border-radius: 8px; margin-bottom: 22px; box-shadow: 4px 4px 0 #000; }
.plan-title { font-family: 'Bungee', sans-serif; font-size: 15px; letter-spacing: 0.04em; color: var(--primary); margin-bottom: 12px; padding-bottom: 8px; display: block; border-bottom: 1px dashed rgba(255,203,5,0.3); text-shadow: 2px 2px 0 #000; }
.plan-role { display: inline-block; background: #1e293b; padding: 3px 8px; border-radius: 4px; color: var(--warning); border: 1px solid #475569; margin-right: 8px; font-size: 13px; font-weight: bold;}
.plan-desc { color: white; font-size: 15px; line-height: 1.7; margin-bottom: 10px;}
.highlight-strat { color: var(--success); font-weight: bold;}

.my-draft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; margin-bottom: 25px;}
.draft-btn {
  background: rgba(28,28,42,0.7); color: var(--text-mute);
  border: 3px solid #000; padding: 12px 6px 10px; border-radius: 12px;
  font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: 0.15s;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 3px 3px 0 #000;
}
.draft-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--primary); color: var(--text); }
.draft-btn.selected {
  background: linear-gradient(180deg, var(--primary), var(--warning));
  color: #000; border-color: #000;
  box-shadow: 3px 3px 0 #000, 0 0 24px rgba(255,203,5,0.4);
  transform: scale(1.03);
}
.draft-btn.lead::after {
  content: '🥇 LEAD'; font-family: 'Bungee', sans-serif; font-size: 9px;
  position: absolute; top: -10px; right: -6px;
  background: var(--danger); color: #fff;
  border: 2px solid #000; box-shadow: 2px 2px 0 #000;
  padding: 2px 6px; border-radius: 4px;
}
.draft-btn.lead::after { content: "🥇 Lead"; position: absolute; top: -10px; right: -5px; background: var(--warning); color: #000; font-size: 11px; padding: 2px 6px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.5);}
html[lang="zh"] .draft-btn.lead::after { content: "🥇 首发"; }
.lang-toggle { display: flex; gap: 2px; background: #1e293b; border-radius: 6px; border: 1px solid #475569; overflow: hidden; }
.lang-toggle button { padding: 4px 10px; font-size: 12px; font-weight: bold; border: none; cursor: pointer; background: transparent; color: #94a3b8; transition: 0.15s; }
.lang-toggle button.active { background: var(--primary); color: #000; }

.live-title { font-size: 16px; color: #94a3b8; font-weight: bold; margin-bottom: 12px; text-align: center; }
.live-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 25px;}
.live-grid-enm { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 8px; margin-bottom: 15px;}

.live-wrapper { position: relative; width: 100%; }
.live-btn {
  width: 100%; background: rgba(28,28,42,0.7); color: var(--text);
  border: 2.5px solid #000; padding: 8px 4px; border-radius: 10px;
  font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: 0.15s; box-shadow: 2px 2px 0 #000;
}
.live-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--primary); }
.live-btn.my-active {
  background: linear-gradient(180deg, var(--primary), var(--warning));
  color: #000; border-color: #000;
  box-shadow: 2px 2px 0 #000, 0 0 16px rgba(255,203,5,0.5);
  transform: scale(1.04);
}
.live-btn.enm-active {
  background: linear-gradient(180deg, var(--danger), #b81212);
  color: #fff; border-color: #000;
  box-shadow: 2px 2px 0 #000, 0 0 16px rgba(238,21,21,0.5);
  transform: scale(1.04);
}
.live-btn.dead {
  background: rgba(0,0,0,0.5) !important; color: #444 !important;
  border-color: #333 !important; text-decoration: line-through;
  box-shadow: 2px 2px 0 #000 !important; transform: none !important; opacity: 0.5;
}

.faint-badge { position: absolute; top: -8px; right: -5px; background: #334155; border: 1px solid #000; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; z-index: 10; transition: 0.2s;}
.faint-badge:hover { background: #f43f5e; color: white; transform: scale(1.2);}
.faint-badge.is-dead { background: #f43f5e; color: white; border-color: #fff;}

.live-search-box { display: flex; gap: 10px; margin-bottom: 20px;}
.live-search-box input { flex: 1; padding: 12px; font-size: 14px; font-weight: bold; border-radius: 8px; border: 2px dashed var(--danger); background: #0f172a; color: white; box-sizing: border-box; text-align: center;}

.auto-predict-panel { background: #000; border: 3px solid var(--primary); border-radius: 12px; padding: 25px; margin-top: 25px; position: relative; display: flex; flex-direction: column; gap: 15px; transition: 0.3s;}
#phase3-panel .auto-predict-panel { padding: 10px 12px; margin-top: 8px; gap: 6px; font-size: 14px; }
.auto-predict-panel.danger-mode { border-color: var(--danger); box-shadow: 0 0 30px rgba(244, 63, 94, 0.3); }
.auto-predict-panel.warning-mode { border-color: var(--warning); box-shadow: 0 0 30px rgba(234, 179, 8, 0.3); }
.auto-predict-panel.safe-mode { border-color: var(--success); box-shadow: 0 0 30px rgba(16, 185, 129, 0.3); }

.ap-badge { position: absolute; top: -12px; left: 20px; background: var(--primary); color: #000; padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.danger-mode .ap-badge { background: var(--danger); color: white;}
.warning-mode .ap-badge { background: var(--warning); color: black;}
.safe-mode .ap-badge { background: var(--success); color: black;}

.ap-section { border-left: 4px solid #475569; padding-left: 15px; }
.ap-title { font-size: 14px; color: #94a3b8; font-weight: bold; margin-bottom: 8px; text-transform: uppercase;}
.ap-content { font-size: 16px; color: white; line-height: 1.6; font-weight: bold;}

.highlight-danger { color: var(--danger); font-size: 20px;}
.highlight-safe { color: var(--success); font-size: 18px;}
.highlight-swap { background: #334155; border: 1px solid var(--warning); color: var(--warning); padding: 4px 10px; border-radius: 6px; font-size: 18px; display:inline-block; margin-top: 5px;}

.battle-log-section { margin: 20px 0; }
.battle-log-bar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.blog-btn {
  flex: 1; min-width: 55px; padding: 9px 4px; border-radius: 8px;
  font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 700;
  border: 2.5px solid #000; background: rgba(28,28,42,0.85); color: #fff;
  cursor: pointer; transition: 0.1s; text-align: center; box-shadow: 2px 2px 0 #000;
}
.blog-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #000; }
.blog-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 #000; }
.my-move-btn {
  flex: 1; min-width: 60px; padding: 10px 6px; border-radius: 8px;
  font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 700;
  border: 2.5px solid #000; background: linear-gradient(180deg, var(--primary), var(--warning));
  color: #000; cursor: pointer; transition: 0.1s; text-align: center;
  box-shadow: 2px 2px 0 #000;
}
.my-move-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #000; }
.my-move-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 #000; }
.blog-btn.b-phys { border-color: #dc2626; } .blog-btn.b-spec { border-color: #3b82f6; }
.blog-btn.b-setup { border-color: #eab308; } .blog-btn.b-status { border-color: #a855f7; }
.blog-btn.b-defend { border-color: #22c55e; } .blog-btn.b-switch { border-color: #f97316; }

.predict-box { background: rgba(234, 179, 8, 0.08); border-left: 4px solid var(--warning); padding: 12px 15px; border-radius: 0 8px 8px 0; margin-top: 10px; font-size: 14px; color: #fef3c7; line-height: 1.6; display: none; }
.history-strip { max-height: 100px; overflow-y: auto; background: #0f172a; border-radius: 8px; padding: 8px 12px; font-size: 12px; color: #94a3b8; line-height: 1.8; margin-top: 8px; border: 1px solid #1e293b; }
.history-strip:empty::before { content: "暂无记录… 对战开始后点击按钮记录对面行动"; color: #475569; font-style: italic; }
.hist-entry { border-bottom: 1px dashed #1e293b; padding: 2px 0; }
.h-phys { color: #f87171; } .h-spec { color: #60a5fa; } .h-setup { color: #facc15; }
.h-status { color: #c084fc; } .h-defend { color: #4ade80; } .h-switch { color: #fb923c; }

.speed-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: bold; }
.spd-fast { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid var(--success); }
.spd-slow { background: rgba(244,63,94,0.15); color: var(--danger); border: 1px solid var(--danger); }
.spd-tie { background: rgba(234,179,8,0.15); color: var(--warning); border: 1px solid var(--warning); }
.undo-btn { background: none; border: 1px dashed #475569; color: #64748b; padding: 4px 10px; border-radius: 6px; font-size: 11px; cursor: pointer; }

/* ─── Animated HUD HP Bars ─── */
.hp-bar-outer {
  width: 100%; height: 6px; background: rgba(0,0,0,0.4); border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); margin: 6px 0;
}
.hp-bar-inner {
  height: 100%; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(255,255,255,0.2);
}
.hp-green { background: linear-gradient(90deg, #10b981, #34d399); }
.hp-yellow { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.hp-red { background: linear-gradient(90deg, #ef4444, #f87171); }

.ai-cmd-box {
  background: rgba(10, 15, 30, 0.85); backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3); border-radius: 14px;
  padding: 20px; margin-bottom: 15px; min-height: 80px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; transition: 0.3s;
  box-shadow: 0 0 40px rgba(0,0,0,0.6), inset 0 0 15px rgba(139, 92, 246, 0.1);
  overflow: hidden;
}
.ai-cmd-box::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 20px 20px; pointer-events: none; opacity: 0.3;
}

/* Coach (Ask AI) trigger button — square-ish, gold, fits next to ai-cmd-box */
.coach-btn {
  font-family: 'Bungee', sans-serif; font-size: 13px; letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--primary), #e8b300);
  color: #000;
  padding: 0 16px;
  min-width: 92px; min-height: 60px;
  border: 3px solid #000; border-radius: 12px;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer; transition: 0.1s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.coach-btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 #000; }
@media (max-width: 700px) {
  .coach-btn { min-width: 76px; min-height: 50px; font-size: 12px; padding: 0 10px; }
}
.ai-cmd-text { font-family: 'Outfit', sans-serif; font-weight: 700; z-index: 5; }
.ai-cmd-box.loading { border-color: rgba(139, 92, 246, 0.8); }
.ai-cmd-directive { text-align: center; z-index: 5; }
.ai-cmd-text { font-size: 20px; font-weight: bold; color: white; line-height: 1.5; }
.ai-cmd-sub { font-size: 13px; color: #94a3b8; margin-top: 6px; }
#ai-cmd-box #ai-predict-board { border-top: 1px solid #334155; padding-top: 10px; font-size: 13px; line-height: 1.5; color: #e2e8f0; display: flex; flex-direction: column; gap: 6px; }
#ai-cmd-box #ai-predict-board:empty { display: none; }
.ai-key-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.ai-key-bar input { flex:1; padding:8px 12px; font-size:13px; border-radius:6px; border:1px solid #475569; background:#0f172a; color:white; }
.ai-key-bar button { padding:8px 16px; font-size:13px; font-weight:bold; border-radius:6px; border:none; background:#8b5cf6; color:white; cursor:pointer; white-space:nowrap; }

.calc-log { background: #000; border: 1px solid #334155; border-left: 4px solid var(--primary); padding: 12px; font-family: monospace; color: #94a3b8; font-size: 12px; line-height: 1.5; border-radius: 4px; margin-bottom: 15px; max-height: 120px; overflow-y: auto; }

.build-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; margin-top: 15px; }
.build-card { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 12px; font-size: 13px; line-height: 1.6; }
.build-card.selected { border-color: var(--success); background: rgba(16,185,129,0.05); }
.bc-name { font-size: 16px; font-weight: bold; color: var(--primary); margin-bottom: 6px; }
.bc-row { color: #cbd5e1; } .bc-label { color: #64748b; font-size: 12px; }
.bc-moves { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bc-move { background: #1e293b; padding: 2px 8px; border-radius: 4px; font-size: 12px; color: var(--warning); }
.bc-warn { color: var(--danger); font-size: 12px; margin-top: 6px; border-top: 1px dashed #334155; padding-top: 6px; }
.calc-hl { color: var(--success); font-weight: bold; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — phones / narrow tablets (<= 700px)
═══════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  body { padding: 0 6px 80px 6px; font-size: 14px; }

  .top-bar { top: 6px; right: 6px; gap: 4px; }
  .bmc-btn { font-size: 11px; padding: 5px 8px; }
  .lang-toggle button { padding: 3px 7px; font-size: 11px; }

  .hero-section { margin-top: 40px; padding: 12px 14px 12px; }
  .hero-title { font-size: 17px; }
  .hero-tagline { font-size: 12px; }
  .hero-howto { font-size: 11px; padding: 6px 10px; }

  /* Phase 3 split (my team | enemy) → stack vertically on phones */
  .team-split { flex-direction: column !important; }

  /* Bigger touch targets — Apple HIG says 44px min, but we squeeze a bit for density */
  .my-move-btn, .blog-btn { min-height: 40px !important; padding: 8px 6px !important; }
  .draft-btn { min-height: 80px; }
  .live-btn { padding: 8px 4px !important; }

  /* Phase panels: less padding on phones */
  .panel-box { padding: 16px 12px; }
  .title-bar { padding: 10px 0; }
  .status-text { font-size: 13px; }
  .search-bar { padding: 12px; font-size: 15px; }
  .action-btn { font-size: 16px; padding: 13px; }

  /* Roster grid → 3 cols max on phones (was auto-fill 130px which can be cramped) */
  .pkmn-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pkmn-btn { font-size: 12px; padding: 4px 3px 6px; }
  .pkmn-sprite { width: 56px; height: 56px; }

  /* AZ nav: wrap better */
  .az-nav { gap: 4px; margin: 12px 0; }
  .az-nav a { padding: 0 9px; height: 28px; line-height: 28px; font-size: 13px; }

  /* Battle box typography — keep AI directive readable */
  .ai-cmd-text { font-size: 16px; }
  .ai-cmd-sub { font-size: 11px; }

  /* Drafted Pokemon grid */
  .my-draft-grid { gap: 6px; }
  .draft-sprite { width: 56px; height: 56px; }

  /* Live grids (phase 3) — tighter on mobile so 3 cards fit without horizontal overflow */
  .live-sprite { width: 40px; height: 40px; }
  .live-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 4px !important; }
  .live-grid-enm { grid-template-columns: repeat(3, 1fr) !important; gap: 4px; }
  .live-btn { font-size: 11px !important; padding: 6px 2px !important; }
  .live-wrapper { min-width: 0; overflow: hidden; }

  /* HP +/- buttons easier to tap but compact width */
  .live-wrapper button[onclick*="changeHP"] { width: 28px !important; height: 30px !important; font-size: 14px !important; }
  /* Compress the HP percentage text — was min-width 36px inline; override here */
  .live-wrapper > div[style*="margin:8px 0"] { gap: 3px !important; margin: 5px 0 !important; }
  .live-wrapper > div[style*="margin:8px 0"] > span { font-size: 11px !important; min-width: 26px !important; }

  /* Status row pills (麻 烧 毒 睡 冻) — shrink to fit */
  .live-wrapper > div:last-child button { min-width: 14px !important; font-size: 9px !important; padding: 1px 2px !important; }

  /* Skull badge: smaller so it doesn't overlap when card is narrow */
  .faint-badge { width: 18px !important; height: 18px !important; font-size: 10px !important; top: -4px !important; right: -2px !important; }

  /* Mon-frame glow ring (around sprite) — keep but ensure it doesn't push width */
  .mon-frame { max-width: 100%; }
}

/* extra-small (<=380px) — final tightening */
@media (max-width: 380px) {
  body { padding: 0 4px 80px 4px; }
  .pkmn-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 20px; }
  .hero-section { padding: 14px 10px; }

  /* Phase 3 mon cards: ultra-narrow viewports */
  .live-sprite { width: 36px; height: 36px; }
  .live-wrapper button[onclick*="changeHP"] { width: 24px !important; height: 28px !important; font-size: 13px !important; }
  .live-wrapper > div[style*="margin:8px 0"] > span { font-size: 10px !important; min-width: 22px !important; }
  .live-wrapper > div:last-child button { min-width: 12px !important; font-size: 8px !important; }
  .live-btn { font-size: 10px !important; padding: 5px 1px !important; }
  .panel-box { padding: 12px 8px; }
  .ai-cmd-box { padding: 12px 10px; }
}
