/* Calculator panel (systems/calc/): tabs, the pokemon form, the score and stats, the A×B duel. */

.calc-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.calc-tab {
  padding: 7px 16px; border-radius: 9px; border: 1px solid var(--line); background: #0b1424;
  color: var(--muted); font-family: var(--pixel); font-size: 0.95rem; cursor: pointer;
}
.calc-tab:hover { color: var(--text); background: #14223b; }
.calc-tab.on { background: var(--card-2); border-color: var(--accent); color: var(--accent); }

.calc-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 14px; align-items: start; }
.cmp-layout { display: grid; gap: 14px; }
.cmp-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) {
  .calc-layout, .cmp-forms { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- the pokemon form */
.cf { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
/* the game's .input has a 240px floor for page-wide fields; here they share rows */
.cf .input { min-width: 0; box-sizing: border-box; padding: 6px 10px; }
.cf-title { font-family: var(--pixel); font-size: 1rem; color: var(--accent); }
.cf-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.cf-field { display: grid; gap: 4px; font-size: 0.78rem; color: var(--muted); }
.cf-grow { flex: 1; min-width: 180px; }
.cf-label-row { display: flex; align-items: center; gap: 8px; }
.cf-label-row .cf-quick { margin-left: auto; }
.cf-search-wrap { position: relative; flex: 1; min-width: 180px; }
.cf-search { width: 100%; }
.cf-mine { flex: 1; min-width: 160px; }
.cf-results {
  position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto;
  background: var(--bg-2, #101a2e); border: 1px solid var(--line); border-radius: 10px; padding: 4px;
  box-shadow: 0 10px 24px #0008;
}
.cf-result { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px; border-radius: 7px; background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; }
.cf-result:hover { background: #1f3460; }
.cf-chosen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 40px; }
.cf-num { width: 90px; }
.input.bad { border-color: var(--red, #e5484d); }
.cf-q { display: flex; align-items: center; gap: 8px; }
.cf-range { flex: 1; accent-color: var(--accent); }
.cf-ivs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cf-iv-cell { display: grid; gap: 3px; font-size: 0.72rem; color: var(--muted); }
.cf-iv { width: 100%; }
.cf-iv-bar { height: 4px; border-radius: 2px; background: #0b1424; overflow: hidden; }
.cf-iv-bar i { display: block; height: 100%; transition: width 0.15s; }
.cf-iv-bar i.lo { background: #e5484d; }
.cf-iv-bar i.mid { background: #f5b84a; }
.cf-iv-bar i.hi { background: #4cc96a; }
.cf-quick { display: flex; gap: 4px; }
.cf-chips { display: flex; gap: 4px; }
.cf-chip, .cf-shiny {
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: #0b1424;
  color: var(--muted); font-family: var(--pixel); cursor: pointer;
}
.cf-chip.on { background: var(--card-2); border-color: var(--accent); color: var(--accent); }
.cf-shiny.on { border-color: #c9a227; color: #ffe14d; background: #3a3215; }
.cf-shiny:disabled { opacity: 0.45; cursor: default; }

/* ---------------------------------------------------------------- one pokemon: score and stats */
.calc-out { display: grid; gap: 12px; }
.calc-empty { display: grid; justify-items: center; gap: 10px; padding: 40px 16px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 12px; }
.calc-empty img { width: 56px; height: 56px; image-rendering: pixelated; opacity: 0.8; }
.calc-hero { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.calc-stage { display: grid; place-items: center; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 50% 70%, #2a3f6b, #0b1424 70%); }
.calc-score { display: grid; justify-items: center; gap: 2px; }
.calc-score-num { font-family: var(--pixel); font-size: 2.6rem; line-height: 1; }
.calc-band { font-family: var(--pixel); font-size: 0.85rem; padding: 2px 10px; border-radius: 999px; background: #0b1424; }
.calc-who { display: grid; gap: 6px; }
.calc-who h3 { font-family: var(--pixel); font-size: 1.3rem; }
.tone-gold { color: #ffd23f; } .tone-purple { color: #c08bff; } .tone-blue { color: #5aa9ff; }
.tone-green { color: #4cc96a; } .tone-gray { color: #a8b3c7; } .tone-red { color: #ff7a8a; }
@media (max-width: 600px) { .calc-hero { grid-template-columns: auto minmax(0, 1fr); } .calc-who { grid-column: 1 / -1; } }

.calc-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.calc-card h4 { font-family: var(--pixel); font-size: 1rem; }
.calc-stats { display: grid; gap: 6px; }
.calc-stat { display: grid; grid-template-columns: 64px minmax(0, 1fr) 70px 64px; gap: 8px; align-items: center; font-size: 0.85rem; }
.calc-stat-name { color: var(--muted); font-size: 0.75rem; }
.calc-stat-track { position: relative; height: 10px; border-radius: 5px; background: #0b1424; overflow: hidden; }
.calc-stat-track i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; transition: width 0.2s; }
.calc-stat-track i.avg { background: #ffffff26; }
.calc-stat-track i.up { background: linear-gradient(90deg, #2f8f4a, #4cc96a); mix-blend-mode: screen; }
.calc-stat-track i.down { background: linear-gradient(90deg, #8f2f3a, #e5484d); mix-blend-mode: screen; }
.calc-stat b { text-align: right; font-family: var(--pixel); }
.calc-diff { font-size: 0.75rem; text-align: right; }
.calc-diff.up { color: #4cc96a; }
.calc-diff.down { color: #ff7a8a; }
.calc-total { display: grid; grid-template-columns: 64px minmax(0, 1fr) 70px 64px; gap: 8px; padding-top: 6px; border-top: 1px solid #ffffff12; }
.calc-total span:first-child { color: var(--muted); font-size: 0.75rem; }
.calc-total b { grid-column: 3; text-align: right; font-family: var(--pixel); }
.calc-moves { display: grid; gap: 4px; }
.calc-move { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px 48px 52px; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 7px; background: #0b1424; font-size: 0.85rem; }
.calc-move b { text-align: right; font-family: var(--pixel); }
.calc-move-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- A × B */
.cmp-out { display: grid; gap: 12px; }
.cmp-result { display: grid; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.cmp-result h3 { font-family: var(--pixel); font-size: 1.25rem; color: var(--accent); }
.cmp-bar { display: flex; height: 22px; border-radius: 11px; overflow: hidden; background: #0b1424; }
.cmp-bar i { display: grid; place-items: center; font-style: normal; font-size: 0.75rem; font-weight: 700; color: #fff; transition: width 0.3s; min-width: 0; }
.cmp-bar i.a { background: linear-gradient(90deg, #2f5fbf, #4a86ff); }
.cmp-bar i.b { background: linear-gradient(90deg, #e5484d, #bf2f3a); }
.cmp-bar i.draw { background: #4a5570; }
.cmp-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.cmp-vs { font-family: var(--pixel); font-size: 1.4rem; color: var(--muted); }
.cmp-side { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 14px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); transition: opacity 0.2s, transform 0.2s; }
.cmp-side.side-a { border-top: 3px solid #4a86ff; }
.cmp-side.side-b { border-top: 3px solid #e5484d; }
.cmp-side.win { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px #ffd23f22; }
.cmp-side.lose { opacity: 0.7; }
.cmp-crown { position: absolute; top: -14px; width: 28px; height: 28px; image-rendering: pixelated; }
.cmp-eff { font-style: normal; font-weight: 700; }
.cmp-eff.up { color: #4cc96a; }
.cmp-eff.down { color: #ff7a8a; }
.cmp-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 0.9rem; }
.cmp-table th, .cmp-table td { padding: 6px 10px; text-align: center; border-top: 1px solid #ffffff10; }
.cmp-table th { color: var(--muted); font-weight: 600; font-size: 0.78rem; }
.cmp-table td { font-family: var(--pixel); }
.cmp-table td.hi { color: #4cc96a; }
@media (max-width: 600px) { .cmp-sides { grid-template-columns: minmax(0, 1fr); } .cmp-vs { justify-self: center; } }
