:root {
  color-scheme: dark;
  --ui-scale: 0.9;
  --night: #07100f;
  --ink: #0d1715;
  --pine: #17372e;
  --moss: #4a7445;
  --leaf: #a5cf74;
  --gold: #e9c46a;
  --ember: #df7c4e;
  --steel: #c9d8d5;
  --muted: #92a69e;
  --panel: rgba(8, 15, 14, 0.66);
  --panel-strong: rgba(14, 31, 27, 0.78);
  --line: rgba(219, 231, 204, 0.23);
  --shadow: rgba(0, 0, 0, 0.38);
}

html {
  font-size: 90%;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(233, 196, 106, 0.2), transparent 26rem),
    radial-gradient(circle at 88% 18%, rgba(165, 207, 116, 0.18), transparent 30rem),
    linear-gradient(145deg, #08110f 0%, #13251f 46%, #07100f 100%);
  color: #eff8ef;
  font-family: Inter, system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("./assets/mythic-background.webp");
  background-position: center;
  background-size: cover;
  filter: saturate(1.06) contrast(1.08) brightness(0.8);
  transform: scale(1.02);
}

button,
input {
  font: inherit;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

#mythic-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.56;
  mix-blend-mode: screen;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 181, 88, 0.12), transparent 22rem),
    linear-gradient(90deg, rgba(5, 10, 10, 0.72), rgba(5, 10, 10, 0.34) 54%, rgba(5, 10, 10, 0.72)),
    linear-gradient(180deg, rgba(5, 10, 10, 0.08), rgba(5, 10, 10, 0.7));
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  width: min(1062px, calc(100% - 24px));
  margin: 0 auto;
  padding: 10px 0 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-link,
.site-topbar a,
.site-footer a {
  color: inherit;
  text-decoration: none;
}

.brand-link {
  color: #fff1bf;
  font-family: "Cinzel Decorative", Cinzel, Georgia, serif;
  font-size: 0.9rem;
  font-weight: 900;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.language-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.lang-chip {
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 4px 7px;
  background: rgba(7, 16, 15, 0.5);
  color: rgba(239, 248, 239, 0.82);
  font-size: 0.66rem;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.lang-chip.active {
  border-color: rgba(233, 196, 106, 0.54);
  color: #fff1bf;
}

.lang-en { box-shadow: inset 0 -2px rgba(233, 196, 106, 0.42); }
.lang-es { box-shadow: inset 0 -2px rgba(223, 124, 78, 0.5); }
.lang-fr { box-shadow: inset 0 -2px rgba(92, 155, 255, 0.5); }
.lang-de { box-shadow: inset 0 -2px rgba(214, 190, 74, 0.5); }
.lang-pt { box-shadow: inset 0 -2px rgba(64, 184, 104, 0.5); }
.lang-zh { box-shadow: inset 0 -2px rgba(239, 89, 89, 0.54); }
.lang-ko { box-shadow: inset 0 -2px rgba(165, 207, 116, 0.5); }

.app-shell {
  position: relative;
  z-index: 3;
  width: min(1062px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0 42px;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 78px;
  border: 1px dashed rgba(233, 196, 106, 0.32);
  border-radius: 8px;
  background: rgba(7, 16, 15, 0.42);
  color: rgba(255, 241, 191, 0.72);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.ad-banner {
  min-height: 90px;
  margin-bottom: 12px;
}

.ad-score {
  min-height: 120px;
  margin-top: 12px;
}

.hero {
  min-height: 27vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  padding: 28px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--leaf);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Cormorant Garamond", Cinzel, Georgia, serif;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-family: "Cinzel Decorative", Cinzel, Georgia, serif;
  font-size: clamp(2.55rem, 6vw, 5.7rem);
  line-height: 0.95;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.82), 0 0 24px rgba(132, 221, 220, 0.18);
  text-wrap: balance;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  font-weight: 700;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(128px, 1fr));
  gap: 10px;
  min-width: min(100%, 310px);
}

.hero-stats div,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 70px var(--shadow);
  backdrop-filter: blur(10px) saturate(1.08);
}

.hero-stats div {
  border-radius: 8px;
  padding: 16px;
}

.hero-stats span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-stats strong {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--gold);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border-radius: 8px;
  padding: clamp(16px, 2vw, 24px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-actions {
  display: grid;
  grid-template-columns: auto;
  align-items: flex-end;
  gap: 5px;
}

.score-panel .panel-actions {
  grid-template-columns: minmax(202px, 1fr) auto;
  align-items: start;
  min-width: min(100%, 344px);
}

.score-panel .reset-button {
  grid-column: 2;
}

.ilvl-panel .panel-actions {
  justify-items: end;
}

.reset-button {
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid rgba(165, 207, 116, 0.25);
  border-radius: 8px;
  background: rgba(20, 45, 35, 0.28);
  color: rgba(202, 239, 167, 0.78);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.reset-button:hover {
  transform: translateY(-1px);
  border-color: rgba(233, 196, 106, 0.46);
  background: rgba(75, 95, 51, 0.3);
  color: #d8f4b9;
}

.result-pill {
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid rgba(233, 196, 106, 0.45);
  border-radius: 8px;
  background: rgba(233, 196, 106, 0.12);
  color: var(--gold);
  font-size: 1.45rem;
  font-weight: 800;
  text-align: center;
}

.score-form,
.gear-grid {
  display: grid;
  gap: 10px;
}

.cutoff-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  grid-row: 1 / span 2;
  margin: 0;
}

.cutoff-chip {
  min-height: 34px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 5px 6px;
  background: rgba(10, 20, 18, 0.58);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.04);
}

.cutoff-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #fff7df;
  font-size: 0.56rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.cutoff-chip img {
  width: auto;
  max-width: 16px;
  height: 10px;
  object-fit: contain;
  background: transparent;
  border-radius: 1px;
}

.cutoff-chip strong {
  color: #fff7df;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.cutoff-us {
  grid-column: 1 / span 2;
  border-color: rgba(239, 89, 89, 0.46);
  background: rgba(91, 21, 24, 0.42);
}

.cutoff-cn {
  grid-column: 3 / span 2;
  border-color: rgba(233, 196, 106, 0.52);
  background: rgba(92, 67, 18, 0.42);
}

.cutoff-eu {
  grid-column: 5 / span 2;
  border-color: rgba(92, 155, 255, 0.48);
  background: rgba(22, 48, 92, 0.42);
}

.cutoff-kr {
  grid-column: 2 / span 2;
  border-color: rgba(185, 113, 255, 0.56);
  background: rgba(78, 34, 118, 0.46);
}

.cutoff-tw {
  grid-column: 4 / span 2;
  border-color: rgba(99, 211, 122, 0.5);
  background: rgba(26, 91, 49, 0.44);
}

.dungeon-row,
.gear-row {
  display: grid;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 26, 22, 0.66);
}

.dungeon-row {
  cursor: grab;
}

.dungeon-row.dragging {
  opacity: 0.62;
}

.dungeon-row {
  grid-template-columns: minmax(138px, 1fr) 136px 116px 86px;
  gap: 7px;
  padding: 8px;
}

.dungeon-row input,
.dungeon-row button,
.dungeon-row label,
.time-under,
.key-control,
.stars {
  cursor: auto;
}

.gear-row {
  grid-template-columns: minmax(118px, 1fr) 154px;
  gap: 8px 12px;
  padding: 12px;
}

.slot-name,
.dungeon-name {
  min-width: 0;
  color: #f3fbf3;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 800;
}

.dungeon-name {
  width: 100%;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  background: transparent;
  color: #f3fbf3;
  font-weight: 800;
  white-space: normal;
}

.dungeon-name:focus {
  border-bottom-color: var(--leaf);
}

.number-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(201, 216, 213, 0.22);
  border-radius: 8px;
  outline: 0;
  background: rgba(4, 9, 8, 0.58);
  color: #fff7df;
  font-weight: 800;
  text-align: center;
}

.number-input:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(165, 207, 116, 0.16);
}

.key-control {
  display: grid;
  grid-template-columns: 36px minmax(48px, 1fr) 36px;
  gap: 5px;
  align-items: center;
}

.ilvl-control {
  display: grid;
  grid-template-columns: 42px minmax(54px, 1fr) 42px;
  gap: 6px;
  align-items: center;
}

.key-step {
  min-height: 34px;
  border: 1px solid rgba(233, 196, 106, 0.35);
  border-radius: 8px;
  background: rgba(233, 196, 106, 0.12);
  color: #ffe4a4;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.key-step:hover {
  transform: translateY(-1px);
  border-color: rgba(233, 196, 106, 0.68);
  background: rgba(233, 196, 106, 0.2);
}

.stars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.star-button,
.weapon-toggle button,
.quick-chip {
  min-height: 34px;
  border: 1px solid rgba(201, 216, 213, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--steel);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.star-button:hover,
.weapon-toggle button:hover,
.quick-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(233, 196, 106, 0.62);
}

.star-button.active,
.weapon-toggle button.active,
.quick-chip.active {
  border-color: rgba(233, 196, 106, 0.72);
  background: linear-gradient(180deg, rgba(233, 196, 106, 0.24), rgba(223, 124, 78, 0.14));
  color: #fff0bd;
}

.quick-select {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.quick-label {
  color: #b7ef8e;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  font-style: italic;
  font-weight: 700;
  margin-right: 2px;
  white-space: nowrap;
}

.quick-label-compact {
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.quick-chip {
  min-height: 28px;
  min-width: 47px;
  padding: 5px 8px;
  color: #b7ef8e;
  font-size: 0.74rem;
  font-weight: 900;
}

.row-score {
  color: var(--gold);
  font-weight: 800;
  text-align: center;
}

.score-input {
  border-color: rgba(233, 196, 106, 0.34);
  background: rgba(28, 24, 10, 0.52);
  color: var(--gold);
}

.time-under {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(170px, 1fr);
  gap: 7px;
  align-items: center;
}

.time-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.time-mode-button {
  min-height: 31px;
  border: 1px solid rgba(201, 216, 213, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--steel);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.time-mode-button[data-time-mode="timedIn"] {
  color: #ffd4a8;
}

.time-under .time-mode-button[data-time-mode="timedIn"] {
  color: #ffd4a8 !important;
}

.time-mode-button.active[data-time-mode="timedIn"] {
  border-color: rgba(223, 124, 78, 0.78);
  background: rgba(223, 124, 78, 0.22);
  color: #ffd4a8;
}

.time-mode-button.active[data-time-mode="timeUnder"] {
  border-color: rgba(165, 207, 116, 0.72);
  background: rgba(72, 126, 76, 0.24);
  color: #c9f79a;
}

.time-entry {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.par-time {
  color: rgba(255, 247, 223, 0.74);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.time-under span {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.time-under > span,
.par-time {
  color: #b7ef8e;
}

.weapon-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.seo-content,
.site-footer,
.legal-page {
  position: relative;
  z-index: 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 15, 14, 0.58);
  box-shadow: 0 24px 70px var(--shadow);
  backdrop-filter: blur(10px) saturate(1.08);
}

.seo-content {
  margin-top: 18px;
  padding: clamp(18px, 3vw, 30px);
}

.seo-content p,
.site-footer p,
.legal-page p,
.legal-page li {
  color: rgba(239, 248, 239, 0.82);
  line-height: 1.65;
}

.seo-content > p {
  max-width: 860px;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.seo-grid h3,
.legal-page h2 {
  margin: 0 0 8px;
  color: #fff1bf;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.3rem;
}

.seo-grid p {
  margin: 0;
}

.site-footer {
  display: grid;
  width: min(1062px, calc(100% - 24px));
  margin: 18px auto 24px;
  padding: 18px;
  gap: 12px;
}

.site-footer strong {
  color: #fff1bf;
  font-family: "Cinzel Decorative", Cinzel, Georgia, serif;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer a {
  color: #b7ef8e;
  font-size: 0.84rem;
  font-weight: 800;
}

.site-footer p {
  margin: 0;
}

.disclaimer {
  color: rgba(201, 216, 213, 0.68) !important;
  font-size: 0.78rem;
}

.legal-page {
  width: min(900px, calc(100% - 24px));
  margin: 24px auto;
  padding: clamp(20px, 4vw, 36px);
}

.legal-page h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
}

.legal-page a {
  color: #b7ef8e;
}

.hidden {
  display: none;
}

@media (max-width: 920px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 22vh;
  }
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .language-nav {
    justify-content: flex-start;
  }

  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions {
    width: 100%;
    align-items: stretch;
  }

  .score-panel .panel-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .score-panel .reset-button {
    grid-column: auto;
  }

  .reset-button {
    align-self: flex-end;
    width: auto;
  }

  .result-pill {
    width: 100%;
    min-width: 0;
  }

  .cutoff-strip {
    grid-row: auto;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dungeon-row {
    grid-template-columns: 1fr;
  }

  .key-control {
    grid-column: 1 / -1;
    grid-template-columns: 46px minmax(90px, 1fr) 46px;
  }

  .stars {
    grid-column: 1 / -1;
  }

  .row-score {
    grid-column: 1 / -1;
    text-align: center;
  }

  .time-under {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .time-mode {
    grid-template-columns: 1fr 1fr;
  }

  .gear-row {
    grid-template-columns: 1fr;
  }

  .ilvl-control {
    grid-template-columns: 46px minmax(90px, 1fr) 46px;
  }

  .seo-grid {
    grid-template-columns: 1fr;
  }
}
