/* ==========================================================================
   Requiem Calc - Stylesheet
   --------------------------------------------------------------------------
   Grown feature-by-feature (Skill Calculator -> EXP Calculator -> Equipment
   Planner -> portal shell), so related rules for the same component can
   appear in more than one place below. Section comments mark where each
   area's styling begins; cascade order is preserved exactly as shipped.
   ========================================================================== */

:root {
  --main: #fecf7d;
  --sub: #d1d1d1;
  --green: #00ff39;
  --panel: #08080a;
  --dark: #0b0b0e;
  --border: #6e5c58;
}
/* ---- Global reset ---------------------------------------------------------- */

* {
  box-sizing: border-box;
}
/* ---- Page background & base typography ------------------------------------- */

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 8%, rgba(95, 35, 18, 0.22), transparent 38%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.7) 58%, #000 100%),
    url("assets/ui/site_bg.png") center top / cover no-repeat;
  color: var(--main);
  font-family: Bahnschrift, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* ---- Skill Calculator: app shell ------------------------------------------- */

.app {
  width: 544px;
  height: 1220px;
  position: relative;
  background: #08080a;
  overflow: hidden;
  user-select: none;
  margin: 16px auto 0;
  box-shadow:
    0 0 0 1px rgba(255, 174, 100, 0.18),
    0 0 38px rgba(0, 0, 0, 0.92),
    0 0 90px rgba(150, 45, 20, 0.18);
  border-radius: 3px;
}
/* ---- Skill Calculator: topbar (level / profession / preset controls) ------ */

.topbar {
  height: 150px;
  padding: 8px 28px;
  background: linear-gradient(180deg, rgba(13, 10, 11, 0.96), rgba(5, 5, 7, 0.93));
  position: relative;
  z-index: 5;
}
h1 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 24px;
  text-align: center;
  font-weight: 700;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 35px;
}
.row label {
  white-space: nowrap;
}
input,
select,
button {
  height: 26px;
  background: #121216;
  color: var(--main);
  border: 1px solid #55493a;
  font: inherit;
  padding: 0 8px;
}
input[type="number"] {
  width: 68px;
}
select {
  min-width: 0;
}
#classSelect {
  width: 180px;
}
#subclassSelect {
  width: 138px;
}
#presetSelect {
  width: 122px;
}
button {
  cursor: pointer;
  min-width: 72px;
}
button:hover,
select:hover,
input:hover {
  background: #26262a;
}
.points {
  color: var(--green);
  min-width: 145px;
}
.points.empty {
  color: #919191;
}
/* ---- Skill Calculator: skill & DNA tree panels, nodes, connector lines ----- */

.tree-panel {
  position: relative;
  width: 544px;
  overflow: hidden;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border: 1px solid rgba(117, 86, 86, 0.6);
}
.skill-panel {
  height: 670px;
  background-image:
    linear-gradient(rgba(5, 5, 7, 0.65), rgba(5, 5, 7, 0.65)), url("assets/ui/req_calc_bg.png");
}
.dna-panel {
  height: 400px;
  background-image:
    linear-gradient(rgba(5, 5, 7, 0.49), rgba(5, 5, 7, 0.49)), url("assets/ui/dna_bg.png");
}
.tree-panel h2 {
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  margin: 0;
  z-index: 2;
  text-align: center;
  font-size: 16px;
  line-height: 22px;
}
.dna-panel h2 {
  top: 7px;
}
.tree-content {
  position: absolute;
  left: 35px;
  right: 35px;
  top: 65px;
  bottom: 50px;
}
.dna-panel .tree-content {
  top: 40px;
  bottom: 30px;
}
.lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.class-emblem {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  object-fit: contain;
  opacity: 0.15;
  image-rendering: auto;
  z-index: 0;
  pointer-events: none;
}
.skill-node {
  position: absolute;
  width: 41px;
  height: 41px;
  z-index: 3;
}
.skill-node img.icon {
  width: 41px;
  height: 41px;
  display: block;
  image-rendering: auto;
}
.skill-node.locked img.icon {
  filter: grayscale(100%);
  opacity: 1;
}
.skill-node.hover img.icon {
  outline: 2px solid var(--main);
  outline-offset: -2px;
}
.level-num {
  position: absolute;
  left: 3px;
  top: 2px;
  color: #fff537;
  font-weight: 700;
  font-size: 13px;
  line-height: 13px;
  text-shadow: 1px 1px 0 #000;
}
.req-level {
  position: absolute;
  right: 0;
  top: 2px;
  color: #e65050;
  font-weight: 700;
  font-size: 12px;
  text-shadow: 1px 1px 0 #000;
}
.node-btn {
  position: absolute;
  bottom: 0;
  width: 12px;
  height: 12px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.node-btn.minus {
  left: 0;
  background-image: url("assets/ui/minus.png");
}
.node-btn.plus {
  right: 0;
  background-image: url("assets/ui/plus.png");
}
.node-btn:hover {
  filter: brightness(1.25);
}
.node-btn:active {
  filter: brightness(0.72);
}
/* ---- Skill Calculator: hover tooltip --------------------------------------- */

.tooltip {
  position: fixed;
  z-index: 9999;
  width: min(410px, calc(100vw - 20px));
  min-height: 205px;
  padding: 4px;
  border: 8px solid transparent;
  border-image-source: url("assets/ui/tooltip_bg.png");
  border-image-slice: 25 fill;
  border-image-width: 25px;
  border-image-outset: 0;
  border-image-repeat: stretch;
  background: transparent;
  color: var(--main);
  pointer-events: none;
  font-size: 14px;
  line-height: 1.22;
}
.tooltip-head {
  display: grid;
  grid-template-columns: 42px 1fr 82px;
  gap: 10px;
  align-items: start;
}
#tooltipIcon {
  width: 42px;
  height: 42px;
}
.tooltip-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.15;
  max-height: 44px;
  overflow: hidden;
}
.tooltip-base {
  color: var(--sub);
  text-align: right;
  font-size: 13px;
}
.tooltip-meta,
.tooltip-meta-block {
  color: var(--sub);
  font-size: 13px;
}
.tooltip-meta-block {
  margin-left: 48px;
  white-space: pre-line;
}
.tooltip hr {
  border: 0;
  border-top: 1px solid rgba(78, 78, 70, 0.65);
  margin: 10px 0 12px;
}
.tooltip-body {
  white-space: pre-line;
}
.tooltip-body .section {
  display: block;
  font-weight: 700;
  margin: 10px 0 3px;
}
.tooltip-body .muted {
  color: var(--sub);
}
/* ---- Skill Calculator: dialogs (save preset, etc.) ------------------------- */

.dark-dialog {
  background: #08080a;
  color: var(--main);
  border: 1px solid #55493a;
  font: inherit;
}
.dark-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
.dark-dialog input {
  width: 300px;
  margin-top: 8px;
}
.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.about-title {
  font-size: 16px;
}
/* ---- Skill Calculator: standalone footer (legacy, pre-portal-shell) ------- */

.site-footer {
  align-self: center;
  width: min(760px, calc(100vw - 32px));
  margin: 18px auto 34px;
  padding: 16px 18px 18px;
  text-align: center;
  color: var(--sub);
  background: linear-gradient(180deg, rgba(20, 14, 14, 0.72), rgba(5, 5, 6, 0.82));
  border: 1px solid rgba(126, 88, 72, 0.42);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.55),
    0 0 34px rgba(0, 0, 0, 0.62);
  border-radius: 3px;
}
.footer-title {
  color: var(--main);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}
.footer-line {
  margin-top: 5px;
  color: #d9c6a4;
  font-size: 14px;
}
.footer-line strong {
  color: var(--main);
}
.footer-sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(209, 209, 209, 0.68);
}
/* ---- Responsive breakpoints ------------------------------------------------- */

@media (max-width: 590px) {
  .app {
    transform: scale(calc((100vw - 18px) / 544));
    transform-origin: top center;
    margin-bottom: calc(-1220px+ (1220px * ((100vw - 18px) / 544)));
  }
}
@keyframes reqGuideGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(254, 207, 125, 0.42),
      0 0 6px rgba(254, 207, 125, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(254, 207, 125, 0.88),
      0 0 14px rgba(254, 207, 125, 0.52),
      0 0 24px rgba(150, 45, 20, 0.35);
  }
}
@keyframes reqSaveGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(254, 207, 125, 0.24),
      0 0 5px rgba(254, 207, 125, 0.14);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(254, 207, 125, 0.72),
      0 0 13px rgba(254, 207, 125, 0.4);
  }
}
.guide-glow {
  animation: reqGuideGlow 1.45s ease-in-out infinite;
}
#savePreset.save-glow {
  animation: reqSaveGlow 1.8s ease-in-out infinite;
}
#deletePreset {
  color: #ff7b7b;
  border-color: #7a2929;
  background: #1a0d0f;
}
#deletePreset:hover {
  color: #ff9b9b;
  background: #2a1115;
  border-color: #a33a3a;
}
#deletePreset:active {
  background: #090506;
}
.sacrifice-name {
  font-family: "Cinzel Decorative", "Cinzel", "Trajan Pro", Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fecf7d;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 #000,
    0 0 6px rgba(254, 207, 125, 0.35),
    0 0 14px rgba(150, 45, 20, 0.45);
}
@media (max-width: 700px), (pointer: coarse) {
  body {
    background: #000 !important;
    align-items: center;
  }
  .app {
    box-shadow:
      0 0 0 1px rgba(255, 174, 100, 0.14),
      0 0 22px rgba(0, 0, 0, 0.78);
    will-change: transform;
  }
  .tree-panel {
    backface-visibility: hidden;
  }
  .tooltip {
    width: min(410px, calc(100vw - 18px));
  }
  .site-footer {
    align-self: center;
    width: calc(100vw - 32px);
    margin-left: auto;
    margin-right: auto;
    transform: none;
  }
}
#savePreset,
#deletePreset,
#resetBuild {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  padding-top: 0;
  padding-bottom: 0;
}
#resetBuild {
  color: #fecf7d;
  border-color: #6f5a3a;
  background: #151217;
}
#resetBuild:hover {
  background: #26202a;
}
#resetBuild:active {
  background: #0a080c;
}
#savePreset,
#deletePreset,
#resetBuild {
  min-width: 62px;
}
body {
  background: #000 !important;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.74) 62%, #000 100%),
    url("assets/ui/site_bg.png") center top / cover no-repeat;
}
.site-footer {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 8px 0 20px !important;
}
#deletePreset:disabled {
  color: #7d4b4b;
  border-color: #3a2020;
  background: #120b0d;
  opacity: 0.55;
  cursor: not-allowed;
}
#resetBuild:disabled {
  color: #7a6a52;
  border-color: #3a3128;
  background: #100e12;
  opacity: 0.55;
  cursor: not-allowed;
}

.seo-intro {
  max-width: 960px;
  margin: 12px auto 4px;
  padding: 8px 16px;
  color: #d1d1d1;
  font-size: 13px;
  line-height: 1.35;
  opacity: 0.78;
  text-align: center;
}
.seo-intro h1 {
  margin: 0 0 4px;
  color: #fecf7d;
  font-size: 18px;
  font-weight: 700;
}
.seo-intro p {
  margin: 0;
}
