* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1020;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #eef3ff;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #0b1020;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(#0b1020, #152038);
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-start;
  gap: 6px;
  padding: max(10px, env(safe-area-inset-top)) 10px 8px;
  pointer-events: none;
  background: linear-gradient(rgba(0,0,0,0.5), transparent);
  font-size: 13px;
  font-weight: 600;
  z-index: 5;
}

.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-right {
  align-items: flex-end;
}

.hud-center {
  text-align: center;
  padding-top: 2px;
}

#wave-label {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fde68a;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.hud-item .label {
  opacity: 0.7;
  font-weight: 500;
  margin-right: 4px;
}

.shop-btn {
  pointer-events: auto;
  margin-top: 4px;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #081018;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  cursor: pointer;
}

.shop-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

#wave-banner {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 6;
  pointer-events: none;
  text-align: center;
}

#wave-banner.hidden { display: none; }

#wave-banner-title {
  font-size: 30px;
  font-weight: 800;
  color: #fde68a;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: 8px;
}
#wave-banner-count {
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 16px rgba(0,0,0,0.55);
}
#wave-banner {
  background: rgba(10, 16, 36, 0.72);
  border: 1px solid #3b4d7a;
  border-radius: 18px;
  padding: 22px 36px;
}

#place-hint {
  position: absolute;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(320px, calc(100% - 24px));
  pointer-events: none;
}

#place-hint.hidden { display: none; }

#place-hint-text {
  background: rgba(10, 16, 36, 0.85);
  border: 1px solid #4ade80;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

#place-cancel {
  pointer-events: auto;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #eef3ff;
  background: #334155;
  cursor: pointer;
}

#overlay,
#start-overlay,
#shop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.72);
  padding: 24px;
  z-index: 10;
}

#overlay.hidden,
#start-overlay.hidden,
#shop-overlay.hidden {
  display: none;
}

.panel {
  width: min(340px, 100%);
  background: #161d33;
  border: 1px solid #2b3960;
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

.panel h1 {
  font-size: 26px;
  margin-bottom: 10px;
}

.panel p {
  font-size: 15px;
  line-height: 1.45;
  opacity: 0.9;
  margin-bottom: 10px;
}

.shop-panel {
  max-height: min(90vh, 640px);
  overflow-y: auto;
  touch-action: pan-y;
}

.shop-gold {
  margin-bottom: 14px !important;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.shop-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  text-align: left;
  width: 100%;
  margin: 0;
  border: 1px solid #2b3960;
  border-radius: 12px;
  padding: 12px 14px;
  background: #1c2540;
  color: #eef3ff;
  cursor: pointer;
}

.shop-item .item-name {
  font-size: 15px;
  font-weight: 700;
  grid-column: 1;
  grid-row: 1;
}

.shop-item .item-desc {
  font-size: 12px;
  opacity: 0.75;
  grid-column: 1;
  grid-row: 2;
}

.shop-item .item-price {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  align-self: center;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.shop-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.shop-item.owned .item-price {
  color: #34d399;
}

button {
  margin-top: 12px;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  color: #081018;
  background: linear-gradient(180deg, #7dffb3, #34d399);
  cursor: pointer;
}

button.secondary {
  background: #334155;
  color: #eef3ff;
}

button:active {
  transform: scale(0.98);
}


#toast {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 12;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #fbbf24;
  color: #fde68a;
  font-weight: 800;
  font-size: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  white-space: nowrap;
}

#toast.hidden { display: none; }

#hud.hidden { display: none; }

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

.hud-stat {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.hud-stat .label { opacity: 0.85; margin-right: 4px; font-weight: 700; }
.gold-stat { color: #fbbf24; }
.wave-stat { color: #fde68a; font-size: 20px; }
.hud-item.muted { font-size: 12px; opacity: 0.9; }

.start-panel .start-sub {
  opacity: 0.75;
  margin-bottom: 8px;
}
.start-panel button {
  display: block;
  width: 100%;
  margin-top: 10px;
}

#options-overlay,
#diff-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.72);
  padding: 24px;
  z-index: 11;
}
#options-overlay.hidden,
#diff-overlay.hidden { display: none; }

.opt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
  font-size: 16px;
  font-weight: 600;
}
.opt-hint { font-size: 13px; opacity: 0.7; }

.diff-list {
  max-height: min(55vh, 420px);
  overflow-y: auto;
  /* diff-list max */
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.diff-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0;
  border: 1px solid #2b3960;
  border-radius: 12px;
  padding: 12px 14px;
  background: #1c2540;
  color: #eef3ff;
  cursor: pointer;
  text-align: left;
}
.diff-item .diff-name { font-size: 16px; font-weight: 800; }
.diff-item .diff-desc { font-size: 12px; opacity: 0.75; }
.diff-item.selected {
  border-color: #34d399;
  box-shadow: 0 0 0 1px #34d399 inset;
}
.diff-item.locked {
  opacity: 0.45;
  cursor: default;
}


.menu-steine {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid #64748b;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
}
.menu-steine strong { color: #cbd5e1; }

#meta-shop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.78);
  padding: 16px;
  z-index: 12;
}
#meta-shop-overlay.hidden { display: none; }

.meta-shop-panel {
  width: min(360px, 100%);
  max-height: min(92vh, 680px);
  height: min(92vh, 680px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  touch-action: pan-y;
}
.meta-shop-header,
.meta-tabs,
#essence-scroll,
.meta-shop-panel > .secondary,
.meta-shop-panel > #meta-shop-close {
  flex: 0 0 auto;
}
.meta-shop-panel > #meta-shop-close,
.meta-shop-panel > .secondary {
  margin-top: 4px;
}
.meta-shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.meta-shop-header h1 { margin: 0; font-size: 22px; flex: 1; text-align: center; }
.mystery-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #312e81;
  border: 1px solid #818cf8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: #e0e7ff;
}
.mystery-badge strong { color: #c7d2fe; }
.steine-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid #94a3b8;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.steine-badge strong { color: #e2e8f0; }

.meta-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.meta-tab {
  margin: 0;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid #2b3960;
  background: #1c2540;
  color: #eef3ff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.meta-tab.active {
  border-color: #94a3b8;
  background: linear-gradient(180deg, #64748b, #475569);
  color: #0f172a;
}

.meta-tab-panels {
  flex: 1 1 0;
  min-height: 0;
  height: 0; /* force flex child to take remaining space and scroll */
  margin-bottom: 8px;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
  padding-bottom: 0;
  scroll-padding-bottom: 120px;
}
.meta-panel { display: none; }
.meta-panel.active {
  display: block;
  padding-bottom: 28px; /* v23: real rubber-band bounce replaces the empty spring zone */
}
.meta-panel h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #f1f5f9;
}
.meta-panel p {
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.45;
}


/* FC — Heroes / Champions in Hauptmenü-Shop */
.heroes-intro {
  font-size: 12px;
  opacity: 0.75;
  margin: 0 0 10px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-right: 2px;
  /* scroll lives on .meta-tab-panels so all F tabs share one scroller */
}
.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 88px 1fr;
  grid-template-rows: auto auto auto;
  gap: 4px 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid #2b3960;
  background: #141c33;
  align-items: start;
}
.hero-card.locked {
  opacity: 0.72;
  filter: grayscale(0.35);
}
.hero-card.owned {
  border-color: #64748b;
}
.hero-art {
  grid-row: 1 / span 3;
  width: 88px;
  height: 118px;
  border-radius: 10px;
  overflow: hidden;
  background: #0b1224;
  border: 1px solid #334155;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-name {
  margin: 0;
  font-size: 16px;
  color: #f8fafc;
  padding-right: 28px;
}
.hero-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.8;
  min-height: 2.6em;
}
.hero-buy {
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #94a3b8;
  background: linear-gradient(180deg, #64748b, #475569);
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  justify-self: start;
}
.hero-buy:disabled {
  cursor: not-allowed;
  border-color: #334155;
  background: #1e293b;
  color: #94a3b8;
}
.hero-buy.owned-btn {
  border-color: #475569;
  background: #1e293b;
  color: #cbd5e1;
  cursor: default;
}
.hero-info-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #64748b;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

#hero-info-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.86);
  padding: 16px;
  z-index: 14;
}
#hero-info-overlay.hidden { display: none; }
.hero-info-panel {
  position: relative;
  width: min(340px, 100%);
  max-height: min(92vh, 640px);
  overflow-y: auto;
  text-align: center;
}
.hero-info-x {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.hero-info-art {
  width: min(220px, 70%);
  margin: 8px auto 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #475569;
  background: #0b1224;
}
.hero-info-art img {
  width: 100%;
  height: auto;
  display: block;
}
#hero-info-name {
  margin: 0 0 8px;
  font-size: 22px;
}
#hero-info-desc {
  margin: 0 0 14px;
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.45;
}

.hero-art-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    -45deg,
    #1e293b,
    #1e293b 8px,
    #0f172a 8px,
    #0f172a 16px
  );
}
.hero-placeholder-mark {
  font-size: 28px;
  font-weight: 800;
  color: #64748b;
}
.hero-card.placeholder .hero-name { opacity: 0.9; }


.menu-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 4px;
}
.menu-speed {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #1e3a5f;
  border: 1px solid #38bdf8;
  color: #e0f2fe;
  font-size: 13px;
  font-weight: 700;
}
.menu-speed.hidden { display: none; }

/* FS — F-Shop tab Shop */
.fs-intro { font-size: 12px; opacity: 0.75; margin: 0 0 10px; }
.fs-list { display: grid; gap: 12px; }
.fs-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #2b3960;
  background: #141c33;
}
.fs-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.fs-card-top h3 { margin: 0; font-size: 16px; color: #f8fafc; }
.fs-remain { font-size: 11px; font-weight: 700; color: #93c5fd; white-space: nowrap; }
.fs-desc { margin: 0 0 10px; font-size: 12px; line-height: 1.4; opacity: 0.85; }
.fs-buy {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #94a3b8;
  background: linear-gradient(180deg, #64748b, #475569);
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.fs-buy:disabled {
  border-color: #334155;
  background: #1e293b;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Hero select (fc include) */
#hero-select-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.82);
  padding: 16px;
  z-index: 13;
}
#hero-select-overlay.hidden { display: none; }
.hero-select-panel {
  width: min(360px, 100%);
  text-align: center;
}
.hero-select-sub { font-size: 13px; opacity: 0.8; margin-bottom: 12px; }
.hero-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  max-height: min(50vh, 360px);
  overflow-y: auto;
}
.hero-select-card {
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid #2b3960;
  background: #141c33;
  color: #eef3ff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-select-card.selected {
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148,163,184,0.35);
}
.hero-select-art {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1224;
  border: 1px solid #334155;
}
.hero-select-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.hero-select-art.default-ship {
  background: radial-gradient(circle at 50% 40%, #34d399 0%, #065f46 70%);
}
.hero-select-name { font-size: 12px; font-weight: 700; }


/* F-Science + Earth Charge */
.meta-currencies {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  min-width: 72px;
}
.earth-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #1a2e1a;
  border: 1px solid #4ade80;
  color: #bbf7d0;
  font-size: 11px;
  font-weight: 700;
}
.sci-intro { font-size: 12px; opacity: 0.75; margin: 0 0 8px; }
.sci-ec-row {
  font-size: 13px;
  font-weight: 700;
  color: #86efac;
  margin-bottom: 12px;
}
.sci-element-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.sci-el {
  margin: 0;
  padding: 14px 8px;
  border-radius: 14px;
  border: 1px solid #2b3960;
  background: #141c33;
  color: #eef3ff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sci-el:not(.locked):hover { border-color: #4ade80; }
.sci-el.locked {
  opacity: 0.55;
  filter: grayscale(0.4);
  cursor: not-allowed;
}
.sci-el-name { font-size: 14px; font-weight: 800; }
.sci-el-soon { font-size: 11px; color: #94a3b8; }
.sci-tree-view.hidden, .sci-info.hidden, .sci-element-picker.hidden { display: none; }
.sci-back {
  margin: 0 0 8px;
  padding: 6px 10px;
  font-size: 12px;
}
.sci-tree-title { margin: 0 0 10px; font-size: 16px; color: #f8fafc; }
.sci-tree-layout {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  align-items: start;
}
.sci-cost-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 18px;
}
.sci-cost-h {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #86efac;
}
.sci-tree {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sci-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 72px;
}
.sci-node {
  margin: 0;
  padding: 8px;
  border-radius: 14px;
  border: 2px solid #2b3960;
  background: #0f172a;
  color: #eef3ff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sci-node img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.sci-node .sci-node-label { font-size: 11px; font-weight: 700; text-align: center; }
.sci-node.owned {
  border-color: #4ade80;
  box-shadow: 0 0 0 1px rgba(74,222,128,0.35);
}
.sci-node.locked-req {
  opacity: 0.45;
  filter: grayscale(0.5);
}
.sci-node .sci-node-price {
  font-size: 10px;
  color: #86efac;
  font-weight: 700;
}
.sci-info {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #2b3960;
  background: #141c33;
}
.sci-info h3 { margin: 0 0 6px; font-size: 16px; color: #f8fafc; }
.sci-info p { margin: 0 0 8px; font-size: 13px; line-height: 1.4; }
.sci-info-cost { color: #86efac; font-weight: 700; }
.sci-info-actions { display: flex; gap: 8px; flex-wrap: wrap; }


/* F-Shop currency header: Essenz scroll + Charged Rock */
.meta-header-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 96px;
}
.meta-icon-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #e0f2fe;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.meta-icon-btn img,
.meta-charged-rock img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.55), 0 0 2px #38bdf8;
  border: 1px solid rgba(125, 211, 252, 0.65);
}
.meta-icon-btn[aria-expanded="true"] img {
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9), 0 0 4px #7dd3fc;
}
.meta-icon-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #7dd3fc;
  text-shadow: 0 0 6px rgba(56,189,248,0.8);
}
.meta-charged-rock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.meta-charged-rock img {
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.5), inset 0 0 0 1px rgba(147,197,253,0.3);
}
.charged-rock-count {
  font-size: 11px;
  font-weight: 800;
  color: #bfdbfe;
}
.essence-scroll {
  margin: 0 0 8px;
  padding: 0 4px;
  max-height: 220px;
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.22s ease;
  opacity: 1;
}
.essence-scroll.hidden {
  display: block;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
}
.essence-scroll-inner {
  margin: 0 auto;
  padding: 12px 14px 14px;
  max-width: 100%;
  border-radius: 4px 4px 10px 10px;
  background:
    linear-gradient(180deg, rgba(255,248,220,0.97), rgba(232,213,170,0.96));
  border: 1px solid #b8956a;
  box-shadow:
    inset 0 0 0 2px rgba(180,140,90,0.25),
    0 8px 18px rgba(0,0,0,0.35);
  color: #3b2a14;
  position: relative;
}
.essence-scroll-inner::before,
.essence-scroll-inner::after {
  content: "";
  display: block;
  height: 6px;
  margin: 0 -6px 8px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    90deg,
    #c4a574 0 8px,
    #a67c52 8px 12px
  );
  opacity: 0.7;
}
.essence-scroll-inner::after {
  margin: 8px -6px 0;
}
.essence-scroll-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #5b3d1e;
  letter-spacing: 0.04em;
}
.essence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.essence-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.28);
  border: 1px solid rgba(120,80,40,0.2);
  font-size: 13px;
  font-weight: 600;
}
.essence-list .ess-name { color: #4a3318; }
.essence-list strong { color: #1e3a5f; font-variant-numeric: tabular-nums; }


/* --- v17 settings gear + vault pick --- */
.settings-btn {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  cursor: pointer;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-btn:active {
  transform: scale(0.94);
  background: rgba(30, 41, 59, 0.9);
}

#settings-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.78);
  padding: 24px;
  z-index: 16;
}
#settings-overlay.hidden { display: none; }
.settings-panel button {
  display: block;
  width: 100%;
  margin-top: 10px;
}
#settings-quit {
  background: linear-gradient(180deg, #f87171, #dc2626);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

#vault-pick-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.82);
  padding: 16px;
  z-index: 18;
}
#vault-pick-overlay.hidden { display: none; }
.vault-pick-panel {
  width: min(100%, 360px);
  max-height: min(88vh, 640px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.vault-pick-sub {
  text-align: center;
  opacity: 0.8;
  margin: -4px 0 14px;
  font-size: 14px;
}
.vault-pick-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vault-pick-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  color: #f8fafc;
  cursor: pointer;
  min-height: 76px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.vault-pick-card:active {
  transform: scale(0.98);
  border-color: #fbbf24;
}
.vault-pick-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: #0f172a;
}
.vault-pick-card .vpc-name {
  display: block;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 2px;
  color: #fde68a;
}
.vault-pick-card .vpc-desc {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.85;
  font-weight: 500;
}

/* ===== v19 FM — Fusion (Science) ===== */
.hidden.fusion-slot-img, .fusion-x.hidden, .fusion-go.hidden, .fusion-anim.hidden, .fusion-picker.hidden { display: none !important; }
.sci-tree-heading { margin: 14px 0 6px; font-size: 15px; color: #f8fafc; }
.fusion-box {
  position: relative;
  margin: 0 0 12px;
  padding: 12px 10px 10px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.18), rgba(15, 23, 42, 0.9) 70%);
  border: 1px solid rgba(167, 139, 250, 0.55);
  overflow: hidden;
}
.fusion-title { margin: 0 0 8px; font-size: 16px; text-align: center; color: #e9d5ff; letter-spacing: 0.04em; }
.fusion-slots { display: flex; align-items: center; justify-content: center; gap: 10px; }
.fusion-slot-wrap { position: relative; }
.fusion-slot {
  margin: 0;
  width: 104px;
  height: 104px;
  border-radius: 14px;
  border: 2px dashed rgba(148, 163, 184, 0.7);
  background: rgba(2, 6, 23, 0.6);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  cursor: pointer;
}
.fusion-slot.filled { border-style: solid; border-color: #a78bfa; box-shadow: 0 0 14px rgba(167, 139, 250, 0.45); }
.fusion-slot.full { border-color: #4ade80; box-shadow: 0 0 14px rgba(74, 222, 128, 0.45); }
.fusion-slot-img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.fusion-slot-plus { font-size: 34px; line-height: 1; color: #94a3b8; }
.fusion-slot-label { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.2; }
.fusion-stone-img { filter: grayscale(1) brightness(0.95); }
.fusion-slot.empty .fusion-stone-img { opacity: 0.45; }
.fusion-op { font-size: 26px; font-weight: 800; color: #c4b5fd; }
.fusion-x {
  position: absolute; top: -8px; right: -8px;
  width: 26px; height: 26px; margin: 0; padding: 0;
  border-radius: 50%; border: 1px solid #f87171;
  background: #450a0a; color: #fecaca; font-size: 16px; font-weight: 800; line-height: 1;
  cursor: pointer;
}
.fusion-status { margin: 8px 0 6px; font-size: 12px; text-align: center; color: #cbd5e1; min-height: 16px; }
.fusion-go {
  display: block; margin: 4px auto 8px; padding: 10px 28px;
  font-size: 16px; font-weight: 900; letter-spacing: 0.06em;
  color: #fff; border: none; border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  box-shadow: 0 0 18px rgba(219, 39, 119, 0.55);
  animation: fusionPulse 1.1s ease-in-out infinite;
}
@keyframes fusionPulse { 50% { transform: scale(1.06); box-shadow: 0 0 26px rgba(219, 39, 119, 0.8); } }
.fusion-rocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.fusion-rock {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 10px; background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.3); font-size: 11px; font-weight: 700;
}
.fusion-rock img { border-radius: 6px; }
.fusion-rock strong { font-size: 14px; color: #fde68a; }
/* element tints (base art is blue) */
.el-earth img, img.el-earth { filter: hue-rotate(-115deg) saturate(1.3) brightness(0.92); }
.el-fire img, img.el-fire { filter: hue-rotate(165deg) saturate(1.8) brightness(1.05); }
.el-ice img, img.el-ice { filter: hue-rotate(-12deg) saturate(1.1) brightness(1.15); }
.el-mystery img, img.el-mystery { filter: hue-rotate(70deg) saturate(1.5); }

.fusion-picker {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, 0.78); padding: 16px;
}
.fusion-picker-inner {
  width: min(320px, 100%); padding: 14px; border-radius: 16px;
  background: #0f172a; border: 1px solid #a78bfa; text-align: center;
}
.fusion-picker-inner h3 { margin: 0 0 10px; color: #e9d5ff; }
.fusion-picker-list { display: grid; gap: 8px; margin-bottom: 10px; }
.fusion-pick {
  margin: 0; display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 12px; text-align: left;
  background: #1e293b; border: 1px solid #334155; color: #f1f5f9; font-weight: 700; font-size: 14px;
}
.fusion-pick img { width: 40px; height: 40px; border-radius: 8px; }
.fusion-pick .fp-name { flex: 1; }
.fusion-pick .fp-count { color: #fde68a; }
.fusion-pick:disabled { opacity: 0.4; }
.fusion-pick:not(:disabled):active { border-color: #a78bfa; }

.fusion-anim {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(2, 6, 23, 0.9); border-radius: 14px; overflow: hidden;
}
.fusion-anim img { position: absolute; width: 64px; height: 64px; top: 50%; left: 50%; margin: -32px 0 0 -32px; border-radius: 12px; }
.fusion-anim .fa-charge { animation: faCharge 1.5s ease-in forwards; }
.fusion-anim .fa-stone { filter: grayscale(1); animation: faStone 1.5s ease-in forwards; }
.fusion-anim .fa-flash {
  position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.7) 35%, rgba(196, 181, 253, 0) 70%);
  opacity: 0; animation: faFlash 1.5s ease-out forwards;
}
.fusion-anim .fa-result { opacity: 0; animation: faResult 1.9s ease-out forwards; }
.fusion-anim .fa-label {
  position: absolute; left: 0; right: 0; bottom: 14%; text-align: center;
  font-size: 22px; font-weight: 900; color: #fde68a; text-shadow: 0 0 12px rgba(253, 230, 138, 0.8);
  opacity: 0; animation: faLabel 1.9s ease-out forwards;
}
@keyframes faCharge {
  0% { transform: translateX(-110px) scale(1); opacity: 1; }
  55% { transform: translateX(-8px) scale(0.9) rotate(180deg); opacity: 1; }
  70% { transform: translateX(0) scale(0.3) rotate(320deg); opacity: 0.6; }
  80%, 100% { transform: translateX(0) scale(0); opacity: 0; }
}
@keyframes faStone {
  0% { transform: translateX(110px); opacity: 1; }
  55% { transform: translateX(8px); opacity: 1; }
  70% { transform: translateX(0) scale(1.1); opacity: 0.8; }
  80%, 100% { transform: scale(0); opacity: 0; }
}
@keyframes faFlash {
  0%, 55% { opacity: 0; transform: scale(0.3); }
  72% { opacity: 1; transform: scale(6); }
  100% { opacity: 0; transform: scale(9); }
}
@keyframes faResult {
  0%, 60% { opacity: 0; transform: scale(0.2); }
  75% { opacity: 1; transform: scale(1.5); }
  88%, 100% { opacity: 1; transform: scale(1.3); }
}
@keyframes faLabel {
  0%, 68% { opacity: 0; transform: translateY(10px); }
  82%, 100% { opacity: 1; transform: translateY(0); }
}
.forge-hint { font-size: 13px; color: #cbd5e1; }
.link-btn {
  display: inline; margin: 0; padding: 0; background: none; border: none;
  color: #c4b5fd; text-decoration: underline; font: inherit; cursor: pointer;
}

/* --- v20 Charged Rock overview + Science rock balances --- */
#rocks-scroll { flex: 0 0 auto; }
#rocks-scroll:not(.hidden) { max-height: 300px; }
.meta-charged-rock.meta-icon-btn[aria-expanded="true"] img { box-shadow: 0 0 14px rgba(96,165,250,0.95), 0 0 4px #93c5fd; }
.essence-scroll-inner p.rocks-scroll-sub { line-height: 1.3; margin: -4px 0 8px; text-align: center; font-size: 11px; color: #6b4a22; }
.essence-scroll-inner p.rocks-scroll-total { line-height: 1.3; margin: 8px 0 0; text-align: center; font-size: 11px; font-weight: 700; color: #5b3d1e; }
.rocks-list .rov-nums { font-size: 12px; color: #4a3318; }
.rocks-list li.el-earth { border-left: 4px solid #a3e635; }
.rocks-list li.el-fire { border-left: 4px solid #f97316; }
.rocks-list li.el-ice { border-left: 4px solid #38bdf8; }
.sci-rock-row { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.sci-rock-row span { display: inline-flex; align-items: center; gap: 4px; }
.sci-rock-row img { border-radius: 5px; }
.sci-rock-row .el-fire { color: #fdba74; }
.sci-rock-row .el-ice { color: #7dd3fc; }
.sci-node.too-poor .sci-node-price { color: #fca5a5; }

/* ===== v21 In-Game-Shop Loadout ===== */
.ss-hide { display: none !important; }
.ss-wrap { margin-bottom: 14px; }
.ss-h { margin: 12px 0 8px; font-size: 14px; color: #fde68a; letter-spacing: .02em; }
.ss-bar-row { display: flex; align-items: center; gap: 8px; }
.ss-scroll-btn { position: relative; flex: 0 0 auto; width: 52px; height: 52px; padding: 3px; margin: 0; border-radius: 12px; border: 1px solid #b8956a; background: #2a2113; cursor: pointer; transition: transform .2s; }
.ss-scroll-btn img { width: 44px; height: 44px; border-radius: 9px; display: block; }
.ss-scroll-btn[aria-expanded="true"] { box-shadow: 0 0 0 2px #fbbf24; }
.ss-scroll-btn.ss-bump { transform: scale(1.18) rotate(-6deg); }
.ss-scroll-count { position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #fbbf24; color: #1f1300; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.ss-bar { flex: 1; display: flex; gap: 6px; padding: 6px; border-radius: 12px; background: #0b1224; border: 1px solid #334155; min-height: 64px; }
.ss-slot { flex: 1 1 0; min-width: 0; border-radius: 10px; border: 1px dashed #475569; background: #111a30; display: flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s; }
.ss-slot.ss-target { border-color: #fbbf24; }
.ss-slot.ss-hover { background: #3b2f0b; border-style: solid; }
.ss-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; min-width: 0; }
.ss-slot .ss-tile { cursor: default; }
.ss-tile img { width: 40px; height: 40px; border-radius: 8px; pointer-events: none; }
.ss-glyph { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: radial-gradient(circle, #1e3a8a, #0b1224); }
.ss-tname { font-size: 10px; font-weight: 700; color: #e2e8f0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62px; }
.ss-tile.ss-selected { outline: 2px solid #fbbf24; border-radius: 10px; background: #3b2f0b; }
.ss-scroll { overflow: hidden; max-height: 260px; transition: max-height .28s ease, opacity .22s ease; opacity: 1; margin-top: 8px; }
.ss-scroll.hidden { max-height: 0; opacity: 0; pointer-events: none; margin-top: 0; }
.ss-scroll-inner { padding: 10px 12px; border-radius: 4px 4px 10px 10px; background: linear-gradient(180deg, rgba(255,248,220,.97), rgba(232,213,170,.96)); border: 1px solid #b8956a; color: #3b2a14; }
.ss-scroll-inner h4 { margin: 0 0 6px; font-size: 13px; }
.ss-scroll-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-scroll-list .ss-tile { background: rgba(59,42,20,.12); border-radius: 10px; }
.ss-scroll-list .ss-tname { color: #3b2a14; }
.ss-empty { margin: 0; font-size: 12px; opacity: .75; }
.ss-hint { margin: 6px 0 0 !important; font-size: 11px !important; opacity: .7; }
.ss-card-row { display: flex; gap: 10px; align-items: flex-start; }
.ss-card-icon img { width: 48px; height: 48px; border-radius: 10px; display: block; }
.ss-card-body { flex: 1; min-width: 0; }
.ss-card-body h3 { margin: 0 0 4px; font-size: 15px; color: #f8fafc; display: flex; justify-content: space-between; gap: 6px; }
.ss-card .ss-tile { background: #1e293b; border-radius: 10px; border: 1px solid #fbbf24; }
.ss-owned { font-size: 12px; font-weight: 800; color: #34d399; }
.ss-card-own { border-color: #14532d; }
.ss-unlocks { margin-bottom: 12px; }
.ss-fly { position: fixed; z-index: 9999; width: 44px; height: 44px; pointer-events: none; transition: transform .55s cubic-bezier(.5,-.2,.6,1), opacity .55s; }
.ss-fly img, .ss-fly .ss-glyph { width: 44px; height: 44px; border-radius: 9px; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.ss-ghost { transition: none; opacity: .9; }
.ess-convert { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 700; }
.ess-convert button { padding: 4px 8px; border-radius: 8px; border: 1px solid #8a6a3a; background: #f5e6c4; color: #3b2a14; font-weight: 800; font-size: 12px; cursor: pointer; }
.ess-convert button:disabled { opacity: .45; cursor: default; }
.shop-item-feature .item-name img { width: 22px; height: 22px; border-radius: 5px; vertical-align: middle; }
#essence-scroll:not(.hidden) { max-height: 320px; }
/* v21: 5 Slots passen auf schmale Screens */
.ss-bar { min-width: 0; overflow: hidden; }
.ss-slot .ss-tile { width: 100%; padding: 4px 1px; }
.ss-slot .ss-tile img, .ss-slot .ss-glyph { width: min(40px, 100%); height: auto; aspect-ratio: 1; }
.ss-slot .ss-tname { max-width: 100%; font-size: 9.5px; }

/* ===== v22 Run-Menü ===== */
#hero-select-overlay.run-setup { align-items: flex-start; overflow-y: auto; padding: 10px; -webkit-overflow-scrolling: touch; }
.run-setup-panel { width: min(380px, 100%); text-align: left; padding: 14px 12px 0; }
.run-setup-panel h1 { text-align: center; margin: 0 0 4px; font-size: 22px; }
.rs-sec { margin-bottom: 8px; }
.rs-sec .ss-h { margin: 8px 0 6px; }
.rs-sub { color: #cbd5e1; font-weight: 600; font-size: 12px; }
.rs-champs { grid-template-columns: repeat(2, 1fr); max-height: none; overflow: visible; margin-bottom: 0; gap: 8px; }
.rs-champs .hero-select-card { padding: 8px; gap: 4px; }
.rs-champs .hero-select-art { width: 56px; height: 56px; }
.hero-select-card.selected { border-color: #a3e635; box-shadow: 0 0 0 2px rgba(163,230,53,.35); background: #1a2e14; }
.hero-select-card.locked { cursor: default; border-style: dashed; }
.hero-select-card.locked .hero-select-art, .hero-select-card.locked .hero-select-name { filter: grayscale(1); opacity: .45; }
.rs-tag { font-size: 10px; opacity: .7; }
.rs-buy { margin: 0; padding: 4px 8px; font-size: 11px; border-radius: 8px; width: auto; }
.rs-skill { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-wide { grid-column: 1 / -1; }
.rs-node { margin: 0; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 12px; border: 2px solid #2b3960; background: #141c33; color: #eef3ff; text-align: left; width: 100%; cursor: pointer; }
.rs-node img { width: 40px; height: 40px; border-radius: 8px; flex: 0 0 auto; }
.rs-node.active { border-color: #a3e635; box-shadow: 0 0 0 2px rgba(163,230,53,.35); background: #1a2e14; }
.rs-node.locked { opacity: .42; filter: grayscale(1); }
.rs-node:disabled { cursor: default; }
.rs-node:not(.locked):disabled { opacity: .8; }
.rs-node-name { font-size: 12px; font-weight: 800; display: block; }
.rs-node-st { font-size: 10px; opacity: .8; display: block; }
.rs-note { font-size: 11px; opacity: .75; margin: 6px 0 0; }
.rs-warn { color: #fde68a; opacity: 1; }
.rs-diff { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-diff-chip { margin: 0; padding: 6px 12px; font-size: 12px; border-radius: 999px; width: auto; background: #141c33; border: 2px solid #2b3960; color: #eef3ff; }
.rs-diff-chip.selected { border-color: #fbbf24; background: #3b2f0b; }
.rs-diff-chip.locked { opacity: .45; }
.rs-actions { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 0 12px; background: #161d33; margin-top: 4px; }
.rs-actions button { flex: 1; margin: 0; }
#btn-clear-board { position: absolute; left: 8px; top: 44%; z-index: 6; width: 58px; margin: 0; padding: 4px 2px 5px; border-radius: 14px; border: 2px solid #fbbf24; background: rgba(59,47,11,.9); color: #fde68a; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; font-weight: 800; box-shadow: 0 0 14px rgba(251,191,36,.55); animation: cbPulse 1.2s ease-in-out infinite; }
#btn-clear-board.hidden { display: none; }
#btn-clear-board img { width: 28px; height: 36px; }
#btn-clear-board .cb-count { font-size: 10px; }
@keyframes cbPulse { 50% { box-shadow: 0 0 22px rgba(251,191,36,.9); } }


/* ===== v23: Federung scroll (rubber-band) + overflow fixes + test mode ===== */
/* Root cause of "scroll geht nicht": global `* { touch-action:none }` blocks native
   touch panning in every menu. All menus now scroll via the JS Fed scroller. */
.shop-panel, .meta-shop-panel, .meta-tab-panels, .diff-list, .hero-info-panel,
.vault-pick-panel, .essence-scroll, .ss-scroll { touch-action: none; }
#overlay, #start-overlay, #shop-overlay, #options-overlay, #diff-overlay,
#meta-shop-overlay, #hero-info-overlay, #hero-select-overlay, #settings-overlay,
#vault-pick-overlay, .fusion-picker {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
#overlay > .panel, #start-overlay > .panel, #shop-overlay > .panel, #options-overlay > .panel,
#diff-overlay > .panel, #meta-shop-overlay > .panel, #hero-info-overlay > .panel,
#hero-select-overlay > .panel, #settings-overlay > .panel, #vault-pick-overlay > .panel,
.fusion-picker > * {
  margin: auto;
  flex-shrink: 0;
}
.essence-scroll:not(.hidden), .ss-scroll:not(.hidden) { overflow-y: auto; }
.fed-scroll.fed-active > * { translate: 0 var(--fed, 0px); }
.fed-scroll { scroll-behavior: auto !important; }

#test-badge {
  position: fixed;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 1px 8px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font: 800 11px/16px system-ui, sans-serif;
  letter-spacing: 1.5px;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
  opacity: .9;
}
#test-badge.hidden { display: none; }
#new-badge { position: fixed; left: 50%; bottom: 4px; transform: translateX(-50%); z-index: 60; padding: 1px 8px; border-radius: 999px; background: #16a34a; color: #fff; font: 800 11px/16px system-ui, sans-serif; letter-spacing: 1.5px; pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.5); opacity: .9; }
#new-badge.hidden { display: none; }

/* v27: Skilltree-Level */
.sci-level { margin-top: 14px; padding: 12px; border-radius: 14px; border: 1px solid #3b4a75; background: linear-gradient(180deg, #17213d, #111a30); }
.sci-lv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sci-lv-badge { font-size: 20px; font-weight: 900; color: #fde68a; background: #0f172a; border: 2px solid #f59e0b; border-radius: 12px; padding: 4px 10px; }
.sci-lv-badge small { font-size: 12px; opacity: .7; }
.sci-lv-stats { font-size: 12px; color: #cbd5e1; }
.sci-lv-stats b { color: #86efac; }
.sci-lv-note { font-size: 12px; margin: 10px 0 6px; color: #cbd5e1; }
.sci-lv-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sci-lv-btns button { display: flex; flex-direction: column; align-items: center; padding: 8px 6px; font-weight: 800; }
.sci-lv-btns button small { font-size: 11px; font-weight: 600; opacity: .85; }
.sci-lv-btns button:disabled { opacity: .45; cursor: not-allowed; }
.sci-lv-bonus { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 8px; border-radius: 12px; background: #0f172a; border: 1px dashed #475569; font-size: 12px; line-height: 1.35; }
.sci-lv-bonus img { border-radius: 10px; flex: none; }
.sci-lv-bonus.locked img { filter: grayscale(0.85) brightness(.7); }
.sci-lv-bonus.on { border: 1px solid #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,.25); }
.sci-lv-bonus em { font-style: normal; font-size: 11px; color: #94a3b8; }
.sci-lv-bonus em.ok, .rs-tree-lv .ok { color: #86efac; }
.sci-lv-bonus small { color: #cbd5e1; }
.rs-tree-lv { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 11px; line-height: 1.35; padding: 6px 8px; border-radius: 10px; background: rgba(15,23,42,.6); border: 1px solid #334155; }
.rs-tree-lv img { border-radius: 8px; flex: none; }
.rs-tree-lv:not(.on) img { filter: grayscale(0.85) brightness(.7); }
.rs-tree-lv.on { border-color: #f59e0b; }

/* ===== v30 Schmiede ===== */
.fm-tabs { display: flex; gap: 6px; margin: 0 0 8px; }
.fm-tab { flex: 1; padding: 8px 6px; border-radius: 10px; border: 1px solid rgba(167,139,250,0.45); background: rgba(15,23,42,0.75); color: #c4b5fd; font-weight: 800; font-size: 13px; }
.fm-tab.active { background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; border-color: transparent; }
.fusion-box.hidden, .forge-box.hidden, .forge-anim.hidden { display: none !important; }
.forge-box { position: relative; margin: 0 0 12px; padding: 12px 10px 10px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(circle at 50% 25%, rgba(234,88,12,0.2), rgba(15,23,42,0.92) 70%); border: 1px solid rgba(251,146,60,0.55); }
.forge-sub { margin: 0 0 8px; font-size: 12px; color: #fed7aa; text-align: center; line-height: 1.35; }
.forge-row { display: flex; flex-direction: column; gap: 8px; }
.forge-lbl { display: block; font-size: 11px; font-weight: 800; color: #fdba74; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.forge-items, .forge-charges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.forge-charges { grid-template-columns: repeat(3, 1fr); }
.forge-item, .forge-charge { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 3px; border-radius: 10px;
  background: rgba(15,23,42,0.8); border: 1px solid rgba(148,163,184,0.35); color: #e2e8f0; font-size: 11px; font-weight: 700; }
.forge-item img { border-radius: 8px; }
.forge-item.sel, .forge-charge.sel { border-color: #fb923c; box-shadow: 0 0 12px rgba(251,146,60,0.6); }
.forge-item.soon { opacity: 0.42; filter: grayscale(1); }
.forge-item em { position: absolute; top: 2px; right: 3px; font-size: 9px; font-style: normal; background: #475569; border-radius: 6px; padding: 0 4px; color: #fff; }
.forge-charge .fc-name { font-size: 13px; font-weight: 900; }
.forge-charge .fc-have { font-size: 10px; color: #cbd5e1; }
.forge-charge.el-earth .fc-name { color: #d6a35c; } .forge-charge.el-fire .fc-name { color: #fb923c; } .forge-charge.el-ice .fc-name { color: #7dd3fc; }
.forge-charge.done { opacity: 0.6; }
.forge-preview { margin: 8px 0 4px; min-height: 40px; font-size: 12px; color: #e2e8f0; }
.forge-preview .fp-row { display: flex; gap: 8px; align-items: flex-start; }
.forge-preview img { border-radius: 10px; flex: none; box-shadow: 0 0 14px rgba(251,146,60,0.5); }
.forge-preview p { margin: 2px 0; } .fp-cost { color: #fdba74; font-weight: 700; } .fp-hint { text-align: center; color: #94a3b8; }
.forge-go { background: linear-gradient(135deg, #ea580c, #b91c1c); box-shadow: 0 0 18px rgba(234,88,12,0.55); }
.forge-go:disabled { animation: none; opacity: 0.45; filter: grayscale(0.6); }
.forge-anim { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(2,6,23,0.88); pointer-events: none; }
.forge-anim .fg-anvil { position: absolute; font-size: 64px; animation: fgHammer 0.35s ease-in 3; transform-origin: 70% 70%; }
.forge-anim .fg-flash { position: absolute; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle, #fff, #fb923c 40%, transparent 70%); opacity: 0; animation: fgFlash 1.4s ease-out forwards; }
.forge-anim .fg-sparks { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fde047;
  box-shadow: 30px -20px 0 #fb923c, -34px -14px 0 #fde047, 22px 26px 0 #f97316, -26px 24px 0 #fde047, 0 -38px 0 #fff; opacity: 0; animation: fgSpark 1.4s ease-out forwards; }
.forge-anim .fg-result { position: absolute; width: 84px; height: 84px; border-radius: 16px; opacity: 0; animation: fgResult 1.4s ease-out forwards; }
.forge-anim.el-earth .fg-result { box-shadow: 0 0 26px #d6a35c; } .forge-anim.el-fire .fg-result { box-shadow: 0 0 26px #f97316; } .forge-anim.el-ice .fg-result { box-shadow: 0 0 26px #7dd3fc; }
.forge-anim .fa-label { position: absolute; bottom: 14px; opacity: 0; animation: fgResult 1.4s ease-out forwards; }
@keyframes fgHammer { 0% { transform: rotate(-30deg); } 70% { transform: rotate(18deg); } 100% { transform: rotate(-30deg); } }
@keyframes fgFlash { 0%, 55% { opacity: 0; transform: scale(0.4); } 65% { opacity: 1; transform: scale(4); } 100% { opacity: 0; transform: scale(7); } }
@keyframes fgSpark { 0%, 55% { opacity: 0; transform: scale(0.5); } 70% { opacity: 1; transform: scale(2.4); } 100% { opacity: 0; transform: scale(3.4); } }
@keyframes fgResult { 0%, 60% { opacity: 0; transform: scale(0.3); } 80% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }

/* ===== v31 HUD-Fortschritt ===== */
.wave-progress { width: 118px; margin-top: 3px; pointer-events: none; --wp: #fde68a; --wpg: rgba(253,230,138,0); }
.wp-track { position: relative; height: 7px; border-radius: 999px; background: rgba(15,23,42,0.75); border: 1px solid rgba(255,255,255,0.22); overflow: visible; }
.wp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, rgba(255,255,255,0.15), var(--wp)); box-shadow: 0 0 8px var(--wpg); transition: width 0.4s ease, background 0.6s, box-shadow 0.6s; }
.wp-notches { position: absolute; inset: 0; }
.wp-notch { position: absolute; top: -3px; width: 3px; height: 11px; margin-left: -1.5px; border-radius: 2px; background: #94a3b8; box-shadow: 0 0 0 1px rgba(0,0,0,0.5); }
.wp-notch.wp-end { width: 7px; height: 13px; top: -4px; margin-left: -6px; background: #dc2626; border-radius: 3px; }
.wp-notch.next { background: #fca5a5; animation: wpNext 0.9s ease-in-out infinite; }
.wp-notch.done { background: var(--wp); box-shadow: 0 0 6px var(--wp); }
@keyframes wpNext { 50% { transform: scaleY(1.35); } }
.wave-progress[data-heat="1"] { --wp: #fbbf24; --wpg: rgba(251,191,36,0.75); }
.wave-progress[data-heat="2"] { --wp: #f97316; --wpg: rgba(249,115,22,0.85); }
.wave-progress[data-heat="3"] { --wp: #ef4444; --wpg: rgba(239,68,68,0.95); }
.wave-progress[data-heat="4"] { --wp: #ec4899; --wpg: rgba(236,72,153,1); }
.wave-progress[data-heat="5"] { --wp: #f5f3ff; --wpg: rgba(196,181,253,1); }
.wave-progress[data-heat="3"] .wp-fill, .wave-progress[data-heat="4"] .wp-fill, .wave-progress[data-heat="5"] .wp-fill { animation: wpHeat 1.1s ease-in-out infinite; }
@keyframes wpHeat { 50% { box-shadow: 0 0 14px var(--wpg); } }
.wave-progress.wp-flash .wp-track { animation: wpFlash 1.1s ease-out; }
@keyframes wpFlash { 0% { box-shadow: 0 0 0 0 var(--wpg); transform: scale(1); } 25% { box-shadow: 0 0 18px 4px var(--wpg); transform: scale(1.12); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); transform: scale(1); } }

/* ===== PvP-Teaser (nicht spielbar) ===== */
.pvp-teaser { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px auto 0; padding: 8px 18px;
  font-size: 15px; color: #e9e4ff; background: radial-gradient(circle at 50% 40%, #2a1245 0%, #120a22 70%);
  border: 1px solid rgba(196,165,255,0.55); animation: pvpGlow 2.6s ease-in-out infinite; }
.pvp-teaser .pvp-swords { width: 22px; height: 22px; filter: drop-shadow(0 0 4px rgba(245,210,122,0.7)); }
.pvp-teaser .pvp-q { letter-spacing: 3px; font-weight: 800; color: #f5d27a; text-shadow: 0 0 8px rgba(196,165,255,0.9); }
.pvp-teaser .pvp-lock { font-size: 12px; font-weight: 600; opacity: 0.75; }
@keyframes pvpGlow { 0%,100% { box-shadow: 0 0 6px rgba(139,92,246,0.45), inset 0 0 6px rgba(245,210,122,0.12); }
  50% { box-shadow: 0 0 18px rgba(168,85,247,0.85), 0 0 4px rgba(245,210,122,0.8), inset 0 0 12px rgba(245,210,122,0.3); } }
@media (prefers-reduced-motion: reduce) { .pvp-teaser { animation: none; box-shadow: 0 0 10px rgba(168,85,247,0.6); } }
#pvp-teaser-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8,3,18,0.86); padding: 20px; z-index: 19; animation: pvpFade .35s ease-out; }
#pvp-teaser-overlay.hidden { display: none; }
@keyframes pvpFade { from { opacity: 0; } to { opacity: 1; } }
.pvp-teaser-panel { background: linear-gradient(180deg, #1b0f2e, #0f0a1c); border-color: rgba(196,165,255,0.5);
  box-shadow: 0 0 30px rgba(139,92,246,0.45), 0 12px 40px rgba(0,0,0,0.6); }
.pvp-scene { width: 100%; height: auto; border-radius: 10px; display: block; margin-bottom: 12px; border: 1px solid rgba(245,210,122,0.25); }
.pvp-scene .pvp-vs { font-size: 26px; fill: #f5d27a; opacity: 0.85; animation: pvpPulse 1.8s ease-in-out infinite; }
@keyframes pvpPulse { 0%,100% { opacity: 0.35; } 50% { opacity: 0.95; } }
.pvp-title { font-size: 21px !important; color: #f5d27a; text-shadow: 0 0 12px rgba(168,85,247,0.8); }
.pvp-sub { font-weight: 700; color: #e9e4ff; letter-spacing: 1px; }
.pvp-whisper { font-size: 13px !important; font-style: italic; opacity: 0.6 !important; }

/* v33: Dragon-Mode Erst-Hinweis */
.dragon-hint { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(2,8,23,0.72); padding: 16px; }
.dragon-hint.hidden { display: none; }
.dh-card { max-width: 330px; width: 100%; background: linear-gradient(180deg, #0c1e3a, #08142a); border: 2px solid #7dd3fc; border-radius: 16px; padding: 14px 16px 16px; color: #e0f2fe; text-align: center; box-shadow: 0 0 28px rgba(125,211,252,0.45); }
.dh-img { width: 84px; height: auto; display: block; margin: -4px auto 2px; filter: drop-shadow(0 0 10px rgba(125,211,252,0.7)); }
.dh-card h3 { margin: 2px 0 10px; font-size: 1.25rem; letter-spacing: 0.04em; color: #bae6fd; }
.dh-zones { display: flex; flex-direction: column; gap: 6px; border: 1px dashed rgba(186,230,253,0.5); border-radius: 10px; overflow: hidden; }
.dh-zone { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; font-size: 0.86rem; }
.dh-zone b { font-size: 0.95rem; }
.dh-top { background: rgba(56,189,248,0.16); }
.dh-bottom { background: rgba(250,204,21,0.12); border-top: 2px solid rgba(250,204,21,0.55); }
.dh-two { font-size: 0.84rem; margin: 10px 0 4px; line-height: 1.35; }
.dh-tip { font-size: 0.82rem; margin: 4px 0 10px; color: #fde68a; }
.dh-ok { background: #38bdf8; color: #082f49; border: 0; border-radius: 10px; padding: 9px 22px; font-weight: 800; font-size: 1rem; cursor: pointer; }

/* ===== v34: FS-Shop Sektionen + LuckyCard-Würfel + Shop-Auswahl ===== */
.fs-sec { margin: 0 0 16px; padding: 10px 10px 4px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); }
.fs-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 0; }
.fs-sec-sub { margin: -4px 0 10px; font-size: 12px; opacity: .7; }
#fs-sec-ingame { border-color: rgba(120,200,255,.25); }
#fs-sec-overall { border-color: rgba(255,200,90,.25); }
.ss-card.hidden, .fs-all-done.hidden { display: none; }
.fs-all-done { padding: 6px 2px 10px; color: #9fe39f; }
.rs-sub-note { margin: -4px 0 8px; font-size: 12px; opacity: .72; }
.lucky-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(5,8,20,.72); backdrop-filter: blur(3px); }
.lucky-overlay.hidden { display: none; }
.lucky-box { position: relative; width: min(320px, 86vw); padding: 18px 16px 14px; border-radius: 20px; text-align: center; background: linear-gradient(180deg,#1d2448,#0f1430); border: 2px solid rgba(255,210,90,.55); box-shadow: 0 0 40px rgba(255,200,80,.25); overflow: visible; }
.lucky-title { margin: 0 0 6px; font-size: 22px; color: #ffd36b; letter-spacing: .5px; }
.lucky-stage { position: relative; height: 170px; perspective: 640px; display: flex; align-items: center; justify-content: center; }
.lucky-rolling .lucky-stage { animation: lucky-hop 1.5s cubic-bezier(.3,.6,.3,1); }
@keyframes lucky-hop { 0%{transform:translateY(-60px)} 22%{transform:translateY(0)} 38%{transform:translateY(-34px)} 56%{transform:translateY(0)} 70%{transform:translateY(-14px)} 84%,100%{transform:translateY(0)} }
.lucky-die { position: relative; width: 104px; height: 104px; transform-style: preserve-3d; transform: rotateX(-20deg) rotateY(30deg); }
.ld-face { position: absolute; inset: 0; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: radial-gradient(circle at 35% 30%, #fffdf4, #e6dcc2 70%, #cbbf9f); border: 2px solid #b9a77a; box-shadow: inset 0 0 14px rgba(0,0,0,.25); color: #6b5a3a; backface-visibility: hidden; }
.ld-face span { font-size: 40px; line-height: 1; color: #b0473b; }
.ld-face small { font-size: 11px; font-weight: 700; }
.ld-win { background: radial-gradient(circle at 35% 30%, #fff7d6, #ffd36b 70%, #e0a92f); border-color: #fff1b0; }
.ld-win img { width: 58px; height: 58px; border-radius: 50%; box-shadow: 0 0 14px rgba(140,90,255,.8); }
.ld-win b { font-size: 16px; color: #5a2d91; }
.ld-f1 { transform: translateZ(52px); }
.ld-f2 { transform: rotateY(180deg) translateZ(52px); }
.ld-f3 { transform: rotateY(90deg) translateZ(52px); }
.ld-f4 { transform: rotateY(-90deg) translateZ(52px); }
.ld-f5 { transform: rotateX(90deg) translateZ(52px); }
.ld-f6 { transform: rotateX(-90deg) translateZ(52px); }
.lucky-shadow { position: absolute; bottom: 10px; left: 50%; width: 110px; height: 16px; margin-left: -55px; border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(4px); }
.lucky-result { min-height: 24px; margin: 6px 0 2px; font-size: 16px; }
.lucky-won .lucky-result { color: #ffd36b; text-shadow: 0 0 12px rgba(255,200,80,.8); }
.lucky-lost .lucky-result { color: #c9cbe0; }
.lucky-won .lucky-box { animation: lucky-glow 1.2s ease-out; border-color: #ffe08a; }
@keyframes lucky-glow { 0%{box-shadow:0 0 0 rgba(255,210,90,0)} 30%{box-shadow:0 0 70px 12px rgba(255,210,90,.75)} 100%{box-shadow:0 0 40px rgba(255,200,80,.3)} }
.lucky-tap { margin: 6px 0 0; font-size: 11px; opacity: .55; }
.lucky-burst { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; }
.lb-p { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: #ffd36b; box-shadow: 0 0 10px #ffd36b; animation: lb-fly 1s ease-out forwards; }
.lb-p.lb-c { background: #b58cff; box-shadow: 0 0 10px #b58cff; }
@keyframes lb-fly { 0%{transform:translate(0,0) scale(.4);opacity:1} 100%{transform:translate(var(--dx),var(--dy)) scale(1);opacity:0} }
.lb-plus { position: absolute; left: -60px; top: -110px; width: 120px; display: flex; align-items: center; justify-content: center; gap: 6px; font: 800 26px/1 system-ui, sans-serif; color: #ffe08a; text-shadow: 0 0 10px rgba(255,200,80,.9); animation: lb-rise 1.6s ease-out forwards; }
.lb-plus img { border-radius: 50%; }
@keyframes lb-rise { 0%{transform:translateY(20px) scale(.6);opacity:0} 25%{transform:translateY(0) scale(1.15);opacity:1} 100%{transform:translateY(-26px) scale(1);opacity:0} }
.lucky-title { transition: opacity .2s; }
.lucky-won .lucky-title { opacity: 0; }

/* v35/v36: Helden-HP im HUD, Menü-Zahnrad, Einstellungen */
.hud-hp { display: flex; align-items: center; gap: 4px; }
.hhp-bar { display: inline-block; width: 46px; height: 7px; border-radius: 4px; background: rgba(0,0,0,0.55); overflow: hidden; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); }
.hhp-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #22c55e, #86efac); transition: width 0.15s; }
.hhp-bar i.low { background: linear-gradient(90deg, #dc2626, #f87171); }
#hero-hp-txt { font-size: 11px; min-width: 34px; }
.opt-row.hidden { display: none; }
.start-panel { position: relative; }
.start-panel .menu-gear { position: absolute; top: 10px; right: 10px; z-index: 2; margin: 0; width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; }
#settings-overlay { z-index: 80; }
#settings-quit.hidden { display: none; }

/* v37 Forge-Tab (Schmiede) */
.anvil-ico { display:inline-block; width:16px; height:12px; margin-right:4px; vertical-align:-1px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cpath fill='%23cbd5e1' stroke='%23334155' stroke-width='1' d='M2 3h20c4 0 7 1 9 4c-3 1-6 2-9 2v3c0 2-2 3-4 4v2h4v4H6v-4h4v-2c-2-1-4-2-4-4V9H5C3 9 2 7 2 3z'/%3E%3C/svg%3E"); }
.meta-tab.active .anvil-ico { filter: brightness(0.35); }
.anvil-ico.anvil-lg { width:30px; height:22px; margin-right:8px; vertical-align:-3px; filter:none; }
.forge-h2 { display:flex; align-items:center; }
.v37-forge .fusion-box, .v37-forge .forge-box { margin-top: 10px; }

/* ===== v38: Sprache, Victory-Cutscene, Tutorial ===== */
.lang-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lang-btns { display: flex; gap: 6px; }
.lang-btns button { padding: 6px 12px; font-size: 0.85rem; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); }
.lang-btns button.active { background: #f59e0b; color: #1c1917; border-color: #fbbf24; }
#settings-tutorial { margin-top: 4px; }
#victory-overlay { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(30,27,75,0.96), rgba(2,6,23,0.99)); opacity: 0; transition: opacity 0.35s ease; touch-action: none; }
#victory-overlay.show { opacity: 1; }
#victory-overlay.hide { opacity: 0; pointer-events: none; }
#victory-overlay .vic-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#victory-overlay .vic-box { position: relative; text-align: center; padding: 0 18px; }
#victory-overlay .vic-rays { position: absolute; left: 50%; top: 70px; width: 360px; height: 360px; margin: -180px 0 0 -180px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--vic) 40%, transparent) 0deg 10deg, transparent 10deg 24deg);
  border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); animation: vicSpin 9s linear infinite; opacity: 0.7; }
#victory-overlay .vic-medal { position: relative; width: 132px; height: 132px; margin: 0 auto 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--vic) 38%, color-mix(in srgb, var(--vic) 55%, #000) 100%);
  border: 6px solid color-mix(in srgb, var(--vic) 70%, #fff); box-shadow: 0 0 40px var(--vic), inset 0 -8px 18px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center; transform: scale(0) rotate(-200deg); }
#victory-overlay.show .vic-medal { animation: vicMedal 0.9s cubic-bezier(.2,1.6,.4,1) 0.15s forwards; }
#victory-overlay .vic-medal span { font-size: 64px; color: rgba(255,255,255,0.92); text-shadow: 0 2px 6px rgba(0,0,0,0.45); }
#victory-overlay .vic-title { font-size: clamp(1.5rem, 7vw, 2.6rem); font-weight: 900; letter-spacing: 0.06em; color: #fff;
  text-shadow: 0 0 18px var(--vic), 0 3px 0 rgba(0,0,0,0.5); opacity: 0; transform: translateY(16px); }
#victory-overlay .vic-sub { margin-top: 10px; font-size: clamp(0.95rem, 4.2vw, 1.3rem); font-weight: 800; letter-spacing: 0.08em; color: #fde68a; opacity: 0; transform: translateY(12px); }
#victory-overlay.show .vic-title { animation: vicIn 0.5s ease 0.75s forwards; }
#victory-overlay.show .vic-sub { animation: vicIn 0.5s ease 1.15s forwards; }
#victory-overlay .vic-tap { margin-top: 28px; font-size: 0.85rem; color: rgba(255,255,255,0.7); opacity: 0; transition: opacity 0.4s; }
#victory-overlay.tappable .vic-tap { opacity: 1; animation: vicPulse 1.2s ease-in-out infinite; }
@keyframes vicMedal { to { transform: scale(1) rotate(0deg); } }
@keyframes vicIn { to { opacity: 1; transform: none; } }
@keyframes vicSpin { to { transform: rotate(360deg); } }
@keyframes vicPulse { 50% { opacity: 0.45; } }
#tut-root { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }
#tut-root.hidden { display: none; }
#tut-root .tut-spot { position: fixed; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(2,6,23,0.62), 0 0 0 3px #fbbf24, 0 0 22px 6px rgba(251,191,36,0.55);
  transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease; animation: tutGlow 1.4s ease-in-out infinite; }
@keyframes tutGlow { 50% { box-shadow: 0 0 0 9999px rgba(2,6,23,0.62), 0 0 0 3px #fde68a, 0 0 32px 10px rgba(251,191,36,0.75); } }
#tut-root .tut-bubble { position: fixed; pointer-events: auto; background: #fffbeb; color: #1c1917; border-radius: 16px; padding: 12px 14px 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45); border: 3px solid #f59e0b; font-size: 0.95rem; line-height: 1.35; transition: left 0.2s ease, top 0.2s ease; }
#tut-root .tut-step { font-size: 0.72rem; font-weight: 800; color: #b45309; letter-spacing: 0.06em; margin-bottom: 4px; }
#tut-root .tut-text { font-weight: 600; }
#tut-root .tut-btns { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
#tut-root .tut-btns button { padding: 7px 14px; font-size: 0.85rem; min-height: 0; margin: 0; }
#tut-root .tut-skip { background: transparent; color: #78716c; border: 1px solid #d6d3d1; }
#tut-root .tut-next { background: #f59e0b; color: #1c1917; font-weight: 800; border: 0; }
#tut-root .tut-next.hidden { display: none; }
#tut-root.tut-free .tut-bubble { opacity: 0.94; }

/* ===== v39: Starter-Champion + Diagonal +1 Badge ===== */
#champ-pick-overlay { position: fixed; inset: 0; z-index: 14; display: flex; align-items: center; justify-content: center; background: rgba(2,6,23,0.88); padding: 12px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#champ-pick-overlay.hidden { display: none; }
.champ-pick-panel { width: min(440px, 100%); text-align: center; }
.champ-pick-panel h2 { margin: 4px 0 4px; color: #fde68a; }
.champ-pick-panel .cp-sub { margin: 0 0 10px; font-size: 0.85rem; opacity: 0.85; }
.cp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.cp-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px 10px; margin: 0; min-height: 0; border-radius: 14px; border: 2px solid rgba(148,163,184,0.35); background: linear-gradient(180deg, rgba(30,41,59,0.95), rgba(15,23,42,0.98)); color: #f8fafc; cursor: pointer; }
.cp-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #0f172a; }
.cp-card .cp-name { font-weight: 800; font-size: 0.8rem; color: #fde68a; line-height: 1.15; }
.cp-card .cp-desc { font-size: 0.66rem; line-height: 1.25; opacity: 0.85; font-weight: 500; }
.cp-card .cp-free { position: absolute; top: 4px; right: 4px; background: #16a34a; color: #fff; font: 800 10px/14px system-ui, sans-serif; padding: 1px 6px; border-radius: 999px; }
.cp-card.selected { border-color: #fbbf24; box-shadow: 0 0 16px rgba(251,191,36,0.6); transform: translateY(-2px); }
#champ-pick-go { width: 100%; }
#champ-pick-go:disabled { opacity: 0.45; }
.vault-pick-card .vpc-icon { position: relative; display: block; width: 64px; height: 64px; }
.vault-pick-card .vpc-badge { position: absolute; right: -6px; bottom: -6px; background: #f59e0b; color: #1c1917; font: 900 15px/1 system-ui, sans-serif; padding: 4px 6px; border-radius: 999px; border: 2px solid #1c1917; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }

/* ===== v40: weich gesperrte Kauf-Buttons + need-Anzeige ===== */
.shop-item.v40-dis { opacity: 0.45; cursor: default; }
.hero-buy.v40-dis { cursor: not-allowed; border-color: #334155; background: #1e293b; color: #94a3b8; }
.fs-buy.v40-dis { border-color: #334155; background: #1e293b; color: #94a3b8; cursor: not-allowed; }
.fusion-pick.v40-dis { opacity: 0.4; }
.ess-convert button.v40-dis { opacity: .45; cursor: default; }
.sci-lv-btns button.v40-dis { opacity: .45; cursor: not-allowed; }
.forge-go.v40-dis { animation: none; opacity: 0.45; filter: grayscale(0.6); }
.v40-need-pop { position: fixed; z-index: 2147483000; pointer-events: none; padding: 6px 12px; border-radius: 999px;
  background: #7f1d1d; border: 2px solid #f87171; color: #fff; font: 800 14px/1.2 system-ui, sans-serif; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); animation: v40Pop 2s ease-out forwards; }
@keyframes v40Pop { 0% { transform: translateY(6px) scale(.85); opacity: 0; } 10% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }
.v40-shake { animation: v40Shake .45s ease-in-out; outline: 2px solid #f87171; outline-offset: 2px; }
@keyframes v40Shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
#toast.v40-need-toast { border-color: #f87171; color: #fecaca; background: rgba(127,29,29,0.95); z-index: 2147482000; position: fixed; }

/* ===== v41: Skill-Modi als getrennte Karten (grau = nicht gekauft, farbig = gekauft, Glow = angetippt) ===== */
.sci-cost-col.v41-off { display: none; }
.sci-tree.v41-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; flex: 1; }
.v41-paths-note { grid-column: 1 / -1; margin: 0; font-size: 12px; color: #cbd5e1; line-height: 1.35; }
.v41-pcard { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 8px; border-radius: 16px; border: 1px solid #3b4a75; background: linear-gradient(180deg, #1b2747, #121a31); }
.v41-pcard.gray { background: linear-gradient(180deg, #1f2430, #15181f); border-color: #3a3f4b; }
.v41-pc-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; }
.v41-mode { color: #93c5fd; text-transform: uppercase; letter-spacing: .04em; }
.v41-pcard.gray .v41-mode { color: #9ca3af; }
.v41-own { color: #86efac; }
.v41-lock { color: #9ca3af; }
.v41-pc-lv { font-size: 12px; text-align: center; color: #e2e8f0; }
.v41-pc-lv .ok { color: #86efac; }
.v41-kids { display: flex; flex-direction: column; gap: 6px; }
.sci-node.v41-node { width: 100%; transition: box-shadow .2s, filter .2s, transform .1s; }
.sci-node.v41-main img { width: 64px; height: 64px; }
.sci-node.v41-kid { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 6px; }
.sci-node.v41-kid img { width: 40px; height: 40px; }
.sci-node.v41-gray { filter: grayscale(1) brightness(.82); }
.sci-node.v41-gray img { filter: grayscale(1); }
.sci-node.v41-color { filter: none; }
.sci-node.v41-sel { outline: none; border-color: #fde047 !important; box-shadow: 0 0 0 2px #fde047, 0 0 16px 4px rgba(253,224,71,.65), 0 0 30px rgba(250,204,21,.35); }
.sci-node.v41-gray.v41-sel { filter: grayscale(1) brightness(.95); }
.sci-level.v41-lvgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.v41-lvcol { padding: 8px; border-radius: 12px; background: #0f172a; border: 1px solid #334155; min-width: 0; }
.v41-lvcol.gray { filter: grayscale(1); opacity: .8; }
.v41-lv-name { font-weight: 900; font-size: 13px; color: #f8fafc; margin-bottom: 6px; }
.v41-lvcol .sci-lv-head { gap: 6px; }
.v41-lvcol .sci-lv-badge { font-size: 16px; padding: 2px 8px; }
.v41-lvcol .sci-lv-btns { grid-template-columns: 1fr; gap: 6px; }
.v41-lvcol .sci-lv-bonus, .v41-spec-prev { margin-top: 8px; padding: 6px; gap: 6px; font-size: 11px; }
.v41-spec-prev { display: flex; align-items: flex-start; border-radius: 10px; border: 1px dashed #4b5563; line-height: 1.3; }
.v41-spec-prev img, .v41-lvcol .sci-lv-bonus img { width: 40px; height: 40px; border-radius: 8px; flex: none; }
.v41-next5 { color: #fde68a; }
.v41-info-spec { margin: 0 0 8px; padding: 8px; border-radius: 10px; background: #0f172a; border: 1px solid #334155; font-size: 12px; line-height: 1.35; }
.v41-is-row { margin: 2px 0; }
.v41-is-row.small { font-size: 11px; color: #94a3b8; }
.v41-is-5 { display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 8px; border: 1px dashed #f59e0b; margin: 6px 0; }
.v41-is-5.on { border-style: solid; box-shadow: 0 0 10px rgba(245,158,11,.3); }
.v41-is-5 img { border-radius: 8px; flex: none; }
.v41-is-5 em { font-style: normal; color: #86efac; }

/* ===== v41: Forge Convert ===== */
.convert-box.hidden { display: none; }
.convert-box { padding: 10px; border-radius: 14px; border: 1px solid #3b4a75; background: linear-gradient(180deg, #1a2140, #111830); }
.mconv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 8px; }
.mconv-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; font-size: 12px; }
.mconv-btn small { opacity: .8; font-weight: 600; }
.mconv-cost { font-size: 11px; color: #c4b5fd; font-weight: 800; }
.mconv-orb { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 10px currentColor; background: radial-gradient(circle at 35% 30%, #fff 0 12%, currentColor 45%, #111 100%); }
.mconv-btn.el-robo { color: #e2e8f0; } .mconv-btn.el-robo .mconv-orb { color: #38bdf8; }
.mconv-btn.el-ice .mconv-orb { color: #7dd3fc; }
.mconv-btn.el-earth .mconv-orb { color: #84cc16; }
.mconv-btn.el-fire .mconv-orb { color: #f97316; }
.mconv-btn.el-stone .mconv-orb { color: #a8a29e; }
.mconv-btn b, .mconv-btn small, .mconv-btn .mconv-cost { color: #f8fafc; }

/* ===== v41: Run-Ende Bilanz + Gold -> Rocks ===== */
.v41-re.hidden { display: none; }
.v41-re { position: relative; margin: 10px 0 12px; padding: 10px; border-radius: 14px; background: rgba(15,23,42,.75); border: 1px solid #334155; text-align: center; }
.v41-re-h { font-size: 12px; font-weight: 800; color: #93c5fd; text-transform: uppercase; letter-spacing: .05em; margin: 2px 0 6px; }
.v41-re-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.v41-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: #1e293b; border: 1px solid #475569; font-size: 12px; font-weight: 800; color: #f8fafc; }
.v41-chip i { width: 12px; height: 12px; border-radius: 50%; background: #a78bfa; box-shadow: 0 0 6px currentColor; }
.v41-chip.ch-earth i { background: #84cc16; } .v41-chip.ch-fire i { background: #f97316; } .v41-chip.ch-ice i { background: #7dd3fc; }
.v41-chip.ch-robo i { background: #38bdf8; } .v41-chip.ch-stone i { background: #a8a29e; }
.v41-chip.ch-rock i, .v41-chip.ch-crock i { border-radius: 3px; transform: rotate(45deg); background: linear-gradient(135deg, #e7e5e4, #78716c); }
.v41-chip.none { opacity: .7; font-weight: 600; }
.v41-re-conv { display: flex; align-items: center; justify-content: center; gap: 10px; }
.v41-re-box { display: flex; flex-direction: column; align-items: center; min-width: 92px; padding: 8px 10px; border-radius: 12px; background: #0b1220; border: 1px solid #475569; }
.v41-re-box b { font-size: 24px; font-variant-numeric: tabular-nums; color: #fde68a; }
.v41-re-box.rocks b { color: #e7e5e4; }
.v41-re-box small { font-size: 11px; color: #cbd5e1; }
.v41-re-arrow { font-size: 22px; color: #fbbf24; animation: v41Arrow 0.8s ease-in-out infinite alternate; }
@keyframes v41Arrow { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
.v41-coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff7cc, #facc15 45%, #a16207); box-shadow: 0 0 8px rgba(250,204,21,.7); }
.v41-rock, .v41-fly { width: 22px; height: 20px; background: linear-gradient(135deg, #f5f5f4, #a8a29e 45%, #57534e); clip-path: polygon(20% 8%, 70% 0, 100% 38%, 86% 88%, 34% 100%, 0 62%); }
.v41-fly { position: absolute; width: 18px; height: 16px; pointer-events: none; z-index: 3; animation: v41Fly .7s cubic-bezier(.4,-0.3,.6,1) forwards; }
@keyframes v41Fly { 0% { transform: translate(0,0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: .2; } }
.v41-re-box.v41-pop { animation: v41Pop .45s ease-out; }
@keyframes v41Pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); box-shadow: 0 0 18px rgba(231,229,228,.6); } 100% { transform: scale(1); } }
.v41-re-rule { margin: 8px 0 0; font-size: 11px; color: #94a3b8; }

/* ===== v42: Weapons-Region, Eis-Texte ===== */
.sci-el.sci-el-weapons { grid-column: 1 / -1; background: linear-gradient(135deg, #1e293b, #3f2a0e); border-color: #f59e0b; }
.sci-el.sci-el-weapons .sci-el-name { color: #fde68a; letter-spacing: .04em; }
.sci-tree.v42-weapons { display: flex; flex-direction: column; gap: 12px; padding: 8px 4px; }
.v42-note, .v42-note2 { margin: 0; font-size: 11.5px; color: #cbd5e1; line-height: 1.35; }
.v42-note2 { color: #94a3b8; font-style: italic; }
.v42-wcard { border: 1px solid #475569; border-radius: 16px; background: linear-gradient(180deg, #111827, #0b1220); padding: 10px; }
.v42-wcard.fused { border-color: #f59e0b; box-shadow: 0 0 18px rgba(245,158,11,.25); }
.v42-wc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.v42-prev { width: 64px; height: 64px; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #1e3a5f, #0b1220); border: 1px solid #334155; flex: none; }
.v42-wc-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v42-wc-txt b { font-size: 15px; color: #f8fafc; }
.v42-wc-txt small { font-size: 11px; color: #94a3b8; }
.v42-wc-txt small span { color: #fde68a; font-weight: 800; }
.v42-row { display: grid; grid-template-columns: 1fr 52px 1fr; align-items: center; gap: 6px; }
.v42-fusrow { display: flex; justify-content: center; margin-top: 8px; }
.v42-fusrow .v42-tile { width: 60%; }
.v42-tile { display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 0; padding: 8px 4px; border-radius: 14px; border: 2px solid #334155;
  background: #0f172a; color: #e2e8f0; cursor: pointer; transition: box-shadow .15s, filter .15s, transform .1s; min-width: 0; }
.v42-tile:active { transform: scale(.97); }
.v42-tile .v42-ico { width: 56px; height: 56px; border-radius: 10px; }
.v42-tn { font-size: 12px; font-weight: 800; text-align: center; line-height: 1.15; }
.v42-tp { font-size: 11px; color: #fbbf24; font-weight: 700; }
.v42-tile.v42-gray { filter: grayscale(1) brightness(.85); opacity: .85; }
.v42-tile.v42-color { border-color: #22c55e; background: linear-gradient(180deg, #052e16, #0f172a); }
.v42-tile.v42-color .v42-tp { color: #86efac; }
.v42-tile.v42-fus.v42-color { border-color: #f59e0b; background: linear-gradient(180deg, #451a03, #0f172a); }
.v42-tile.too-poor .v42-tp { color: #f87171; }
.v42-tile.v42-sel, .v42-plus.v42-sel { outline: none; border-color: #fde047 !important; box-shadow: 0 0 0 2px #fde047, 0 0 16px 4px rgba(253,224,71,.65), 0 0 30px rgba(250,204,21,.35); }
.v42-tile.v42-gray.v42-sel { filter: grayscale(1) brightness(.95); opacity: 1; }
.v42-plus { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; border: 2px solid #fbbf24; background: radial-gradient(circle, #f59e0b, #92400e);
  color: #fff; font-size: 30px; font-weight: 900; line-height: 1; padding: 0; cursor: pointer; animation: v42Pulse 1.4s ease-in-out infinite; }
@keyframes v42Pulse { 0%,100% { box-shadow: 0 0 6px 1px rgba(251,191,36,.5); } 50% { box-shadow: 0 0 18px 6px rgba(251,191,36,.85); } }
.v42-eq, .v42-dot { text-align: center; font-size: 24px; color: #64748b; font-weight: 900; }
.v42-eq { color: #f59e0b; }
.v42-soon-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.v42-soon { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 2px dashed #475569; border-radius: 12px; color: #64748b; background: rgba(15,23,42,.6); }
.v42-soon b { font-size: 12px; } .v42-soon small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.v42-lock { font-size: 16px; filter: grayscale(1); }
.sci-level.v42-infobox { padding: 10px; }
.v42-hint { margin: 0; font-size: 12px; color: #94a3b8; text-align: center; }
.v42-info { display: flex; gap: 10px; align-items: flex-start; }
.v42-info .v42-ico { width: 72px; height: 72px; border-radius: 12px; flex: none; background: radial-gradient(circle at 50% 40%, #1e3a5f, #0b1220); }
.v42-info-txt { min-width: 0; flex: 1; }
.v42-info-txt h4 { margin: 0 0 4px; font-size: 15px; color: #f8fafc; }
.v42-info-txt p { margin: 0 0 6px; font-size: 12px; color: #cbd5e1; line-height: 1.35; }
.v42-status { font-weight: 800; color: #fde68a !important; }
.v42-fustag { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: #f59e0b; color: #1c1917; vertical-align: middle; }
.v42-buy { width: 100%; }
.sci-tree.v42-weapons, .sci-tree.v41-paths { grid-column: 1 / -1; min-width: 0; }

/* v43: ALL-Badge */
#test-badge.all { background: #7c3aed; }

/* v44 accounts */
#acct-overlay, #pn-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 50% 30%, #1e2a4d 0%, #0a0f1f 70%); color: #eef3ff; font-family: inherit; }
#pn-overlay { background: rgba(5, 8, 18, 0.86); z-index: 110; }
.acct-panel form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.acct-panel input { width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px; border: 1px solid #2b3960; background: #0d1326; color: #eef3ff; font-size: 16px; }
.acct-panel input:focus { outline: 2px solid #34d399; }
.acct-panel button { width: 100%; }
.acct-tabs { display: flex; gap: 6px; background: #0d1326; border-radius: 999px; padding: 4px; }
.acct-tabs .acct-tab { margin: 0; padding: 8px 10px; font-size: 14px; background: transparent; color: #9fb0d8; }
.acct-tabs .acct-tab.on { background: linear-gradient(180deg, #7dffb3, #34d399); color: #081018; }
.acct-msg { min-height: 1.2em; color: #fca5a5; font-size: 14px !important; margin: 0 !important; }
.acct-note { font-size: 13px !important; color: #a7f3d0; margin: 0 !important; }
.acct-sub { font-size: 13px !important; opacity: .75; }
.acct-srv { margin-top: 12px; margin-bottom: 0 !important; }
.acct-spinner { width: 44px; height: 44px; margin: 4px auto 14px; border-radius: 50%; border: 4px solid #2b3960; border-top-color: #34d399; animation: acctspin 0.9s linear infinite; }
@keyframes acctspin { to { transform: rotate(360deg); } }
.pn-panel { width: min(380px, 100%); max-height: min(86vh, 640px); display: flex; flex-direction: column; }
.pn-list { overflow-y: auto; text-align: left; touch-action: pan-y; }
.pn-build h3 { font-size: 16px; color: #7dffb3; margin: 10px 0 6px; }
.pn-build h3 span { color: #9fb0d8; font-weight: 400; font-size: 13px; }
.pn-build ul { margin: 0 0 6px 18px; padding: 0; }
.pn-build li { font-size: 14px; line-height: 1.4; margin-bottom: 5px; }
.pn-older.hidden { display: none; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 12px; background: #0d1326; border-radius: 12px; font-size: 14px; }
.settings-panel .acct-row button { width: auto; margin: 0; padding: 8px 14px; font-size: 14px; }
.acct-panel .acct-lang { width: auto; margin: 10px auto 0; padding: 6px 16px; font-size: 13px; }

/* v45 base defense */
#test-badge, #new-badge { z-index: 130; }
.bd-edge { position: fixed; top: 50%; transform: translateY(-50%); z-index: 70; width: 34px; height: 92px; margin: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid rgba(255,255,255,.28);
  background: linear-gradient(180deg, rgba(20,60,110,.92), rgba(8,30,60,.92)); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.45); cursor: pointer; }
.bd-edge.hidden { display: none; }
.bd-edge-left { left: 0; border-left: 0; border-radius: 0 16px 16px 0; animation: bdNudge 2.4s ease-in-out infinite; }
.bd-edge-right { right: 0; border-right: 0; border-radius: 16px 0 0 16px; }
.bd-chev { font: 900 30px/1 system-ui, sans-serif; color: #7ee0ff; text-shadow: 0 0 8px rgba(126,224,255,.8); }
.bd-edge-lbl { writing-mode: vertical-rl; transform: rotate(180deg); font: 800 9px/1 system-ui, sans-serif; letter-spacing: 1.5px; color: #cfe8ff; }
@keyframes bdNudge { 0%, 70%, 100% { transform: translate(0, -50%); } 80% { transform: translate(-5px, -50%); } 90% { transform: translate(2px, -50%); } }
#bd-root { position: fixed; inset: 0; z-index: 95; overflow: hidden; background: #08304f; color: #eef6ff; opacity: 1; transition: opacity .25s ease; touch-action: none; }
#bd-root.hidden { display: none; }
#bd-root.bd-out { opacity: 0; pointer-events: none; }
#bd-sea, #bd-intro-cv, #bd-intro-video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#bd-intro-video { object-fit: cover; background: #000; }
#bd-intro-video.hidden { display: none; }
#bd-intro { position: absolute; inset: 0; z-index: 5; background: #000; cursor: pointer; }
#bd-intro.hidden { display: none; }
.bd-skip { position: absolute; left: 0; right: 0; bottom: 64px; margin: 0; text-align: center; font: 600 13px system-ui, sans-serif; color: rgba(255,255,255,.75); animation: bdBlink 1.6s ease-in-out infinite; }
@keyframes bdBlink { 50% { opacity: .35; } }
.bd-menu { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 26px) 50px 74px; box-sizing: border-box; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
#bd-root.bd-menu-on .bd-menu { opacity: 1; }
.bd-menu > * { pointer-events: auto; }
.bd-head { text-align: center; }
.bd-title { margin: 0; font: 900 34px/1.05 system-ui, sans-serif; letter-spacing: 2px; color: #fff3c4; text-shadow: 0 3px 0 #7a3b0a, 0 0 18px rgba(255,170,80,.7); }
.bd-sub { margin: 6px 0 0; font: 600 14px system-ui, sans-serif; color: #e0f2ff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.bd-btns { display: flex; flex-direction: column; gap: 10px; width: min(220px, 64vw); margin-top: -4vh; }
.bd-btn { width: 100%; margin: 0 !important; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.bd-play { font-size: 20px !important; padding: 14px 18px !important; }
.bd-hint { margin: 0; font: 600 12px system-ui, sans-serif; color: rgba(255,255,255,.8); text-shadow: 0 1px 3px rgba(0,0,0,.7); pointer-events: none !important; }
#bd-modal { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(3,12,24,.62); }
#bd-modal.hidden { display: none; }
.bd-panel { width: min(340px, 100%); max-height: min(80vh, 520px); display: flex; flex-direction: column; text-align: center; }
.bd-panel h2 { margin: 0 0 6px; }
.bd-panel p { margin: 6px 0 12px; line-height: 1.4; }
.bd-soon-tag { display: inline-block; align-self: center; padding: 3px 12px; border-radius: 999px; background: #f59e0b; color: #1c1206; font-weight: 800; }
.bd-set-list { overflow-y: auto; touch-action: pan-y; text-align: left; margin-bottom: 10px; }
.bd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 10px 12px; background: #0d1326; border-radius: 12px; font-size: 15px; }
.bd-row input[type=checkbox] { width: 22px; height: 22px; }
.bd-lang { display: flex; gap: 6px; }
.bd-lang button { width: auto; margin: 0; padding: 6px 12px; font-size: 13px; background: #1c2645; color: #9fb0d8; }
.bd-lang button.on { background: linear-gradient(180deg, #7dffb3, #34d399); color: #081018; }

/* ===== v46: Gebäude-Abschnitt + Upgrade-Panel ===== */
.v46-hide { display: none !important; }
.v46-bsec { margin-top: 10px; border-top: 1px solid rgba(148,163,184,.25); padding-top: 8px; }
.v46-bh { font-size: 15px; margin: 2px 0 2px; color: #fde68a; }
.v46-bcap { font-size: 11px; opacity: .75; margin: 0 0 6px; }
.v46-bitem small { opacity: .7; font-weight: 400; }
.v46-bitem.locked { opacity: .5; }
#v46-panel { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(2,6,23,.45); }
#v46-panel.hidden { display: none; }
.v46p-box { width: min(420px, 96vw); max-height: 82vh; overflow-y: auto; background: linear-gradient(#1e293b, #0f172a); border: 1px solid #475569; border-radius: 16px 16px 0 0; padding: 12px 14px 16px; color: #e2e8f0; box-shadow: 0 -8px 30px rgba(0,0,0,.5); }
.v46p-head { display: flex; gap: 10px; align-items: center; }
.v46p-head > div { flex: 1; }
.v46p-ico { font-size: 28px; }
.v46p-title { font-size: 17px; margin: 0; }
.v46p-sub { margin: 2px 0 0; font-size: 12px; opacity: .75; }
.v46p-x { background: none; border: 0; color: #cbd5e1; font-size: 20px; padding: 4px 8px; }
.v46p-vis { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 0; }
.v46p-spr { height: 72px; width: auto; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); }
.v46p-mat { image-rendering: auto; }
.v46p-pips { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.v46p-pip { width: 10px; height: 10px; border-radius: 3px; background: #334155; display: inline-block; }
.v46p-pip.on { background: #facc15; }
.v46p-pip.ms { outline: 1px solid #f97316; }
.v46p-stats { width: 100%; font-size: 13px; border-collapse: collapse; }
.v46p-stats td { padding: 2px 4px; border-bottom: 1px solid rgba(148,163,184,.15); }
.v46p-stats td:nth-child(2) { text-align: right; }
.v46p-stats b { color: #86efac; }
.v46p-ms { list-style: none; padding: 0; margin: 8px 0; font-size: 12px; }
.v46p-ms li { padding: 2px 0; opacity: .55; }
.v46p-ms li.on { opacity: 1; color: #fde68a; }
.v46p-btns { display: flex; flex-direction: column; gap: 6px; }
.v46p-btns button { padding: 10px; border-radius: 10px; border: 0; font-size: 14px; color: #0f172a; background: #facc15; font-weight: 600; }
.v46p-btns button.short { background: #64748b; color: #e2e8f0; }
.v46p-need { display: block; font-size: 11px; color: #fca5a5; font-weight: 600; }
.v46p-btns .v46p-sell { background: #334155; color: #e2e8f0; }
.v46p-btns .v46p-rep { background: #38bdf8; }
.v46p-btns .v46p-close { background: transparent; color: #94a3b8; }

/* ===== v47: Overworld main menu + medieval UI (art/menu) ===== */
@font-face { font-family: "MedievalSharp"; src: url("assets/fonts/MedievalSharp.woff") format("woff"); font-display: swap; }
:root { --v47-font: "MedievalSharp", Georgia, "Times New Roman", serif; }
#start-overlay { background: #0b0d10; overflow: hidden; isolation: isolate; }
#start-overlay .ow-bg, #start-overlay .ow-water, #start-overlay .ow-clouds, #start-overlay .ow-dim { position: absolute; inset: -2%; pointer-events: none; }
#start-overlay .ow-bg { background: url("assets/menu/bg.webp") center 60% / cover no-repeat; image-rendering: pixelated; z-index: -4; animation: owPar 40s ease-in-out infinite alternate; }
#start-overlay .ow-water { z-index: -3; background: repeating-linear-gradient(115deg, rgba(255,255,255,0) 0 18px, rgba(190,230,255,0.55) 22px, rgba(255,255,255,0) 28px 60px);
  background-size: 240px 240px; -webkit-mask: url("assets/menu/water.png") center 60% / cover no-repeat; mask: url("assets/menu/water.png") center 60% / cover no-repeat;
  opacity: 0.16; mix-blend-mode: screen; animation: owShim 7s linear infinite, owPar 40s ease-in-out infinite alternate; }
#start-overlay .ow-clouds { z-index: -2; background: url("assets/menu/clouds.webp") 0 60% / cover repeat-x; image-rendering: pixelated; opacity: 0.35; animation: owCloud 140s linear infinite; inset: 0 -60% 0 0; }
#start-overlay .ow-dim { z-index: -1; background: radial-gradient(ellipse at 50% 48%, rgba(0,0,0,0.5), rgba(0,0,0,0.25) 70%); }
@keyframes owShim { from { background-position: 0 0; } to { background-position: 240px 120px; } }
@keyframes owCloud { from { transform: translateX(0); } to { transform: translateX(-37.5%); } }
@keyframes owPar { from { transform: translate3d(-0.6%, 0, 0) scale(1.02); } to { transform: translate3d(0.6%, -0.5%, 0) scale(1.02); } }
@media (prefers-reduced-motion: reduce) { #start-overlay .ow-bg, #start-overlay .ow-water, #start-overlay .ow-clouds { animation: none; } }

/* parchment main panel (panel_frame, inset 36) */
#start-overlay > .panel.start-panel { background: none; border-style: solid; border-width: 24px; border-radius: 0; box-shadow: 0 14px 40px rgba(0,0,0,0.55);
  border-image: url("assets/menu/panel_frame.png") 36 fill / 24px stretch; image-rendering: pixelated; color: #3A2410; padding: 14px 14px 18px; width: min(330px, 100%); }
.start-panel h1 { font-family: var(--v47-font); color: #3A2410; font-size: 36px; letter-spacing: 3px; margin: 2px 0 2px; text-shadow: 0 1px 0 rgba(255,240,200,0.6); }
.start-panel .start-sub { color: #5a3a18; opacity: 1; font-size: 13px; }
.start-panel .menu-steine, .start-panel .menu-speed { background: rgba(58,36,16,0.12); color: #3A2410; border-color: rgba(58,36,16,0.4); }
.start-panel .menu-gear { color: #3A2410; background: rgba(58,36,16,0.12); }
.start-panel .ow-main { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.start-panel .ow-main > button { width: 100%; margin-top: 8px; font-size: 21px; min-height: 52px; border-width: 16px; border-image-width: 16px; padding: 0 10px; }
.start-panel .ow-row { display: flex; gap: 8px; margin-top: 8px; }
.start-panel .ow-row > button { flex: 1; margin-top: 0; font-size: 14px; padding: 2px 6px; }

/* medieval 9-slice buttons for all menu buttons */
:is(#start-overlay, #meta-shop-overlay, #settings-overlay, #options-overlay, #diff-overlay, #shop-overlay, #overlay, #hero-info-overlay,
    #hero-select-overlay, #vault-pick-overlay, #pvp-teaser-overlay, #credits-overlay, #quit-overlay, #bd-root, .v46-modal, .bld-modal)
  button:not(.menu-gear):not(.settings-btn):not(.hero-info-x):not(.pvp-teaser):not(.meta-tab):not(.v47-plain):not([data-lang]) {
  border-style: solid; border-width: 10px; border-radius: 0; background: none; box-shadow: none;
  border-image: url("assets/menu/button_primary_normal.png") 24 fill / 10px stretch; image-rendering: pixelated;
  color: #FFF3C4; font-family: var(--v47-font); font-weight: 400; letter-spacing: 0.5px;
  text-shadow: -1px -1px 0 #3A2008, 1px -1px 0 #3A2008, -1px 1px 0 #3A2008, 1px 1px 0 #3A2008, 0 2px 0 #3A2008;
  padding: 4px 14px; transform: none;
}
:is(#start-overlay, #meta-shop-overlay, #settings-overlay, #options-overlay, #diff-overlay, #shop-overlay, #overlay, #hero-info-overlay,
    #hero-select-overlay, #vault-pick-overlay, #pvp-teaser-overlay, #credits-overlay, #quit-overlay, #bd-root, .v46-modal, .bld-modal)
  button:not(.menu-gear):not(.settings-btn):not(.hero-info-x):not(.pvp-teaser):not(.meta-tab):not(.v47-plain):not([data-lang]):active:not(:disabled) {
  border-image-source: url("assets/menu/button_primary_pressed.png"); transform: translateY(2px);
}
:is(#start-overlay, #meta-shop-overlay, #settings-overlay, #options-overlay, #diff-overlay, #shop-overlay, #overlay, #hero-info-overlay,
    #hero-select-overlay, #vault-pick-overlay, #pvp-teaser-overlay, #credits-overlay, #quit-overlay, #bd-root, .v46-modal, .bld-modal)
  button.secondary:not(.meta-tab):not(.v47-plain) {
  border-image-source: url("assets/menu/button_secondary_normal.png"); color: #F0F0F0;
  text-shadow: -1px -1px 0 #202428, 1px -1px 0 #202428, -1px 1px 0 #202428, 1px 1px 0 #202428, 0 2px 0 #202428;
}
:is(#start-overlay, #meta-shop-overlay, #settings-overlay, #options-overlay, #diff-overlay, #shop-overlay, #overlay, #hero-info-overlay,
    #hero-select-overlay, #vault-pick-overlay, #pvp-teaser-overlay, #credits-overlay, #quit-overlay, #bd-root, .v46-modal, .bld-modal)
  button.secondary:not(.meta-tab):not(.v47-plain):active:not(:disabled) { border-image-source: url("assets/menu/button_secondary_pressed.png"); }
button.v47-danger, #settings-quit { border-image-source: url("assets/menu/button_danger_normal.png") !important; color: #FFE0D0 !important;
  text-shadow: -1px -1px 0 #2A0000, 1px -1px 0 #2A0000, -1px 1px 0 #2A0000, 1px 1px 0 #2A0000, 0 2px 0 #2A0000 !important; }
button.v47-danger:active, #settings-quit:active { border-image-source: url("assets/menu/button_danger_pressed.png") !important; }
:is(#start-overlay, #meta-shop-overlay, #settings-overlay, #options-overlay, #diff-overlay, #shop-overlay, #overlay, #hero-info-overlay,
    #hero-select-overlay, #vault-pick-overlay, #credits-overlay, #quit-overlay, #bd-root, .v46-modal, .bld-modal) button:disabled:not(.meta-tab) {
  border-image-source: url("assets/menu/button_primary_disabled.png") !important; color: #9A9A9A !important; opacity: 1; filter: none; }
:is(#meta-shop-overlay, #settings-overlay, #shop-overlay, #bd-root) button.secondary:disabled { border-image-source: url("assets/menu/button_secondary_disabled.png") !important; }
/* tabs: small stone buttons, active = gold */
.meta-tab { border-style: solid; border-width: 8px; border-radius: 0; background: none !important; border-image: url("assets/menu/button_secondary_normal.png") 24 fill / 8px stretch;
  image-rendering: pixelated; color: #F0F0F0 !important; font-family: var(--v47-font); text-shadow: 0 1px 0 #202428, 1px 0 0 #202428, -1px 0 0 #202428, 0 -1px 0 #202428; padding: 4px 6px; }
.meta-tab.active { border-image-source: url("assets/menu/button_primary_normal.png"); color: #FFF3C4 !important; }
/* wooden frames for the other menu panels (panel_small, inset 24) */
:is(#meta-shop-overlay, #settings-overlay, #options-overlay, #diff-overlay, #shop-overlay, #overlay, #hero-info-overlay, #hero-select-overlay,
    #vault-pick-overlay, #credits-overlay, #quit-overlay) > .panel {
  border-style: solid; border-width: 12px; border-radius: 0; border-image: url("assets/menu/panel_small.png") 24 / 12px stretch; image-rendering: pixelated;
  background-color: #1a130d; background-clip: padding-box; }
:is(#meta-shop-overlay, #settings-overlay, #options-overlay, #diff-overlay, #shop-overlay, #overlay, #hero-info-overlay, #hero-select-overlay,
    #vault-pick-overlay, #credits-overlay, #quit-overlay) .panel :is(h1, h2) { font-family: var(--v47-font); font-weight: 400; color: #FFE7A8; letter-spacing: 1px; }
#bd-root :is(h1, h2, .bd-title) { font-family: var(--v47-font); font-weight: 400; }
/* quit + credits overlays */
#quit-overlay, #credits-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5,6,10,0.7); z-index: 60; padding: 20px; overflow-y: auto; }
#quit-overlay.hidden, #credits-overlay.hidden { display: none; }
#credits-overlay .panel { width: min(360px, 100%); text-align: left; }
#credits-overlay h1 { text-align: center; }
#credits-list { list-style: none; padding: 0; margin: 6px 0 4px; font-size: 12px; line-height: 1.45; color: #e9dcc0; }
#credits-list li { margin: 0 0 8px; word-break: break-word; }
#credits-list b { color: #FFE7A8; }
#credits-overlay .credits-src { font-size: 11px; opacity: 0.75; }
#credits-close, #quit-back { display: block; margin: 10px auto 0; }
/* champion turntable */
.hero-turn { position: relative; width: 200px; height: 200px; margin: 0 auto 4px; cursor: pointer; background: radial-gradient(ellipse at 50% 85%, rgba(255,214,140,0.25), rgba(0,0,0,0) 60%); }
.hero-turn img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.15s; }
.hero-turn.hidden { display: none; }
.hero-turn small { position: absolute; bottom: -2px; left: 0; right: 0; text-align: center; font-size: 11px; opacity: 0.7; }

#credits-overlay,#quit-overlay{z-index:10050 !important;}

/* ===== v47b: medieval faceted shops (AS in-game shop + buildings, FS meta shop, forge/science consistent) ===== */
:root{--v47-gold:#d9a441;--v47-gold2:#f6d77a;--v47-stone:#4a4440;--v47-ink:#f3e6c4;
  --v47-facet:polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px),0 10px);
  --v47-facet-s:polygon(6px 0,calc(100% - 6px) 0,100% 6px,100% calc(100% - 6px),calc(100% - 6px) 100%,6px 100%,0 calc(100% - 6px),0 6px);}
#shop-overlay .panel,#shop-overlay > div,#meta-shop-overlay > div{
  background:linear-gradient(180deg,rgba(46,32,20,.97),rgba(26,18,12,.98)) !important;
  border:24px solid transparent !important;border-image:url(assets/menu/panel_frame.png) 36 fill stretch / 24px !important;
  border-image-source:url(assets/menu/panel_frame.png) !important;box-shadow:0 10px 40px rgba(0,0,0,.6) !important;border-radius:0 !important;}
#shop-overlay h2,#shop-overlay h3,#meta-shop-overlay h2,#meta-shop-overlay h3,.fs-sec-h,.ss-h,.forge-box h3,.v46-bhead{
  font-family:"MedievalSharp",Georgia,serif !important;color:var(--v47-gold2) !important;letter-spacing:.06em;
  text-shadow:0 2px 0 #2a1708,0 0 8px rgba(246,215,122,.25);}
/* cards / tiles: faceted gold-stone frame with engraved inner edge */
#shop-overlay .shop-item,.fs-card,.ss-card,.ss-slot,.forge-col,.forge-preview,.sci-node,.tree-node,.v46-bcard,.hero-card,
#meta-shop-overlay article{
  position:relative;clip-path:var(--v47-facet);border:none !important;border-radius:0 !important;
  background:linear-gradient(135deg,var(--v47-gold2),var(--v47-gold) 35%,#7a5420 65%,var(--v47-gold2)) !important;padding:3px !important;
  box-shadow:none !important;}
#shop-overlay .shop-item > *,.fs-card > *,.v46-bcard > *{position:relative;z-index:1}
#shop-overlay .shop-item::before,.fs-card::before,.ss-card::before,.forge-col::before,.forge-preview::before,.v46-bcard::before,#meta-shop-overlay article::before{
  content:"";position:absolute;inset:3px;clip-path:var(--v47-facet);z-index:0;
  background:radial-gradient(120% 90% at 50% 0%,#5a4130,#2b1d13 70%),#2b1d13;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.7),inset 0 0 0 3px rgba(217,164,65,.35),inset 0 0 18px rgba(0,0,0,.6);}
#shop-overlay .shop-item{padding:12px 14px !important;color:var(--v47-ink) !important;min-height:64px}
#shop-overlay .shop-item:active{transform:translateY(2px)}
#shop-overlay .shop-item:disabled{filter:grayscale(.7) brightness(.75)}
.fs-card,#meta-shop-overlay article{padding:12px !important;color:var(--v47-ink) !important}
/* price plaques & currency bars */
.shop-gold,.fs-remain,.ss-price,.price,.cost,.shop-cost,.v46-cost,.meta-rocks,#meta-rocks,.rocks-pill,.shop-item .price,.shop-item small{
  display:inline-block;clip-path:var(--v47-facet-s);border:none !important;border-radius:0 !important;
  background:linear-gradient(180deg,#6b6460,#3c3632 55%,#2a2522) !important;color:var(--v47-gold2) !important;
  padding:3px 12px !important;font-weight:700;box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -2px 0 rgba(0,0,0,.4) !important;}
.shop-gold strong{color:#ffe08a}
.fs-buy,#forge-go,.fusion-go,.sci-buy,.tree-buy{font-family:"MedievalSharp",Georgia,serif !important}
/* tabs as faceted banners */
.meta-tab{clip-path:polygon(0 0,100% 0,100% 78%,50% 100%,0 78%) !important;border:none !important;border-radius:0 !important;
  background:linear-gradient(180deg,#5d5752,#38322e) !important;color:#e8dcc0 !important;padding:8px 6px 14px !important;
  font-family:"MedievalSharp",Georgia,serif !important;border-image:none !important;}
.meta-tab.active{background:linear-gradient(180deg,var(--v47-gold2),var(--v47-gold) 60%,#8a5d1f) !important;color:#2a1708 !important}
.ss-wrap,.fs-sec,.forge-box,.sci-box,#fs-sec-ingame,#fs-sec-overall{background:rgba(20,14,9,.55) !important;border:1px solid rgba(217,164,65,.25) !important;
  border-radius:0 !important;clip-path:var(--v47-facet);padding:10px !important}

/* v47 fix: medieval title font must not cover the Charges/Rocks buttons */
.meta-shop-header h1 { pointer-events: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-shop-header .meta-header-left { position: relative; z-index: 2; }

/* v47 fix: facet clip on containers broke hit-testing of inner buttons */
.ss-wrap,.fs-sec,.forge-box,.sci-box,#fs-sec-ingame,#fs-sec-overall{clip-path:none !important}
/* v47 fix: card ::before frames must never swallow taps */
#shop-overlay .shop-item::before,.fs-card::before,.ss-card::before,.forge-col::before,.forge-preview::before,.v46-bcard::before,#meta-shop-overlay article::before{pointer-events:none !important}
.ss-card > *,.forge-col > *,.forge-preview > *,#meta-shop-overlay article > *{position:relative;z-index:1}
/* v47 fix: forge grids must fit the panel width (medieval font widened them) */
.forge-items{grid-template-columns:repeat(4,minmax(0,1fr)) !important}
.forge-charges{grid-template-columns:repeat(3,minmax(0,1fr)) !important}
.forge-item,.forge-charge{min-width:0 !important;overflow:hidden}
.forge-item *,.forge-charge *{max-width:100%;overflow-wrap:anywhere}
/* v47 fix: only the tapped skill/item glows - gold medieval rim (facet clip would hide it) */
.sci-node.v41-sel,.forge-item.sel,.forge-charge.sel,.tree-node.v41-sel{clip-path:none !important;outline:2px solid #f3c25a !important;outline-offset:1px;box-shadow:0 0 0 2px #7a5420,0 0 14px 4px rgba(243,194,90,.7),0 0 28px rgba(217,164,65,.45) !important}

/* v48: Mauer-Bau + Mauer-Panel (Mittelalter) */
.v48-build { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 61; width: min(380px, 94vw); background: linear-gradient(#3b2a1a, #24170d); border: 2px solid #a16207; border-radius: 10px; padding: 8px 10px; color: #fde68a; font: 13px/1.3 inherit; box-shadow: 0 6px 20px rgba(0,0,0,.55); }
.v48-build.hidden, .v48-panel.hidden { display: none; }
.v48b-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 3px 0; }
.v48-build button, .v48p-box button { background: linear-gradient(#78350f, #451a03); color: #fef3c7; border: 1px solid #d97706; border-radius: 6px; padding: 6px 10px; font-weight: 700; cursor: pointer; }
.v48-build button:disabled, .v48p-box button:disabled { opacity: .45; cursor: default; }
.v48b-err { min-height: 16px; color: #fca5a5; font-size: 12px; text-align: center; }
.v48-panel { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(2,6,23,.45); }
.v48p-box { width: min(420px, 96vw); background: linear-gradient(#3b2a1a, #1c1209); border: 2px solid #a16207; border-radius: 14px 14px 0 0; padding: 12px 14px 16px; color: #fde68a; display: flex; flex-direction: column; gap: 6px; }
.v48p-box h3 { margin: 0; } .v48p-sub { margin: 0 0 4px; font-size: 12px; color: #fcd34d; }

/* v48: Wellen-HUD Mittelalter (facettiert, MedievalSharp, wie AS/FS-Shop) */
#hud .hud-center { position: relative; padding: 4px 14px 6px; clip-path: var(--v47-facet); background: linear-gradient(#5a4a3c, #2c241e); box-shadow: inset 0 0 0 2px var(--v47-gold); }
#hud .hud-center::before { content: ""; position: absolute; inset: 3px; clip-path: var(--v47-facet); background: linear-gradient(#3a302a, #1e1915); z-index: 0; }
#hud .hud-center > * { position: relative; z-index: 1; }
#hud .hud-stat { font-family: var(--v47-font); font-weight: 400; color: var(--v47-gold2); letter-spacing: .06em; text-shadow: 0 1px 0 #000; }
#hud .hud-stat .label { color: var(--v47-ink); font-weight: 400; }
#hud #wave-label { font-family: var(--v47-font); color: var(--v47-gold2); }
#hud .wave-progress .wp-track { border: 1px solid var(--v47-gold); border-radius: 0; clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 50%, calc(100% - 4px) 100%, 4px 100%, 0 50%); background: #1e1915; }
#wave-banner-title { font-family: var(--v47-font) !important; color: var(--v47-gold2) !important; padding: 6px 22px; clip-path: var(--v47-facet); background: linear-gradient(#5a4a3c, #2c241e); box-shadow: inset 0 0 0 2px var(--v47-gold); text-shadow: 0 2px 0 #000; }
#wave-banner-count { font-family: var(--v47-font) !important; color: var(--v47-gold2) !important; text-shadow: 0 2px 0 #000; }
