:root {
  --bg: #07100f;
  --bg-soft: #0b1817;
  --panel: rgba(12, 28, 26, 0.93);
  --panel-strong: rgba(9, 22, 21, 0.98);
  --line: rgba(200, 145, 52, 0.28);
  --line-strong: rgba(232, 181, 78, 0.65);
  --gold: #d39b39;
  --gold-light: #f2d08a;
  --gold-dark: #8d5b18;
  --teal: #25c7c2;
  --teal-soft: #76e0da;
  --text: #f4efe4;
  --muted: #aab9b5;
  --danger: #df6a5d;
  --success: #81d5a3;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 12%, rgba(22, 154, 151, 0.12), transparent 30rem),
    radial-gradient(circle at 84% 7%, rgba(192, 128, 33, 0.12), transparent 28rem),
    linear-gradient(180deg, #06100f 0%, #081513 55%, #050c0b 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.12;
  pointer-events: none;
}
.ambient--one { left: -180px; top: 28%; background: var(--teal); }
.ambient--two { right: -180px; top: 44%; background: var(--gold); }

.site-header {
  position: relative;
  padding: 30px 20px 24px;
  border-bottom: 1px solid rgba(220, 168, 65, 0.18);
  background: linear-gradient(180deg, rgba(4, 12, 11, .88), rgba(6, 16, 15, .55));
  backdrop-filter: blur(12px);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: min(620px, 75vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--teal), var(--gold), transparent);
}

.header-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.brand-logo {
  width: clamp(220px, 34vw, 390px);
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.55));
}

.header-copy { max-width: 520px; }
.header-copy h1 {
  margin: 3px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  color: var(--gold-light);
  text-shadow: 0 3px 18px rgba(209, 151, 55, .17);
}
.header-copy p:last-child { margin: 0; color: var(--muted); font-size: 1.05rem; }

.eyebrow, .section-kicker, .winner-label {
  margin: 0;
  color: var(--teal-soft);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 0;
  display: grid;
  gap: 22px;
}

.panel, .winner-panel, .result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(20px, 3vw, 32px);
  background:
    linear-gradient(140deg, rgba(20, 43, 39, .86), rgba(7, 20, 18, .95)),
    var(--panel);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading h2, .selected-map-copy h2 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  color: var(--gold-light);
}

.section-description { margin: 7px 0 0; color: var(--muted); }
.section-description strong { color: var(--text); }

.map-count, .level-badge {
  padding: 7px 11px;
  border: 1px solid rgba(37, 199, 194, .25);
  border-radius: 999px;
  color: var(--teal-soft);
  background: rgba(15, 69, 66, .25);
  font-size: .82rem;
  white-space: nowrap;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.map-card {
  position: relative;
  min-width: 0;
  padding: 12px 10px 13px;
  border: 1px solid rgba(209, 151, 55, .2);
  border-radius: 15px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(18, 41, 38, .82), rgba(7, 18, 17, .9));
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.map-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 199, 194, .62);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}

.map-card.is-active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(69, 51, 19, .48), rgba(11, 30, 27, .95));
  box-shadow: inset 0 0 0 1px rgba(242, 208, 138, .15), 0 12px 30px rgba(0,0,0,.3);
}

.map-card.is-active::after {
  content: "";
  position: absolute;
  inset: auto 22% -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
}

.map-card img {
  display: block;
  width: 72px;
  height: 74px;
  margin: 0 auto 7px;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 8px 8px rgba(0,0,0,.38));
}

.map-card span { display: block; text-align: center; }
.map-card .map-name { min-height: 38px; font-size: .86rem; font-weight: 750; line-height: 1.2; }
.map-card .map-level { margin-top: 4px; color: var(--muted); font-size: .72rem; }

.calculator-panel { padding-top: 0; overflow: hidden; }

.selected-map-banner {
  margin: 0 calc(clamp(20px, 3vw, 32px) * -1) 26px;
  padding: 17px clamp(20px, 3vw, 32px);
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid rgba(209, 151, 55, .25);
  background:
    radial-gradient(circle at 12% 50%, rgba(37,199,194,.18), transparent 30%),
    linear-gradient(90deg, rgba(11, 43, 40, .72), rgba(40, 31, 14, .38));
}

.selected-map-art {
  width: 90px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37,199,194,.22);
  border-radius: 16px;
  background: rgba(4, 15, 14, .52);
  overflow: hidden;
}
.selected-map-art img { width: 82px; height: 82px; object-fit: contain; }
.selected-map-copy h2 { margin-bottom: 7px; }

.model-info {
  min-width: 170px;
  padding: 12px 15px;
  text-align: right;
  border-left: 1px solid rgba(209,151,55,.24);
}
.model-info span, .model-info small { display: block; color: var(--muted); }
.model-info strong { display: block; color: var(--gold-light); font-family: Georgia, serif; font-size: 1.65rem; line-height: 1.05; }
.model-info small { margin-top: 3px; }

.inputs-heading { align-items: end; }
.input-actions { display: flex; gap: 8px; }

.button {
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .84rem;
  font-weight: 750;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.button:active { transform: translateY(1px); }
.button--ghost {
  border-color: rgba(209,151,55,.28);
  background: rgba(7, 20, 18, .62);
}
.button--ghost:hover { border-color: var(--gold); background: rgba(72, 52, 19, .34); }

.damage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.damage-field {
  padding: 16px;
  border: 1px solid rgba(209,151,55,.19);
  border-radius: 15px;
  background: rgba(5, 17, 16, .58);
}
.damage-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.damage-field .stage-pill {
  padding: 3px 8px;
  border: 1px solid rgba(37,199,194,.3);
  border-radius: 999px;
  color: var(--teal-soft);
  font-size: .72rem;
  font-weight: 850;
}
.damage-field .metin-name { color: var(--muted); font-size: .78rem; text-align: right; }

.damage-input-wrap { position: relative; }
.damage-input {
  width: 100%;
  height: 51px;
  padding: 0 50px 0 14px;
  border: 1px solid rgba(37,199,194,.24);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: rgba(3, 13, 12, .85);
  font-size: 1.08rem;
  font-weight: 760;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.damage-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(37,199,194,.11);
}
.damage-input.is-invalid { border-color: var(--danger); }
.damage-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--gold-light); font-size: .76rem; font-weight: 800; }
.damage-meta { min-height: 19px; margin: 7px 1px 0; color: var(--muted); font-size: .76rem; }
.damage-meta.is-error { color: #f09a90; }

.assumption-note {
  margin-top: 16px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(37,199,194,.16);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(11, 50, 46, .22);
  font-size: .82rem;
}
.assumption-note p { margin: 0; }
.info-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37,199,194,.38);
  border-radius: 50%;
  color: var(--teal-soft);
  font-family: Georgia, serif;
  font-weight: 800;
}

.winner-panel {
  position: relative;
  padding: 23px 26px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 6% 50%, rgba(37,199,194,.24), transparent 24%),
    radial-gradient(circle at 95% 50%, rgba(211,155,57,.22), transparent 28%),
    linear-gradient(115deg, rgba(10, 42, 38, .96), rgba(41, 30, 12, .91));
  border-color: rgba(226, 176, 75, .52);
}
.winner-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.035) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: sheen 8s ease-in-out infinite;
}
@keyframes sheen { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.winner-crown {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242,208,138,.52);
  border-radius: 14px;
  color: var(--gold-light);
  background: rgba(109,72,17,.35);
  font-size: 1.45rem;
  transform: rotate(45deg);
}
.winner-crown::first-letter { transform: rotate(-45deg); }
.winner-content h2 { margin: 3px 0 3px; font-family: Georgia, serif; font-size: clamp(1.45rem, 3vw, 2.25rem); color: var(--gold-light); }
.winner-content p:last-child { margin: 0; color: var(--muted); }
.winner-rate { min-width: 130px; text-align: right; }
.winner-rate span { display: block; color: var(--muted); font-size: .78rem; }
.winner-rate strong { display: block; color: var(--teal-soft); font-family: Georgia, serif; font-size: 2rem; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.result-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(18, 39, 36, .94), rgba(6, 17, 16, .98));
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.result-card.is-winner {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 20px 45px rgba(0,0,0,.38), inset 0 0 0 1px rgba(242,208,138,.12);
}
.result-card.is-winner::before {
  content: "NAJLEPSZY";
  position: absolute;
  top: 13px;
  right: -34px;
  width: 128px;
  padding: 4px 0;
  transform: rotate(37deg);
  text-align: center;
  color: #1b160c;
  background: linear-gradient(90deg, #ae7220, #f0cf86, #b57925);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .11em;
}
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.result-stage { margin: 0; color: var(--teal-soft); font-size: .72rem; font-weight: 900; letter-spacing: .12em; }
.result-name { margin: 3px 0 0; font-family: Georgia, serif; font-size: 1.2rem; color: var(--gold-light); }
.drop-badge { padding: 5px 8px; border: 1px solid rgba(209,151,55,.32); border-radius: 9px; color: var(--gold-light); background: rgba(83,56,14,.25); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.result-main { margin: 19px 0 15px; }
.result-main span { display: block; color: var(--muted); font-size: .78rem; }
.result-main strong { display: block; margin-top: 1px; font-family: Georgia, serif; font-size: 2rem; color: var(--text); }
.result-main small { color: var(--teal-soft); }
.stat-list { display: grid; gap: 8px; }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.055); }
.stat-row span { color: var(--muted); font-size: .78rem; }
.stat-row strong { text-align: right; font-size: .86rem; }
.breakpoint {
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid rgba(37,199,194,.14);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(12, 54, 50, .18);
  font-size: .76rem;
}
.breakpoint strong { color: var(--teal-soft); }

.table-wrap { overflow-x: auto; border: 1px solid rgba(209,151,55,.18); border-radius: 14px; }
.simulation-table { width: 100%; min-width: 730px; border-collapse: collapse; }
.simulation-table th, .simulation-table td { padding: 15px 16px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.055); }
.simulation-table th:first-child, .simulation-table td:first-child { text-align: left; }
.simulation-table thead { background: rgba(67, 47, 14, .33); }
.simulation-table th { color: var(--gold-light); font-size: .78rem; letter-spacing: .04em; }
.simulation-table td { font-variant-numeric: tabular-nums; }
.simulation-table tbody tr:last-child td { border-bottom: 0; }
.simulation-table tbody tr.is-winner { background: rgba(18, 91, 81, .18); }
.simulation-table tbody tr.is-winner td { color: var(--teal-soft); font-weight: 800; }
.table-stage { display: inline-flex; min-width: 38px; margin-right: 8px; padding: 3px 7px; justify-content: center; border-radius: 999px; background: rgba(37,199,194,.12); color: var(--teal-soft); font-size: .7rem; font-weight: 900; }

.methodology-panel { padding-top: 0; padding-bottom: 0; }
details summary { padding: 18px 0; cursor: pointer; color: var(--gold-light); font-weight: 800; }
details summary::marker { color: var(--teal); }
.methodology-content { padding: 0 0 20px; color: var(--muted); }
.formula-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.formula-grid code { padding: 11px; border: 1px solid rgba(37,199,194,.15); border-radius: 10px; color: var(--teal-soft); background: rgba(3,15,14,.62); text-align: center; }

.empty-result {
  padding: 25px;
  border: 1px dashed rgba(209,151,55,.3);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
  background: rgba(4,14,13,.3);
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 0;
  padding: 22px 0 30px;
  color: #71827e;
  text-align: center;
  font-size: .78rem;
}
.site-footer p { margin: 0; }

@media (max-width: 980px) {
  .map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .header-inner { flex-direction: column; gap: 6px; text-align: center; }
  .header-copy { max-width: 740px; }
  .brand-logo { width: min(390px, 78vw); margin-bottom: -15px; }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 20px, 1180px); margin-top: 18px; gap: 15px; }
  .site-header { padding: 16px 12px 20px; }
  .header-copy p:last-child { font-size: .92rem; }
  .panel { padding: 19px 15px; border-radius: 16px; }
  .selected-map-banner { margin: 0 -15px 22px; padding: 14px 15px; grid-template-columns: 72px 1fr; }
  .selected-map-art { width: 70px; height: 70px; }
  .selected-map-art img { width: 64px; height: 64px; }
  .model-info { grid-column: 1 / -1; min-width: 0; padding: 10px 0 0; display: flex; align-items: baseline; gap: 8px; border-left: 0; border-top: 1px solid rgba(209,151,55,.2); text-align: left; }
  .model-info span, .model-info strong, .model-info small { display: inline; }
  .model-info strong { font-size: 1.25rem; }
  .damage-grid, .results-grid { grid-template-columns: 1fr; }
  .result-card.is-winner { transform: none; }
  .winner-panel { grid-template-columns: auto 1fr; padding: 20px 17px; }
  .winner-rate { grid-column: 2; text-align: left; }
  .winner-rate strong { font-size: 1.65rem; }
  .formula-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading, .inputs-heading { flex-direction: column; align-items: stretch; }
  .input-actions { width: 100%; }
  .input-actions .button { flex: 1; }
  .winner-crown { width: 42px; height: 42px; }
  .winner-content h2 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
