:root {
  --bg: #0f172a;
  --panel: #111c31;
  --panel-soft: #17233a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.22);
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --danger: #f87171;
  --success: #4ade80;
  --radius: 8px;
  --shadow: 0 18px 60px rgba(2, 6, 23, 0.28);
}

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

[hidden] { display: none !important; }

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 34rem),
    var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-nav {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.nav-brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-brand:hover,
.nav-link:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.nav-links--main {
  flex: 1;
  justify-content: center;
}

.nav-links--auth {
  justify-content: flex-end;
}

.nav-menu {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.nav-user {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.82rem;
  padding: 4px 9px;
  white-space: nowrap;
  transition: background 0.14s, color 0.14s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--text);
  text-decoration: none;
}

.nav-link--active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link--cta {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--accent);
}

.nav-link--cta:hover {
  color: var(--accent);
}

.nav-link--danger {
  color: var(--danger);
}

.nav-link--danger:hover {
  color: var(--danger);
}

.nav-link--admin {
  color: var(--muted);
  border-color: rgba(255,255,255,0.12);
}

.nav-link--admin:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.25);
}

.site-main {
  flex: 1;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 14px 24px;
}

.footer-inner {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.footer-brand__name {
  color: var(--text);
  font-weight: 700;
}

.footer-brand__tagline,
.footer-copy {
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.footer-link {
  color: var(--muted);
}

.footer-copy {
  margin: 0;
  text-align: right;
}

.landing {
  max-width: 1120px;
  margin: 0 auto;
  padding: 76px 24px 96px;
  position: relative;
}

.landing::before {
  animation: landingGlow 12s ease-in-out infinite alternate;
  background:
    radial-gradient(circle at 18% 18%, rgba(251, 191, 36, 0.18), transparent 26rem),
    radial-gradient(circle at 80% 10%, rgba(56, 189, 248, 0.16), transparent 22rem);
  content: "";
  inset: -58px calc(50% - 50vw) auto;
  height: 620px;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.landing__hero {
  max-width: 820px;
  margin-bottom: 44px;
}

.landing__eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.landing__title {
  font-size: clamp(2.4rem, 8vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0 0 24px;
}

.landing__tagline {
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.7;
  max-width: 680px;
  margin: 0 0 30px;
}

.landing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.landing__features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.landing-countdown {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(17, 24, 39, 0.86)),
    radial-gradient(circle at 18% 12%, rgba(251, 191, 36, 0.18), transparent 22rem);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.3);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  margin: 0 0 34px;
  overflow: hidden;
  padding: 22px;
  position: relative;
}

.landing-countdown::before {
  background: linear-gradient(90deg, #fbbf24, #38bdf8, #f97316);
  content: "";
  height: 3px;
  inset: 0 0 auto;
  position: absolute;
}

.landing-countdown__copy {
  min-width: 0;
}

.landing-countdown__eyebrow {
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.landing-countdown h2 {
  color: #fff7ed;
  font-size: clamp(1.35rem, 2.6vw, 2.05rem);
  line-height: 1.1;
  margin: 0 0 8px;
}

.landing-countdown p {
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  max-width: 560px;
}

.landing-countdown__timer {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-countdown__unit {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius);
  min-width: 0;
  padding: 14px 8px 12px;
  text-align: center;
}

.landing-countdown__unit strong {
  color: #fde68a;
  display: block;
  font-size: clamp(1.45rem, 4vw, 2.45rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.landing-countdown__unit span {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-top: 8px;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .landing-countdown {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .landing-countdown__timer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.landing .cms-block--hero {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  margin-bottom: 62px;
  max-width: none;
  min-height: 520px;
}

.landing .cms-hero__copy {
  max-width: 690px;
}

.landing .cms-block--hero .page-eyebrow {
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.landing .cms-block--hero .page-title {
  color: #fff7ed;
  font-size: clamp(3rem, 8vw, 6.7rem);
  letter-spacing: -0.06em;
  line-height: 0.9;
  margin: 0 0 24px;
  max-width: 760px;
  text-wrap: balance;
}

.landing .cms-block--hero .page-subtitle {
  color: #cbd5e1;
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.75;
  margin: 0 0 30px;
  max-width: 640px;
}

.landing .cms-block--hero .page-actions {
  gap: 14px;
}

.landing .cms-block--hero .btn--primary {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  box-shadow: 0 18px 46px rgba(249, 115, 22, 0.28);
  color: #241207;
}

.landing .cms-block--hero .btn--primary:hover {
  color: #241207;
  filter: brightness(1.04);
}

.landing .cms-block--hero .btn--ghost {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
}

.cms-hero-scene {
  display: none;
}

.landing .cms-hero-scene {
  display: block;
  min-height: 450px;
  position: relative;
}

.cms-hero-scene__halo {
  animation: pulseHalo 5s ease-in-out infinite;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.24), transparent 64%);
  border-radius: 50%;
  filter: blur(12px);
  height: 420px;
  left: 50%;
  position: absolute;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 420px;
}

.cms-hero-scene__window {
  animation: floatScene 6s ease-in-out infinite;
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(180deg, rgba(8, 13, 28, 0.35), rgba(8, 13, 28, 0.1)),
    radial-gradient(circle at 50% 72%, rgba(251, 191, 36, 0.28), transparent 22%),
    linear-gradient(160deg, #13213a 0%, #0d1729 52%, #24130b 100%);
  border: 1px solid rgba(255, 237, 213, 0.16);
  border-radius: 26px;
  box-shadow:
    0 34px 90px rgba(2, 6, 23, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  margin-left: auto;
  max-width: 430px;
  overflow: hidden;
  position: relative;
}

.cms-hero-scene__stars {
  background-image:
    radial-gradient(circle, rgba(226, 232, 240, 0.95) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(125, 211, 252, 0.9) 0 1px, transparent 1.5px);
  background-position: 10px 20px, 70px 60px;
  background-size: 90px 80px, 130px 110px;
  inset: 0;
  opacity: 0.32;
  position: absolute;
}

.cms-hero-scene__mountain {
  background: linear-gradient(135deg, #16233a, #263b5b);
  bottom: 122px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  height: 210px;
  position: absolute;
  width: 290px;
}

.cms-hero-scene__mountain--back {
  left: -50px;
  opacity: 0.7;
}

.cms-hero-scene__mountain--front {
  background: linear-gradient(135deg, #1f2d46, #3b2a22);
  height: 250px;
  right: -70px;
  width: 360px;
}

.cms-hero-scene__forge {
  bottom: 68px;
  height: 180px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 230px;
}

.cms-hero-scene__roof {
  background: linear-gradient(135deg, #7c2d12, #fb923c);
  clip-path: polygon(50% 0, 100% 42%, 90% 48%, 90% 100%, 10% 100%, 10% 48%, 0 42%);
  height: 145px;
  inset: 12px 0 auto;
  position: absolute;
}

.cms-hero-scene__fire {
  animation: forgeFire 0.9s ease-in-out infinite alternate;
  background:
    radial-gradient(circle at 50% 65%, #fff7ed 0 10%, transparent 11%),
    radial-gradient(circle at 46% 58%, #fbbf24 0 24%, transparent 25%),
    radial-gradient(circle at 54% 56%, #f97316 0 38%, transparent 39%);
  border-radius: 50% 50% 42% 42%;
  bottom: 24px;
  height: 70px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 82px;
}

.cms-hero-scene__anvil {
  background: linear-gradient(180deg, #e2e8f0, #64748b);
  border-radius: 10px 10px 6px 6px;
  bottom: -18px;
  height: 38px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 150px;
}

.cms-hero-scene__anvil::before {
  background: #cbd5e1;
  border-radius: 8px;
  content: "";
  height: 18px;
  left: -26px;
  position: absolute;
  top: 4px;
  width: 64px;
}

.cms-hero-scene__smoke {
  animation: smokeRise 4s ease-in-out infinite;
  background: rgba(203, 213, 225, 0.28);
  border-radius: 50%;
  filter: blur(4px);
  height: 56px;
  position: absolute;
  top: -34px;
  width: 56px;
}

.cms-hero-scene__smoke--one {
  left: 74px;
}

.cms-hero-scene__smoke--two {
  animation-delay: 1.1s;
  left: 110px;
  top: -48px;
}

.cms-hero-scene__blade {
  animation: bladeShine 3.6s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(226, 232, 240, 0.96), #67e8f9, rgba(226, 232, 240, 0.86), transparent);
  border-radius: 999px;
  bottom: 118px;
  box-shadow: 0 0 40px rgba(103, 232, 249, 0.38);
  height: 8px;
  left: 14%;
  position: absolute;
  transform: rotate(-17deg);
  width: 76%;
}

.cms-hero-scene__ember {
  animation: emberLift 3.2s ease-in infinite;
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 0 0 18px #f97316;
  height: 7px;
  position: absolute;
  width: 7px;
}

.cms-hero-scene__ember--one {
  animation-delay: 0.2s;
  bottom: 132px;
  left: 38%;
}

.cms-hero-scene__ember--two {
  animation-delay: 1.1s;
  bottom: 116px;
  left: 59%;
}

.cms-hero-scene__ember--three {
  animation-delay: 1.8s;
  bottom: 162px;
  left: 50%;
}

.cms-hero-scene__rune {
  backdrop-filter: blur(16px);
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 999px;
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 12px;
  position: absolute;
}

.cms-hero-scene__rune--one {
  left: 10px;
  top: 86px;
}

.cms-hero-scene__rune--two {
  right: 2px;
  top: 152px;
}

.cms-hero-scene__rune--three {
  bottom: 70px;
  left: 42px;
}

.landing .cms-block--cards {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.18);
  padding: 22px;
}

.landing .feature-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025)),
    rgba(17, 28, 49, 0.82);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: none;
  min-height: 170px;
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.landing .feature-card::before {
  background: linear-gradient(180deg, #fbbf24, #38bdf8);
  border-radius: 999px;
  content: "";
  height: 36px;
  opacity: 0.7;
  position: absolute;
  right: 18px;
  top: 18px;
  width: 4px;
}

.landing .feature-card:hover {
  background:
    linear-gradient(180deg, rgba(251, 191, 36, 0.08), rgba(56, 189, 248, 0.04)),
    rgba(17, 28, 49, 0.9);
  border-color: rgba(251, 191, 36, 0.34);
  transform: translateY(-4px);
}

@keyframes landingGlow {
  from { opacity: 0.78; transform: translateY(0); }
  to { opacity: 1; transform: translateY(22px); }
}

@keyframes floatScene {
  0%, 100% { transform: translateY(0) rotate(-0.6deg); }
  50% { transform: translateY(-14px) rotate(0.6deg); }
}

@keyframes pulseHalo {
  0%, 100% { opacity: 0.64; transform: translate(-50%, -50%) scale(0.96); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

@keyframes forgeFire {
  from { filter: saturate(1) brightness(1); transform: translateX(-50%) scale(0.94); }
  to { filter: saturate(1.25) brightness(1.16); transform: translateX(-50%) scale(1.08); }
}

@keyframes smokeRise {
  0% { opacity: 0; transform: translateY(28px) scale(0.7); }
  25% { opacity: 0.42; }
  100% { opacity: 0; transform: translateY(-70px) scale(1.35); }
}

@keyframes bladeShine {
  0%, 100% { opacity: 0.62; filter: brightness(1); }
  45% { opacity: 1; filter: brightness(1.5); }
}

@keyframes emberLift {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-160px) translateX(34px) scale(1.1); }
}

.feature-card,
.auth-card,
.content-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature-card {
  padding: 22px;
}

.feature-card__title {
  font-size: 1rem;
  margin: 0 0 10px;
}

.feature-card__desc {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  padding: 11px 18px;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #082f49;
}

.btn--primary:hover {
  background: var(--accent-strong);
  color: #f0f9ff;
}

.btn--ghost,
.btn--secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn--full {
  width: 100%;
}

.auth-page,
.content-page {
  display: flex;
  justify-content: center;
  padding: 56px 16px;
}

.auth-page {
  align-items: center;
  min-height: calc(100vh - 116px);
}

.auth-card {
  max-width: 440px;
  padding: 34px;
  width: 100%;
}

.auth-card__brand {
  margin-bottom: 24px;
  text-align: center;
}

.auth-card__title,
.page-title {
  margin: 0 0 8px;
}

.auth-card__sub,
.auth-card__footer,
.text-muted {
  color: var(--muted);
}

.auth-card__sub {
  margin: 0;
}

.auth-card__footer {
  font-size: 0.92rem;
  margin: 18px 0 0;
  text-align: center;
}

/* Honeypot — visually invisible to humans, filled by bots */
.form-group--honeypot {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  left: -9999px;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group--inline {
  align-items: center;
  flex-direction: row;
}

.form-group--terms {
  align-items: flex-start;
}

.form-label {
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 650;
}

.form-label--inline {
  font-weight: 500;
  line-height: 1.5;
}

.form-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  outline: none;
  padding: 11px 12px;
}

.form-input:focus {
  border-color: var(--accent);
}

select.form-input,
select.form-input option {
  background: var(--panel);
  color: var(--text);
}

select.form-input {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  padding-right: 32px;
}

.form-checkbox {
  accent-color: var(--accent);
  height: 16px;
  margin: 2px 0 0;
  width: 16px;
}

.form-error {
  color: var(--danger);
  font-size: 0.82rem;
}

.alert {
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 16px;
  padding: 12px 14px;
}

.alert--success {
  background: rgba(74, 222, 128, 0.12);
  border-color: var(--success);
}

.alert--danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: var(--danger);
}

.alert--info {
  background: rgba(56, 189, 248, 0.12);
}

.content-card {
  max-width: 820px;
  padding: 36px;
  width: 100%;
}

.content-card h2 {
  margin-top: 28px;
}

.content-card p,
.content-card li {
  color: #cbd5e1;
  line-height: 1.65;
}

.admin-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 46px 24px 80px;
}

.admin-header {
  margin-bottom: 28px;
}

.admin-eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.admin-header h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.admin-header p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  max-width: 720px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.admin-stat,
.admin-action-card,
.admin-form {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-stat {
  padding: 18px;
}

.admin-stat__value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.admin-stat__label {
  color: var(--muted);
  display: block;
  font-size: 0.9rem;
  margin-top: 4px;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.admin-action-card {
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
}

.admin-action-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  text-decoration: none;
}

.admin-action-card span {
  color: var(--muted);
  line-height: 1.5;
}

.admin-action-card--muted {
  opacity: 0.72;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

.admin-form--wide {
  max-width: none;
}

.content-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 12px;
}

.content-tab:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--text);
  text-decoration: none;
}

.content-accordion {
  display: grid;
  gap: 12px;
}

.content-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.content-section summary {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 14px 16px;
}

.content-section summary::-webkit-details-marker {
  display: none;
}

.content-section summary span {
  color: var(--text);
  font-weight: 800;
}

.content-section summary small {
  color: var(--muted);
}

.content-section__fields {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.content-builder {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  padding: 20px;
}

.content-builder__form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(140px, 0.8fr) minmax(130px, 0.7fr) minmax(180px, 1fr) minmax(240px, 1.4fr) auto;
}

.content-edit-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  padding: 16px;
}

.content-edit-card__head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.content-edit-card code {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  margin-top: 4px;
}

.content-editor-guide {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 18px;
}

.content-editor-guide article {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 6px;
  padding: 14px;
}

.content-editor-guide strong {
  color: var(--text);
}

.content-editor-guide span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.content-editor-guide a {
  font-size: 0.82rem;
  font-weight: 800;
}

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

.block-preview-panel {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 16px;
}

.block-preview-panel__label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.block-live-preview {
  border-radius: var(--radius);
  overflow: hidden;
  pointer-events: none;
}

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

.admin-field small {
  color: var(--muted);
}

.admin-form textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 640px) {
  .site-nav {
    overflow: visible;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px 12px;
    background: rgba(15, 23, 42, 0.97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    z-index: 100;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-links--main,
  .nav-links--auth {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
  }

  .nav-links--auth {
    border-top: 1px solid var(--line);
    margin-top: 6px;
    padding-top: 6px;
    justify-content: flex-start;
  }

  .nav-user {
    display: none;
  }

  .admin-subnav {
    gap: 6px;
    padding: 8px 10px;
    flex-wrap: wrap;
  }

  .admin-subnav__drop {
    flex: 1 1 140px;
    min-width: 0;
  }

  .admin-subnav__group-btn {
    justify-content: center;
    width: 100%;
  }

  .admin-subnav__menu {
    min-width: min(260px, calc(100vw - 20px));
  }

  .landing {
    padding-top: 48px;
  }

  .landing .cms-block--hero {
    gap: 30px;
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .landing .cms-block--hero .page-title {
    font-size: clamp(2.7rem, 16vw, 4.2rem);
  }

  .landing .cms-hero-scene {
    min-height: 360px;
  }

  .cms-hero-scene__window {
    margin: 0 auto;
    max-width: 320px;
  }

  .cms-hero-scene__rune {
    display: none;
  }

  .footer-inner,
  .content-builder__form,
  .content-meta-grid,
  .cms-admin-grid,
  .cms-form-grid,
  .cms-section-row,
  .cms-section-row__form,
  .cms-item-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .cms-sidebar {
    position: static;
  }

  .cms-panel-head,
  .cms-subhead {
    display: grid;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-brand,
  .footer-copy {
    text-align: center;
  }
}

/* ── Game page shell ──────────────────────────────────────────────── */

.game-page {
  background: #120d0a;
  overflow: hidden;
}

.game-page .site-nav {
  background: rgba(18, 13, 10, 0.88);
  border-bottom: 1px solid rgba(255, 186, 92, 0.14);
  position: fixed;
  transition: transform 0.25s ease;
  width: 100%;
}

/* B — Auto-hide nav on mobile when playing */
.game-page .site-nav {
  transition: transform 0.25s ease;
}

.game-page .site-nav.is-hidden {
  transform: translateY(-100%);
}

.game-page .site-main {
  min-height: 100vh;
  min-height: 100dvh;
}

.forge-game {
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 186, 92, 0.22), transparent 28rem),
    radial-gradient(circle at 82% 22%, rgba(129, 78, 255, 0.16), transparent 30rem),
    #120d0a;
  height: 100vh;
  height: 100dvh; /* shrinks as mobile browser chrome appears/hides */
  overflow: hidden;
  position: relative;
}

.forge-game__canvas {
  display: block;
  height: 100vh;
  height: 100dvh;
  image-rendering: pixelated;
  touch-action: none;
  width: 100vw;
  width: 100dvw;
  will-change: transform;
}

/* ── HUD container ────────────────────────────────────────────────── */

.forge-hud {
  color: #fff7e7;
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 12;
}

.forge-hud button {
  font: inherit;
}

/* ── Top bar: location | stats | daytime ────────────────────────── */

.forge-hud__top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  left: 18px;
  position: absolute;
  right: 70px;
  top: 76px;
}

/* Shared glass panel base */
.forge-panel,
.forge-stats,
.forge-quickbar,
.forge-drawer,
.forge-location {
  backdrop-filter: blur(18px);
  background: rgba(20, 12, 8, 0.88);
  border: 1px solid rgba(255, 200, 120, 0.18);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 231, 180, 0.07);
}

/* ── Draggable panel system ──────────────────────────────────────── */

/* Grip icon shown in panel headers */
.forge-drag-grip {
  color: rgba(255, 255, 255, 0.3);
  cursor: grab;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  padding: 0 3px;
  touch-action: none;
  user-select: none;
}

.forge-drag-grip:hover { color: rgba(255, 255, 255, 0.7); }
.forge-drag-grip:active { cursor: grabbing; }

/* Grip tab on the quickbar */
.forge-quickbar__grip {
  align-items: center;
  color: rgba(255, 255, 255, 0.3);
  cursor: grab;
  display: flex;
  flex-shrink: 0;
  font-size: 13px;
  padding: 0 4px;
  touch-action: none;
  user-select: none;
}

.forge-quickbar__grip:hover { color: rgba(255, 255, 255, 0.6); }
.forge-quickbar__grip:active { cursor: grabbing; }

/* Active drag state */
.is-dragging {
  cursor: grabbing !important;
  opacity: 0.82;
  transition: none !important;
  z-index: 999;
}

/* Snap-to-zone animation */
.is-snapping {
  transition: left 0.2s ease, top 0.2s ease !important;
}

/* ── Location badge (also the HUD-top drag handle) ──────────────── */

.forge-location {
  align-items: center;
  border-radius: 10px;
  color: #ffd891;
  cursor: grab;
  display: flex;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  text-transform: uppercase;
  touch-action: none;
  white-space: nowrap;
}

.forge-location__icon {
  font-size: 16px;
}

.game-texture-icon {
  --txp: 0%;
  --typ: 0%;
  background-image: url("/assets/game/textures.svg");
  background-position: var(--txp) var(--typ);
  background-repeat: no-repeat;
  background-size: 800% 800%;
  display: inline-block;
  flex: 0 0 auto;
  height: 1.55em;
  image-rendering: auto;
  vertical-align: -0.3em;
  width: 1.55em;
}

.game-emoji-icon {
  align-items: center;
  background-image: none;
  display: inline-flex;
  font-size: 1.2em;
  justify-content: center;
  line-height: 1;
}

.game-texture-icon--forge { --txp: 71.4286%; --typ: 85.7143%; }
.game-texture-icon--gold { --txp: 0%; --typ: 71.4286%; }
.game-texture-icon--ore { --txp: 14.2857%; --typ: 71.4286%; }
.game-texture-icon--wood { --txp: 28.5714%; --typ: 71.4286%; }
.game-texture-icon--faith { --txp: 42.8571%; --typ: 71.4286%; }
.game-texture-icon--herbs { --txp: 57.1429%; --typ: 71.4286%; }
.game-texture-icon--seeds { --txp: 71.4286%; --typ: 71.4286%; }
.game-texture-icon--crops { --txp: 85.7143%; --typ: 71.4286%; }
.game-texture-icon--egg { --txp: 100%; --typ: 71.4286%; }
.game-texture-icon--milk { --txp: 0%; --typ: 85.7143%; }
.game-texture-icon--map { --txp: 57.1429%; --typ: 57.1429%; }
.game-texture-icon--npc { --txp: 14.2857%; --typ: 0%; }
.game-texture-icon--menu { --txp: 57.1429%; --typ: 100%; }
.game-texture-icon--phone { --txp: 100%; --typ: 100%; }
.game-texture-icon--close { --txp: 100%; --typ: 100%; }
.game-texture-icon--inventory { --txp: 57.1429%; --typ: 100%; }
.game-texture-icon--shop { --txp: 14.2857%; --typ: 100%; }
.game-texture-icon--settings { --txp: 85.7143%; --typ: 85.7143%; }
.game-texture-icon--resume { --txp: 0%; --typ: 14.2857%; }
.game-texture-icon--quit { --txp: 100%; --typ: 100%; }

/* ── Resource stats bar ───────────────────────────────────────────── */

/* C+D — HUD collapse toggle button */
.forge-hud__collapse {
  align-self: flex-start;
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.22s ease;
}

.forge-hud__top.is-collapsed .forge-hud__collapse {
  transform: rotate(180deg);
}

.forge-stats {
  border-radius: 10px;
  display: flex;
  gap: 6px;
  max-height: 200px;
  overflow: hidden;
  padding: 8px;
  transition: max-height 0.22s ease, opacity 0.18s, padding 0.18s;
}

/* C+D — Collapsed state hides resource stats, leaves location + daytime */
.forge-hud__top.is-collapsed .forge-stats {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.forge-stat {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 62px;
  padding: 8px 10px;
  text-align: center;
}

.forge-stat__icon {
  font-size: 16px;
  line-height: 1;
}

.forge-stat__icon .game-texture-icon,
.forge-location__icon .game-texture-icon {
  height: 22px;
  width: 22px;
}

.forge-stat strong {
  color: #fff7e7;
  display: block;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.forge-stat em {
  color: #c9ae7d;
  display: block;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Daytime chip ────────────────────────────────────────────────── */

.forge-daytime {
  align-self: center;
  background: rgba(20, 12, 8, 0.72);
  border: 1px solid rgba(255, 200, 120, 0.22);
  border-radius: 20px;
  color: #ffd891;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  white-space: nowrap;
}

/* ── Minimap panel ───────────────────────────────────────────────── */

.forge-minimap-panel {
  border-color: rgba(255, 170, 60, 0.32);
  bottom: 18px;
  box-shadow: 0 0 22px rgba(255, 140, 40, 0.2), 0 12px 36px rgba(0, 0, 0, 0.55);
  padding: 0;
  pointer-events: auto;
  position: absolute;
  right: 18px;
  top: auto;
  width: 258px;
}

.forge-minimap-panel__drag {
  align-items: center;
  background: rgba(255, 170, 60, 0.06);
  border-bottom: 1px solid rgba(255, 170, 60, 0.14);
  border-radius: 10px 10px 0 0;
  cursor: grab;
  display: flex;
  justify-content: flex-end;
  min-height: 24px;
  padding: 2px 6px;
  position: relative;
  user-select: none;
}

.forge-minimap-panel__drag:active {
  cursor: grabbing;
}

.forge-minimap-panel__resize {
  bottom: 0;
  cursor: nwse-resize;
  height: 16px;
  position: absolute;
  right: 0;
  width: 16px;
}

.forge-minimap-panel__resize::after {
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255, 170, 60, 0.4) 30%, rgba(255, 170, 60, 0.4) 42%,
    transparent 42%,
    transparent 56%,
    rgba(255, 170, 60, 0.4) 56%, rgba(255, 170, 60, 0.4) 68%,
    transparent 68%
  );
  bottom: 3px;
  content: "";
  height: 10px;
  position: absolute;
  right: 3px;
  width: 10px;
}

/* Shared collapse toggle button (used by minimap and quest panel) */
.forge-panel-toggle {
  background: none;
  border: none;
  color: #7a6850;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  pointer-events: auto;
  transition: color 0.12s;
}

.forge-panel-toggle:hover {
  color: #ffd891;
}

.forge-minimap {
  border-radius: 0 0 8px 8px;
  cursor: pointer;
  display: block;
  image-rendering: pixelated;
  opacity: 0.92;
  transition: opacity 0.18s, max-height 0.22s ease;
  width: 100%;
  /* height is set by the canvas height attribute */
}

.forge-minimap:hover {
  opacity: 1;
}

/* Collapsed state — canvas slides away */
.forge-minimap-panel.is-collapsed .forge-minimap {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.forge-minimap-panel.is-collapsed .forge-panel-toggle {
  color: #c9ae7d;
}

/* ── Menu toggle button ──────────────────────────────────────────── */

.forge-menu-btn {
  background: rgba(20, 12, 8, 0.88);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 200, 120, 0.18);
  border-radius: 9px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 231, 180, 0.07);
  color: #ffd891;
  cursor: pointer;
  font-size: 17px;
  min-height: 44px;
  min-width: 44px;
  padding: 9px 13px;
  pointer-events: auto;
  position: absolute;
  right: 18px;
  top: 76px;
  touch-action: manipulation;
  transition: background 0.12s, border-color 0.12s;
}

.forge-menu-btn:hover {
  background: rgba(255, 186, 92, 0.14);
  border-color: rgba(255, 186, 92, 0.4);
}

/* Quest count badge on the menu button — visible on touch devices where the overlay is hidden */
.forge-menu-btn[data-quest-badge]:not([data-quest-badge=""])::after {
  align-items: center;
  background: #ef4444;
  border: 1.5px solid rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  color: #fff;
  content: attr(data-quest-badge);
  display: flex;
  font-size: 9px;
  font-weight: 900;
  height: 16px;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  right: 3px;
  top: 3px;
  width: 16px;
}

/* ── Panel base ──────────────────────────────────────────────────── */

.forge-panel {
  border-radius: 10px;
  padding: 14px 16px;
}

.forge-panel h1 {
  font-size: 17px;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.forge-panel p {
  color: #d7c8aa;
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

/* ── Quest / order tracker ───────────────────────────────────────── */

.forge-quest {
  border-radius: 10px;
  bottom: 18px;
  left: 18px;
  max-width: min(500px, calc(100vw - 36px));
  min-width: 180px;
  padding: 10px 12px;
  pointer-events: auto;
  position: absolute;
}

/* Quest overlay is desktop-only — on touch devices quests are accessed via the menu */
@media (hover: none) and (pointer: coarse) {
  .forge-quest { display: none !important; }
}

.forge-quest__head {
  align-items: center;
  cursor: default;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 8px;
  user-select: none;
}

.forge-quest__body {
  max-height: 200px;
  overflow: hidden;
  transition: max-height 0.22s ease, opacity 0.18s;
  opacity: 1;
}

.forge-quest.is-collapsed .forge-quest__body {
  max-height: 0;
  opacity: 0;
}

.forge-quest.is-collapsed .forge-quest__head {
  margin-bottom: 0;
}

.forge-quest__head strong {
  color: #c9ae7d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.forge-quest__head span {
  background: rgba(255, 186, 92, 0.14);
  border: 1px solid rgba(255, 186, 92, 0.38);
  border-radius: 999px;
  color: #ffd891;
  font-size: 12px;
  font-weight: 850;
  padding: 4px 10px;
}

.forge-quest p {
  color: #d7c8aa;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.forge-quest__controls {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #a09078 !important;
  font-size: 11px !important;
  margin-top: 10px !important;
  padding-top: 10px;
}

.forge-quest__controls kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #d7c8aa;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
}

/* ── Quickbar ────────────────────────────────────────────────────── */

.forge-quickbar {
  border-radius: 10px;
  bottom: 18px;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(6, 60px);
  left: 50%;
  padding: 9px;
  pointer-events: auto;
  position: absolute;
  transform: translateX(-50%);
}

.forge-slot {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 200, 120, 0.14);
  border-radius: 9px;
  color: #fff7e7;
  cursor: pointer;
  display: grid;
  font-size: 22px;
  height: 60px;
  place-items: center;
  position: relative;
  touch-action: manipulation;
  transition: background 0.1s, border-color 0.1s, transform 0.1s, box-shadow 0.1s;
}

.forge-slot__texture {
  height: 35px;
  width: 35px;
}

.forge-slot:hover {
  background: rgba(255, 186, 92, 0.1);
  border-color: rgba(255, 186, 92, 0.3);
}

.forge-slot.is-active {
  background: rgba(255, 186, 92, 0.18);
  border-color: rgba(255, 216, 145, 0.7);
  box-shadow: 0 0 14px rgba(255, 186, 92, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

.forge-slot--hand {
  border-style: dashed;
  opacity: 0.65;
}

.forge-slot--hand.is-active {
  border-style: solid;
  opacity: 1;
}

.forge-slot small,
.forge-slot b {
  font-size: 10px;
  font-weight: 900;
  position: absolute;
}

.forge-slot small {
  color: #c9ae7d;
  left: 6px;
  top: 5px;
}

.forge-slot b {
  bottom: 5px;
  color: #ffd891;
  right: 6px;
}

/* ── Toast ───────────────────────────────────────────────────────── */

.forge-toast {
  background: rgba(18, 10, 7, 0.96);
  border: 1px solid rgba(255, 200, 120, 0.22);
  border-radius: 999px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 231, 180, 0.06);
  font-size: 13px;
  font-weight: 800;
  left: 50%;
  letter-spacing: 0.02em;
  max-width: min(720px, calc(100vw - 36px));
  opacity: 0;
  padding: 11px 18px;
  position: absolute;
  text-align: center;
  top: 148px;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.forge-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Drawers (inventory / shop) ──────────────────────────────────── */

@keyframes forge-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.forge-drawer {
  border-radius: 10px;
  display: none;
  max-height: min(690px, calc(100vh - 150px));
  max-height: min(690px, calc(100dvh - 150px));
  overflow: auto;
  padding: 16px;
  pointer-events: auto;
  position: absolute;
  right: 18px;
  top: 154px;
  width: min(580px, calc(100vw - 36px));
}

.forge-drawer.is-open {
  animation: forge-panel-in 0.16s ease both;
  display: block;
}

.forge-drawer__head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.forge-drawer h2 {
  color: #ffd891;
  font-size: 16px;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

.forge-close {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 200, 120, 0.16);
  border-radius: 999px;
  color: #fff7e7;
  cursor: pointer;
  font-size: 13px;
  min-height: 36px;
  min-width: 36px;
  padding: 6px 10px;
  touch-action: manipulation;
  transition: background 0.1s;
}

.forge-close:hover {
  background: rgba(255, 186, 92, 0.14);
}

/* ── Inventory & shop items ──────────────────────────────────────── */

.forge-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.forge-item,
.forge-shop-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 12px;
}

.forge-item {
  min-height: 110px;
}

.forge-item__icon {
  font-size: 24px;
}

.forge-item__icon .game-texture-icon {
  height: 34px;
  width: 34px;
}

.forge-item__name,
.forge-shop-item h3 {
  font-size: 13px;
  font-weight: 850;
  margin: 5px 0;
}

.forge-item__meta,
.forge-shop-item p,
.forge-cost {
  color: #d7c8aa;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.forge-cost__old {
  color: #9b8d72;
  margin-left: 4px;
  text-decoration: line-through;
}

.forge-mini {
  background: rgba(255, 216, 145, 0.14);
  border-radius: 999px;
  color: #ffd891;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  margin-right: 5px;
  margin-top: 8px;
  padding: 5px 8px;
}

.forge-shop-item {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  margin-bottom: 10px;
}

.forge-shop-item.is-locked {
  opacity: 0.58;
}

.forge-skill-rank {
  align-items: center;
  background: rgba(255, 216, 145, 0.1);
  border: 1px solid rgba(255, 216, 145, 0.18);
  border-radius: 8px;
  color: #ffd891;
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 850;
  gap: 2px;
  min-width: 68px;
  padding: 8px;
  text-align: center;
}

.forge-skill-rank strong {
  color: #fff7e7;
  font-size: 14px;
}

.forge-cost {
  color: #ffd891;
  font-weight: 850;
  margin-top: 7px;
}

/* ── Craft panel: progress bar + multi-craft button ─────────────── */

.forge-craft-progress {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.forge-craft-progress__bar {
  background: rgba(255, 186, 92, 0.72);
  border-radius: 999px;
  flex: 1 1 auto;
  height: 4px;
  max-width: 80px;
  transition: width 0.2s ease;
}

.forge-craft-progress span {
  color: #c9ae7d;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 850;
}

.forge-craft-btns {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forge-craft-max {
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 10px;
  white-space: nowrap;
}

.forge-property-drawer {
  width: min(640px, calc(100vw - 36px));
}

.forge-property-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
}

.forge-property-summary div {
  background: rgba(255, 216, 145, 0.08);
  border: 1px solid rgba(255, 216, 145, 0.16);
  border-radius: 8px;
  padding: 9px;
}

.forge-property-summary strong {
  color: #fff7e7;
  display: block;
  font-size: 18px;
  line-height: 1;
}

.forge-property-summary span,
.forge-property-note,
.forge-property-legend {
  color: #d7c8aa;
  font-size: 12px;
}

.forge-property-note {
  margin-bottom: 12px;
}

.forge-property-grid {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(var(--property-cols), minmax(0, 1fr));
  margin-bottom: 12px;
}

.forge-property-cell {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  cursor: pointer;
  min-width: 0;
  padding: 0;
}

.forge-property-cell.is-owned {
  background: rgba(255, 216, 145, 0.22);
  border-color: rgba(255, 216, 145, 0.55);
  cursor: default;
}

.forge-property-cell.is-base {
  box-shadow: inset 0 0 0 2px rgba(255, 247, 231, 0.22);
}

.forge-property-cell.is-expandable:not(:disabled) {
  background: rgba(99, 179, 237, 0.22);
  border-color: rgba(99, 179, 237, 0.55);
}

.forge-property-cell.is-selected {
  background: rgba(74, 222, 128, 0.28);
  border-color: rgba(74, 222, 128, 0.72);
}

.forge-property-cell.is-expandable:not(:disabled):hover {
  filter: brightness(1.25);
}

.forge-property-cell:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.forge-property-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.forge-property-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.forge-property-actions span {
  color: #fff7e7;
  font-size: 12px;
  font-weight: 850;
  margin-right: auto;
}

.forge-property-legend span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.forge-property-legend i {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.forge-property-legend i.is-owned {
  background: rgba(255, 216, 145, 0.28);
  border-color: rgba(255, 216, 145, 0.55);
}

.forge-property-legend i.is-expandable {
  background: rgba(99, 179, 237, 0.28);
  border-color: rgba(99, 179, 237, 0.55);
}

.forge-property-legend i.is-selected {
  background: rgba(74, 222, 128, 0.32);
  border-color: rgba(74, 222, 128, 0.72);
}

/* ── Primary button ──────────────────────────────────────────────── */

.forge-primary,
.forge-close,
.forge-mini {
  border: 0;
  cursor: pointer;
  font-weight: 850;
}

.forge-primary {
  background: linear-gradient(135deg, #ffd891 0%, #ff9f45 100%);
  border-radius: 9px;
  color: #271306;
  font-size: 14px;
  min-height: 44px;
  padding: 12px 20px;
  touch-action: manipulation;
  transition: filter 0.12s;
}

.forge-primary:hover {
  filter: brightness(1.1);
}

.forge-primary:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.5;
}

/* ── Game menu overlay ───────────────────────────────────────────── */

.forge-menu {
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(6, 3, 1, 0.72);
  display: flex;
  inset: 0;
  justify-content: center;
  pointer-events: auto;
  position: absolute;
  z-index: 18;
}

.forge-menu[aria-hidden="true"] {
  display: none;
}

.forge-menu__panel {
  background:
    linear-gradient(160deg, #1e130d 0%, #2c1c12 100%);
  border: 1px solid rgba(255, 186, 92, 0.28);
  border-radius: 14px;
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.8),
    0 0 48px rgba(255, 186, 92, 0.07),
    inset 0 1px 0 rgba(255, 231, 180, 0.08);
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  min-width: min(300px, calc(100vw - 32px));
  overflow-y: auto;
  padding: 28px 24px;
}

.forge-menu__title {
  color: #ffd891;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  text-align: center;
  text-transform: uppercase;
}

.forge-menu__btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 200, 120, 0.16);
  border-radius: 9px;
  color: #fff7e7;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  padding: 12px 16px;
  text-align: left;
  touch-action: manipulation;
  transition: background 0.12s, border-color 0.12s;
}

.forge-menu__btn:hover {
  background: rgba(255, 186, 92, 0.11);
  border-color: rgba(255, 186, 92, 0.38);
}

.forge-menu__btn--primary {
  background: rgba(255, 186, 92, 0.13);
  border-color: rgba(255, 186, 92, 0.42);
  color: #ffd891;
}

.forge-menu__btn--primary:hover {
  background: rgba(255, 186, 92, 0.22);
}

.forge-menu__btn--danger {
  border-color: rgba(248, 113, 113, 0.18);
  color: #f87171;
}

.forge-menu__btn--danger:hover {
  background: rgba(248, 113, 113, 0.09);
  border-color: rgba(248, 113, 113, 0.4);
}

.forge-menu__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 2px 0;
}



/* ── Settings panel ──────────────────────────────────────────────── */

.forge-settings {
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 4px 2px 0 0;
  scrollbar-width: thin;
}

.forge-settings__head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.forge-settings__head strong {
  color: #ffd891;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.forge-settings__section {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 200, 120, 0.12);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px;
}

.forge-settings__section strong {
  color: #a09070;
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.forge-settings__section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.forge-menu__mini-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 200, 120, 0.16);
  border-radius: 6px;
  color: #ffd891;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
}

.forge-order-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 216, 145, 0.16);
  border-radius: 7px;
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  padding: 10px;
}

.forge-order-card span {
  color: #a09070;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.forge-order-card b {
  color: #ffd891;
  font-size: 15px;
}

.forge-order-card p {
  color: #d7c8aa;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.forge-settings__row {
  align-items: center;
  color: #fff7e7;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 9px;
}

.forge-hotkeys {
  display: grid;
  gap: 6px;
}

.forge-hotkey {
  align-items: center;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  color: #fff7e7;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 12px;
  justify-content: space-between;
  padding: 8px 9px;
  text-align: left;
}

.forge-hotkey:hover,
.forge-hotkey.is-capturing {
  background: rgba(255, 186, 92, 0.1);
  border-color: rgba(255, 186, 92, 0.38);
}

.forge-hotkey kbd,
.forge-hotkey-hint {
  color: #c9ae7d;
}

.forge-hotkey kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 900;
  min-width: 42px;
  padding: 2px 6px;
  text-align: center;
}

.forge-hotkey-hint {
  font-size: 11px;
  line-height: 1.35;
  margin: 8px 0 0;
}

.forge-settings__keys {
  display: none;
}

.forge-settings__row input[type="checkbox"] {
  accent-color: #ffd891;
  cursor: pointer;
  height: 15px;
  width: 15px;
}

.forge-settings__keys {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}

.forge-settings__keys td {
  color: #c9ae7d;
  padding: 3px 5px;
}

.forge-settings__keys td:first-child {
  text-align: right;
  white-space: nowrap;
}

.forge-settings__keys kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #c9ae7d;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
}

.forge-dialog[aria-hidden="true"] {
  display: none;
}

.forge-dialog {
  align-items: flex-end;
  animation: forge-panel-in 0.18s ease both;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.56));
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 20px;
  pointer-events: auto;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 39;
}

.forge-dialog__panel {
  align-items: center;
  background:
    linear-gradient(145deg, rgba(28, 18, 11, 0.98), rgba(13, 18, 30, 0.98)),
    radial-gradient(circle at 20% 0%, rgba(255, 186, 92, 0.18), transparent 58%);
  border: 1px solid rgba(255, 216, 145, 0.2);
  border-radius: 12px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
  display: grid;
  gap: 14px;
  grid-template-columns: 86px minmax(0, 1fr) minmax(160px, 220px);
  max-width: min(920px, calc(100vw - 32px));
  min-height: 138px;
  padding: 18px;
  position: relative;
  width: 100%;
}

.forge-dialog__close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: #d7c8aa;
  cursor: pointer;
  height: 30px;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
}

.forge-dialog__portrait {
  align-items: center;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 216, 145, 0.14);
  border-radius: 9px;
  display: flex;
  height: 86px;
  justify-content: center;
  width: 86px;
}

.forge-dialog__portrait-icon {
  height: 72px;
  width: 72px;
}

.forge-dialog__copy {
  min-width: 0;
  padding-right: 16px;
}

.forge-dialog__role {
  color: #c9ae7d;
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.forge-dialog__copy h2 {
  color: #ffd891;
  font-size: 22px;
  margin: 2px 0 7px;
}

.forge-dialog__copy p {
  color: #f2dfbd;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.forge-dialog__choices {
  display: grid;
  gap: 7px;
}

.forge-dialog__choice {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 200, 120, 0.16);
  border-radius: 8px;
  color: #fff7e7;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 11px;
  text-align: left;
  touch-action: manipulation;
}

.forge-dialog__choice:hover {
  background: rgba(255, 186, 92, 0.12);
  border-color: rgba(255, 186, 92, 0.4);
}

@media (max-width: 720px) {
  .forge-dialog {
    padding: 12px;
  }

  .forge-dialog__panel {
    align-items: stretch;
    grid-template-columns: 64px minmax(0, 1fr);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 14px;
  }

  .forge-dialog__portrait {
    height: 64px;
    width: 64px;
  }

  .forge-dialog__portrait-icon {
    height: 54px;
    width: 54px;
  }

  .forge-dialog__choices {
    grid-column: 1 / -1;
  }

  /* Enlarge close button to meet minimum 44px touch target */
  .forge-dialog__close {
    height: 44px;
    width: 44px;
  }

  /* Larger touch targets for dialog choices on mobile — minimum 44px height */
  .forge-dialog__choice {
    min-height: 44px;
    padding: 13px 11px;
  }
}

/* ── Start screen ────────────────────────────────────────────────── */

.forge-start {
  background:
    linear-gradient(145deg, rgba(26, 16, 10, 0.98) 0%, rgba(50, 32, 18, 0.94) 100%),
    radial-gradient(circle at 50% 0%, rgba(255, 186, 92, 0.18), transparent 68%);
  border: 1px solid rgba(255, 200, 120, 0.2);
  border-radius: 14px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 231, 180, 0.07);
  left: 50%;
  max-width: min(580px, calc(100vw - 36px));
  padding: 32px 28px;
  pointer-events: auto;
  position: absolute;
  text-align: center;
  top: 52%;
  transform: translate(-50%, -50%);
}

.forge-start.is-hidden {
  display: none;
}

.forge-start__badge {
  background: rgba(255, 186, 92, 0.12);
  border: 1px solid rgba(255, 186, 92, 0.3);
  border-radius: 999px;
  color: #c9ae7d;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  padding: 4px 12px;
  text-transform: uppercase;
}

.forge-start h2 {
  font-size: clamp(36px, 7vw, 64px);
  letter-spacing: -0.04em;
  line-height: 0.92;
  margin: 0 0 14px;
}

.forge-start p {
  color: #d7c8aa;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 auto 24px;
  max-width: 440px;
}

/* ── Responsive: tablet ──────────────────────────────────────────── */

@media (max-width: 920px) {
  .forge-hud__top {
    top: 100px;
    right: 18px;
  }

  .forge-minimap-panel {
    top: auto;
    bottom: 160px;
    right: 18px;
    width: 180px;
  }

  .forge-stats {
    gap: 5px;
  }

  .forge-stat {
    min-width: 52px;
    padding: 7px 8px;
  }

  .forge-quickbar {
    bottom: 148px;
  }
}

/* ── Nav-gone: HUD slides up after mobile nav hides during play ──── */
/* Body class fnp-nav-gone is added by JS when the nav slides off.  */
/* Transition matches site-nav transform 0.25s so they move together. */

@media (max-width: 640px) {
  .fnp-nav-gone .forge-hud__top {
    top: 18px;
  }
  .fnp-nav-gone .forge-menu-btn {
    top: 18px;
  }
  .fnp-nav-gone .forge-drawer {
    max-height: calc(100dvh - 176px); /* 100px top + 76px quickbar clearance */
    top: 100px;
  }
  .fnp-nav-gone .forge-toast {
    top: 90px;
  }
}

/* ── Responsive: mobile ──────────────────────────────────────────── */

@media (max-width: 640px) {
  .game-page .site-nav {
    position: fixed;
  }

  .forge-hud__top {
    gap: 8px;
    left: 10px;
    right: 10px;
    top: 52px;
    transition: top 0.25s ease;
  }

  .forge-location {
    font-size: 11px;
    padding: 8px 10px;
  }

  .forge-stat {
    min-width: 46px;
    padding: 6px 6px;
  }

  .forge-stat strong {
    font-size: 14px;
  }

  /* Allow horizontal scroll through stats on small screens instead of clipping */
  .forge-stats {
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .forge-stats::-webkit-scrollbar {
    display: none;
  }

  /* Minimap: visible but collapsed by default on touch (JS sets is-collapsed).    *
   * Positioned above the interact button on the right to avoid joystick zone.    */
  .forge-minimap-panel {
    bottom: 160px;
    right: 10px;
    top: auto;
    width: 160px;
  }

  .forge-minimap {
    height: 120px;
    width: 160px;
  }

  .forge-hud__top {
    right: 10px;   /* full width on mobile */
  }

  .forge-menu-btn {
    top: 136px;
    transition: top 0.25s ease;
  }

  .forge-quest {
    bottom: 118px;
    left: 10px;
    max-width: calc(100vw - 20px);
  }

  .forge-quest__controls {
    display: none;
  }

  /* Quickbar: single scrollable row so all 9 tools are reachable without    *
   * wrapping into the joystick capture zone at the bottom-left.            */
  .forge-quickbar {
    bottom: 12px;
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    max-width: calc(100vw - 20px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .forge-quickbar::-webkit-scrollbar {
    display: none;
  }

  /* E — Slim quickbar: 46px instead of 52px, tighter padding */
  .forge-quickbar {
    padding: 6px;
  }

  .forge-slot {
    flex: 0 0 46px;
    height: 46px;
  }

  /* Drag grip is useless on mobile (quickbar is fixed-position and scrollable) */
  .forge-quickbar__grip {
    display: none;
  }

  /* Drawer: use full width and cap height so it doesn't run under the quickbar */
  .forge-drawer {
    left: 10px;
    max-height: calc(100vh - 230px);
    max-height: calc(100dvh - 230px); /* 154px top + 76px quickbar clearance */
    right: 10px;
    top: 154px;
    transition: top 0.25s ease;
    width: auto;
  }
}

/* ── Very narrow screens (≤380px — e.g. iPhone SE) ──────────────── */

@media (max-width: 380px) {
  .forge-quickbar {
    gap: 3px;
  }

  .forge-slot {
    flex: 0 0 44px;
    font-size: 18px;
    height: 44px;
  }
}

/* ── Safe-area insets (notched phones) ───────────────────────────── */

@supports (bottom: env(safe-area-inset-bottom)) {
  .forge-quickbar {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Touch controls (virtual joystick + interact button) ─────────── */

.forge-touch-controls {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 14;
}

/* Zone covers the bottom-left area where the left thumb rests */
.forge-joystick-zone {
  bottom: 82px;
  height: 200px;
  left: 0;
  pointer-events: auto;
  position: absolute;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  width: 170px;
}

/* Base appears at the first touch point (opacity toggled by JS) */
.forge-joystick-base {
  background: rgba(255, 216, 145, 0.1);
  border: 2px solid rgba(255, 216, 145, 0.28);
  border-radius: 50%;
  height: 110px;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.1s;
  width: 110px;
}

.forge-joystick-knob {
  background: rgba(255, 159, 69, 0.72);
  border: 2px solid rgba(255, 216, 145, 0.82);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  height: 44px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
}

/* Circular interact button, right side above quickbar */
.forge-touch-interact {
  align-items: center;
  background: rgba(255, 159, 69, 0.82);
  border: 2px solid rgba(255, 216, 145, 0.5);
  border-radius: 50%;
  bottom: 90px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  color: #fff7e7;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 900;
  height: 64px;
  justify-content: center;
  line-height: 1;
  pointer-events: auto;
  position: absolute;
  right: 12px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  width: 64px;
}

.forge-touch-interact:active {
  background: rgba(255, 186, 92, 0.95);
  transform: scale(0.9);
}

/* Contextual label: smaller text + brighter border so the button reads as actionable */
.forge-touch-interact.is-labeled {
  border-color: rgba(255, 216, 145, 0.9);
  box-shadow: 0 4px 20px rgba(255, 200, 80, 0.35);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* Map toggle button — thumb-reachable shortcut to open/collapse the minimap */
.forge-touch-map {
  align-items: center;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 200, 120, 0.22);
  border-radius: 50%;
  bottom: 166px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color: #c9ae7d;
  cursor: pointer;
  display: flex;
  font-size: 1.1rem;
  height: 44px;
  justify-content: center;
  pointer-events: auto;
  position: absolute;
  right: 20px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  width: 44px;
}

.forge-touch-map:active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  transform: scale(0.9);
}

/* ── Quick panel shortcut buttons (Inventory / Skills) on touch ──── */
.forge-touch-quick {
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 200, 120, 0.18);
  border-radius: 50%;
  bottom: 166px;   /* default; overridden per-modifier below */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  color: #c9ae7d;
  cursor: pointer;
  display: flex;
  font-size: 0.9rem;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  pointer-events: auto;
  position: absolute;
  right: 72px;     /* left of the E/map column */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  width: 40px;
}

.forge-touch-quick--inv    { bottom: 90px; }
.forge-touch-quick--skills { bottom: 138px; }

.forge-touch-quick:active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  transform: scale(0.9);
}

@supports (bottom: env(safe-area-inset-bottom)) {
  .forge-joystick-zone {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .forge-touch-interact {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  .forge-touch-map {
    bottom: calc(166px + env(safe-area-inset-bottom, 0px));
  }

  .forge-touch-quick--inv {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  .forge-touch-quick--skills {
    bottom: calc(138px + env(safe-area-inset-bottom, 0px));
  }

  @media (max-width: 640px) {
    .forge-minimap-panel {
      bottom: calc(160px + env(safe-area-inset-bottom, 0px));
    }
  }
}

/* ── Portrait lock overlay ─────────────────────────────────────────── */

.forge-rotate-overlay {
  align-items: center;
  background: var(--bg);
  display: none;
  flex-direction: column;
  gap: 20px;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  text-align: center;
  z-index: 9999;
}

.forge-rotate-overlay__icon {
  animation: rotate-hint 2s ease-in-out infinite;
  font-size: 3.5rem;
}

.forge-rotate-overlay__text {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0;
}

@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  50%       { transform: rotate(90deg); }
}

/* Only block portrait on narrow phones — tablets (≥768px) have enough width to play */
@media (orientation: portrait) and (hover: none) and (pointer: coarse) and (max-width: 767px) {
  .game-page .forge-rotate-overlay {
    display: flex;
  }
}

/* ── Landscape phones (portrait-locked game, tall-screen excluded) ── */

@media (max-height: 440px) and (orientation: landscape) {
  .forge-hud__top {
    gap: 6px;
    left: 10px;
    right: 10px;
    top: 64px;
  }

  .forge-location {
    font-size: 10px;
    padding: 5px 8px;
  }

  .forge-stat {
    min-width: 40px;
    padding: 4px 5px;
  }

  .forge-stat strong {
    font-size: 13px;
  }

  .forge-menu-btn {
    top: 64px;
  }

  .forge-quest {
    bottom: 84px;
    left: 10px;
    max-width: calc(55vw - 20px);
  }

  .forge-quickbar {
    bottom: 4px;
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .forge-slot {
    flex: 0 0 46px;
    font-size: 18px;
    height: 46px;
  }

  .forge-joystick-zone {
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    height: 150px;
    width: 150px;
  }

  .forge-joystick-base {
    height: 90px;
    width: 90px;
  }

  .forge-touch-interact {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    font-size: 1.1rem;
    height: 56px;
    right: 14px;
    width: 56px;
  }

  .forge-touch-interact.is-labeled {
    font-size: 0.7rem;
  }

  /* Map button must sit above the (56px+56px=112px) interact button with a gap */
  .forge-touch-map {
    bottom: calc(124px + env(safe-area-inset-bottom, 0px));
    height: 40px;
    right: 18px;
    width: 40px;
  }

  /* Quick panel buttons in landscape: smaller, sit at same level as interact / map */
  .forge-touch-quick {
    height: 36px;
    width: 36px;
    font-size: 0.8rem;
    right: 76px;
  }

  .forge-touch-quick--inv {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  .forge-touch-quick--skills {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
}

@supports (bottom: env(safe-area-inset-bottom)) {
  @media (max-height: 440px) and (orientation: landscape) {
    .forge-quickbar {
      bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    }
  }
}

/* Drawer on landscape phones: start below the compact HUD, leave quickbar clearance.
   Quickbar top edge ≈ 62px from bottom in this layout; top is 118px.
   Max safe height = dvh - 118 (top) - 70 (bottom clearance) = dvh - 188. */
@media (max-height: 440px) and (orientation: landscape) {
  .forge-drawer {
    max-height: calc(100vh - 188px);
    max-height: calc(100dvh - 188px);
    top: 118px;
  }
}

/* ── Editor page ─────────────────────────────────────────────────── */

.editor-page {
  background: #0d0d0d;
  overflow: hidden;
}

.editor-page .site-nav {
  position: relative;
}

.editor-layout {
  display: flex;
  height: calc(100vh - 58px);
  overflow: hidden;
}

.editor-sidebar {
  background: #111827;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  width: 240px;
  flex-shrink: 0;
}

.editor-sidebar__section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px;
}

.editor-label {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.editor-map-btns,
.editor-tool-btns {
  display: grid;
  gap: 5px;
  grid-template-columns: 1fr 1fr;
}

.editor-map-btn,
.editor-tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 6px;
  text-align: center;
  transition: background 0.1s, border-color 0.1s;
}

.editor-map-btn:hover,
.editor-tool-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.editor-map-btn.is-active,
.editor-tool-btn.is-active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--accent);
}

.editor-palette {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-palette-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.editor-palette-header {
  color: #5a6878;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.editor-object-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 7px 10px;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
}

.editor-object-btn:hover {
  background: rgba(255, 186, 92, 0.1);
  border-color: rgba(255, 186, 92, 0.3);
}

.editor-object-btn.is-active {
  background: rgba(255, 186, 92, 0.15);
  border-color: rgba(255, 186, 92, 0.5);
  color: #ffd891;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.editor-field label {
  color: #7a8898;
  font-size: 11px;
}

.editor-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  padding: 8px 10px;
}

.editor-input:focus {
  border-color: var(--accent);
}

.editor-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 10px;
  text-align: left;
  transition: background 0.1s;
}

.editor-action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.editor-action-btn--primary {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent);
}

.editor-action-btn--primary:hover {
  background: rgba(56, 189, 248, 0.22);
}

.editor-action-btn--danger {
  border-color: rgba(248, 113, 113, 0.2);
  color: var(--danger);
}

.editor-action-btn--danger:hover {
  background: rgba(248, 113, 113, 0.08);
}

.editor-textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #7a8898;
  font: inherit;
  font-size: 11px;
  min-height: 72px;
  outline: none;
  padding: 8px;
  resize: vertical;
}

.editor-textarea:focus {
  border-color: var(--accent);
  color: var(--text);
}

.editor-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.editor-toolbar {
  align-items: center;
  background: #0f1623;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-shrink: 0;
  gap: 16px;
  padding: 8px 16px;
}

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

.editor-toolbar__coords {
  color: #4a5568;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.editor-toolbar-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 9px;
  transition: background 0.1s;
}

.editor-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.editor-toolbar-label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 5px;
}

.editor-canvas {
  cursor: crosshair;
  display: block;
  flex: 1;
  image-rendering: pixelated;
}

/* ── Terrain palette ──────────────────────────────────────────────── */

.editor-brush-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.editor-brush-slider {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  cursor: pointer;
  flex: 1;
  height: 6px;
  outline: none;
}

.editor-brush-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: var(--accent);
  border-radius: 50%;
  height: 16px;
  width: 16px;
}

.editor-brush-slider::-moz-range-thumb {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  height: 16px;
  width: 16px;
}

.editor-brush-label {
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 42px;
  text-align: right;
}

.editor-terrain-section {
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-top: 6px;
  padding: 5px 8px;
  text-transform: uppercase;
}

.editor-terrain-section:first-child {
  margin-top: 0;
}

.editor-terrain-section--usable {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.editor-terrain-section--static {
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.editor-terrain-palette {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 2px;
}

.editor-terrain-palette::-webkit-scrollbar {
  width: 4px;
}

.editor-terrain-palette::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

.editor-terrain-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.editor-terrain-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 11px;
  gap: 7px;
  overflow: hidden;
  padding: 5px 7px;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
  white-space: nowrap;
}

.editor-terrain-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.editor-terrain-btn.is-active {
  background: rgba(255, 186, 92, 0.14);
  border-color: rgba(255, 186, 92, 0.45);
  color: #ffd891;
}

.editor-terrain-swatch {
  border-radius: 3px;
  flex-shrink: 0;
  height: 14px;
  outline: 1px solid rgba(255, 255, 255, 0.15);
  width: 14px;
}

.editor-terrain-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Object appearance panel ──────────────────────────────────────── */

.editor-vis-divider {
  background: rgba(255, 255, 255, 0.06);
  height: 1px;
  margin: 4px 0 8px;
}

.editor-vis-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.editor-color-input {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
  height: 28px;
  padding: 2px 3px;
  width: 44px;
}

.editor-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.editor-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

.editor-vis-meta {
  color: var(--accent);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 46px;
}

.editor-vis-hint {
  color: #3a4a58;
  font-size: 10px;
}

.editor-own-chip {
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  vertical-align: middle;
}

.editor-own-chip--ownable {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.editor-own-chip--buyable {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.editor-own-chip--not_ownable {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

/* ── Building panel ───────────────────────────────────────────────── */

.editor-house-btn {
  align-items: center;
  background: rgba(122, 75, 45, 0.08);
  border: 1px solid rgba(122, 75, 45, 0.25);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 12px;
  gap: 7px;
  padding: 7px 10px;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
}

.editor-house-btn:hover {
  background: rgba(168, 65, 39, 0.15);
  border-color: rgba(168, 65, 39, 0.4);
}

.editor-house-btn.is-active {
  background: rgba(168, 65, 39, 0.22);
  border-color: rgba(255, 186, 92, 0.5);
  color: #ffd891;
}

.editor-fence-style-btn {
  background: rgba(91, 53, 31, 0.1);
  border: 1px solid rgba(91, 53, 31, 0.25);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  padding: 7px 8px;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
  width: 100%;
  margin-bottom: 4px;
}

.editor-fence-style-btn:hover {
  background: rgba(91, 53, 31, 0.2);
  border-color: rgba(255, 186, 92, 0.3);
}

.editor-fence-style-btn.is-active {
  background: rgba(91, 53, 31, 0.28);
  border-color: rgba(255, 186, 92, 0.5);
  color: #ffd891;
}

.editor-bld-style-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.editor-bld-style-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 11px;
  gap: 8px;
  padding: 6px 8px;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
}

.editor-bld-style-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.editor-bld-style-btn.is-active {
  background: rgba(255, 186, 92, 0.14);
  border-color: rgba(255, 186, 92, 0.45);
  color: #ffd891;
}

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

.editor-bld-own-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  padding: 6px 4px;
  text-align: center;
  transition: background 0.1s;
}

.editor-bld-own-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.editor-bld-own-btn.is-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.55);
  color: var(--accent);
}

.editor-lvl-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.editor-lvl-list::-webkit-scrollbar { width: 4px; }
.editor-lvl-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.editor-lvl-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.editor-lvl-hdr {
  align-items: center;
  display: flex;
  gap: 6px;
}

.editor-lvl-num {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex: 1;
}

.editor-lvl-base {
  color: #3a4a58;
  font-size: 10px;
  font-style: italic;
}

.editor-lvl-del {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 4px;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 6px;
}

.editor-lvl-label {
  font-size: 11px;
  padding: 5px 8px;
}

.editor-lvl-reqs {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.editor-req-row {
  align-items: center;
  display: flex;
  gap: 6px;
}

.editor-req-icon {
  font-size: 13px;
  min-width: 18px;
  text-align: center;
}

.editor-req-input {
  flex: 1;
  font-size: 11px;
  padding: 4px 6px;
}

/* ── Draft / Live slot panel ──────────────────────────────────────────── */

.editor-slot-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.editor-slot-badge {
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 8px;
}

.slot--draft   { background: rgba(251, 191,  36, 0.14); border: 1px solid rgba(251, 191,  36, 0.4); color: #fbbf24; }
.slot--live    { background: rgba( 74, 222, 128, 0.14); border: 1px solid rgba( 74, 222, 128, 0.4); color: #4ade80; }
.slot--loading { background: rgba(148, 163, 184, 0.08); border: 1px solid rgba(148, 163, 184, 0.2); color: #94a3b8; }
.slot--empty   { background: rgba(148, 163, 184, 0.08); border: 1px solid rgba(148, 163, 184, 0.2); color: #4a5568; }

.editor-slot-panel {
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.editor-slot-panel--draft {
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.15);
}

.editor-slot-panel--live {
  background: rgba(74, 222, 128, 0.04);
  border: 1px solid rgba(74, 222, 128, 0.12);
}

.editor-slot-panel__label {
  color: #5a6878;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.editor-slot-hint {
  color: #3a4a58;
  font-size: 10px;
  margin: 0;
}

.editor-slot-divider-line {
  background: rgba(255, 255, 255, 0.06);
  height: 1px;
  margin: 6px 0;
}

.editor-action-btn--publish {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.35);
  color: #4ade80;
}

.editor-action-btn--publish:hover {
  background: rgba(74, 222, 128, 0.18);
  border-color: rgba(74, 222, 128, 0.55);
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  gap: 20px 40px;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand__name {
  font-weight: 700;
  font-size: 0.95rem;
}

.footer-brand__tagline {
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.footer-link {
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 4px 8px;
  transition: color 0.14s;
}

.footer-link:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-link--button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.8rem;
  grid-column: 1 / -1;
  margin: 0;
}

.cookie-consent {
  align-items: center;
  background: #1a2a44;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  bottom: 18px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.3);
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr auto;
  left: 50%;
  max-width: min(860px, calc(100vw - 24px));
  padding: 14px 18px;
  position: fixed;
  transform: translateX(-50%);
  width: 100%;
  z-index: 1200;
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent__link {
  color: var(--accent);
}
.cookie-consent__link:hover {
  text-decoration: underline;
}

/* ── Manage panel (spans full banner width) ─────────────────────────────── */

.cookie-manage-panel {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0;
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 12px;
}

.cookie-manage-panel[hidden] {
  display: none;
}

.cookie-manage-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ── Cookie category row ────────────────────────────────────────────────── */

.cookie-category {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 0;
}

.cookie-category:first-child {
  border-top: none;
}

.cookie-category__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cookie-category__info strong {
  color: var(--text);
  font-size: 0.85rem;
}

.cookie-category__info span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.cookie-always-on {
  color: var(--success, #4ade80);
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── Toggle switch ──────────────────────────────────────────────────────── */

.cookie-toggle-label {
  cursor: pointer;
  display: inline-block;
  flex-shrink: 0;
  height: 22px;
  position: relative;
  width: 40px;
}

.cookie-toggle-input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}

.cookie-toggle-slider {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 22px;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: background 0.2s;
}

.cookie-toggle-slider::before {
  background: #fff;
  border-radius: 50%;
  bottom: 3px;
  content: '';
  height: 16px;
  left: 3px;
  position: absolute;
  transition: transform 0.2s;
  width: 16px;
}

.cookie-toggle-input:checked + .cookie-toggle-slider {
  background: var(--accent, #38bdf8);
}

.cookie-toggle-input:checked + .cookie-toggle-slider::before {
  transform: translateX(18px);
}

.cookie-toggle-input:focus-visible + .cookie-toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Privacy page inline settings card ─────────────────────────────────── */

.cookie-settings-card {
  margin-top: 24px;
}

.cookie-settings-card__title {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.cookie-settings-card__intro {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.cookie-settings-card__status {
  color: var(--success, #4ade80);
  font-size: 0.85rem;
  min-height: 1.4em;
  margin-top: 8px;
}

.cookie-settings-card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.cookie-consent__copy {
  display: grid;
  gap: 4px;
}

.cookie-consent__copy strong {
  color: var(--text);
  font-size: 0.95rem;
}

.cookie-consent__copy p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.cookie-consent__actions .btn--ghost {
  border-color: rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}

.cookie-consent__actions .btn--ghost:hover {
  border-color: rgba(148, 163, 184, 0.7);
  color: #f1f5f9;
}

@media (max-width: 720px) {
  .cookie-consent {
    bottom: 10px;
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }

  .cookie-consent__actions {
    justify-content: stretch;
  }

  .cookie-consent__actions .btn {
    flex: 1 1 120px;
    text-align: center;
  }
}

/* ── Inner page layout ────────────────────────────────────────────────── */
.inner-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.page-header {
  margin-bottom: 48px;
  max-width: 680px;
}

.page-header--center {
  max-width: 100%;
  text-align: center;
}

.page-eyebrow {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.page-title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 16px;
}

.page-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0;
}

/* ── Tag / Badge ─────────────────────────────────────────────────────── */
.tag {
  border-radius: 99px;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  text-transform: uppercase;
}

.tag--blue  { background: rgba(56,189,248,0.14);  color: var(--accent); }
.tag--green { background: rgba(74,222,128,0.14);  color: var(--success); }
.tag--amber { background: rgba(251,191,36,0.14);  color: #fbbf24; }
.tag--red   { background: rgba(248,113,113,0.14); color: var(--danger); }
.tag--muted { background: rgba(148,163,184,0.14); color: var(--muted); }

/* ── News page ───────────────────────────────────────────────────────── */

/* Public filter bar */
.pub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.pub-filter-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 6px;
  padding: 6px 14px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pub-filter-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--fg);
}

.pub-filter-btn.is-active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.3);
  color: var(--fg);
}

.pub-filter-btn__count {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 1px 7px;
}

.pub-filter-btn .tag { pointer-events: none; }

/* News list wrapper */
.news-list {
  display: grid;
  gap: 20px;
}

/* Featured card — newest post */
.news-card--featured {
  border-color: rgba(56,189,248,0.22);
  background: rgba(17, 28, 49, 0.95);
}

.news-card--featured .news-card__title {
  font-size: 1.5rem;
}

.tag--latest {
  background: rgba(56,189,248,0.18);
  color: var(--accent);
}

/* No-results message */
.news-empty {
  color: var(--muted);
}

.news-no-results {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 40px 0;
  text-align: center;
}

.news-no-results__clear {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

.news-grid {
  display: grid;
  gap: 20px;
}

.news-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  padding: 24px 28px;
  transition: border-color 0.18s;
}

.news-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.news-card__meta {
  align-items: center;
  display: flex;
  gap: 10px;
}

.news-card__date {
  color: var(--muted);
  font-size: 0.82rem;
}

.news-card__title {
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.news-card__excerpt {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.news-card__body {
  border-top: 1px solid var(--line);
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-top: 6px;
  padding-top: 16px;
}

.news-card__body p { margin: 0 0 10px; }
.news-card__body ul { margin: 0 0 10px; padding-left: 20px; }

/* ── News admin — filter bar ─────────────────────────────────────────── */
.news-list-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.news-filter-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.news-filter-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--fg);
}

.news-filter-btn.is-active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.3);
  color: var(--fg);
}

.news-filter-btn .tag {
  pointer-events: none;
}

.news-filter-count {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.td--title {
  font-weight: 600;
  max-width: 320px;
}

.td--empty {
  color: var(--muted);
  padding: 32px !important;
  text-align: center;
}

/* ── News admin — edit + preview layout ──────────────────────────────── */
.admin-page--wide {
  max-width: 1340px;
}

.news-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: 28px;
  align-items: start;
}

.news-edit-pane { }

/* Mobile tab strip — hidden on wide screens */
.news-edit-tabs {
  display: none;
  gap: 4px;
  margin-bottom: 18px;
}

.news-edit-tab {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  flex: 1;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 9px 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.news-edit-tab.is-active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.28);
  color: var(--fg);
}

/* Preview pane */
.news-preview-pane {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.news-preview-header__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.news-preview-header__title span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-preview-header__title small {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
}

/* Viewport toggle buttons */
.news-preview-viewports {
  display: flex;
  gap: 4px;
}

.news-vp-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  height: 30px;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  width: 34px;
}

.news-vp-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--fg);
}

.news-vp-btn.is-active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.28);
  color: var(--fg);
}

/* Preview wrap — switches between full-width and phone-width */
.news-preview-wrap {
  transition: max-width 0.25s ease;
}

.news-preview-wrap.is-mobile {
  max-width: 375px;
  margin: 0 auto;
}

.news-preview-card {
  /* inherits .news-card styles — no extra style needed */
}

/* Field row: two inputs side by side */
.admin-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Responsive: collapse to tabs on small screens ──────────── */
@media (max-width: 920px) {
  .news-edit-layout {
    grid-template-columns: 1fr;
  }

  .news-edit-tabs {
    display: flex;
  }

  .news-preview-pane {
    position: static;
    max-height: none;
  }
}

/* ── Leaderboard ─────────────────────────────────────────────────────── */
.lb-empty {
  color: var(--muted);
  padding: 40px 0;
}

.lb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.lb-table-wrap {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.lb-table-wrap--full {
  grid-column: 1 / -1;
}

.lb-table-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.lb-table-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 3px;
}

.lb-table-sub {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

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

.lb-table thead tr {
  border-bottom: 1px solid var(--line);
}

.lb-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 10px 16px;
  text-align: left;
  text-transform: uppercase;
}

.lb-th--num  { text-align: right; }
.lb-th--rank { width: 42px; text-align: center; }

.lb-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}

.lb-table tbody tr:last-child { border-bottom: none; }

.lb-table tbody tr:hover {
  background: rgba(255,255,255,0.04);
}

.lb-row--top {
  background: rgba(200,169,90,0.05);
}

.lb-table td {
  font-size: 0.9rem;
  padding: 11px 16px;
}

.lb-td--rank {
  font-size: 1rem;
  text-align: center;
  width: 42px;
}

.lb-td--name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-td--num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.lb-td--gold {
  color: var(--gold, #c8a95a);
  font-weight: 600;
}

.lb-td--muted {
  color: var(--muted);
  font-size: 0.8rem;
}

.lb-map {
  font-size: 0.9rem;
  opacity: 0.7;
}

.lb-generated {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 20px;
  text-align: right;
}

.lb-th--hide-mobile,
.lb-td--hide-mobile { }

@media (max-width: 760px) {
  .lb-grid {
    grid-template-columns: 1fr;
  }
  .lb-table-wrap--full {
    grid-column: 1;
  }
  .lb-th--hide-mobile,
  .lb-td--hide-mobile {
    display: none;
  }
}

/* ── Shop page ───────────────────────────────────────────────────────── */
.shop-section {
  margin-bottom: 56px;
}

.shop-section--subscribe {
  margin-bottom: 34px;
}

.shop-subscribe {
  align-items: center;
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: var(--radius);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  padding: 24px;
}

.shop-subscribe__copy {
  min-width: 0;
}

.shop-subscribe__button {
  min-height: 92px;
}

.shop-subscribe__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shop-subscribe__status {
  color: var(--success);
  font-size: 0.82rem;
  margin: 10px 0 0;
}

.shop-subscribe__status--error {
  color: #f87171;
}

.shop-section__title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.shop-section__desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.shop-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.shop-item {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  transition: border-color 0.18s;
}

.shop-item:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.shop-item--rare {
  border-color: rgba(251, 191, 36, 0.28);
}

.shop-item--rare:hover {
  border-color: rgba(251, 191, 36, 0.55);
}

.shop-item__icon {
  font-size: 28px;
  line-height: 1;
}

.shop-item__name {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0;
}

.shop-item__desc {
  color: var(--muted);
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0;
}

.shop-item__footer {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 4px;
}

.shop-item__price {
  font-size: 0.92rem;
  font-weight: 700;
}

.shop-item__price--gold { color: #fbbf24; }
.shop-item__price--rare { color: var(--accent); }
.shop-item__price--free { color: var(--success); }

.shop-coming-soon {
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  font-size: 0.9rem;
  gap: 10px;
  padding: 20px 24px;
}

.shop-subscribe__status--active {
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 600;
}

.shop-upgrades {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.shop-upgrade-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.15s;
}

.shop-upgrade-card:hover {
  border-color: rgba(148, 163, 184, 0.45);
}

.shop-upgrade-card--maxed {
  opacity: 0.55;
}

.shop-upgrade-card--bought {
  border-color: var(--success);
}

.shop-upgrade-card__icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.shop-upgrade-card__body {
  flex: 1;
  min-width: 0;
}

.shop-upgrade-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.shop-upgrade-card__desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.shop-upgrade-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shop-upgrade-card__cost {
  font-size: 0.85rem;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.shop-upgrade-card__cost--maxed {
  color: var(--muted);
  font-size: 0.82rem;
}

.shop-upgrade-card__cost--strike {
  text-decoration: line-through;
  color: var(--muted);
  font-size: 0.78rem;
}

.shop-upgrade-card__quality {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  text-transform: capitalize;
}

.shop-upgrade-card__action {
  flex-shrink: 0;
  align-self: center;
}

.shop-result {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.shop-result--ok {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--success);
}

.shop-result--err {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
}

.shop-upgrade-card__discount-badge {
  background: rgba(74, 222, 128, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 4px;
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 5px;
}

.shop-upgrade-card__sub-tease {
  color: var(--accent);
  font-size: 0.76rem;
}

@media (max-width: 720px) {
  .shop-subscribe {
    grid-template-columns: 1fr;
  }
  .shop-upgrades {
    grid-template-columns: 1fr;
  }
}

/* ── Admin Discount Editor ───────────────────────────────────────────── */
.admin-section__desc {
  color: var(--muted);
  font-size: 0.88rem;
  margin: -6px 0 14px;
  line-height: 1.55;
}

.form-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.discount-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
}

.discount-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}

.discount-card--active {
  border-color: rgba(74, 222, 128, 0.4);
}

.discount-card--scheduled {
  border-color: rgba(251, 191, 36, 0.4);
}

.discount-card--expired {
  border-color: rgba(248, 113, 113, 0.35);
  opacity: 0.7;
}

.discount-card__head {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  padding: 10px 14px;
}

.discount-card__badge {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.discount-card__status-dot {
  border-radius: 50%;
  flex-shrink: 0;
  height: 8px;
  width: 8px;
}

.dot--green  { background: var(--success); box-shadow: 0 0 6px rgba(74, 222, 128, 0.55); }
.dot--amber  { background: #fbbf24;        box-shadow: 0 0 6px rgba(251, 191, 36, 0.45); }
.dot--muted  { background: var(--line);    }

.discount-card__status-label {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
  padding: 6px 14px 0;
  min-height: 22px;
}

.discount-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.discount-percent-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.discount-percent-input {
  align-items: center;
  display: flex;
  gap: 8px;
}

.discount-percent-input__num {
  max-width: 72px !important;
  text-align: right;
}

.discount-percent-input__unit {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.discount-window {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discount-window__row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.discount-window__label {
  font-size: 0.8rem !important;
  margin-bottom: 0 !important;
}

.discount-window__input {
  font-size: 0.83rem !important;
  padding: 5px 8px !important;
}

.discount-window__hint {
  color: var(--muted);
  font-size: 0.73rem;
}

/* Discount pills in admin table */
.discount-pill {
  border-radius: 4px;
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  margin-right: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.discount-pill--sub {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.discount-pill--pub {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: var(--success);
}

.discount-pill--off {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: line-through;
}

/* "Web shop" badge in NPC column */
.status-badge--blue {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}

@media (max-width: 900px) {
  .discount-editor {
    grid-template-columns: 1fr;
  }
}

/* ── Settings page ───────────────────────────────────────────────────── */
.settings-page {
  display: grid;
  gap: 32px;
  max-width: 700px;
  margin: 0 auto;
  padding: 52px 24px 80px;
}

.settings-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
}

.settings-card--danger {
  border-color: rgba(248, 113, 113, 0.28);
}

.settings-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.settings-card__sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 20px;
}

.settings-card__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── About page ──────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 40px;
}

.about-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.about-card__icon {
  font-size: 26px;
  margin-bottom: 12px;
}

.about-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.about-card__desc {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

.how-to-play {
  counter-reset: step;
  display: grid;
  gap: 16px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.how-to-play__item {
  align-items: flex-start;
  counter-increment: step;
  display: flex;
  gap: 16px;
}

.how-to-play__num {
  align-items: center;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 50%;
  color: var(--accent);
  display: flex;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.how-to-play__num::before { content: counter(step); }

.how-to-play__text {
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.6;
  padding-top: 4px;
}

.map-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.map-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.map-card__name {
  font-weight: 700;
  margin: 0 0 4px;
}

.map-card__desc {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ── Contact page ────────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr 360px;
}

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

.contact-form-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
}

.contact-form-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.contact-form-card__header {
  margin-bottom: 22px;
}

.contact-form-card__eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.contact-form-card__intro {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 8px 0 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-message-group {
  gap: 9px;
}

.contact-message-input {
  min-height: 210px;
  resize: vertical;
}

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

@media (max-width: 640px) {
  .contact-details-grid {
    grid-template-columns: 1fr;
  }
}

.contact-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-info-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.contact-info-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 14px;
}

.contact-method {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.contact-method__icon {
  align-items: center;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 6px;
  color: var(--accent);
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  min-width: 38px;
  padding: 0 6px;
}
.contact-method__label { color: var(--muted); font-size: 0.82rem; }
.contact-method__value { font-size: 0.9rem; font-weight: 600; }

.contact-sidebar__text,
.section-intro,
.prose-text {
  color: var(--muted);
  line-height: 1.7;
}

.contact-sidebar__text {
  font-size: 0.9rem;
  margin: 0 0 16px;
}

.contact-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-faq-section {
  margin-top: 56px;
}

.contact-faq-section__title {
  font-size: 1.3rem;
  margin: 0 0 6px;
}

.contact-faq-section__intro {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.legal-admin-textarea {
  min-height: 420px;
  resize: vertical;
}

.content-section-public {
  margin-bottom: 56px;
}

.content-section-public h2 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.section-intro {
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.prose-text {
  max-width: 760px;
}

.prose-text p {
  margin: 0 0 14px;
}

.imprint-body .imprint-section {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 20px;
}

.imprint-body .imprint-section:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.imprint-body h2 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.imprint-body address {
  font-style: normal;
  line-height: 1.7;
}

.page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.cms-admin-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.cms-admin-kpis span {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 8px 12px;
}

.cms-admin-kpis strong {
  color: var(--text);
  font-weight: 800;
}

.cms-admin-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 320px 1fr;
}

.cms-sidebar,
.cms-workspace {
  display: grid;
  gap: 18px;
}

.cms-sidebar {
  position: sticky;
  top: 86px;
}

.cms-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 420px;
  overflow: auto;
}

.cms-list__item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  color: var(--text);
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.cms-list__item:hover,
.cms-list__item.is-active {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.5);
  text-decoration: none;
}

.cms-list__item:hover {
  transform: translateY(-1px);
}

.cms-list__item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.cms-list__item em {
  justify-self: start;
}

.cms-create-form,
.cms-assign-form {
  display: grid;
  gap: 10px;
}

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

.cms-subhead {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 12px;
}

.cms-subhead .admin-section__title {
  margin-bottom: 4px;
}

.cms-subhead__meta {
  background: rgba(200, 169, 90, 0.1);
  border: 1px solid rgba(200, 169, 90, 0.22);
  border-radius: 999px;
  color: var(--gold, #c8a95a);
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 6px 10px;
}

.cms-form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
}

.cms-form-grid__full {
  grid-column: 1 / -1;
}

.cms-section-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.cms-section-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto auto;
  padding: 12px;
}

.cms-section-row span,
.cms-usage {
  color: var(--muted);
  font-size: 0.84rem;
}

.cms-section-row__form {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 78px 120px auto auto;
}

.cms-field-row,
.cms-item-row {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.cms-item-row {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  grid-template-columns: minmax(140px, 0.7fr) minmax(120px, 0.6fr) minmax(220px, 1.4fr);
  padding: 12px;
}

.cms-item-row label {
  display: grid;
  gap: 6px;
}

.cms-item-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cms-usage {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: var(--radius);
  line-height: 1.6;
  padding: 10px 12px;
}

.cms-usage a {
  margin-left: 8px;
}

.cms-preview {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 20px;
}

.cms-preview__frame {
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.92), rgba(15, 23, 42, 0.74));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 26px;
}

.cms-preview__frame .cms-block:last-child {
  margin-bottom: 0;
}

.cms-block {
  margin-bottom: 32px;
}

.cms-block__title {
  font-size: 1.25rem;
  margin: 0 0 16px;
}

.landing .cms-block--hero {
  max-width: 820px;
}

.landing .cms-block--hero .page-title {
  font-size: clamp(2.4rem, 8vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.cms-hero-items,
.cms-inline-items {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.cms-hero-item,
.cms-inline-item {
  background: rgba(17, 28, 49, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) - 2px);
  padding: 14px 16px;
}

.cms-hero-item__title,
.cms-inline-item h3 {
  color: var(--text);
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.cms-hero-item p,
.cms-inline-item p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.guide-chapter-list {
  display: grid;
  gap: 16px;
  max-width: 860px;
}

.guide-chapter {
  align-items: flex-start;
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 16px;
  padding: 20px;
}

.guide-chapter__num {
  align-items: center;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 50%;
  color: var(--accent);
  display: flex;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.guide-chapter h2 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.guide-chapter p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-question {
  background: rgba(17, 28, 49, 0.82);
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 18px;
  text-align: left;
  width: 100%;
}

.faq-question:hover { background: rgba(255,255,255,0.04); }

.faq-question__chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item.is-open .faq-question__chevron { transform: rotate(180deg); }

.faq-answer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: none;
  font-size: 0.9rem;
  line-height: 1.65;
  padding: 14px 18px;
}

.faq-item.is-open .faq-answer { display: block; }

/* ── Forge & Pray — Agreement & Login Gate Modals ─────────────────────── */
.fnp-modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 1100;
}

.fnp-modal__panel {
  background: #1a1410;
  border: 1px solid rgba(255, 216, 145, 0.18);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  max-width: 440px;
  padding: 40px 36px 32px;
  text-align: center;
  width: 100%;
}

.fnp-modal__icon {
  font-size: 40px;
  margin-bottom: 14px;
}

.fnp-modal__title {
  color: #ffd891;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
}

.fnp-modal__body {
  color: rgba(255, 255, 255, 0.70);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 16px;
}

.fnp-modal__body a {
  color: #ffd891;
}

.fnp-modal__note {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 24px;
  padding: 10px 14px;
}

.fnp-modal__note a {
  color: #ffd891;
}

.fnp-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.fnp-modal__dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.32);
  cursor: pointer;
  display: block;
  font-size: 13px;
  margin: 14px auto 0;
  padding: 4px;
  text-decoration: underline;
}

.fnp-modal__dismiss:hover {
  color: rgba(255, 255, 255, 0.54);
}

.fnp-modal__footer-links {
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  margin: 16px 0 0;
}

.fnp-modal__footer-links a {
  color: #ffd891;
}

/* Ghost button used in modals */
.forge-btn-ghost {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(255, 216, 145, 0.35);
  border-radius: 8px;
  color: #ffd891;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  justify-content: center;
  padding: 10px 22px;
  text-decoration: none;
  transition: background 0.15s;
}

.forge-btn-ghost:hover {
  background: rgba(255, 216, 145, 0.08);
}

/* Demo badge shown next to location label in HUD */
.fnp-demo-badge {
  background: rgba(226, 75, 74, 0.18);
  border: 1px solid rgba(226, 75, 74, 0.40);
  border-radius: 99px;
  color: #e24b4a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  text-transform: uppercase;
}

/* "Create a free account" note on the start screen */
.forge-start__note {
  color: rgba(255, 255, 255, 0.40);
  font-size: 13px;
  margin-top: 12px;
}

.forge-start__note a {
  color: #ffd891;
}

/* -- High-end CMS command center --------------------------------------- */
.cms-command {
  max-width: 1480px;
  padding-top: 28px;
}

.cms-command::before {
  background:
    radial-gradient(circle at 16% 0%, rgba(200, 169, 90, 0.16), transparent 30rem),
    radial-gradient(circle at 84% 2%, rgba(56, 189, 248, 0.1), transparent 26rem);
  content: "";
  height: 520px;
  inset: 0 0 auto;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

.cms-command-hero {
  align-items: end;
  background:
    linear-gradient(135deg, rgba(20, 30, 49, 0.94), rgba(11, 17, 30, 0.9)),
    radial-gradient(circle at 88% 20%, rgba(200, 169, 90, 0.22), transparent 20rem);
  border: 1px solid rgba(226, 232, 240, 0.13);
  border-radius: 10px;
  box-shadow: 0 28px 88px rgba(2, 6, 23, 0.36);
  display: flex;
  gap: 26px;
  justify-content: space-between;
  margin-bottom: 18px;
  overflow: hidden;
  padding: 30px;
  position: relative;
}

.cms-command-hero::after {
  background: linear-gradient(180deg, rgba(200, 169, 90, 0.85), rgba(56, 189, 248, 0.42));
  content: "";
  height: 78%;
  opacity: 0.6;
  position: absolute;
  right: 0;
  top: 11%;
  width: 3px;
}

.cms-command-hero h1 {
  color: #fff7ed;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 0.96;
  margin: 0 0 14px;
  max-width: 760px;
}

.cms-command-hero p:not(.admin-eyebrow) {
  color: #b7c2d3;
  line-height: 1.65;
  margin: 0;
  max-width: 760px;
}

.cms-command-hero__actions,
.block-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cms-command .btn--primary {
  background: linear-gradient(135deg, #f5c76b, #c8a95a);
  border-color: rgba(255, 236, 179, 0.35);
  box-shadow: 0 18px 38px rgba(200, 169, 90, 0.2);
  color: #17100a;
}

.cms-command .btn--primary:hover {
  color: #17100a;
  filter: brightness(1.05);
}

.cms-command-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.cms-command-kpis article,
.cms-command-panel {
  background: linear-gradient(180deg, rgba(18, 28, 46, 0.94), rgba(11, 18, 31, 0.92));
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 10px;
  box-shadow: 0 18px 56px rgba(2, 6, 23, 0.24);
}

.cms-command-kpis article {
  display: grid;
  gap: 7px;
  padding: 18px;
}

.cms-command-kpis span,
.cms-panel-kicker {
  color: #91a0b4;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cms-command-kpis strong {
  color: #fff7ed;
  font-size: 2.2rem;
  letter-spacing: -0.05em;
  line-height: 1;
}

.cms-command-kpis em {
  color: #9caaba;
  font-size: 0.82rem;
  font-style: normal;
}

.cms-focus-header {
  align-items: center;
  background: linear-gradient(135deg, rgba(18, 28, 46, 0.94), rgba(11, 18, 31, 0.92));
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 10px;
  box-shadow: 0 18px 56px rgba(2, 6, 23, 0.24);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.cms-focus-header h1 {
  color: #fff7ed;
  font-size: clamp(1.45rem, 2.4vw, 2.4rem);
  line-height: 1.05;
  margin: 0 0 7px;
}

.cms-focus-header p:not(.admin-eyebrow) {
  color: #b7c2d3;
  line-height: 1.5;
  margin: 0;
}

.cms-control-map {
  margin-bottom: 18px;
}

.cms-control-map__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cms-control-card {
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 180px;
  padding: 16px;
}

.cms-control-card--primary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(15, 23, 42, 0.58));
  border-color: rgba(56, 189, 248, 0.32);
}

.cms-control-card--warning {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(15, 23, 42, 0.6));
  border-color: rgba(251, 191, 36, 0.36);
}

.cms-control-card h3 {
  color: #f8fafc;
  font-size: 1rem;
  line-height: 1.25;
  margin: 0;
}

.cms-control-card p {
  flex: 1;
  line-height: 1.55;
  margin: 0;
}

.cms-control-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cms-control-links a {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  color: #dbeafe;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 8px;
}

.cms-control-links a:hover {
  background: rgba(255, 255, 255, 0.09);
  text-decoration: none;
}

.cms-health-panel {
  margin-bottom: 18px;
}

.cms-health-list {
  display: grid;
  gap: 10px;
}

.cms-health-list article {
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 8px;
  padding: 12px 14px;
}

.cms-health-list strong {
  color: #fde68a;
  display: block;
  font-size: 0.92rem;
  margin-bottom: 3px;
}

.cms-health-list span {
  color: #cbd5e1;
  display: block;
  font-size: 0.82rem;
  line-height: 1.45;
}

.cms-command-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.cms-command-layout--focused {
  grid-template-columns: minmax(0, 1fr) 310px;
}

.cms-command-main,
.cms-command-rail,
.block-studio-library {
  display: grid;
  gap: 18px;
}

.cms-command-rail,
.block-studio-library {
  position: sticky;
  top: 82px;
}

.cms-command-panel {
  padding: 20px;
}

.cms-command-panel h2,
.cms-page-designer h2,
.block-editor-panel h2,
.block-preview-panel h2 {
  color: #fff7ed;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}

.cms-command-panel h3 {
  color: #f8fafc;
  font-size: 0.95rem;
  margin: 0 0 5px;
}

.cms-command-panel p,
.cms-command-panel small {
  color: #91a0b4;
}

.cms-command-panel__head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cms-command-panel__head--compact {
  align-items: start;
}

.cms-command-create {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.75fr) auto;
  min-width: min(100%, 560px);
}

.cms-command .form-input {
  background: rgba(5, 10, 19, 0.55);
  border-color: rgba(226, 232, 240, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  color: #eef2f7;
}

.cms-command .form-input:focus {
  border-color: rgba(200, 169, 90, 0.78);
}

.cms-command .form-input option {
  background: #0b1220;
  color: #eef2f7;
}

.cms-page-table {
  border: 1px solid rgba(226, 232, 240, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.cms-page-table__row {
  align-items: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.09);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1.4fr) 120px 100px 120px auto;
  min-height: 58px;
  padding: 12px 14px;
}

.cms-page-table__row:last-child {
  border-bottom: none;
}

.cms-page-table__row--head {
  background: rgba(255, 255, 255, 0.035);
  color: #7f8da0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  min-height: 42px;
  text-transform: uppercase;
}

.cms-page-table__row.is-selected,
.cms-page-table__row:hover:not(.cms-page-table__row--head) {
  background: rgba(200, 169, 90, 0.065);
}

.cms-page-table strong,
.cms-mini-list strong,
.cms-publish-list strong {
  color: #eef2f7;
  display: block;
}

.cms-page-table small,
.cms-mini-list small {
  color: #7f8da0;
  display: block;
  font-size: 0.78rem;
  margin-top: 2px;
}

.cms-health {
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  justify-self: start;
  padding: 4px 9px;
}

.cms-health.is-good {
  background: rgba(74, 222, 128, 0.12);
  color: #86efac;
}

.cms-health.is-warning {
  background: rgba(251, 191, 36, 0.12);
  color: #f8d47b;
}

.cms-block-launcher {
  background:
    linear-gradient(180deg, rgba(200, 169, 90, 0.12), rgba(18, 28, 46, 0.94)),
    #111c31;
  display: grid;
  gap: 18px;
}

.cms-mini-list,
.cms-global-field-list,
.cms-publish-list {
  display: grid;
  gap: 8px;
}

.cms-mini-list a,
.cms-global-field-list a,
.cms-publish-list a {
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(226, 232, 240, 0.09);
  border-radius: 8px;
  color: #eef2f7;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 12px;
}

.cms-mini-list a:hover,
.cms-mini-list a.is-active,
.cms-global-field-list a:hover,
.cms-publish-list a:hover {
  border-color: rgba(200, 169, 90, 0.38);
  text-decoration: none;
}

.cms-mini-list a.is-active {
  background: rgba(200, 169, 90, 0.11);
}

.cms-global-field-list em {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  color: #bae6fd;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  padding: 3px 7px;
}

.cms-publish-list span {
  color: #91a0b4;
  font-size: 0.78rem;
}

.block-studio-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 330px minmax(0, 1fr);
}

.block-designer-shell {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 320px minmax(0, 1fr);
}

.block-designer-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.block-designer-topbar .cms-panel-head {
  margin-bottom: 14px;
}

.block-designer-meta {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.block-designer-meta label {
  min-width: 0;
}

.block-designer-meta__note,
.legacy-migration-panel {
  grid-column: 1 / -1;
}

.legacy-migration-panel {
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.legacy-migration-panel strong {
  color: #dbeafe;
}

.legacy-migration-panel span {
  color: #9fb0c6;
  font-size: 0.82rem;
}

.block-designer-workbench {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.74fr);
}

.block-designer-side {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 82px;
}

.block-studio-workspace {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
}

.block-studio-library .cms-list {
  max-height: calc(100vh - 360px);
}

.block-studio .cms-list__item,
.block-studio .cms-section-row,
.block-studio .cms-item-row,
.cms-page-designer .cms-section-row {
  background: rgba(5, 10, 19, 0.38);
  border-color: rgba(226, 232, 240, 0.1);
}

.block-studio .cms-list__item:hover,
.block-studio .cms-list__item.is-active {
  background: rgba(200, 169, 90, 0.1);
  border-color: rgba(200, 169, 90, 0.46);
}

.block-preview-panel {
  position: sticky;
  top: 82px;
}

.block-designer-side .block-preview-panel {
  position: static;
}

.block-studio .cms-preview__frame {
  background:
    linear-gradient(180deg, rgba(8, 12, 24, 0.92), rgba(15, 23, 42, 0.82)),
    radial-gradient(circle at 80% 0%, rgba(200, 169, 90, 0.12), transparent 18rem);
  border-color: rgba(226, 232, 240, 0.12);
  min-height: 360px;
}

.cms-command .action-btn {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(226, 232, 240, 0.14);
  color: #b7c2d3;
  padding: 6px 11px;
}

.cms-command .action-btn:hover {
  border-color: rgba(200, 169, 90, 0.5);
  color: #fff7ed;
}

.cms-command .action-btn--danger {
  border-color: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
}

.cms-command .cms-panel-head {
  border-bottom: 1px solid rgba(226, 232, 240, 0.09);
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.cms-command .cms-subhead {
  margin-top: 8px;
}

.cms-command .cms-usage {
  background: rgba(56, 189, 248, 0.075);
  border-color: rgba(56, 189, 248, 0.18);
}

.preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.element-list--canvas {
  display: grid;
  gap: 10px;
  min-height: 88px;
}

.element-card--visual {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(8, 13, 24, 0.78));
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}

.element-card--visual:hover,
.element-card--visual.is-selected {
  border-color: rgba(200, 169, 90, 0.55);
}

.element-card--visual.is-selected {
  background:
    linear-gradient(135deg, rgba(200, 169, 90, 0.16), rgba(15, 23, 42, 0.84));
}

.element-card--visual.is-drop-target {
  border-color: rgba(56, 189, 248, 0.7);
  transform: translateY(-1px);
}

.element-card__select {
  align-items: center;
  background: transparent;
  border: 0;
  color: #dbe4f0;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.element-card__select strong,
.element-card__select small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-card__select small {
  color: #91a0b4;
  font-size: 0.76rem;
  margin-top: 2px;
}

.element-card__select em {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  padding: 4px 8px;
}

.element-card__index {
  align-items: center;
  background: rgba(200, 169, 90, 0.12);
  border: 1px solid rgba(200, 169, 90, 0.26);
  border-radius: 8px;
  color: #f5d788;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.element-card__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.element-empty-hint {
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(226, 232, 240, 0.2);
  border-radius: 8px;
  color: #9fb0c6;
  margin: 0;
  padding: 18px;
  text-align: center;
}

.element-add-bar {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  margin-top: 16px;
}

.element-inspector {
  display: grid;
  gap: 13px;
}

.inspector-group,
.inspector-field,
.inspector-items {
  display: grid;
  gap: 8px;
}

.variant-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 999px;
  color: #b7c2d3;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 6px;
  padding: 7px 10px;
}

.variant-pill.is-active {
  background: rgba(200, 169, 90, 0.13);
  border-color: rgba(200, 169, 90, 0.45);
  color: #fff7ed;
}

.inspector-item {
  background: rgba(5, 10, 19, 0.34);
  border: 1px solid rgba(226, 232, 240, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.preview-status {
  color: #91a0b4;
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .cms-command-layout,
  .block-studio-grid,
  .block-studio-workspace,
  .block-designer-shell,
  .block-designer-workbench {
    grid-template-columns: 1fr;
  }

  .cms-command-rail,
  .block-studio-library,
  .block-preview-panel,
  .block-designer-side {
    position: static;
  }

  .block-studio-library .cms-list {
    max-height: 360px;
  }
}

@media (max-width: 820px) {
  .content-editor-guide {
    grid-template-columns: 1fr;
  }

  .cms-command {
    padding-inline: 14px;
  }

  .cms-command-hero,
  .cms-focus-header,
  .cms-command-panel__head,
  .cms-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .cms-command-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cms-control-map__grid {
    grid-template-columns: 1fr;
  }

  .cms-command-create,
  .cms-form-grid,
  .cms-item-row,
  .block-designer-meta,
  .element-card--visual,
  .element-add-bar {
    grid-template-columns: 1fr;
  }

  .element-card__actions {
    justify-content: start;
  }

  .cms-page-table__row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .cms-page-table__row--head {
    display: none;
  }

  .cms-section-row,
  .cms-section-row__form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cms-command-kpis {
    grid-template-columns: 1fr;
  }
}

/* -- Admin sub-navigation ----------------------------------------------- */
.admin-subnav {
  align-items: stretch;
  background: rgba(17, 28, 49, 0.6);
  border-bottom: 1px solid var(--line);
  display: flex;
  padding: 0 24px;
  position: relative;
  z-index: 200;
}

.admin-subnav__drop {
  position: relative;
}

.admin-subnav__group-btn {
  align-items: center;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 0.85rem;
  gap: 5px;
  height: 100%;
  padding: 10px 14px;
  transition: color 0.14s;
  white-space: nowrap;
}
.admin-subnav__group-btn:hover { color: var(--text); }
.admin-subnav__group-btn--active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.admin-subnav__caret {
  font-size: 0.65rem;
  opacity: 0.55;
  transition: transform 0.15s;
}
.admin-subnav__drop:hover .admin-subnav__caret,
.admin-subnav__drop:focus-within .admin-subnav__caret,
.admin-subnav__drop.is-open .admin-subnav__caret { transform: rotate(180deg); }

.admin-subnav__menu {
  background: rgba(12, 20, 38, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  gap: 2px;
  left: 0;
  min-width: 168px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 1px);
  z-index: 300;
}
.admin-subnav__drop:hover .admin-subnav__menu,
.admin-subnav__drop:focus-within .admin-subnav__menu,
.admin-subnav__drop.is-open .admin-subnav__menu { display: flex; }

.admin-subnav__link {
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 12px;
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.admin-subnav__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
}
.admin-subnav__link--active {
  background: rgba(99, 179, 237, 0.1);
  color: var(--accent);
}

/* -- Admin table -------------------------------------------------------- */
.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table {
  border-collapse: collapse;
  font-size: 0.875rem;
  width: 100%;
}

.admin-table thead th {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.admin-table td {
  color: #cbd5e1;
  padding: 11px 14px;
  vertical-align: middle;
}

.admin-table td.td--muted { color: var(--muted); font-size: 0.82rem; }
.admin-table td.td--mono  { font-family: ui-monospace, monospace; font-size: 0.82rem; }

/* -- Admin card (for stats sections inside admin pages) ----------------- */
.admin-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.admin-card__title {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.admin-card__value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 4px;
}

.admin-card__sub {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

.admin-cards-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-bottom: 20px;
}

.admin-card--highlight {
  border-color: var(--gold, #c8a95a);
  background: rgba(200, 169, 90, 0.07);
}
.admin-card--highlight .admin-card__value {
  color: var(--gold, #c8a95a);
}

/* ── Map distribution bar chart ─────────────────────────── */
.admin-map-dist {
  margin-top: 4px;
  margin-bottom: 8px;
}
.admin-map-dist__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.admin-map-dist__bars {
  display: grid;
  gap: 8px;
}
.admin-map-bar {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  align-items: center;
  gap: 10px;
}
.admin-map-bar__name {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.admin-map-bar__track {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.admin-map-bar__fill {
  height: 100%;
  background: var(--gold, #c8a95a);
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 4px;
}
.admin-map-bar__count {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

/* -- Admin section header ----------------------------------------------- */
.admin-section {
  margin-bottom: 36px;
}

.admin-section__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

/* -- Admin search bar --------------------------------------------------- */
.admin-search {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-search__input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  flex: 1;
  font: inherit;
  max-width: 360px;
  outline: none;
  padding: 9px 12px;
}
.admin-search__input:focus { border-color: var(--accent); }

/* -- Admin form (shared between Content and News edit) ------------------ */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 820px;
}

.admin-form--wide {
  max-width: none;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field small {
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* -- Statistics page restyled ------------------------------------------- */
.stats-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-bottom: 28px;
}

.stats-filter {
  margin-bottom: 24px;
}

.stats-charts-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 24px;
}

@media (max-width: 740px) {
  .stats-charts-grid { grid-template-columns: 1fr; }
}

.chart-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  padding: 18px 20px 14px;
}

.chart-card__title {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}

.chart-card__sub {
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0 0 14px;
}

.chart-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  height: 220px;
}

.chart-canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.chart-empty {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 12px 0 0;
  text-align: center;
}

/* -- Player avatar initial ---------------------------------------------- */
.player-avatar {
  align-items: center;
  background: rgba(56, 189, 248, 0.14);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  width: 30px;
  flex-shrink: 0;
}

.player-cell {
  align-items: center;
  display: flex;
  gap: 10px;
}

.player-cell__name { font-weight: 600; }
.player-cell__email { color: var(--muted); font-size: 0.8rem; }

/* -- News admin status badges ------------------------------------------- */
.status-badge {
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 9px;
  text-transform: uppercase;
}
.status-badge--pub  { background: rgba(74,222,128,0.14); color: var(--success); }
.status-badge--draft { background: rgba(148,163,184,0.14); color: var(--muted); }
.status-badge--published { background: rgba(74,222,128,0.14); color: var(--success); }
.status-badge--archived { background: rgba(248,113,113,0.12); color: var(--danger); }

/* -- Inline action buttons ---------------------------------------------- */
.action-btns { display: flex; gap: 6px; }

.action-btn {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  padding: 4px 10px;
  text-decoration: none;
  transition: border-color 0.14s, color 0.14s;
  background: transparent;
}
.action-btn:hover { border-color: rgba(255,255,255,0.3); color: var(--text); text-decoration: none; }
.action-btn--danger { color: var(--danger); border-color: rgba(248,113,113,0.3); }
.action-btn--danger:hover { background: rgba(248,113,113,0.08); border-color: var(--danger); color: var(--danger); }

/* -- btn--danger (main button system) ----------------------------------- */
.btn--danger {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--danger);
}
.btn--danger:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

/* -- admin-table muted row ---------------------------------------------- */
.admin-table__row--muted td { opacity: 0.45; }

/* -- admin-cards-grid spacing variant ----------------------------------- */
.admin-cards-grid--spaced { margin-bottom: 24px; }

/* -- admin-card value truncation ---------------------------------------- */
.admin-card__value--truncate {
  font-size: 1.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -- editor slot tabs --------------------------------------------------- */
.editor-slot-tabs {
  display: grid;
  gap: 5px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 8px;
}

.editor-slot-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 6px;
  text-align: center;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.editor-slot-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}
.editor-slot-tab--draft.is-active {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}
.editor-slot-tab--live.is-active {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

/* -- Stats filter form -------------------------------------------------- */
.stats-filter__form {
  align-items: center;
  display: flex;
  gap: 10px;
}
.stats-filter__label {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.stats-filter__select { padding: 8px 12px; width: auto; }

/* -- Item Designer sidebar actions -------------------------------------- */
.imd-side-actions {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 16px;
}
.imd-side-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.imd-import { display: flex; flex-direction: column; gap: 8px; }
.imd-import-row { align-items: center; display: flex; gap: 10px; }

.forge-live-quests {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.forge-live-quest {
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  padding: 0.55rem 0.65rem;
}

.forge-live-quest strong,
.forge-live-quest span {
  display: block;
}

.forge-live-quest span {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.82rem;
  margin-top: 0.18rem;
}

.forge-live-quest ul {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
}

.forge-live-quest li {
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.82);
}

.forge-live-quest__accept {
  margin-top: 0.45rem;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 4px;
  background: rgba(96, 165, 250, 0.18);
  color: #e7edf8;
  padding: 0.32rem 0.5rem;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE BACKGROUND IMAGE
   ═══════════════════════════════════════════════════════════════ */
body.has-page-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--page-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  pointer-events: none;
  z-index: -1;
}

/* ═══════════════════════════════════════════════════════════════
   CMS ELEMENT BASE
   ═══════════════════════════════════════════════════════════════ */
.cms-element {
  padding: 48px 0;
  max-width: 1120px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════
   TEXT ELEMENT VARIANTS
   ═══════════════════════════════════════════════════════════════ */
.cms-element--text .prose-text p + p { margin-top: 1em; }

.cms-element--text.el--centered {
  text-align: center;
  max-width: 720px;
}
.cms-element--text.el--centered .cms-block__title { margin-inline: auto; }

.cms-element--text.el--featured {
  border-left: 3px solid #fbbf24;
  padding-left: 28px;
}
.cms-element--text.el--featured .cms-block__title { color: #fff7ed; }

.cms-element--text.el--callout {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 36px 40px;
}

/* ═══════════════════════════════════════════════════════════════
   HERO ELEMENT VARIANTS
   ═══════════════════════════════════════════════════════════════ */
.cms-element--hero.el--compact {
  min-height: 340px !important;
}
.cms-element--hero.el--minimal {
  display: block;
  min-height: unset;
}
.cms-element--hero.el--minimal .cms-hero-scene { display: none; }

/* ═══════════════════════════════════════════════════════════════
   CARD GRID VARIANTS
   ═══════════════════════════════════════════════════════════════ */
.el-grid {
  display: grid;
  gap: 16px;
}
.el-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.el-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.el-grid--showcase { grid-template-columns: 1fr; max-width: 760px; }
.el-grid--showcase .feature-card { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* ═══════════════════════════════════════════════════════════════
   LIST ELEMENT VARIANTS
   ═══════════════════════════════════════════════════════════════ */
/* Checklist */
.el-checklist { display: flex; flex-direction: column; gap: 12px; }
.el-checklist .el-list-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
}
.el-checklist .el-list-item::before {
  content: '✓';
  color: var(--success);
  font-weight: 800;
  flex-shrink: 0;
}
.el-checklist .el-list-item small { color: var(--muted); font-size: 0.85rem; margin-left: 4px; }

/* Timeline */
.el-timeline { display: flex; flex-direction: column; gap: 0; padding-left: 20px; border-left: 2px solid var(--line); }
.el-timeline-item {
  display: flex;
  gap: 20px;
  padding: 0 0 28px 28px;
  position: relative;
}
.el-timeline-dot {
  position: absolute;
  left: -9px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  flex-shrink: 0;
}
.el-timeline-item strong { display: block; color: var(--text); margin-bottom: 6px; }
.el-timeline-item p { color: var(--muted); margin: 0; }

/* Compact list */
.el-list-compact { display: flex; flex-direction: column; gap: 8px; }
.el-list-compact .el-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  font-size: 0.95rem;
}
.el-list-compact .el-list-item small { color: var(--muted); font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════════════════
   CTA ELEMENT VARIANTS
   ═══════════════════════════════════════════════════════════════ */
.cms-element--cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.cms-element--cta__title {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
}
.cms-element--cta.el--banner {
  background: linear-gradient(135deg, rgba(120,53,15,0.6), rgba(92,40,8,0.4));
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 14px;
  padding: 48px 40px;
  align-items: center;
  text-align: center;
  max-width: none;
}
.cms-element--cta.el--ghost .btn--primary {
  background: transparent;
  border: 1px solid rgba(56,189,248,0.5);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   BANNER ELEMENT
   ═══════════════════════════════════════════════════════════════ */
.cms-element--banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}
.cms-banner__icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}
.cms-banner__body { flex: 1; min-width: 200px; }
.cms-banner__title { display: block; font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.cms-banner__text { margin: 0; font-size: 0.9rem; color: var(--muted); }
.cms-banner__cta { flex-shrink: 0; }

.cms-element--banner.el--amber {
  background: rgba(120, 53, 15, 0.35);
  border-color: rgba(251, 191, 36, 0.3);
}
.cms-element--banner.el--amber .cms-banner__title { color: #fde68a; }

.cms-element--banner.el--cyan {
  background: rgba(8, 47, 73, 0.5);
  border-color: rgba(56, 189, 248, 0.3);
}
.cms-element--banner.el--cyan .cms-banner__title { color: #bae6fd; }

.cms-element--banner.el--danger {
  background: rgba(69, 10, 10, 0.5);
  border-color: rgba(248, 113, 113, 0.3);
}
.cms-element--banner.el--danger .cms-banner__title { color: #fecaca; }

.cms-element--banner.el--subtle {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
}

/* ═══════════════════════════════════════════════════════════════
   QUOTE ELEMENT
   ═══════════════════════════════════════════════════════════════ */
.cms-element--quote { padding: 40px 0; }
.cms-quote { margin: 0; position: relative; padding: 0 0 0 32px; max-width: 760px; }
.cms-quote__mark {
  position: absolute;
  left: -8px;
  top: -20px;
  font-size: 6rem;
  line-height: 1;
  color: rgba(56,189,248,0.2);
  font-family: Georgia, serif;
  pointer-events: none;
}
.cms-quote__text {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  line-height: 1.65;
  color: var(--text);
  font-style: italic;
  margin: 0 0 18px;
}
.cms-quote__attribution {
  font-size: 0.9rem;
  color: var(--muted);
}

.cms-element--quote.el--large .cms-quote__text { font-size: clamp(1.4rem, 3vw, 2rem); }

.cms-element--quote.el--amber .cms-quote__mark { color: rgba(251,191,36,0.3); }
.cms-element--quote.el--amber .cms-quote__text { color: #fde68a; }

/* ═══════════════════════════════════════════════════════════════
   MEDIA ELEMENT
   ═══════════════════════════════════════════════════════════════ */
.cms-element--media { padding: 32px 0; }
.cms-media { margin: 0; }
.cms-media img {
  border-radius: 12px;
  border: 1px solid var(--line);
  width: 100%;
  height: auto;
  display: block;
}
.cms-media figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.cms-media--contained img { max-width: 760px; margin: 0 auto; }
.cms-media--side-left img { max-width: 480px; }

/* ═══════════════════════════════════════════════════════════════
   DIVIDER ELEMENT VARIANTS
   ═══════════════════════════════════════════════════════════════ */
.cms-element--divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 8px 0;
  max-width: none;
  padding: 0;
}
.cms-element--divider.el--rune {
  display: flex;
  align-items: center;
  gap: 16px;
  border: none;
  margin: 24px 0;
  padding: 0;
  max-width: none;
}
.cms-element--divider.el--rune::before,
.cms-element--divider.el--rune::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.cms-element--divider.el--rune span {
  color: var(--muted);
  font-size: 1.1rem;
  opacity: 0.6;
}
.cms-element--spacer {
  height: 64px;
  max-width: none;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN — BG IMAGE PANEL
   ═══════════════════════════════════════════════════════════════ */
.page-bg-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 20px;
}
.page-bg-preview {
  height: 120px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  padding: 10px 14px;
}
.page-bg-label {
  font-size: 0.78rem;
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 3px 8px;
  border-radius: 4px;
  word-break: break-all;
}
.cms-bg-upload-form { display: flex; flex-direction: column; gap: 10px; }
.cms-bg-upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cms-bg-upload-row input[type="file"] { flex: 1; min-width: 200px; }

/* -- Game Guide Designer ----------------------------------------------- */
.guide-designer-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
    gap: 18px;
    align-items: start;
}

.guide-designer-panel,
.guide-designer-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
}

.guide-entry-list,
.permission-grid {
    display: grid;
    gap: 10px;
}

.guide-entry-admin {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px auto auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
}

.guide-entry-admin span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    margin-top: 2px;
}

.guide-entry-admin__order {
    min-width: 0;
}

.permission-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    max-width: 460px;
}

.permission-toggle {
    margin: 0;
}

.permission-pill {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    padding: 6px 10px;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.permission-pill--on {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--text);
}

.guide-chapter-list--expandable {
    gap: 12px;
}

.guide-chapter--expandable {
    display: block;
    padding: 0;
}

.guide-chapter--expandable summary {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    padding: 18px;
    list-style: none;
}

.guide-chapter--expandable summary::-webkit-details-marker {
    display: none;
}

.guide-chapter--expandable summary::after {
    content: "+";
    margin-left: auto;
    color: var(--muted);
    font-size: 1.3rem;
}

.guide-chapter--expandable[open] summary::after {
    content: "-";
}

.guide-chapter__body {
    padding: 0 18px 18px 72px;
}

.guide-chapter__body img {
    display: block;
    max-width: min(100%, 720px);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 0 0 14px;
}

@media (max-width: 860px) {
    .guide-designer-layout,
    .guide-entry-admin {
        grid-template-columns: 1fr;
    }

    .guide-chapter__body {
        padding-left: 18px;
    }
}

/* -- Branding admin page ------------------------------------------------- */
.admin-section__desc {
  color: var(--muted);
  font-size: 0.875rem;
  margin: -8px 0 18px;
}

.admin-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.admin-form__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.admin-form__hint {
  font-weight: 400;
  font-size: 0.78rem;
  opacity: 0.65;
}
.admin-notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.admin-notice--ok  { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.admin-notice--err { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }

.branding-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.branding-preview {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.branding-preview--favicon { width: 96px; }
.branding-preview--og      { width: 260px; }
.branding-preview__label {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
}
.branding-favicon-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255,255,255,0.04);
}
.branding-og-img {
  width: 260px;
  height: 136px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.branding-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  width: 100%;
  min-height: 80px;
}
.branding-file-input {
  cursor: pointer;
}

/* -- OG link-preview card (Discord-style mockup) ------------------------- */
.og-preview-card {
  max-width: 480px;
  border-left: 4px solid #5865f2;   /* Discord blurple accent */
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #2b2d31;
  overflow: hidden;
}
.og-preview-card__image-wrap { line-height: 0; }
.og-preview-card__image {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}
.og-preview-card__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.og-preview-card__site {
  font-size: 0.72rem;
  color: #b5bac1;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.og-preview-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #00aff4;
  margin: 0;
}
.og-preview-card__desc {
  font-size: 0.83rem;
  color: #dbdee1;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.settings-avatar {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.settings-avatar__preview {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
}
.settings-avatar__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 560px) {
  .settings-avatar { grid-template-columns: 1fr; }
}
