:root {
  --bg-1: #090303;
  --bg-2: #140707;
  --bg-3: #1d0b08;

  --panel: rgba(28, 12, 8, 0.88);
  --panel-strong: rgba(40, 16, 10, 0.96);

  --line: rgba(255, 120, 40, 0.18);
  --line-strong: rgba(255, 145, 60, 0.34);

  --text: #f6dfb8;
  --muted: #c6a57d;

  --accent: #ff7a18;
  --accent-2: #ffb347;
  --accent-red: #c1121f;

  --ok: #89d36f;
  --warn: #ffbe55;
  --bad: #ff7474;

  --physical: #ff7b39;
  --elemental: #b77cff;
  --absorb: #f3c96a;
  --decrease: #7ee0d1;

  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius-xl: 24px;
  --blur: blur(18px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(193, 18, 31, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 122, 24, 0.12), transparent 24%),
    radial-gradient(circle at center, rgba(255, 60, 0, 0.05), transparent 36%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(85px);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
  animation: floatGlow 10s ease-in-out infinite;
}

body::before {
  top: -110px;
  left: -70px;
  background: #8f1010;
}

body::after {
  right: -110px;
  bottom: -130px;
  background: #ff6a00;
  animation-delay: -4s;
}

@keyframes floatGlow {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(16px) scale(1.05); }
}

@keyframes pulseSoft {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes subtleFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

@keyframes shineSweep {
  0% { transform: translateX(-130%); opacity: 0; }
  18% { opacity: .25; }
  100% { transform: translateX(130%); opacity: 0; }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1550px;
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 18px;
  margin-bottom: 22px;
}

.glass,
.card,
.metric {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(39, 16, 9, 0.92), rgba(19, 8, 6, 0.88));
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.glass::before,
.card::before,
.metric::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,176,71,0.12), transparent 28%, rgba(193,18,31,0.10));
  pointer-events: none;
}

.glass::after,
.card::after,
.metric::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 179, .06), transparent);
  transform: translateX(-130%);
  animation: shineSweep 8s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-main,
.hero-side,
.card,
.metric,
.recommendation-item,
.monster-card {
  transition: transform .24s ease, border-color .24s ease;
}

.hero-main:hover,
.hero-side:hover,
.card:hover,
.metric:hover,
.recommendation-item:hover,
.monster-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.hero-main { padding: 28px; }
.hero-side {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 170, 70, 0.22);
  border-radius: 999px;
  color: #ffd89a;
  background: rgba(255,255,255,.03);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: #fff0cf;
}

.sub {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 760px;
  font-size: 15px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  padding: 10px 14px;
  border: 1px solid rgba(255, 145, 60, 0.16);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 13px;
}

.hero-label {
  font-size: 12px;
  color: #d0a06a;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.hero-big {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #ffe0ad;
}

.hero-mini {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 22px;
  align-items: start;
}

.card { padding: 22px; }

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.title-row h2,
.title-row h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
  color: #ffe5ba;
}

.title-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.controls { display: grid; gap: 14px; }

label {
  display: block;
  font-size: 12px;
  color: #e2b479;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

select,
input {
  width: 100%;
  border: 1px solid rgba(255, 133, 43, 0.20);
  border-radius: 14px;
  background: rgba(20, 8, 6, 0.82);
  color: var(--text);
  padding: 13px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

select:focus,
input:focus {
  border-color: rgba(255, 136, 43, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 122, 24, 0.14);
  background: rgba(24, 10, 8, 0.96);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.status-bar {
  margin-top: 6px;
  min-height: 19px;
  color: var(--muted);
  font-size: 12px;
}

.quick-stats {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.quick-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255, 133, 43, 0.08);
  font-size: 13px;
}

.quick-item span:first-child { color: var(--muted); }
.quick-item span:last-child { font-weight: 700; color: var(--text); }

.metrics {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.metrics-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric {
  padding: 22px;
  background: linear-gradient(180deg, rgba(42, 17, 10, 0.96), rgba(20, 8, 6, 0.88));
  animation: subtleFloat 5.5s ease-in-out infinite;
}

.metric-physical::before {
  background: linear-gradient(135deg, rgba(255, 123, 57, .18), transparent 35%, rgba(255, 80, 0, .08));
}

.metric-elemental::before {
  background: linear-gradient(135deg, rgba(183, 124, 255, .18), transparent 35%, rgba(114, 73, 200, .08));
}

.metric-absorb::before {
  background: linear-gradient(135deg, rgba(243, 201, 106, .18), transparent 35%, rgba(255, 180, 70, .08));
}

.metric-decrease::before {
  background: linear-gradient(135deg, rgba(126, 224, 209, .18), transparent 35%, rgba(68, 198, 180, .08));
}

.metric .label,
.metric .value,
.metric .desc,
.badge,
.metric .footer-note {
  position: relative;
  z-index: 1;
}

.metric .label {
  color: #f0d0a2;
  font-size: 14px;
  font-weight: 700;
}

.metric .value {
  margin: 14px 0 8px;
  font-size: clamp(24px, 2.2vw, 36px);
  font-weight: 800;
  letter-spacing: -.04em;
  color: #fff1d6;
}

.metric .desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin-top: 12px;
  letter-spacing: .02em;
  border: 1px solid transparent;
}

.ok { background: rgba(137,211,111,.14); color: #baf3a6; border-color: rgba(137,211,111,.2); }
.warn { background: rgba(255,190,85,.14); color: #ffd995; border-color: rgba(255,190,85,.2); }
.bad { background: rgba(255,116,116,.14); color: #ffb0b0; border-color: rgba(255,116,116,.2); }

.analysis-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}

.stack,
.detail-list,
.recommendation-list,
.monster-list {
  display: grid;
  gap: 12px;
}

.stack { gap: 18px; }

.detail-item,
.recommendation-item,
.monster-card {
  padding: 14px 16px;
  border: 1px solid rgba(255, 133, 43, 0.10);
  background: rgba(255,255,255,.025);
  border-radius: 16px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.detail-item span:first-child { color: var(--muted); }
.detail-item span:last-child {
  font-weight: 700;
  text-align: right;
  color: #ffe8bc;
}

.recommendation-item h4,
.monster-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: -.02em;
  color: #ffe4b2;
}

.recommendation-item p,
.monster-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.recommendation-strong {
  color: #fff2d7;
  font-weight: 800;
}

.monster-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: start;
}

.monster-thumb {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(255,122,24,.18), rgba(255,255,255,.03));
  border: 1px solid rgba(255,133,43,.16);
  display: block;
}

.monster-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffe2b1;
  font-weight: 800;
  font-size: 22px;
}

.monster-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 133, 43, 0.12);
  background: rgba(255,255,255,.03);
  color: #f7ddb4;
  font-size: 12px;
}

.image-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,133,43,.12);
  color: var(--muted);
  font-size: 12px;
}

.loading { animation: pulseSoft 1.4s ease-in-out infinite; }
.fade-in { animation: fadeInUp .36s ease; }

.footer-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.kpi-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 10px;
}

.kpi-inline .mini {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,133,43,.10);
}

.mini .mini-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.mini .mini-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff0cd;
}

@media (max-width: 1500px) {
  .metrics-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .hero,
  .layout,
  .analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .metrics-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .metrics-6,
  .row-2,
  .kpi-inline { grid-template-columns: 1fr; }
  .monster-card { grid-template-columns: 1fr; }
  .monster-thumb { width: 100%; height: 180px; }
  .wrap { padding: 16px; }
  .hero-main,
  .hero-side,
  .card,
  .metric { padding: 18px; }
  h1 { font-size: 32px; }
}

/* ===== CALCULADORA DE DAÑO — Rediseño limpio ===== */
.calc-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.calc-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 24px 28px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(178,26,255,.18), rgba(255,43,214,.1), rgba(255,204,102,.06));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
}

.calc-hero-content h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3.5vw, 38px);
  background: linear-gradient(90deg, #fff, #ffcc66);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.calc-hero-content p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 52ch;
}

.calc-eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #ffcc66;
  margin-bottom: 12px;
}

.calc-hero-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.calc-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.1);
  font-size: 13px;
  color: var(--muted);
}

.calc-pill.loading { animation: pulseSoft 1.4s ease-in-out infinite; }

.calc-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1000px) {
  .calc-layout { grid-template-columns: 1fr; }
}

.calc-panel {
  background: linear-gradient(180deg, rgba(42, 17, 10, 0.96), rgba(20, 8, 6, 0.92));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.calc-panel h2 {
  margin: 0 0 18px;
  font-size: 18px;
  color: #ffe5ba;
  font-weight: 700;
}

.calc-inputs .calc-field {
  margin-bottom: 14px;
}

.calc-inputs label {
  display: block;
  font-size: 12px;
  color: #e2b479;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.calc-inputs select,
.calc-inputs input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 133, 43, 0.22);
  background: rgba(20, 8, 6, 0.9);
  color: var(--text);
  font-size: 14px;
}

.calc-inputs select:focus,
.calc-inputs input:focus {
  border-color: rgba(255, 136, 43, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.15);
  outline: none;
}

.calc-divider {
  display: block;
  margin: 20px 0 14px;
  padding: 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: #ffcc66;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.calc-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .calc-row-2 { grid-template-columns: 1fr; }
}

.calc-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.calc-mob-info {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.06);
  display: grid;
  gap: 8px;
}

.calc-mob-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.calc-mob-row span { color: var(--muted); }
.calc-mob-row strong { color: #fff0cd; }

.calc-data-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.9;
}

/* Resultados grandes */
.calc-big-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .calc-big-grid { grid-template-columns: 1fr; }
}

.calc-big-card {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.2);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.calc-big-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
  border-color: rgba(255,255,255,.15);
}

.calc-big-card-kill { border-left: 4px solid var(--ok); }
.calc-big-card-damage { border-left: 4px solid var(--physical); }
.calc-big-card-survival { border-left: 4px solid var(--accent); }
.calc-big-card-worst { border-left: 4px solid var(--elemental); }

.calc-big-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

.calc-big-value {
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 800;
  color: #fff1d6;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.calc-big-value-yesno {
  font-size: clamp(22px, 2.2vw, 32px);
}

.calc-big-badge {
  margin-top: 10px;
}

.calc-big-badge .badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.calc-big-badge .badge.ok { background: rgba(137,211,111,.2); color: #baf3a6; border: 1px solid rgba(137,211,111,.3); }
.calc-big-badge .badge.warn { background: rgba(255,190,85,.2); color: #ffd995; border: 1px solid rgba(255,190,85,.3); }
.calc-big-badge .badge.bad { background: rgba(255,116,116,.2); color: #ffb0b0; border: 1px solid rgba(255,116,116,.3); }

.calc-big-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.calc-big-hint strong { color: #ffd89a; }

/* Diagnóstico */
.calc-diagnosis {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  margin-bottom: 16px;
}

.calc-diagnosis h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #ffd89a;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.calc-diagnosis p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

/* Detalle colapsable */
.calc-detail {
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,.15);
}

.calc-detail summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}

.calc-detail summary:hover {
  color: #ffd89a;
}

.calc-detail-grid {
  padding: 12px 18px 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 500px) {
  .calc-detail-grid { grid-template-columns: 1fr; }
}

.calc-detail-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  font-size: 13px;
}

.calc-detail-item span:first-child { color: var(--muted); }
.calc-detail-item span:last-child { font-weight: 700; color: #ffe8bc; }

/* Sugerencia */
.calc-suggestion {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,176,71,.08), rgba(178,26,255,.05));
  border: 1px solid rgba(255,255,255,.08);
}

.calc-suggestion h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #ffcc66;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.calc-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 500px) {
  .calc-suggestion-grid { grid-template-columns: repeat(2, 1fr); }
}

.calc-suggestion-grid > div {
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.2);
}

.calc-suggestion-grid span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.calc-suggestion-grid strong {
  font-size: 16px;
  color: #fff0cd;
}