*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --parchment: #f2e8ce;
  --parchment2: #ead9b0;
  --parchment3: #d4c080;
  --ink: #120d06;
  --ink2: #1e1208;
  --ink-faded: #4a3318;
  --ink-ghost: #6b5030;
  --gold: #8b6a14;
  --gold2: #b08820;
  --red-seal: #7a1a0a;
  --teal: #1a5a52;
  --border: #c4a84a;
  --shadow: rgba(26, 18, 8, 0.28);
}

html,
body {
  overflow: hidden;
  height: 100%;
  background: var(--parchment);
}

/* Hide all scrollbars visually but keep scroll functionality */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 168, 74, 0.3) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(196, 168, 74, 0.3);
  border-radius: 3px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--parchment);
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}


/* â”€â”€ CA Bonus Input Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#ca-bonus-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 230;
  background: rgba(26, 18, 8, 0.65);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
}

#ca-bonus-modal.open {
  display: flex;
}

.ca-bonus-box {
  background: var(--parchment);
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(26, 18, 8, 0.4);
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ca-bonus-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 0;
}

.ca-bonus-item-icon {
  font-size: 28px;
  line-height: 1;
}

.ca-bonus-item-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink2);
  letter-spacing: .03em;
}

.ca-bonus-body {
  padding: 16px 22px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ca-bonus-label {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-faded);
  line-height: 1.5;
}

.ca-bonus-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ca-bonus-input {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink2);
  width: 120px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  background: rgba(255, 251, 240, .9);
  text-align: center;
  outline: none;
  transition: border-color .15s;
  -moz-appearance: textfield;
  appearance: textfield;
}

.ca-bonus-input::-webkit-inner-spin-button,
.ca-bonus-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ca-bonus-input:focus {
  border-color: var(--gold2);
}

.ca-bonus-pct-label {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold2);
  opacity: .8;
}

.ca-bonus-hint {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: var(--ink-ghost);
  opacity: .7;
  line-height: 1.4;
}

.ca-bonus-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--parchment3);
}

.ca-bonus-confirm-btn {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--ink2);
  color: var(--parchment);
  border: none;
  cursor: pointer;
  padding: 10px 20px;
  transition: background .15s;
}

.ca-bonus-confirm-btn:hover {
  background: var(--gold);
  color: var(--ink2);
}

/* â”€â”€ PARCHMENT TEXTURE â”€â”€ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(26, 18, 8, 0.2) 100%);
}


.frame::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(196, 168, 74, 0.22);
}

.frame::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 0.5px solid rgba(196, 168, 74, 0.10);
}

/* Mid-edge rune marks */
.frame-rune {
  position: fixed;
  z-index: 11;
  pointer-events: none;
  font-size: 11px;
  color: var(--gold2);
  opacity: .55;
  letter-spacing: .1em;
  font-family: 'Cinzel', serif;
}

.fr-top {
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
}

.fr-bottom {
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
}

.fr-left {
  left: 4px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}

.fr-right {
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
}


.corner-star {
  font-size: 18px;
  opacity: .85;
  animation: startwinkle 3s ease-in-out infinite;
}

.corner-arm {
  font-size: 10px;
  opacity: .5;
  font-family: 'Cinzel', serif;
  letter-spacing: .05em;
}

.c-tl {
  top: 8px;
  left: 8px;
}

.c-tr {
  top: 8px;
  right: 14px;
  align-items: flex-end;
}

.c-bl {
  bottom: 8px;
  left: 8px;
  flex-direction: column-reverse;
}

.c-br {
  bottom: 8px;
  right: 14px;
  align-items: flex-end;
  flex-direction: column-reverse;
}

@keyframes startwinkle {

  0%,
  100% {
    opacity: .85;
    text-shadow: none;
  }

  33% {
    opacity: .4;
    text-shadow: none;
  }

  66% {
    opacity: 1;
    text-shadow: 0 0 8px rgba(196, 168, 74, .9), 0 0 16px rgba(196, 168, 74, .4);
  }
}

/* Stagger each corner */
.c-tl .corner-star {
  animation-delay: 0s;
}

.c-tr .corner-star {
  animation-delay: .8s;
}

.c-bl .corner-star {
  animation-delay: 1.6s;
}

.c-br .corner-star {
  animation-delay: 2.4s;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   CAPTCHA GATE
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
/* â•â• GATE â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
#gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity .6s ease, visibility .6s ease;
}

#gate.hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#gate::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
}

#gate::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(26, 18, 8, 0.18) 100%);
}

/* Card â€” same DNA as hp-inner */
.gate-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(360px, 92vw);
  gap: 14px;
  padding: 28px 24px 24px;
  border: 1px solid var(--border);
  background: rgba(242, 232, 206, 0.65);
  text-align: center;
}

.gate-inner::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 0.5px solid rgba(196, 168, 74, 0.3);
  pointer-events: none;
}

.gate-sigil {
  font-size: 32px;
  opacity: .65;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-5px)
  }
}

.gate-eyebrow {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--ink2);
}

.gate-subtitle-brand {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-top: 4px;
}

.gate-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(16px, 4.5vw, 20px);
  color: var(--ink2);
  letter-spacing: .02em;
  line-height: 1.35;
  margin-top: -4px;
}

.gate-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-faded);
  line-height: 1.6;
  margin-top: -4px;
}

.gate-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
}

.gate-rule::before,
.gate-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--parchment3), transparent);
}

.gate-rule span {
  color: var(--gold);
  font-size: 11px;
  flex-shrink: 0;
}

/* Captcha iframe â€” scaled to fit narrow screens */
.captcha-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.captcha-label {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-ghost);
}

#doom_captcha {
  width: 300px;
  height: 150px;
  border: 2px solid var(--border);
  display: block;
  max-width: 100%;
  transform-origin: top center;
}

/* Skip button */
.skip-btn {
  background: transparent;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-ghost);
  text-transform: uppercase;
  border: 1px solid var(--parchment3);
  padding: 10px 32px;
  width: 100%;
  transition: all .2s;
}

.skip-btn:hover {
  border-color: var(--gold2);
  color: var(--ink2);
  background: rgba(196, 168, 74, .07);
}

/* â”€â”€ Deposit toggle switch â”€â”€ */
.dep-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.dep-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dep-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--parchment3);
  border: 1px solid var(--border);
  transition: .2s;
}

.dep-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--ink-ghost);
  transition: .2s;
}

.dep-toggle input:checked+.dep-slider {
  background: rgba(196, 168, 74, .3);
  border-color: var(--gold2);
}

.dep-toggle input:checked+.dep-slider::before {
  transform: translateX(16px);
  background: var(--gold2);
}

.dep-toggle-label {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-faded);
}

.ca-owner-extra {
  padding: 14px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(196, 168, 74, .35);
  background: rgba(196, 168, 74, .08);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-faded);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ca-owner-extra strong {
  color: var(--ink2);
  font-weight: 700;
}

.ca-owner-extra .ca-oe-val {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold2);
}

.ca-case-note {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-faded);
  text-align: center;
  line-height: 1.5;
  border: 1px solid rgba(196, 168, 74, .3);
  background: rgba(196, 168, 74, .06);
  padding: 8px 16px;
  width: 100%;
  max-width: 460px;
}

.ca-case-note strong {
  color: var(--ink2);
  font-weight: 800;
}

.ca-case-note em {
  font-style: normal;
  color: var(--gold2);
  font-weight: 700;
}

/* â”€â”€ Magic Prophecy â”€â”€ */
.ca-prophecy {
  width: 100%;
  max-width: 460px;
  min-height: 64px;
  text-align: center;
  padding: 14px 20px;
  border: 1px solid rgba(196, 168, 74, .4);
  background: rgba(26, 18, 8, .04);
  position: relative;
  overflow: hidden;
  display: none;
}

.ca-prophecy.show {
  display: block;
}

.ca-prophecy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(196, 168, 74, .06) 0%, transparent 70%);
  pointer-events: none;
}

.ca-prophecy-text {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .03em;
  white-space: pre-wrap;
}

.ca-prophecy-text.pos {
  color: #2a5a2a;
}

.ca-prophecy-text.neg {
  color: #7a2020;
}

.ca-prophecy-sigil {
  font-size: 22px;
  display: block;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

@keyframes reveal-char {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.ca-prophecy-text span {
  display: inline;
  opacity: 0;
  animation: reveal-char .06s ease forwards;
}

.hp-hot {
  display: inline-block;
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: #c0392b;
  color: #fff;
  padding: 2px 5px;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 6px;
  animation: hotpulse 1.8s ease-in-out infinite;
}

@keyframes hotpulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .6
  }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MAIN CONTENT
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 44px 80px;
}

#main-content {
  position: fixed;
  inset: 0;
  z-index: 85;
  overflow-y: scroll;
  overflow-x: hidden;
  background: var(--parchment);
}

/* â”€â”€ HEADER â”€â”€ */
.hdr {
  text-align: center;
  padding: 46px 20px 26px;
  border-bottom: 1px solid var(--parchment3);
}

.hdr-sigil {
  font-size: 26px;
  margin-bottom: 6px;
  opacity: .6;
  animation: float 5s ease-in-out infinite;
}

.hdr-eye {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink-ghost);
  margin-bottom: 8px;
}

.hdr-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(20px, 3.5vw, 32px);
  color: var(--ink2);
  letter-spacing: .03em;
  line-height: 1.25;
}

.hdr-sub {
  font-size: 13px;
  color: var(--ink-faded);
  margin-top: 8px;
  line-height: 1.8;
}

.hdr-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px auto 0;
  max-width: 340px;
}

.hdr-rule::before,
.hdr-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--parchment3), transparent);
}

.hdr-rule span {
  color: var(--gold);
  font-size: 13px;
}

/* â”€â”€ META â”€â”€ */
.meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 12px 0 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--ink-ghost);
  border-bottom: 1px solid rgba(196, 168, 74, .22);
}

.meta .val {
  color: var(--ink2);
  font-weight: 600;
}

.meta-sep {
  color: var(--parchment3);
}

.sdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.sdot.live {
  background: var(--teal);
  box-shadow: 0 0 5px var(--teal);
  animation: blink 2s infinite;
}

.sdot.wait {
  background: var(--gold2);
  box-shadow: 0 0 5px var(--gold2);
  animation: blink .8s infinite;
}

.sdot.dead {
  background: var(--ink-ghost);
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .15
  }
}

.rbtn {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--ink2);
  color: var(--parchment);
  border: 1px solid rgba(26, 18, 8, .45);
  padding: 6px 18px;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.rbtn:hover {
  background: var(--ink);
  box-shadow: 2px 2px 10px var(--shadow);
}

.rbtn:disabled {
  background: var(--parchment3);
  color: var(--ink-ghost);
  cursor: not-allowed;
  box-shadow: none;
}

.spin {
  display: inline-block;
}

.spinning {
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* â”€â”€ NOTICES â”€â”€ */
.ebar {
  display: none;
  margin: 10px 0;
  padding: 10px 14px;
  background: rgba(122, 26, 10, .06);
  border: 1px solid rgba(122, 26, 10, .28);
  color: var(--red-seal);
  font-size: 13px;
}

.ebar.show {
  display: block;
}

.nbar {
  display: none;
  margin: 10px 0;
  padding: 8px 14px;
  background: rgba(26, 90, 82, .05);
  border: 1px solid rgba(26, 90, 82, .22);
  color: var(--teal);
  font-size: 12px;
  font-family: 'Cinzel', serif;
  letter-spacing: .06em;
}

.nbar.show {
  display: block;
}

/* â”€â”€ CONTROLS â”€â”€ */
.ctrl {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(196, 168, 74, .2);
}

.clbl {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--ink-faded);
}

.fg {
  display: flex;
  gap: 2px;
}

.fbtn {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  background: none;
  border: 1px solid var(--parchment3);
  color: var(--ink-ghost);
  padding: 5px 14px;
  cursor: pointer;
  transition: all .15s;
}

.fbtn:hover {
  border-color: var(--gold);
  color: var(--ink2);
}

.fbtn.active {
  background: var(--ink2);
  border-color: var(--ink2);
  color: var(--parchment);
}

.sw {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ssel {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  letter-spacing: .01em;
  background: transparent;
  border: 1px solid var(--parchment3);
  color: var(--ink2);
  padding: 5px 10px;
  outline: none;
  cursor: pointer;
}

.ssel option {
  background: var(--parchment);
}

/* â”€â”€ SECTION HEAD â”€â”€ */
.shead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-ghost);
}

.shead::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--parchment3), transparent);
}

/* â”€â”€ TABLE â”€â”€ */
.twrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  border-bottom: 2px solid var(--parchment3);
}

thead th {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faded);
  text-align: left;
  padding: 8px 14px 12px;
  white-space: nowrap;
}

thead th.r {
  text-align: right;
}

tbody tr {
  border-bottom: 1px solid rgba(196, 168, 74, .18);
  transition: background .12s;
}

tbody tr:hover {
  background: rgba(139, 105, 20, .07);
}

tbody tr:nth-child(even) {
  background: rgba(139, 105, 20, .03);
}

tbody tr:nth-child(even):hover {
  background: rgba(139, 105, 20, .07);
}

tbody td {
  padding: 16px 14px;
  vertical-align: middle;
}

tbody td.r {
  text-align: right;
}

/* rank */
.rn {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-ghost);
  width: 30px;
}

tbody tr:nth-child(1) .rn {
  color: var(--gold2);
}

tbody tr:nth-child(2) .rn {
  color: var(--ink-faded);
}

tbody tr:nth-child(3) .rn {
  color: #8b6030;
}

/* item */
.ic {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.ic-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.item-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}



/* rank-change arrows */
.rank-arrow {
  font-family: 'Nunito', sans-serif;
  font-size: 8.5px;
  font-weight: 600;
  display: block;
  margin-top: 1px;
  letter-spacing: .02em;
}

.rank-arrow.up {
  color: #2a7a2a;
}

.rank-arrow.down {
  color: var(--red-seal);
}

.rank-arrow.same {
  color: var(--ink-ghost);
  opacity: .5;
}

.iname {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink2);
}

.badge {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 0;
  width: 40px;
  text-align: center;
  display: inline-block;
  align-self: flex-start;
}

.badge.raw {
  background: rgba(26, 90, 82, .1);
  color: var(--teal);
  border: 1px solid rgba(26, 90, 82, .25);
}

.badge.product {
  background: rgba(139, 105, 20, .1);
  color: var(--gold);
  border: 1px solid rgba(139, 105, 20, .3);
}

/* numbers */
.num {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
}

.num.muted {
  color: var(--ink-ghost);
}

/* location */
.lname {
  font-size: 15px;
  color: var(--ink2);
  font-family: 'Nunito', sans-serif;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}

.lname-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lcountry {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  letter-spacing: .02em;
  color: #c0392b;
  margin-top: 3px;
  display: flex;
  align-items: center;
}

.lexpiry {
  font-size: 11px;
  color: var(--teal);
  margin-top: 2px;
}

/* tags */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  border-radius: 3px;
  white-space: nowrap;
}

.tag.dep {
  color: var(--teal);
  border: 1px solid rgba(26, 90, 82, .3);
  background: rgba(26, 90, 82, .07);
}

.tag.eth {
  color: var(--gold);
  border: 1px solid rgba(139, 105, 20, .35);
  background: rgba(139, 105, 20, .08);
}

/* bonus */
.bwrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.btotal {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink2);
}

.bbreak {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  letter-spacing: .01em;
  color: var(--ink-ghost);
}

/* wage */
.wage {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
}

.wage.pos {
  color: var(--ink2);
}

.wage.neg {
  color: var(--red-seal);
}

/* â”€â”€ INPUTS PANEL â”€â”€ */
.inputs-panel {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--parchment3);
  margin-bottom: 2px;
  background: rgba(242, 232, 206, 0.5);
}

.input-block {
  flex: 1;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-block+.input-block {
  border-left: 1px solid var(--parchment3);
}

.input-block-label {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.opt-tag {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-ghost);
  letter-spacing: 0;
}

.input-block-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink-ghost);
  line-height: 1.5;
}

.ink-input {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink2);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--parchment3);
  padding: 4px 2px;
  outline: none;
  width: 90px;
  transition: border-color .15s;
}

.ink-input:focus {
  border-bottom-color: var(--gold2);
}

.ink-input::placeholder {
  color: var(--ink-ghost);
  font-weight: 400;
  font-size: 13px;
}

.input-unit {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-ghost);
}

.fid-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fid-bar-bg {
  height: 4px;
  background: var(--parchment3);
  border-radius: 2px;
  width: 100px;
  flex-shrink: 0;
}

.fid-bar-fill {
  height: 4px;
  border-radius: 2px;
  background: var(--gold2);
  transition: width .3s;
  width: 0%;
}

.fid-pct {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--gold2);
  font-weight: 600;
  min-width: 32px;
}

.profit-pos {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
}

.profit-neg {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--red-seal);
}

.profit-null {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-ghost);
}

/* â”€â”€ AGRARIAN TOGGLE â”€â”€ */
.agr-block {
  border-top: 1px solid var(--parchment3);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.agr-label {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink2);
}

.agr-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink-ghost);
}

.agr-sel {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--parchment3);
  color: var(--ink2);
  padding: 4px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}

.agr-sel:focus {
  border-color: var(--gold2);
}

.agr-sel option {
  background: var(--parchment);
}

.agr-applies {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: var(--ink-ghost);
}

/* â”€â”€ FOOTER â”€â”€ */
.foot {
  text-align: center;
  padding: 26px 0 0;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--ink-ghost);
  border-top: 1px solid rgba(196, 168, 74, .2);
}

.foot-sig {
  font-size: 18px;
  opacity: .22;
  margin-bottom: 6px;
}

/* â”€â”€ SKELETON â”€â”€ */
.skel {
  border-radius: 1px;
  height: 13px;
  display: inline-block;
  background: linear-gradient(90deg, var(--parchment2) 25%, var(--parchment3) 50%, var(--parchment2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-ghost);
}

.empty .ico {
  font-size: 26px;
  opacity: .2;
  margin-bottom: 12px;
}

.empty p {
  font-size: 13px;
  line-height: 2.2;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MOBILE â€” all screens â‰¤ 680px
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media(max-width:680px) {

  /* Global */
  .frame,
  .corner,
  .frame-rune {
    display: none;
  }

  .hide-sm {
    display: none !important;
  }

  /* â”€â”€ Gate captcha â”€â”€ */
  #gate {
    overflow: hidden;
  }

  .gate-inner {
    width: min(340px, 94vw);
    padding: 22px 16px 20px;
    gap: 11px;
  }

  .gate-sigil {
    font-size: 26px;
  }

  .gate-title {
    font-size: clamp(14px, 4.5vw, 18px);
  }

  .gate-subtitle {
    font-size: 12px;
  }

  #doom_captcha {
    transform: scale(min(1, calc((94vw - 32px) / 300)));
  }

  /* â”€â”€ Homepage â”€â”€ */
  .hp-inner {
    width: min(400px, 96vw);
    padding: 16px 14px 14px;
    gap: 9px;
    margin: auto;
  }

  .hp-inner::before {
    inset: 3px;
  }

  .hp-scales {
    font-size: 32px;
  }

  .hp-title {
    font-size: clamp(15px, 4.5vw, 19px);
  }

  .hp-rule {
    margin: 0;
  }

  /* hp-menu responsive handled by clamp */

  /* â”€â”€ Wage Compendium â”€â”€ */
  .content {
    padding: 0 14px 60px;
  }

  .hdr {
    padding: 28px 10px 18px;
  }

  .hdr-title {
    font-size: 22px;
  }

  .hdr-sub {
    font-size: 13px;
  }

  .meta {
    font-size: 13px;
    gap: 4px 10px;
    padding: 10px 0 8px;
  }

  .ctrl {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
  }

  .fbtn {
    padding: 7px 12px;
    font-size: 13px;
  }

  .ssel {
    font-size: 13px;
    padding: 6px 8px;
  }

  .inputs-panel {
    flex-direction: column;
  }

  .input-block+.input-block {
    border-left: none;
    border-top: 1px solid var(--parchment3);
  }

  .ink-input {
    font-size: 18px;
    width: 100%;
  }

  table {
    font-size: 14px;
  }

  thead th {
    padding: 6px 10px 10px;
    font-size: 11px;
  }

  tbody td {
    padding: 12px 10px;
  }

  .iname {
    font-size: 13px;
  }

  .wage {
    font-size: 15px;
  }

  .lname {
    font-size: 14px;
  }

  .lcountry {
    font-size: 12px;
  }

  .iname {
    font-size: 14px;
  }

  .wage {
    font-size: 16px;
  }

  .btotal {
    font-size: 14px;
  }

  .bbreak {
    font-size: 11px;
  }

  .item-icon {
    font-size: 18px;
  }

  .btotal {
    font-size: 13px;
  }

  .bbreak {
    font-size: 10px;
  }

  .nav-back {
    font-size: 12px;
    padding: 9px 16px;
  }

  /* â”€â”€ Profit Calculator â”€â”€ */
  .pc-inner {
    padding: 0 14px 60px;
  }

  .pc-hdr {
    padding: 24px 8px 18px;
  }

  .pc-items-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
  }

  .pc-item-card {
    padding: 14px 6px 12px;
  }

  .pc-item-icon {
    font-size: 30px;
  }

  .pc-item-name {
    font-size: 12px;
  }

  .pc-item-pp {
    font-size: 11px;
  }

  .pc-panel {
    padding: 22px 18px 26px;
  }

  .pc-panel-title {
    font-size: 17px;
  }

  .pc-inp {
    font-size: 18px;
    max-width: 100%;
  }

  .pc-label {
    font-size: 14px;
  }

  .pc-calc-btn {
    width: 100%;
    padding: 14px;
    font-size: 14px;
  }

  .pc-result-item {
    padding: 11px 14px;
  }

  .pc-result-label {
    font-size: 13px;
  }

  .pc-result-val {
    font-size: 17px;
  }

  .pc-result-val.highlight {
    font-size: 20px;
  }
}

/* â”€â”€ PROFIT CALCULATOR PAGE â”€â”€ */
#profit-page {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 85;
  background: var(--parchment);
  overflow-y: scroll;
}

#profit-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
}

.pc-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 44px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pc-hdr {
  width: 100%;
}

.pc-hdr {
  text-align: center;
  padding: 36px 20px 24px;
  border-bottom: 1px solid var(--parchment3);
  margin-bottom: 24px;
}

/* Shared prominent back button for all sub-pages */
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-ghost);
  background: transparent;
  border: 1px solid var(--parchment3);
  padding: 11px 22px;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 20px;
}

.nav-back:hover {
  color: var(--ink2);
  border-color: var(--gold2);
  background: rgba(196, 168, 74, .07);
}

.nav-back-arrow {
  font-size: 16px;
  transition: transform .2s;
}

.nav-back:hover .nav-back-arrow {
  transform: translateX(-3px);
}

/* Two-column layout: item grid left, panel right */
.pc-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

/* Centered item grid â€” big cards */
.pc-items-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  width: 100%;
}

@media(max-width:900px) {
  .pc-items-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media(max-width:560px) {
  .pc-items-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pc-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 10px 16px;
  border: 1px solid var(--parchment3);
  background: rgba(242, 232, 206, 0.4);
  cursor: pointer;
  transition: all .18s;
  position: relative;
  text-align: center;
}

.pc-item-card:hover {
  border-color: var(--gold2);
  background: rgba(196, 168, 74, .1);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px var(--shadow);
}

.pc-item-card.selected {
  border-color: var(--gold2);
  background: rgba(196, 168, 74, .18);
  box-shadow: inset 0 0 0 1px var(--gold2);
}

.pc-item-icon {
  font-size: 42px;
  line-height: 1;
}

.pc-item-name {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink2);
  line-height: 1.3;
}

.pc-item-pp {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink-ghost);
}

.pc-item-badge {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* Calc panel â€” full width below grid */
.pc-panel {
  display: none;
  border: 1px solid var(--border);
  background: rgba(242, 232, 206, 0.5);
  padding: 36px 48px 40px;
  position: relative;
  width: 100%;
  max-width: 620px;
}

.pc-panel.open {
  display: block;
}

.pc-panel::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 0.5px solid rgba(196, 168, 74, .2);
  pointer-events: none;
}

.pc-panel-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink2);
  letter-spacing: .03em;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.pc-fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.pc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pc-label {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-faded);
}

.pc-label span {
  font-weight: 400;
  color: var(--ink-ghost);
}

.pc-inp {
  font-family: 'Nunito', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink2);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--parchment3);
  padding: 7px 2px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}

.pc-inp:focus {
  border-bottom-color: var(--gold2);
}

.pc-inp::placeholder {
  font-weight: 400;
  font-size: 15px;
  color: var(--ink-ghost);
}

.pc-avg {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink-ghost);
  margin-top: 3px;
}

.pc-calc-btn {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  background: var(--ink2);
  color: var(--parchment);
  border: none;
  padding: 15px 48px;
  cursor: pointer;
  transition: all .2s;
}

.pc-calc-btn:hover {
  background: var(--ink);
  box-shadow: 2px 3px 14px var(--shadow);
}

/* Results */
.pc-results {
  display: none;
  margin-top: 32px;
  border-top: 1px solid var(--parchment3);
  padding-top: 28px;
}

.pc-results.show {
  display: block;
}

.pc-results-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-ghost);
  margin-bottom: 18px;
}

.pc-result-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pc-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border: 1px solid var(--parchment3);
  background: rgba(242, 232, 206, 0.6);
}

.pc-result-label {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--ink-faded);
}

.pc-result-val {
  font-family: 'Nunito', sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink2);
}

.pc-result-val.profit-pos {
  color: var(--teal);
}

.pc-result-val.profit-neg {
  color: var(--red-seal);
}

.pc-result-val.highlight {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--gold2);
}

/* â•â• COMPANY ANALYSIS â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
#ca-page {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 85;
  background: var(--parchment);
  overflow-y: scroll;
}

#ca-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
}

.ca-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 44px 80px;
}

/* Header */
.ca-hdr {
  text-align: center;
  padding: 36px 20px 24px;
  border-bottom: 1px solid var(--parchment3);
  margin-bottom: 32px;
}

/* Search box */
.ca-search-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 0 32px;
}

.ca-search-label {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-faded);
  text-transform: uppercase;
}

.ca-search-row {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 460px;
}

.ca-input {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 600;
  background: rgba(242, 232, 206, 0.8);
  border: 1px solid var(--border);
  border-right: none;
  padding: 12px 18px;
  color: var(--ink2);
  outline: none;
}

.ca-input::placeholder {
  color: var(--ink-ghost);
  font-weight: 400;
}

.ca-input:focus {
  border-color: var(--gold2);
}

.ca-search-btn {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  background: var(--ink2);
  color: var(--parchment);
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.ca-search-btn:hover {
  background: var(--ink);
}

.ca-search-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* User picker (when multiple results) */
.ca-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 460px;
  margin-top: 4px;
}

.ca-picker-label {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-ghost);
  text-align: center;
}

.ca-pick-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(242, 232, 206, 0.6);
  border: 1px solid var(--parchment3);
  padding: 10px 16px;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink2);
}

.ca-pick-btn:hover {
  border-color: var(--gold2);
  background: rgba(196, 168, 74, .08);
}

.ca-pick-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--parchment3);
}

/* Status bar */
.ca-status {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-ghost);
  text-align: center;
  padding: 8px 0;
  min-height: 24px;
}

.ca-status.err {
  color: var(--red-seal);
}

/* Summary bar */
.ca-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 24px;
  padding: 18px 24px;
  margin-bottom: 28px;
  border: 1px solid var(--parchment3);
  background: rgba(242, 232, 206, 0.5);
}

.ca-sum-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ca-sum-avatar-frame {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.ca-sum-avatar-frame::before {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid var(--gold2, #c4a84a);
  clip-path: polygon(6px 0%, 100% 0%, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0% 100%, 0% 6px);
  pointer-events: none;
  z-index: 1;
}

.ca-sum-avatar-frame::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(196, 168, 74, 0.3);
  clip-path: polygon(9px 0%, 100% 0%, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0% 100%, 0% 9px);
  pointer-events: none;
  z-index: 0;
}

.ca-sum-avatar {
  width: 56px;
  height: 56px;
  object-fit: cover;
  display: block;
  clip-path: polygon(6px 0%, 100% 0%, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0% 100%, 0% 6px);
}

.ca-sum-username {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink2);
  letter-spacing: .08em;
  text-align: center;
  white-space: nowrap;
}

.ca-sum-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ca-sum-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-ghost);
}

.ca-sum-val {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink2);
}

.ca-sum-val.pos {
  color: #2a7a2a;
}

.ca-sum-val.neg {
  color: var(--red-seal);
}

.ca-sum-sep {
  width: 1px;
  height: 40px;
  background: var(--parchment3);
  align-self: center;
}

/* Company cards */
.ca-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ca-card {
  border: 1px solid var(--parchment3);
  background: rgba(242, 232, 206, 0.45);
  overflow: hidden;
}

.ca-card-hdr {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: rgba(26, 18, 8, .04);
  border-bottom: 1px solid rgba(196, 168, 74, .2);
  cursor: pointer;
  user-select: none;
}

.ca-card-hdr:hover {
  background: rgba(26, 18, 8, .07);
}

.ca-item-img-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(242, 232, 206, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  outline: none;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(196, 168, 74, .15);
}

.ca-item-img-wrap::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 0.5px solid rgba(196, 168, 74, .3);
  pointer-events: none;
  z-index: 1;
}

.ca-item-img-wrap:hover {
  border-color: var(--gold2);
  background: rgba(196, 168, 74, .15);
  box-shadow: 0 2px 10px rgba(26, 18, 8, .15), inset 0 0 0 1px rgba(196, 168, 74, .3);
}

.ca-item-img-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding-bottom: 2px;
}

.ca-item-img-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(196, 168, 74, .25);
  color: var(--gold2);
  font-family: 'Nunito', sans-serif;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  padding: 3px 0;
  text-transform: uppercase;
  z-index: 2;
  transition: background .15s, color .15s;
}

.ca-item-img-wrap:hover .ca-item-img-label {
  background: rgba(26, 18, 8, .75);
  color: rgba(220, 192, 100, .95);
}

.ca-item-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.ca-supply-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d94040;
  border: 1.5px solid var(--parchment);
  z-index: 3;
  animation: supply-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes supply-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(217, 64, 64, 0.55);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(217, 64, 64, 0);
  }
}

.ca-card-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink2);
  flex: 1;
}

.ca-card-item {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink-ghost);
}

.ca-card-profit {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
}

.ca-card-profit.pos {
  color: #2a7a2a;
}

.ca-card-profit.neg {
  color: var(--red-seal);
}

.ca-chevron {
  font-size: 11px;
  color: var(--ink-ghost);
  margin-left: 8px;
  transition: transform .2s;
}

.ca-card.open .ca-chevron {
  transform: rotate(180deg);
}

/* Card body */
.ca-card-body {
  display: none;
  padding: 20px;
}

.ca-card.open .ca-card-body {
  display: block;
}

.ca-section-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin-bottom: 10px;
  margin-top: 16px;
}

.ca-section-title:first-child {
  margin-top: 0;
}

.ca-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(196, 168, 74, .12);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
}

.ca-row:last-child {
  border-bottom: none;
}

.ca-row-label {
  color: var(--ink-faded);
}

.ca-row-val {
  font-weight: 700;
  color: var(--ink2);
}

.ca-row-val.pos {
  color: #2a7a2a;
}

.ca-row-val.neg {
  color: var(--red-seal);
}

.ca-row-val.muted {
  color: var(--ink-ghost);
  font-weight: 400;
}

.ca-divider {
  height: 1px;
  background: var(--parchment3);
  margin: 12px 0;
}

/* Sim params box */
.ca-sim-params {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  background: rgba(196, 168, 74, .07);
  border: 1px solid rgba(196, 168, 74, .3);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.ca-sim-param-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink-faded);
  white-space: nowrap;
}

.ca-sim-param-text {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-faded);
}

.ca-sim-check {
  accent-color: var(--gold2);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.ca-sim-select {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink2);
  background: var(--parchment);
  border: 1px solid var(--border);
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
}

.ca-sim-select:focus {
  border-color: var(--gold2);
}

.ca-sim-input {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink2);
  background: var(--parchment);
  border: 1px solid var(--border);
  padding: 3px 8px;
  width: 64px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.ca-sim-input::-webkit-inner-spin-button,
.ca-sim-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ca-sim-input:focus {
  border-color: var(--gold2);
}

.ca-sim-supply {
  background: rgba(196, 168, 74, .12);
  border: 1px solid rgba(196, 168, 74, .4);
  padding: 4px 10px;
  font-weight: 700;
  color: var(--ink2);
}

/* Worker rows */
.ca-worker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(196, 168, 74, .1);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
}

.ca-worker-row:last-child {
  border-bottom: none;
}

.ca-worker-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--parchment3);
  flex-shrink: 0;
}

.ca-worker-name {
  flex: 1;
  font-weight: 600;
  color: var(--ink2);
}

.ca-worker-stats {
  font-size: 11px;
  color: var(--ink-ghost);
}

.ca-worker-cost {
  font-weight: 700;
  color: var(--red-seal);
  white-space: nowrap;
}

.ca-worker-prod {
  font-size: 11px;
  color: #2a7a2a;
}

/* â”€â”€ WHAT IF MODAL â”€â”€ */
#ca-whatif-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(26, 18, 8, 0.65);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

#ca-whatif-modal[style*="display: flex"],
#ca-whatif-modal[style*="display:flex"] {
  display: flex !important;
}

.ca-wi-box {
  background: var(--parchment);
  border: 1px solid var(--border);
  box-shadow: 0 12px 48px rgba(26, 18, 8, 0.45), inset 0 1px 0 rgba(255, 255, 255, .3);
  width: min(580px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Corner ornament */
.ca-wi-box::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 0.5px solid rgba(196, 168, 74, .2);
  pointer-events: none;
  z-index: 0;
}

/* â”€â”€ Header â”€â”€ */
.ca-wi-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--parchment3);
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(180deg, rgba(196, 168, 74, .06) 0%, transparent 100%);
}

.ca-wi-hdr-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ca-wi-eyebrow {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold2);
}

.ca-wi-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink2);
  letter-spacing: .04em;
}

.ca-wi-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink-ghost);
  margin-top: 2px;
}

.ca-wi-close {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--ink-ghost);
  font-size: 15px;
  padding: 4px 8px;
  line-height: 1;
  transition: all .15s;
  flex-shrink: 0;
  margin-top: -2px;
}

.ca-wi-close:hover {
  color: var(--ink2);
  border-color: var(--parchment3);
  background: rgba(0, 0, 0, .04);
}

/* â”€â”€ Step 1: item grid â”€â”€ */
#ca-wi-step1 {
  display: flex;
  flex-direction: column;
}

.ca-wi-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-ghost);
  text-transform: uppercase;
  letter-spacing: .09em;
  padding: 16px 24px 10px;
  flex-shrink: 0;
}

.ca-wi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  padding: 0 24px 24px;
  overflow-y: auto;
  max-height: calc(90vh - 130px);
}

.ca-wi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 10px;
  border: 1px solid var(--parchment3);
  background: rgba(242, 232, 206, 0.4);
  cursor: pointer;
  transition: all .14s;
  text-align: center;
}

.ca-wi-item:hover {
  border-color: var(--border);
  background: rgba(196, 168, 74, .1);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(26, 18, 8, .12);
}

.ca-wi-item.current {
  border-color: var(--border);
  background: rgba(196, 168, 74, .15);
  box-shadow: inset 0 0 0 1px rgba(196, 168, 74, .4);
}

.ca-wi-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.ca-wi-item-name {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink2);
  line-height: 1.2;
}

/* â”€â”€ Step 2: bonus input â”€â”€ */
#ca-wi-step2 {
  overflow-y: auto;
}

.ca-wi-step2-inner {
  display: flex;
  flex-direction: column;
  padding: 20px 24px 24px;
  gap: 16px;
}

.ca-wi-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--ink-ghost);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 0;
  cursor: pointer;
  transition: color .12s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ca-wi-back:hover {
  color: var(--ink2);
}

.ca-wi-selected-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(196, 168, 74, .08) 0%, rgba(196, 168, 74, .03) 100%);
  border: 1px solid var(--parchment3);
  border-left: 3px solid var(--border);
}

.ca-wi-selected-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.ca-wi-selected-item strong {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink2);
  letter-spacing: .03em;
}

/* bonus field */
.ca-wi-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ca-wi-field-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-ghost);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.ca-wi-bonus-row {
  display: flex;
  border: 1px solid var(--parchment3);
  transition: border-color .12s;
}

.ca-wi-bonus-row:focus-within {
  border-color: var(--border);
}

.ca-wi-bonus-input {
  flex: 1;
  padding: 14px 18px;
  font-family: 'Cinzel', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--ink2);
  background: var(--parchment);
  border: none;
  outline: none;
  text-align: right;
  min-width: 0;
}

.ca-wi-bonus-input::placeholder {
  color: var(--parchment3);
  font-size: 24px;
}

.ca-wi-bonus-unit {
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold2);
  background: rgba(196, 168, 74, .08);
  border-left: 1px solid var(--parchment3);
  flex-shrink: 0;
}

.ca-wi-bonus-hint {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: var(--ink-ghost);
  line-height: 1.5;
  padding: 8px 12px;
  border-left: 2px solid var(--parchment3);
  background: rgba(0, 0, 0, .02);
}

/* confirm button */
.ca-wi-confirm {
  width: 100%;
  padding: 14px;
  background: var(--gold2);
  border: 1px solid var(--border);
  color: var(--ink2);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .14s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.ca-wi-confirm::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .15) 0%, transparent 60%);
  pointer-events: none;
}

.ca-wi-confirm:hover {
  background: var(--border);
  box-shadow: 0 3px 12px rgba(196, 168, 74, .3);
}

.ca-wi-confirm-icon {
  font-size: 16px;
}

/* â”€â”€ CHANGELOG MODAL â”€â”€ */
#cl-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  background: rgba(26, 18, 8, 0.6);
  backdrop-filter: blur(2px);
}

#cl-modal.open {
  display: flex !important;
}

#dmg-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 210;
  align-items: center;
  justify-content: center;
  background: rgba(26, 18, 8, 0.6);
  backdrop-filter: blur(2px);
}

#dmg-modal.open {
  display: flex !important;
}



.cl-box {
  position: relative;
  background: var(--parchment);
  border: 1px solid var(--border);
  padding: 32px 40px 28px;
  max-width: 560px;
  width: 93%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.cl-box::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 0.5px solid rgba(196, 168, 74, .25);
  pointer-events: none;
}

.cl-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink-ghost);
  font-family: 'Nunito', sans-serif;
  padding: 4px 8px;
  transition: color .15s;
}

.cl-close:hover {
  color: var(--ink2);
}

.cl-sigil {
  font-size: 26px;
  opacity: .65;
  text-align: center;
  margin-bottom: 6px;
}

.cl-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink2);
  text-align: center;
  letter-spacing: .03em;
  margin-bottom: 4px;
}

.cl-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--ink-ghost);
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: .04em;
}

.cl-entries {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-right: 4px;
}

.cl-entry {
  border-top: 1px solid var(--parchment3);
  padding-top: 16px;
}

.cl-entry:first-child {
  border-top: none;
  padding-top: 0;
}

.cl-ver {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: .05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cl-date {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-ghost);
  letter-spacing: .04em;
}

.cl-entries ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cl-entries li {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--ink-faded);
  line-height: 1.55;
}

.cl-entries li strong {
  color: var(--ink2);
  font-weight: 700;
}

.cl-entries li em {
  font-style: normal;
  color: var(--gold2);
}







/* â•â• HOMEPAGE â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
#homepage {
  position: fixed;
  inset: 0;
  z-index: 90;
  /* Rich animated gradient sky â€” warm light fantasy palette */
  background:
    linear-gradient(170deg,
      #faf3e0 0%,
      #f5e6c8 18%,
      #ede0c0 32%,
      #e8d8b8 50%,
      #f0e2c8 68%,
      #faf0da 85%,
      #fff8ec 100%);
  background-size: 100% 200%;
  animation: hp-skyShift 18s ease-in-out infinite alternate;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* NO scroll â€” everything must fit */
}

#homepage.hiding {
  opacity: 0;
  pointer-events: none;
}

/* â”€â”€ Particle canvas (injected by JS) â”€â”€ */
#hp-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* â”€â”€ Animated cloud layer 1 â”€â”€ */
.hp-cloud-layer {
  position: absolute;
  inset: -40% -20%;
  z-index: -5;
  pointer-events: none;
  background:
    radial-gradient(ellipse 600px 350px at 15% 25%, rgba(218, 185, 120, .22) 0%, transparent 70%),
    radial-gradient(ellipse 500px 300px at 75% 20%, rgba(230, 200, 140, .18) 0%, transparent 70%),
    radial-gradient(ellipse 700px 400px at 50% 70%, rgba(210, 175, 105, .15) 0%, transparent 65%),
    radial-gradient(ellipse 400px 250px at 85% 65%, rgba(225, 195, 130, .2) 0%, transparent 70%),
    radial-gradient(ellipse 350px 200px at 30% 80%, rgba(240, 215, 160, .16) 0%, transparent 70%);
  animation: hp-cloudsFloat 25s ease-in-out infinite alternate;
  filter: blur(30px);
}

/* â”€â”€ Animated cloud layer 2 (slower, offset) â”€â”€ */
.hp-cloud-layer-2 {
  position: absolute;
  inset: -30% -15%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 450px 280px at 60% 30%, rgba(196, 168, 74, .12) 0%, transparent 70%),
    radial-gradient(ellipse 550px 320px at 20% 60%, rgba(200, 170, 90, .1) 0%, transparent 65%),
    radial-gradient(ellipse 380px 220px at 80% 45%, rgba(230, 200, 130, .14) 0%, transparent 70%);
  animation: hp-cloudsFloat2 32s ease-in-out infinite alternate;
  filter: blur(40px);
}

/* â”€â”€ Light rays â”€â”€ */
.hp-light-rays {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hp-light-rays::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -20%;
  width: 70%;
  height: 180%;
  background: linear-gradient(130deg,
      transparent 0%,
      rgba(255, 240, 190, .12) 30%,
      rgba(255, 235, 170, .08) 50%,
      transparent 70%);
  transform: rotate(-15deg);
  animation: hp-rayDrift 12s ease-in-out infinite alternate;
}

.hp-light-rays::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 60%;
  height: 160%;
  background: linear-gradient(-120deg,
      transparent 0%,
      rgba(255, 230, 160, .1) 35%,
      rgba(255, 245, 200, .06) 55%,
      transparent 75%);
  transform: rotate(10deg);
  animation: hp-rayDrift2 16s ease-in-out infinite alternate;
}

/* â”€â”€ Grain overlay â”€â”€ */
.hp-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: multiply;
  opacity: .6;
}

/* â”€â”€ Vignette â”€â”€ */
.hp-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(26, 18, 8, .1) 100%),
    linear-gradient(180deg, rgba(255, 248, 230, .5) 0%, transparent 25%, transparent 75%, rgba(210, 180, 120, .15) 100%);
}

/* â”€â”€ Floating rune symbols (CSS only) â”€â”€ */
.hp-rune {
  position: absolute;
  pointer-events: none;
  z-index: -3;
  font-size: 28px;
  color: rgba(196, 168, 74, .08);
  animation: hp-runeFloat 20s ease-in-out infinite;
  filter: blur(1px);
}

.hp-rune:nth-child(1) {
  top: 12%;
  left: 8%;
  animation-delay: 0s;
  animation-duration: 22s;
  font-size: 32px;
}

.hp-rune:nth-child(2) {
  top: 70%;
  left: 85%;
  animation-delay: -5s;
  animation-duration: 26s;
  font-size: 24px;
}

.hp-rune:nth-child(3) {
  top: 25%;
  right: 12%;
  animation-delay: -10s;
  animation-duration: 20s;
  font-size: 20px;
}

.hp-rune:nth-child(4) {
  bottom: 18%;
  left: 15%;
  animation-delay: -8s;
  animation-duration: 24s;
  font-size: 26px;
}

.hp-rune:nth-child(5) {
  top: 55%;
  left: 50%;
  animation-delay: -3s;
  animation-duration: 28s;
  font-size: 18px;
}

.hp-rune:nth-child(6) {
  top: 8%;
  right: 30%;
  animation-delay: -14s;
  animation-duration: 21s;
  font-size: 22px;
}

/* â”€â”€ Animated diamond sparkles (pure CSS) â”€â”€ */
.hp-sparkle {
  position: absolute;
  pointer-events: none;
  z-index: -4;
  width: 4px;
  height: 4px;
  background: rgba(196, 168, 74, .6);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation: hp-sparkleFloat 8s ease-in-out infinite;
}

.hp-sparkle:nth-child(1) {
  top: 20%;
  left: 25%;
  animation-delay: 0s;
  animation-duration: 7s;
}

.hp-sparkle:nth-child(2) {
  top: 60%;
  left: 70%;
  animation-delay: -2s;
  animation-duration: 9s;
  width: 3px;
  height: 3px;
}

.hp-sparkle:nth-child(3) {
  top: 35%;
  right: 20%;
  animation-delay: -4s;
  animation-duration: 6s;
  width: 5px;
  height: 5px;
}

.hp-sparkle:nth-child(4) {
  bottom: 25%;
  left: 40%;
  animation-delay: -1s;
  animation-duration: 10s;
}

.hp-sparkle:nth-child(5) {
  top: 15%;
  right: 35%;
  animation-delay: -6s;
  animation-duration: 8s;
  width: 3px;
  height: 3px;
}

.hp-sparkle:nth-child(6) {
  bottom: 35%;
  right: 15%;
  animation-delay: -3s;
  animation-duration: 11s;
}

.hp-sparkle:nth-child(7) {
  top: 45%;
  left: 10%;
  animation-delay: -5s;
  animation-duration: 7.5s;
  width: 5px;
  height: 5px;
}

.hp-sparkle:nth-child(8) {
  top: 75%;
  left: 55%;
  animation-delay: -7s;
  animation-duration: 9.5s;
}

/* â•â• HOMEPAGE KEYFRAMES â•â• */

@keyframes hp-skyShift {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 0% 100%;
  }
}

@keyframes hp-cloudsFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(3%, -2%) scale(1.03);
  }

  100% {
    transform: translate(-2%, 1%) scale(1.01);
  }
}

@keyframes hp-cloudsFloat2 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-4%, 2.5%) scale(1.05);
  }

  100% {
    transform: translate(2%, -1.5%) scale(0.98);
  }
}

@keyframes hp-rayDrift {
  0% {
    transform: rotate(-15deg) translateX(0);
    opacity: .7;
  }

  100% {
    transform: rotate(-12deg) translateX(5%);
    opacity: 1;
  }
}

@keyframes hp-rayDrift2 {
  0% {
    transform: rotate(10deg) translateX(0);
    opacity: .5;
  }

  100% {
    transform: rotate(13deg) translateX(-4%);
    opacity: .9;
  }
}

@keyframes hp-runeFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: .06;
  }

  25% {
    transform: translateY(-12px) rotate(5deg);
    opacity: .12;
  }

  50% {
    transform: translateY(-8px) rotate(-3deg);
    opacity: .08;
  }

  75% {
    transform: translateY(-15px) rotate(7deg);
    opacity: .14;
  }
}

@keyframes hp-sparkleFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: .3;
  }

  25% {
    transform: translateY(-20px) scale(1.5);
    opacity: .7;
  }

  50% {
    transform: translateY(-10px) scale(0.8);
    opacity: .2;
  }

  75% {
    transform: translateY(-25px) scale(1.3);
    opacity: .6;
  }
}

/* â”€â”€ Wrapper: contains everything, never overflows â”€â”€ */
.hp-wrap {
  position: relative;
  z-index: 1000;
  width: min(580px, 92vw);
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Simpler shadow for Firefox GPU compatibility */
  box-shadow: 0 10px 40px rgba(0,0,0,0.22);
  animation: hp-wrapIn .6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hp-wrapIn {
  from { opacity: 0.1; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Gold rule lines */
.hp-rule-top,
.hp-rule-bot {
  flex-shrink: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(196, 168, 74, .7), #c8a830, rgba(196, 168, 74, .7), transparent);
}

/* Parchment body â€” frosted glass over animated background */
.hp-body {
  flex: 1;
  overflow: hidden;
  border-left: 1px solid rgba(196, 168, 74, .55);
  border-right: 1px solid rgba(196, 168, 74, .55);
  background: rgba(245, 238, 218, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  padding: 0 clamp(10px, 2.5vw, 28px);
}

/* Corner ornaments â€” purely decorative, absolute */
.hp-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 2;
}

.hp-corner svg {
  width: 100%;
  height: 100%;
}

.hp-corner.tl {
  top: 5px;
  left: 5px;
}

.hp-corner.tr {
  top: 5px;
  right: 5px;
  transform: scaleX(-1);
}

.hp-corner.bl {
  bottom: 5px;
  left: 5px;
  transform: scaleY(-1);
}

.hp-corner.br {
  bottom: 5px;
  right: 5px;
  transform: scale(-1);
}

/* â”€â”€ Header block â”€â”€ */
.hp-hdr {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(8px, 1.8vh, 18px) 0 clamp(6px, 1.2vh, 12px);
  border-bottom: 1px solid rgba(196, 168, 74, .28);
  gap: clamp(2px, .6vh, 6px);
}

.hp-sigil {
  font-size: clamp(22px, 4vh, 36px);
  line-height: 1;
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(139, 106, 20, .2));
}

.hp-title {
  font-family: 'Cinzel Decorative', serif;
  font-weight: 700;
  font-size: clamp(13px, 2.8vw, 22px);
  color: var(--ink2);
  letter-spacing: .04em;
  line-height: 1.15;
  text-align: center;
}

.hp-sub {
  font-family: 'Cinzel', serif;
  font-size: clamp(7px, 1.3vw, 9.5px);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  opacity: .65;
  text-align: center;
}

.hp-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}

.hp-divider::before,
.hp-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 168, 74, .45), transparent);
}

.hp-divider span {
  color: var(--gold);
  font-size: 11px;
  flex-shrink: 0;
  opacity: .75;
}

/* â”€â”€ Menu grid: 3 columns â”€â”€ */
.hp-menu {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(4px, 1vw, 8px);
  padding: clamp(6px, 1.2vh, 12px) 0;
}

/* â”€â”€ Button â”€â”€ */
.hp-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.5vh, 13px) clamp(6px, 1vw, 10px) clamp(6px, 1.2vh, 10px);
  gap: clamp(3px, .6vh, 6px);
  background: rgba(255, 251, 240, .65);
  border: 1px solid rgba(196, 168, 74, .38);
  cursor: pointer;
  transition: background .14s, border-color .14s, transform .1s, box-shadow .14s;
  position: relative;
  overflow: hidden;
  text-align: center;
  font-family: 'Cinzel', serif;
}

/* gradient wash on hover */
.hp-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 240, 160, .2) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform .4s;
  pointer-events: none;
}

.hp-btn:hover {
  background: rgba(255, 251, 240, .97);
  border-color: rgba(196, 168, 74, .8);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(139, 106, 20, .14);
}

.hp-btn:hover::after {
  transform: translateX(120%);
}

.hp-btn:active {
  transform: none;
}

.hp-btn.locked {
  opacity: .5;
  cursor: not-allowed;
  background: rgba(242, 232, 206, .4);
  border-color: rgba(196, 168, 74, .15);
}

.hp-btn.locked:hover {
  transform: none;
  box-shadow: none;
  background: rgba(242, 232, 206, .4);
  border-color: rgba(196, 168, 74, .15);
}

.hp-btn.locked::after {
  display: none;
}

.hp-btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 3px rgba(139, 106, 20, .25));
  transition: filter .15s;
}

.hp-btn:hover .hp-btn-icon {
  filter: drop-shadow(0 2px 6px rgba(196, 168, 74, .4));
}

.hp-btn-icon svg {
  width: 36px;
  height: 36px;
}

.hp-btn-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(13px, 1.4vw, 17px);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink2);
  line-height: 1.2;
}

.hp-btn-sub {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(11px, 1.2vw, 14px);
  color: var(--ink-ghost);
  line-height: 1.3;
}

/* Badges */
.hp-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: 'Cinzel', serif;
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: .07em;
  padding: 1px 4px;
  text-transform: uppercase;
  line-height: 1.5;
}

.hp-badge.hot {
  background: var(--red-seal);
  color: #f2e8ce;
}

.hp-badge.dev {
  background: #1a5a52;
  color: #a8e8d8;
}

.hp-badge.lck {
  background: transparent;
  color: var(--ink-ghost);
  font-size: 10px;
  padding: 0 3px;
}

/* â”€â”€ Footer â”€â”€ */
/* â”€â”€ Battle button â”€â”€ */
.hp-battle-wrap {
  width: 100%;
  padding: 0 0 clamp(6px, 1.2vh, 12px);
  flex-shrink: 0;
}

.hp-btn-battle {
  width: 100%;
  flex-direction: row;
  justify-content: center;
  gap: 14px;
  padding: clamp(10px, 1.8vh, 16px) 24px;
  background: linear-gradient(135deg, #2a2a2e 0%, #1e1e22 50%, #252528 100%);
  border-color: rgba(192, 48, 48, .7);
  box-shadow: 0 0 12px rgba(192, 48, 48, .2), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.hp-btn-battle:hover {
  background: linear-gradient(135deg, #32323a 0%, #262630 50%, #2e2e36 100%);
  border-color: rgba(220, 60, 60, .95);
  box-shadow: 0 0 24px rgba(200, 40, 40, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* â”€â”€ SECTION REVEAL ANIMATION â”€â”€ */
@keyframes arcana-reveal {
  0% {
    clip-path: circle(0% at 50% 50%);
    filter: blur(12px) brightness(1.5);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    clip-path: circle(125% at 50% 50%);
    filter: blur(0) brightness(1);
    opacity: 1;
  }
}

@keyframes arcana-reveal-glow {
  0% {
    box-shadow: inset 0 0 0 0 var(--gold2);
  }
  50% {
    box-shadow: inset 0 0 100px 20px rgba(176, 136, 32, 0.4);
  }
  100% {
    box-shadow: inset 0 0 0 0 transparent;
  }
}

.section-reveal {
  animation: arcana-reveal 1.1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  pointer-events: none; /* Disable interaction during animation */
  will-change: clip-path, filter, opacity;
  z-index: 999;
}

.section-reveal::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  animation: arcana-reveal-glow 1.1s ease-out forwards;
}

/* ── COMPANY ANALYSIS SCAN ANIMATION ── */
@keyframes ca-reveal-smooth {
  0% { opacity: 0; filter: brightness(1.6) blur(6px); }
  100% { opacity: 1; filter: brightness(1) blur(0); }
}

.ca-revealing {
  position: relative;
}

.ca-revealing > .ca-inner {
  animation: ca-reveal-smooth 0.6s ease-out forwards;
  opacity: 0;
}

.hp-btn-battle .hp-btn-name {
  font-size: clamp(14px, 1.6vw, 18px);
  color: #e8e8ee;
}

.hp-btn-battle .hp-btn-sub {
  margin-top: 0;
  color: rgba(200, 200, 210, .6);
}

/* WarEra Wiki button styles */
.hp-wiki-wrap {
  width: 100%;
  padding: 0 0 clamp(6px, 1.2vh, 12px);
  flex-shrink: 0;
}

.hp-btn-wiki {
  width: 100%;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: clamp(10px, 1.8vh, 16px) 24px;
  margin-top: 8px;
  background: linear-gradient(135deg, #1a5a52 0%, #164a43 50%, #1a5a52 100%);
  border: 1px solid rgba(196, 168, 74, .7);
  border-radius: 0;
  color: #e8f4f2;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(26, 90, 82, .2), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.hp-btn-wiki:hover {
  background: linear-gradient(135deg, #2a6a62 0%, #1f5a53 50%, #2a6a62 100%);
  border-color: rgba(220, 180, 80, .95);
  box-shadow: 0 0 24px rgba(26, 90, 82, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
  transform: translateY(-1px);
}

.hp-btn-wiki:active {
  transform: none;
}

.hp-btn-wiki .hp-btn-name {
  font-size: clamp(14px, 1.6vw, 18px);
  color: #e8f4f2;
}

.hp-btn-wiki .hp-btn-sub {
  margin-top: 0;
  color: rgba(200, 240, 230, .6);
}

.hp-ftr {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(5px, 1vh, 10px) 0 clamp(6px, 1.2vh, 12px);
  border-top: 1px solid rgba(196, 168, 74, .22);
}

.hp-ver {
  font-family: 'Nunito', sans-serif;
  font-size: 8.5px;
  letter-spacing: .06em;
  color: var(--ink-ghost);
  opacity: .4;
  text-transform: uppercase;
}

.hp-cl-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 8.5px;
  letter-spacing: .07em;
  color: var(--ink-ghost);
  opacity: .5;
  text-transform: uppercase;
  padding: 2px 0;
  transition: opacity .12s;
}

.hp-cl-btn:hover {
  opacity: 1;
}

/* â”€â”€ PROFIT CALCULATOR PAGE â”€â”€ */

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   DMG CALC â€” WAR CHRONICLE RPG THEME
   Direction: ancient war tome, ink + gold,
   corner-cut panels, rune accents
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Page â”€â”€ */
#dmg-page {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 85;
  background: #2e2416;
  background-image:
    radial-gradient(ellipse at 25% 0%, rgba(220, 175, 80, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 100%, rgba(150, 100, 40, 0.08) 0%, transparent 50%);
  overflow-y: scroll;
  color: var(--parchment);
}

#dmg-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  mix-blend-mode: screen;
}

.dmg-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 44px 80px;
  box-sizing: border-box;
}

@media(max-width:680px) {
  .dmg-inner {
    padding: 0 14px 60px;
  }
}

/* â”€â”€ Overrides for header on dark bg â”€â”€ */
#dmg-page .hdr {
  border-bottom: 1px solid rgba(196, 168, 74, .2);
}

#dmg-page .hdr-sigil {
  color: rgba(220, 192, 100, .8);
}

#dmg-page .hdr-eye {
  color: rgba(220, 192, 100, .55);
}

#dmg-page .hdr-title {
  color: #faecc8;
  text-shadow: 0 0 30px rgba(196, 168, 74, .25);
}

#dmg-page .hdr-sub {
  color: rgba(250, 236, 200, .65);
}

#dmg-page .hdr-rule::before,
#dmg-page .hdr-rule::after {
  background: linear-gradient(to right, transparent, rgba(196, 168, 74, .35), transparent);
}

#dmg-page .hdr-rule span {
  color: rgba(220, 192, 100, .65);
}

#dmg-page .nav-back {
  color: rgba(220, 192, 100, .8);
  border-color: rgba(196, 168, 74, .25);
  background: rgba(196, 168, 74, .06);
}

#dmg-page .nav-back:hover {
  color: #faecc8;
  border-color: rgba(196, 168, 74, .6);
}

/* â”€â”€ Action bar â”€â”€ */
.dmg-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(196, 168, 74, .15);
}

/* â”€â”€ Layout â”€â”€ */
.dmg-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

@media(max-width:860px) {
  .dmg-layout {
    grid-template-columns: 1fr;
  }
}

.dmg-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* â•â• RPG PANEL â€” left skills â•â• */
.dmg-panel {
  background: linear-gradient(160deg, #3a2c18 0%, #2e2210 100%);
  border: 1px solid rgba(196, 168, 74, .35);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .4), 0 2px 12px rgba(0, 0, 0, .5);
  position: relative;
}

.dmg-panel::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(196, 168, 74, .1);
  pointer-events: none;
}

.dmg-panel-title {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(220, 192, 100, .85);
  padding: 9px 14px;
  border-bottom: 1px solid rgba(196, 168, 74, .2);
  background: rgba(196, 168, 74, .06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dmg-panel-title::before {
  content: 'âš”';
  font-size: 11px;
  opacity: .6;
}

.dmg-panel-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  color: rgba(250, 236, 200, .35);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 14px 0;
  text-align: center;
}

/* Level row */
.dmg-level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(196, 168, 74, .12);
  gap: 8px;
}

.dmg-level-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: rgba(250, 236, 200, .7);
  flex: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.dmg-level-val {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: #faecc8;
  min-width: 28px;
  text-align: center;
}

input.dmg-level-val {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(196, 168, 74, .4);
  width: 38px;
  outline: none;
  padding: 1px 2px;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
  color: #faecc8;
}

input.dmg-level-val::-webkit-inner-spin-button,
input.dmg-level-val::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

input.dmg-level-val:focus {
  border-bottom-color: #d4b85a;
}

.dmg-pts {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: rgba(250, 236, 200, .65);
  text-align: center;
  padding: 5px 0 9px;
  border-bottom: 1px solid rgba(196, 168, 74, .12);
}

.dmg-pts span {
  color: #d4b85a;
  font-weight: 800;
  font-size: 14px;
}

/* Skill rows */
.dmg-skill-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(196, 168, 74, .08);
  transition: background .12s;
}

.dmg-skill-row:hover {
  background: rgba(196, 168, 74, .04);
}

.dmg-skill-row:last-child {
  border-bottom: none;
}

.dmg-skill-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.dmg-skill-name {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: rgba(250, 236, 200, .8);
  flex: 1;
}

.dmg-skill-val {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  color: #d4b85a;
  min-width: 30px;
  text-align: right;
}

.dmg-skill-locked {
  font-size: 9px;
  color: rgba(250, 236, 200, .35);
}

.dmg-prog {
  display: flex;
  gap: 2px;
  margin-top: 3px;
}

.dmg-pb {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(196, 168, 74, .2);
  background: transparent;
  flex-shrink: 0;
}

.dmg-pb.active {
  background: #c4a84a;
  border-color: #d4b85a;
}

.dmg-pb.active-red {
  background: #a83020;
  border-color: #c43828;
}

.dmg-pb.active-green {
  background: #1a5a52;
  border-color: #1a7a6a;
}

.dmg-pb.active-blue {
  background: #1a3a7a;
  border-color: #1a4a9a;
}

.dmg-pb.active-yellow {
  background: #7a6010;
  border-color: #a88020;
}

/* Small +/- buttons */
.dmg-btn-sm {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  background: rgba(196, 168, 74, .15);
  color: #d4b85a;
  border: 1px solid rgba(196, 168, 74, .3);
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}

.dmg-btn-sm:hover:not(:disabled) {
  background: rgba(196, 168, 74, .3);
  color: #faecc8;
  border-color: #d4b85a;
}

.dmg-btn-sm:disabled {
  background: transparent;
  color: rgba(196, 168, 74, .2);
  border-color: rgba(196, 168, 74, .1);
  cursor: not-allowed;
}

/* â•â• RPG CARD â€” center column â•â• */
.dmg-card {
  background: linear-gradient(160deg, #362a16 0%, #2a2010 100%);
  border: 1px solid rgba(196, 168, 74, .3);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .35), 0 1px 8px rgba(0, 0, 0, .4);
  position: relative;
}

/* Corner ornaments */
.dmg-card::before,
.dmg-card::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(220, 192, 100, .65);
  border-style: solid;
  pointer-events: none;
}

.dmg-card::before {
  top: 3px;
  left: 3px;
  border-width: 1px 0 0 1px;
}

.dmg-card::after {
  bottom: 3px;
  right: 3px;
  border-width: 0 1px 1px 0;
}

.dmg-card-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(196, 168, 74, .18);
  background: rgba(196, 168, 74, .08);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(220, 192, 100, .8);
}

.dmg-card-body {
  padding: 14px 16px;
}

/* â”€â”€ Character Stats â”€â”€ */
.dmg-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

@media(max-width:500px) {
  .dmg-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dmg-stat-item {
  background: rgba(196, 168, 74, .08);
  border: 1px solid rgba(196, 168, 74, .18);
  padding: 7px 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: background .15s;
}

.dmg-stat-item:hover {
  background: rgba(196, 168, 74, .09);
}

.dmg-stat-label {
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(250, 236, 200, .6);
  margin-bottom: 3px;
}

.dmg-stat-val {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: #faecc8;
}

/* HP/Hunger bars */
.dmg-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.dmg-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dmg-bar-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(250, 236, 200, .75);
  width: 52px;
  flex-shrink: 0;
}

.dmg-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid rgba(196, 168, 74, .2);
  position: relative;
}

.dmg-bar-fill {
  height: 100%;
  transition: width .3s;
}

.dmg-bar-fill.health {
  background: linear-gradient(90deg, #1a5a42, #22a06a);
}

.dmg-bar-fill.hunger {
  background: linear-gradient(90deg, #7a3010, #c05020);
}

.dmg-bar-text {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: #d4b85a;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

/* â”€â”€ RPG Character Stats â”€â”€ */

.rpg-stat-card {
  overflow: hidden;
}

/* Header: star ornaments + title */
.rpg-stat-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(196, 168, 74, .22);
  background: linear-gradient(180deg, rgba(196, 168, 74, .12) 0%, rgba(196, 168, 74, .04) 100%);
  position: relative;
}

.rpg-stat-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(220, 192, 100, .95);
  text-shadow: 0 0 18px rgba(220, 192, 100, .35);
}

.rpg-stat-header-ornament {
  opacity: .85;
  flex-shrink: 0;
}

.rpg-stat-header-ornament.right svg {
  transform: scaleX(-1);
}

/* HP / Hunger bars */
.rpg-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid rgba(196, 168, 74, .15);
}

.rpg-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rpg-bar-icon {
  flex-shrink: 0;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rpg-bar-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(250, 236, 200, .8);
  width: 48px;
  flex-shrink: 0;
  font-weight: 600;
}

.rpg-bar-track {
  flex: 1;
  height: 16px;
  background: rgba(0, 0, 0, .6);
  border: 1px solid rgba(196, 168, 74, .25);
  position: relative;
  overflow: hidden;
  clip-path: polygon(5px 0%, 100% 0%, calc(100% - 5px) 100%, 0% 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4);
}

.rpg-bar-fill {
  height: 100%;
  transition: width .4s ease;
  position: relative;
  box-shadow: inset -1px 0 3px rgba(0, 0, 0, .3);
}

.rpg-health {
  background: linear-gradient(90deg, #6b1a1a 0%, #c03030 60%, #e05050 100%);
}

.rpg-hunger {
  background: linear-gradient(90deg, #6b3a10 0%, #b86020 60%, #d88030 100%);
}

.rpg-bar-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: rgba(255, 255, 255, .08);
  pointer-events: none;
}

.rpg-bar-text {
  font-family: 'MedievalSharp', 'Cinzel', serif;
  font-size: 12px;
  color: #d4b85a;
  min-width: 56px;
  text-align: right;
  flex-shrink: 0;
  font-weight: 600;
}

/* Divider */
.rpg-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  margin: 4px 0;
}

.rpg-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 168, 74, .35), transparent);
}

/* Stat grid */
.rpg-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(196, 168, 74, .1);
  border-top: 1px solid rgba(196, 168, 74, .1);
}

@media(max-width:500px) {
  .rpg-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.rpg-stat-item {
  background: linear-gradient(160deg, #2e2310 0%, #231c0c 100%);
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: background .15s;
}

.rpg-stat-item:hover {
  background: linear-gradient(160deg, #3a2c14 0%, #2e2410 100%);
}

.rpg-stat-attack {
  grid-column: span 2;
  align-items: center;
  justify-content: center;
}

.rpg-stat-item-header {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  justify-content: center;
}

.rpg-stat-attack .rpg-stat-item-header {}

.rpg-stat-svg-icon {
  color: rgba(196, 168, 74, .7);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.rpg-stat-name {
  font-family: 'Cinzel', serif;
  font-size: 8.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(250, 236, 200, .55);
}

.rpg-stat-number {
  font-family: 'MedievalSharp', 'Cinzel', serif;
  font-size: 22px;
  font-weight: 400;
  color: #e8d898;
  line-height: 1;
  text-shadow: 0 0 12px rgba(220, 192, 100, .25);
}

.rpg-stat-number.gold {
  color: #d4b85a;
  font-size: 26px;
  text-shadow: 0 0 16px rgba(212, 184, 90, .4);
}

/* Attack breakdown */
.rpg-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 3px;
}

.rpg-breakdown-row {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  color: rgba(250, 236, 200, .45);
  white-space: nowrap;
}

.rpg-breakdown-row strong {
  color: rgba(250, 236, 200, .75);
  font-weight: 700;
}

/* â”€â”€ Equipment â”€â”€ */
.dmg-equip-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: flex-end;
  width: 100%;
}

.dmg-slot-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 72px;
}

.dmg-equip-slot {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(196, 168, 74, .22);
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(196, 168, 74, .22);
  position: relative;
  cursor: pointer;
  transition: all .15s;
}

.dmg-equip-slot img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.dmg-equip-slot:hover {
  border-color: rgba(220, 192, 100, .65);
  background: rgba(196, 168, 74, .09);
  box-shadow: 0 0 8px rgba(196, 168, 74, .12);
}

.dmg-equip-slot.equipped {
  border-color: var(--tier-col);
  background: rgba(196, 168, 74, .07);
}

.dmg-equip-slot .tier-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tier-col);
}

.dmg-equip-label {
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: rgba(250, 236, 200, .4);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* â”€â”€ Inventory â”€â”€ */
.dmg-inv-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dmg-inv-item {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(196, 168, 74, .18);
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  font-size: 20px;
}

.dmg-inv-item:hover {
  border-color: #d4b85a;
  background: rgba(196, 168, 74, .1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}

.dmg-inv-item img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.dmg-inv-item.tier-gray {
  border-color: rgba(138, 138, 138, .35);
}

.dmg-inv-item.tier-green {
  border-color: rgba(42, 122, 42, .4);
}

.dmg-inv-item.tier-blue {
  border-color: rgba(26, 74, 138, .45);
}

.dmg-inv-item.tier-purple {
  border-color: rgba(106, 26, 138, .45);
}

.dmg-inv-item.tier-golden {
  border-color: rgba(196, 168, 74, .65);
}

.dmg-inv-item.tier-red {
  border-color: rgba(200, 30, 30, .65);
}

.dmg-inv-item-large {
  width: 66px;
  height: 66px;
  border-color: rgba(196, 168, 74, .18) !important;
}

.dmg-tier-sep {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(220, 192, 100, .65);
  padding: 8px 0 4px;
  border-top: 1px solid rgba(196, 168, 74, .15);
  margin-top: 6px;
}

/* â”€â”€ Armor Level Slider â”€â”€ */
input[type="range"] {
  accent-color: #d4b85a;
  height: 3px;
}

/* â”€â”€ Tier colors â”€â”€ */
.tier-gray {
  --tier-col: rgba(138, 138, 138, .7);
}

.tier-green {
  --tier-col: rgba(42, 180, 42, .7);
}

.tier-blue {
  --tier-col: rgba(42, 100, 220, .7);
}

.tier-purple {
  --tier-col: rgba(160, 42, 220, .7);
}

.tier-golden {
  --tier-col: rgba(212, 184, 90, .9);
}

.tier-red {
  --tier-col: rgba(220, 40, 40, .9);
}

/* â”€â”€ Ammo/Buff â”€â”€ */
.dmg-buff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dmg-buff-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid rgba(196, 168, 74, .22);
  background: rgba(0, 0, 0, .3);
  cursor: pointer;
  transition: all .15s;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(250, 236, 200, .85);
}

.dmg-buff-btn:hover {
  border-color: #d4b85a;
  background: rgba(196, 168, 74, .1);
  color: #faecc8;
}

.dmg-buff-btn.active-buff {
  border-color: #1a7a6a;
  background: rgba(26, 90, 80, .2);
  color: #20c090;
}

.dmg-buff-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* â”€â”€ Item Config Panel (compact) â”€â”€ */
.dmg-config-panel {
  border: 1px solid rgba(196, 168, 74, .35);
  background: linear-gradient(135deg, #1e160a, #161008);
  padding: 12px 14px;
  display: none;
  margin-top: 10px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .4);
}

.dmg-config-panel.open {
  display: block;
}

.dmg-config-title {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  color: #faecc8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(196, 168, 74, .15);
}

.dmg-config-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.dmg-config-row label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: rgba(250, 236, 200, .75);
  width: 100px;
  flex-shrink: 0;
}

.dmg-config-row .cfg-val {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  color: #d4b85a;
  min-width: 36px;
  text-align: right;
}

.dmg-config-row input[type=range] {
  flex: 1;
  min-width: 80px;
  accent-color: #d4b85a;
  height: 3px;
}

.dmg-config-actions {
  display: flex;
  gap: 6px;
  margin-top: 11px;
  flex-wrap: wrap;
}

.dmg-config-equip {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  background: rgba(196, 168, 74, .18);
  color: #faecc8;
  border: 1px solid rgba(196, 168, 74, .45);
  padding: 6px 16px;
  cursor: pointer;
  transition: all .15s;
}

.dmg-config-equip:hover {
  background: rgba(196, 168, 74, .3);
  border-color: #d4b85a;
}

.dmg-config-cancel {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  background: transparent;
  border: 1px solid rgba(196, 168, 74, .2);
  color: rgba(250, 236, 200, .65);
  padding: 6px 12px;
  cursor: pointer;
  transition: all .15s;
}

.dmg-config-cancel:hover {
  border-color: rgba(220, 192, 100, .65);
  color: rgba(250, 236, 200, .92);
}

/* â”€â”€ Simulation â”€â”€ */
.dmg-sim-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.dmg-sim-btn {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dmg-sim-btn.primary {
  background: rgba(196, 168, 74, .18);
  color: #faecc8;
  border: 1px solid rgba(196, 168, 74, .45);
}

.dmg-sim-btn.primary:hover {
  background: rgba(196, 168, 74, .3);
  border-color: #d4b85a;
  box-shadow: 0 0 12px rgba(196, 168, 74, .15);
}

.dmg-sim-btn.secondary {
  background: transparent;
  border: 1px solid rgba(196, 168, 74, .2);
  color: rgba(250, 236, 200, .7);
}

.dmg-sim-btn.secondary:hover {
  border-color: rgba(220, 192, 100, .65);
  color: #faecc8;
}

/* â”€â”€ Food/Runs â”€â”€ */
.dmg-food-sel,
.dmg-runs-sel {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid rgba(196, 168, 74, .25);
  color: rgba(250, 236, 200, .9);
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
}

.dmg-food-sel option,
.dmg-runs-sel option {
  background: #1c1510;
  color: #faecc8;
}

/* â”€â”€ Results â”€â”€ */
.dmg-results-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(220, 192, 100, .8);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dmg-results-title::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: rgba(196, 168, 74, .4);
}

.dmg-results-title::after {
  content: '';
  display: inline-block;
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(196, 168, 74, .3), transparent);
}

.dmg-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.dmg-kpi {
  border: 1px solid rgba(196, 168, 74, .18);
  background: rgba(0, 0, 0, .3);
  padding: 9px 10px;
  text-align: center;
  position: relative;
}

.dmg-kpi::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(196, 168, 74, .2), transparent);
}

.dmg-kpi-label {
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(250, 236, 200, .5);
  margin-bottom: 4px;
}

.dmg-kpi-val {
  font-family: 'Cinzel', serif;
  font-size: 21px;
  font-weight: 700;
  color: #faecc8;
}

.dmg-kpi-val.gold {
  color: #d4b85a;
}

.dmg-kpi-val.teal {
  color: #20c090;
}

.dmg-kpi-range {
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  color: rgba(250, 236, 200, .4);
  margin-top: 2px;
}

.dmg-factor-row {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: rgba(250, 236, 200, .65);
  padding: 8px 0;
  border-top: 1px solid rgba(196, 168, 74, .14);
  margin-top: 4px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.dmg-factor-row span {
  color: rgba(250, 236, 200, .92);
  font-weight: 600;
}

/* â”€â”€ Compare â”€â”€ */
.dmg-cmp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

@media(max-width:560px) {
  .dmg-cmp-grid {
    grid-template-columns: 1fr;
  }
}

.dmg-cmp-build {
  border: 1px solid rgba(196, 168, 74, .2);
  background: rgba(0, 0, 0, .3);
  padding: 10px;
}

.dmg-cmp-build-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(220, 192, 100, .75);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dmg-cmp-kpi {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: rgba(250, 236, 200, .7);
  padding: 3px 0;
}

.dmg-cmp-diff-pos {
  color: #20c090;
  font-weight: 700;
}

.dmg-cmp-diff-neg {
  color: #c04040;
  font-weight: 700;
}

/* â”€â”€ Presets â”€â”€ */
.dmg-preset-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dmg-preset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(196, 168, 74, .18);
  padding: 7px 10px;
  background: rgba(0, 0, 0, .25);
}

.dmg-preset-name {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(250, 236, 200, .9);
  flex: 1;
}

.dmg-preset-level {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  color: rgba(220, 192, 100, .55);
}

.dmg-preset-btn-load {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: .06em;
  background: rgba(196, 168, 74, .14);
  color: #faecc8;
  border: 1px solid rgba(196, 168, 74, .35);
  padding: 3px 9px;
  cursor: pointer;
  transition: all .15s;
}

.dmg-preset-btn-load:hover {
  background: rgba(196, 168, 74, .25);
}

.dmg-preset-btn-del {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  background: transparent;
  border: none;
  color: rgba(220, 192, 100, .4);
  cursor: pointer;
  padding: 2px 5px;
  transition: color .15s;
}

.dmg-preset-btn-del:hover {
  color: #c04040;
}

.dmg-empty-presets {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: rgba(250, 236, 200, .35);
  text-align: center;
  padding: 10px 0;
  font-style: italic;
}

.dmg-preset-row {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.dmg-preset-input {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(196, 168, 74, .25);
  color: rgba(250, 236, 200, .92);
  padding: 7px 10px;
  flex: 1;
  min-width: 110px;
  outline: none;
}

.dmg-preset-input:focus {
  border-color: #d4b85a;
}

.dmg-preset-input::placeholder {
  color: rgba(220, 192, 100, .4);
}

/* â”€â”€ API Load bar â”€â”€ */
.dmg-api-row {
  display: flex;
  gap: 0;
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}

.dmg-api-input {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(196, 168, 74, .3);
  border-right: none;
  padding: 8px 12px;
  color: rgba(250, 236, 200, .92);
  outline: none;
}

.dmg-api-input::placeholder {
  color: rgba(220, 192, 100, .4);
  font-weight: 400;
}

.dmg-api-input:focus {
  border-color: #d4b85a;
}

.dmg-api-btn {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  background: rgba(196, 168, 74, .18);
  color: #faecc8;
  border: 1px solid rgba(196, 168, 74, .35);
  border-left: none;
  padding: 8px 16px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.dmg-api-btn:hover {
  background: rgba(196, 168, 74, .3);
  border-color: #d4b85a;
}

.dmg-api-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.dmg-api-status {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: rgba(250, 236, 200, .5);
  margin-top: 5px;
  min-height: 16px;
  flex-basis: 100%;
}

.dmg-api-status.err {
  color: #c04040;
}

.dmg-api-status.ok {
  color: #20c090;
}

/* â”€â”€ Tick/MC/CMP result panels â”€â”€ */
#dc-tick-results,
#dc-mc-results,
#dc-cmp-results {
  display: none;
  margin-top: 14px;
}

#dc-tick-results.show,
#dc-mc-results.show,
#dc-cmp-results.show {
  display: block;
}

/* Charts */
.dmg-chart-wrap {
  margin-top: 12px;
}

.dmg-chart-canvas {
  width: 100% !important;
  max-height: 180px;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   LEDGER OF COIN STYLES
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
#ledger-page {
  --gold1: #faecc8;
  --gold2: #d4b85a;
  --gold3: rgba(220, 192, 100, .85);
  --gold-dim: rgba(196, 168, 74, .35);
  --bg0: #302514;
  --bg1: #1a1004;
  --bg2: #221a0b;
  --bg3: #261b07;
  --ink: rgba(250, 236, 200, .92);
  --ink2: rgba(255, 255, 255, .70);
  --ink3: rgba(250, 236, 200, .65);
  --ink4: rgba(250, 236, 200, .25);
  --teal: #20c090;
  --red: #c04040;
  --blue: #4080c0;
  --border: rgba(196, 168, 74, .2);
  --border2: rgba(196, 168, 74, .35);
  display: none;
  position: fixed;
  inset: 0;
  z-index: 85;
  overflow-y: scroll;
}

.ledger-app {
  background: var(--bg0);
  color: var(--ink);
  font-family: 'MedievalSharp', 'Cinzel', serif;
  min-height: 100vh;
  font-size: 13px;
}

.app-header {
  background: linear-gradient(180deg, #1a1206 0%, #0e0b06 100%);
  border-bottom: 1px solid var(--gold-dim);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, .6);
}

.app-header-icon {
  font-size: 22px;
  opacity: .85;
}

.app-header-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold3);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.app-header-sub {
  font-family: 'MedievalSharp', serif;
  font-size: 9px;
  color: var(--ink3);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 1px;
}

.header-sep {
  flex: 1;
}

.api-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-key-row label {
  font-size: 9px;
  color: var(--ink3);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.api-key-input {
  background: rgba(0, 0, 0, .5);
  border: 1px solid var(--border);
  color: var(--ink2);
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  padding: 5px 10px;
  width: 340px;
  outline: none;
  transition: border-color .15s;
}

.api-key-input:focus {
  border-color: var(--gold2);
}

.api-key-input::placeholder {
  color: var(--ink4);
}

.app-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 57px);
}

.sidebar {
  background: var(--bg1);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-section-title {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.entity-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.entity-tab {
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--border);
  color: var(--ink3);
  font-family: 'MedievalSharp', serif;
  font-size: 10px;
  padding: 7px 6px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  letter-spacing: .04em;
}

.entity-tab:hover {
  border-color: var(--gold-dim);
  color: var(--ink2);
}

.entity-tab.active {
  background: rgba(196, 168, 74, .15);
  border-color: var(--gold2);
  color: var(--gold1);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 9px;
  color: var(--ink3);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.filter-input {
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: 'MedievalSharp', serif;
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}

.filter-input:focus {
  border-color: var(--gold2);
}

.filter-input::placeholder {
  color: var(--ink4);
  font-size: 11px;
}

.type-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 320px;
  overflow-y: auto;
}

.type-grid::-webkit-scrollbar {
  width: 4px;
}

.type-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .3);
}

.type-grid::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
}

.type-check {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .12s;
}

.type-check:hover {
  background: rgba(196, 168, 74, .06);
  border-color: var(--border);
}

.type-check input {
  display: none;
}

.type-check-box {
  width: 12px;
  height: 12px;
  border: 1px solid var(--border2);
  background: rgba(0, 0, 0, .4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
}

.type-check input:checked+.type-check-box {
  background: rgba(196, 168, 74, .3);
  border-color: var(--gold2);
}

.type-check input:checked+.type-check-box::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--gold2);
  display: block;
}

.type-check-label {
  font-size: 11px;
  color: var(--ink2);
  flex: 1;
}

.type-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.limit-row {
  display: flex;
  gap: 4px;
}

.limit-btn {
  flex: 1;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--border);
  color: var(--ink3);
  font-family: 'MedievalSharp', serif;
  font-size: 10px;
  padding: 5px 4px;
  cursor: pointer;
  text-align: center;
  transition: all .12s;
}

.limit-btn:hover {
  border-color: var(--gold-dim);
  color: var(--ink2);
}

.limit-btn.active {
  background: rgba(196, 168, 74, .15);
  border-color: var(--gold2);
  color: var(--gold1);
}

.fetch-btn {
  background: linear-gradient(160deg, rgba(196, 168, 74, .22) 0%, rgba(196, 168, 74, .12) 100%);
  border: 1px solid var(--gold2);
  color: var(--gold1);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 10px 16px;
  cursor: pointer;
  width: 100%;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}

.fetch-btn:hover {
  background: linear-gradient(160deg, rgba(196, 168, 74, .32) 0%, rgba(196, 168, 74, .2) 100%);
}

.fetch-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.fetch-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
  transition: left .4s;
}

.fetch-btn:hover::before {
  left: 150%;
}

.status-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  color: var(--ink3);
  padding: 8px 10px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border);
  min-height: 30px;
}

.status-bar-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
  flex-shrink: 0;
}

.result-count {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  color: var(--ink3);
  letter-spacing: .08em;
}

.result-count span {
  color: var(--gold2);
  font-size: 13px;
}

.u2-total-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(196, 168, 74, .1);
  border: 1px solid var(--border);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: .04em;
}

.topbar-sep {
  flex: 1;
}

.cursor-info {
  font-size: 9px;
  color: var(--ink4);
  font-family: 'Nunito', sans-serif;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
}

.page-btn {
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--border);
  color: var(--ink2);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all .12s;
  letter-spacing: .06em;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--gold2);
  color: var(--gold1);
}

.page-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.table-wrap {
  flex: 1;
  overflow: auto;
}

.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
  background: var(--bg0);
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
}

.ledger-app table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.ledger-app thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.ledger-app thead th {
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
  padding: 9px 14px;
  text-align: left;
  font-family: 'Cinzel', serif;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold2);
  white-space: nowrap;
}

.ledger-app thead th:first-child {
  width: 44px;
}

.ledger-app tbody tr {
  border-bottom: 1px solid rgba(196, 168, 74, .08);
  transition: background .1s;
  cursor: pointer;
}

.ledger-app tbody tr:hover {
  background: rgba(196, 168, 74, .05);
}

.ledger-app tbody tr.selected {
  background: rgba(196, 168, 74, .1);
}

.ledger-app td {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--ink2);
  vertical-align: middle;
}

.ledger-app td.mono {
  font-family: 'Nunito', monospace;
  font-size: 11px;
  color: var(--ink3);
}

.ledger-app td.money {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold2);
  font-weight: 600;
}

.ledger-app td.money.zero {
  color: var(--ink4);
  font-size: 11px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: 'MedievalSharp', serif;
  border: 1px solid;
  white-space: nowrap;
}

.item-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: rgba(196, 168, 74, .08);
  border: 1px solid var(--border);
  font-size: 10px;
  color: var(--ink2);
}

.id-chip {
  font-family: 'Nunito', monospace;
  font-size: 10px;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.id-chip:hover {
  color: #6aa8e0;
}

.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--ink4);
}

.table-empty-icon {
  font-size: 36px;
  opacity: .4;
}

.table-empty-text {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.skel {
  background: linear-gradient(90deg, rgba(196, 168, 74, .06) 25%, rgba(196, 168, 74, .12) 50%, rgba(196, 168, 74, .06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  height: 12px;
  border-radius: 2px;
}

.detail-drawer {
  position: fixed;
  right: 0;
  top: 57px;
  width: 360px;
  height: calc(100vh - 57px);
  background: var(--bg1);
  border-left: 1px solid var(--border2);
  z-index: 200;
  transform: translateX(100%);
  transition: transform .25s ease;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, .5);
}

.detail-drawer.open {
  transform: translateX(0);
}

.detail-drawer::-webkit-scrollbar {
  width: 4px;
}

.detail-drawer::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
}

.drawer-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.drawer-title {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold2);
}

.drawer-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink3);
  font-family: 'MedievalSharp', serif;
  font-size: 13px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
}

.drawer-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.drawer-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-field-label {
  font-size: 8.5px;
  color: var(--ink4);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-family: 'Cinzel', serif;
}

.drawer-field-value {
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
  font-family: 'MedievalSharp', serif;
}

.drawer-field-value.large {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--gold2);
  font-weight: 600;
}

.drawer-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border2), transparent);
}

.json-block {
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--border);
  padding: 12px;
  font-family: 'Nunito', monospace;
  font-size: 10px;
  color: var(--ink3);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.6;
}

.ornament-card {
  position: relative;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.ornament-card::before,
.ornament-card::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: rgba(220, 192, 100, .5);
  border-style: solid;
  pointer-events: none;
}

.ornament-card::before {
  top: 3px;
  left: 3px;
  border-width: 1px 0 0 1px;
}

.ornament-card::after {
  bottom: 3px;
  right: 3px;
  border-width: 0 1px 1px 0;
}

.apparat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(160deg, rgba(80, 40, 120, .25) 0%, rgba(60, 20, 100, .15) 100%);
  border: 1px solid rgba(140, 80, 200, .35);
  color: rgba(200, 160, 255, .85);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}

.apparat-btn:hover {
  background: linear-gradient(160deg, rgba(100, 50, 160, .35) 0%, rgba(80, 30, 140, .25) 100%);
  border-color: rgba(160, 100, 240, .6);
  color: rgba(220, 190, 255, .95);
}

.apparat-btn.unlocked {
  border-color: rgba(32, 192, 144, .45);
  background: linear-gradient(160deg, rgba(20, 80, 60, .25) 0%, rgba(10, 50, 40, .15) 100%);
  color: rgba(80, 220, 170, .9);
}

.apparat-btn-icon {
  font-size: 13px;
}

.apparat-lock {
  margin-left: auto;
  font-size: 12px;
}

.apparat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.apparat-overlay.open {
  display: flex;
}

.apparat-modal {
  background: linear-gradient(160deg, #1e1408 0%, #130e05 100%);
  border: 1px solid rgba(140, 80, 200, .4);
  box-shadow: 0 0 40px rgba(100, 40, 180, .25), inset 0 0 30px rgba(0, 0, 0, .3);
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: apparatIn .2s ease;
}

.apparat-modal::-webkit-scrollbar {
  width: 4px;
}

.apparat-modal::-webkit-scrollbar-thumb {
  background: rgba(140, 80, 200, .3);
}

.apparat-modal::before,
.apparat-modal::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(160, 100, 240, .5);
  border-style: solid;
  pointer-events: none;
}

.apparat-modal::before {
  top: 3px;
  left: 3px;
  border-width: 1px 0 0 1px;
}

.apparat-modal::after {
  bottom: 3px;
  right: 3px;
  border-width: 0 1px 1px 0;
}

.apparat-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(140, 80, 200, .2);
  background: rgba(100, 40, 160, .08);
}

.apparat-modal-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: rgba(200, 160, 255, .9);
  letter-spacing: .16em;
}

.apparat-modal-sub {
  font-family: 'MedievalSharp', serif;
  font-size: 9px;
  color: rgba(200, 160, 255, .4);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 3px;
}

.apparat-close {
  background: none;
  border: 1px solid rgba(140, 80, 200, .25);
  color: rgba(200, 160, 255, .5);
  font-size: 13px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
}

.apparat-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.apparat-gate {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.apparat-gate-icon {
  font-size: 32px;
  opacity: .6;
}

.apparat-gate-label {
  font-family: 'MedievalSharp', serif;
  font-size: 11px;
  color: rgba(200, 160, 255, .55);
  letter-spacing: .08em;
}

.apparat-pw-row {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 280px;
}

.apparat-pw-input {
  flex: 1;
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(140, 80, 200, .3);
  border-right: none;
  color: rgba(220, 190, 255, .9);
  font-family: 'MedievalSharp', serif;
  font-size: 12px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .12s;
}

.apparat-pw-input:focus {
  border-color: rgba(160, 100, 240, .7);
}

.apparat-pw-input::placeholder {
  color: rgba(200, 160, 255, .25);
}

.apparat-pw-btn {
  background: rgba(100, 40, 160, .3);
  border: 1px solid rgba(140, 80, 200, .4);
  color: rgba(200, 160, 255, .85);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 8px 14px;
  cursor: pointer;
  transition: all .12s;
}

.apparat-pw-btn:hover {
  background: rgba(120, 60, 200, .45);
  border-color: rgba(180, 120, 255, .6);
}

.apparat-pw-error {
  font-family: 'MedievalSharp', serif;
  font-size: 10px;
  color: var(--red);
  min-height: 14px;
  letter-spacing: .04em;
}

.apparat-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.apparat-section-title {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(32, 192, 144, .7);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(32, 192, 144, .15);
}

.apparat-placeholder {
  font-family: 'MedievalSharp', serif;
  font-size: 11px;
  color: rgba(200, 160, 255, .3);
  text-align: center;
  padding: 20px 0;
}

.apparat-tool-wrap {
  border: 1px solid rgba(140, 80, 200, .2);
  background: rgba(0, 0, 0, .25);
}

.apparat-tool-title {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(200, 160, 255, .7);
  padding: 8px 14px;
  border-bottom: 1px solid rgba(140, 80, 200, .15);
  background: rgba(100, 40, 160, .08);
}

.apparat-tool-body {
  padding: 12px 14px;
}

@media (max-width: 900px) {
  .app-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.date-display-btn {
  flex: 1;
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--border);
  color: var(--gold1);
  font-family: 'MedievalSharp', serif;
  font-size: 11px;
  padding: 6px 8px;
  cursor: pointer;
  text-align: center;
  transition: border-color .12s;
  min-width: 0;
}

.date-display-btn:hover {
  border-color: var(--gold2);
}

.date-display-btn.active-cal {
  border-color: var(--gold2);
  background: rgba(196, 168, 74, .12);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.cal-month-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: .08em;
}

.cal-nav {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink3);
  font-size: 10px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  transition: all .12s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-nav:hover {
  border-color: var(--gold2);
  color: var(--gold1);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-dow {
  font-family: 'Cinzel', serif;
  font-size: 8px;
  color: var(--ink4);
  text-align: center;
  padding: 2px 0;
  letter-spacing: .04em;
}

.cal-day {
  font-family: 'MedievalSharp', serif;
  font-size: 10px;
  color: var(--ink2);
  text-align: center;
  padding: 4px 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .1s;
  border-radius: 1px;
}

.cal-day:hover {
  border-color: var(--gold-dim);
  color: var(--gold1);
  background: rgba(196, 168, 74, .08);
}

.cal-day.empty {
  cursor: default;
  pointer-events: none;
}

.cal-day.today {
  color: var(--gold2);
}

.cal-day.in-range {
  background: rgba(196, 168, 74, .1);
}

.cal-day.range-start,
.cal-day.range-end {
  background: rgba(196, 168, 74, .3);
  border-color: var(--gold2);
  color: var(--gold1);
  font-weight: 700;
}

.cal-day.other-month {
  color: var(--ink4);
  opacity: .4;
}

.drop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

.drop-item:last-child {
  border-bottom: none;
}

.drop-item:hover {
  background: rgba(196, 168, 74, .08);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   WAGE COMPENDIUM â€” CARD VIEW (â‰¤ 1200px)
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Hide table / show cards at narrow widths */
@media (max-width: 1100px) {
  .twrap {
    display: none !important;
  }

  .wc-cards {
    display: grid !important;
  }
}

/* Hide cards on wide screens */
.wc-cards {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

/* â”€â”€ Individual card â”€â”€ */
.wc-card {
  background: rgba(242, 232, 206, 0.6);
  border: 1px solid var(--parchment3);
  padding: 0;
  position: relative;
  overflow: hidden;
  transition: background .12s, box-shadow .12s;
}

.wc-card:hover {
  background: rgba(242, 232, 206, 0.85);
  box-shadow: 0 2px 12px rgba(26, 18, 8, .1);
}

/* Rank stripe on the left edge */
.wc-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--parchment3);
}

.wc-card.rank-1::before {
  background: var(--gold2);
}

.wc-card.rank-2::before {
  background: var(--ink-faded);
}

.wc-card.rank-3::before {
  background: #8b6030;
}

/* â”€â”€ Card header: item name + badge + rank â”€â”€ */
.wc-card-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px 18px;
  border-bottom: 1px solid rgba(196, 168, 74, .2);
}

.wc-card-rank {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-ghost);
  min-width: 22px;
  flex-shrink: 0;
}

.wc-card.rank-1 .wc-card-rank {
  color: var(--gold2);
}

.wc-card.rank-2 .wc-card-rank {
  color: var(--ink-faded);
}

.wc-card.rank-3 .wc-card-rank {
  color: #8b6030;
}

.wc-card-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.wc-card-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-card-arrow {
  margin-left: auto;
  flex-shrink: 0;
}

/* â”€â”€ Card body: data rows â”€â”€ */
.wc-card-body {
  padding: 10px 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wc-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(196, 168, 74, .1);
  gap: 8px;
}

.wc-card-row:last-child {
  border-bottom: none;
}

.wc-card-lbl {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  flex-shrink: 0;
}

.wc-card-val {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--ink2);
  text-align: right;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Max Wage â€” prominent */
.wc-card-wage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0 5px;
  border-bottom: 1px solid rgba(196, 168, 74, .15);
  gap: 8px;
}

.wc-card-wage-lbl {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gold);
}

.wc-card-wage-val {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Region + country block */
.wc-card-location {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: right;
}

.wc-card-region {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--ink2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
  overflow: hidden;
}

.wc-card-country {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: #c0392b;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

/* Bonus breakdown */
.wc-card-bonus {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.wc-card-bonus-total {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink2);
}

.wc-card-bonus-break {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  color: var(--ink-ghost);
  text-align: right;
  white-space: normal;
  word-break: break-word;
}

/* Profit row */
.wc-card-profit-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 5px 0 0;
  gap: 8px;
  margin-top: 2px;
  border-top: 1px dashed rgba(196, 168, 74, .25);
}
