/* Lagerchronik: eine ruhige, raue Gothic-Oberfläche über den funktionalen Basisregeln. */
:root {
  --bg: #0d0d0b;
  --surface: #1b1a16;
  --surface-raised: #25231d;
  --surface-soft: #302a22;
  --border: #51483a;
  --border-bright: #8b785d;
  --text: #eae2d3;
  --muted: #aaa296;
  --accent: #b99663;
  --accent-light: #e2c79a;
  --accent-text: #211b14;
  --aqua: #7ca6ab;
  --good: #a8ba97;
  --warn: #d5a66a;
  --bad: #cd8274;
  --display: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

body { background: #0d0d0b; color: var(--text); font-size: 15px; }
body::before {
  background:
    radial-gradient(ellipse 52% 48% at 82% 8%, rgb(103 74 46 / .16), transparent 75%),
    radial-gradient(ellipse 35% 54% at -8% 74%, rgb(79 37 25 / .18), transparent 79%),
    linear-gradient(118deg, #12120f, #0d0d0b 53%, #17140f);
  animation: atmosphere 30s ease-in-out infinite alternate;
}
body::after {
  opacity: .38;
  background-image:
    repeating-linear-gradient(93deg, transparent 0 113px, rgb(215 180 126 / .025) 114px 115px, transparent 116px 241px),
    repeating-linear-gradient(0deg, transparent 0 89px, rgb(215 180 126 / .019) 90px 91px);
  mask-image: linear-gradient(90deg, #000, transparent 78%);
}
::selection { background: #8c6546; color: #fff6df; }
a { color: var(--accent-light); }

/* Der Rahmen ist wie dunkles Schmiedeeisen, ohne technisch leuchtende Navigationskacheln. */
.topbar {
  min-height: 72px;
  gap: 20px;
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgb(185 150 99 / .25);
  background: rgb(14 15 13 / .92);
  box-shadow: 0 10px 35px rgb(0 0 0 / .17);
  backdrop-filter: blur(18px);
}
.topbar::before { content: ""; position: absolute; bottom: -1px; left: 4%; width: 160px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }
.brand { gap: 11px; font-size: 1.08rem; letter-spacing: .006em; }
.brand img { width: 34px; height: 34px; padding: 4px; border: 1px solid #756344; border-radius: 1px; background: #1b201d; box-shadow: none; }
.brand strong { color: #f0e6d1; font-weight: 600; }
.brand-lockup small { color: #9e967f; font-size: .52rem; letter-spacing: .1em; }
.nav { gap: 2px; }
.nav a { padding: 8px 11px; border-radius: 0; color: #a8a79c; font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.nav a:hover, .nav a.active { border-color: transparent; background: transparent; color: #ebdbc0; }
.nav a.active::after { right: 10px; bottom: 1px; left: 10px; height: 1px; border-radius: 0; background: var(--accent); box-shadow: none; }
.whoami { color: #c6b9a4; font-size: .79rem; }
.language { min-width: 103px; }

.main { width: min(100%, 1560px); padding-top: 42px; }
body:not(.auth-mode) .main::before {
  height: 440px;
  opacity: .28;
  background-image: url('/visuals/minental-valley.webp');
  background-position: center 30%;
  filter: saturate(.63) brightness(.6);
  mask-image: linear-gradient(#000, transparent 93%);
}
.page { animation-duration: .65s; }
.page h1 { margin-bottom: 23px; color: #f0e7d4; font-size: clamp(2.7rem, 3.4vw, 4rem); font-weight: 500; letter-spacing: -.043em; text-shadow: 0 7px 25px rgb(0 0 0 / .33); }
.page > h1::before { content: ""; display: block; width: 38px; height: 1px; margin-bottom: 17px; background: var(--accent); }
h2, h3 { color: #e8ddca; font-weight: 500; }
.eyebrow { color: #ccb48b; font-size: .65rem; letter-spacing: .18em; }
.signal-dot { width: 6px; height: 6px; background: #9ab398; box-shadow: 0 0 9px rgb(154 179 152 / .38); animation: none; }

/* Anmeldung: Bild und Diorama dienen als Schauplatz, das Formular bleibt klar lesbar. */
.auth-mode .main { width: min(100%, 1540px); padding-top: clamp(24px, 5vh, 62px); }
.auth-shell { grid-template-columns: minmax(0, 1.14fr) minmax(420px, .86fr); gap: 22px; min-height: min(710px, calc(100vh - 160px)); }
.auth-card { align-self: center; }
.auth-showcase, .auth-card { border: 1px solid #514839; border-radius: 2px; box-shadow: 0 24px 60px rgb(0 0 0 / .27); }
.auth-showcase {
  isolation: isolate;
  min-height: 630px;
  padding: clamp(32px, 3.9vw, 62px);
  background:
    linear-gradient(98deg, rgb(13 14 12 / .7) 0%, rgb(17 17 14 / .26) 56%, rgb(17 15 12 / .12)),
    linear-gradient(0deg, rgb(11 11 9 / .68), transparent 65%),
    url('/visuals/minental-valley.webp') 46% center / cover no-repeat,
    #171812;
}
.auth-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(29 21 15 / .36), transparent 75%), radial-gradient(ellipse at 76% 54%, rgb(199 143 79 / .13), transparent 48%);
  opacity: 1;
  animation: none;
}
.auth-showcase::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgb(201 172 125 / .13); border-radius: 0; box-shadow: inset 0 0 110px rgb(0 0 0 / .47); pointer-events: none; }
.auth-showcase-copy, .auth-showcase-footer { position: relative; z-index: 3; }
.auth-showcase-copy h2 { max-width: 11ch; margin: 21px 0 18px; font-size: clamp(3rem, 4.6vw, 5.5rem); font-weight: 500; line-height: 1.01; letter-spacing: -.05em; text-shadow: 0 5px 25px rgb(0 0 0 / .69); }
.auth-showcase-copy p { max-width: 31ch; color: #d8d1c1; font-size: 1rem; text-shadow: 0 2px 10px rgb(0 0 0 / .65); }
.auth-showcase-footer { border-top-color: rgb(194 160 113 / .31); color: #e1d4bc; }
.auth-showcase-footer > span:last-child { color: #b3a48c; }
.auth-card { padding: clamp(32px, 3.8vw, 61px); background: linear-gradient(152deg, rgb(34 32 26 / .97), rgb(20 20 17 / .99)); }
.auth-card::before { background: rgb(178 112 61 / .06); }
.auth-card-head h1 { margin-top: 14px; font-size: clamp(2.4rem, 3vw, 3.7rem); }
.auth-card h1::before { display: none; }

/* Die Three.js-Leinwand hat eine schlichte Feuerschale als WebGL-Fallback. */
.arcane-viewport { position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; width: 60%; overflow: hidden; cursor: grab; touch-action: pan-y; }
.arcane-viewport:active { cursor: grabbing; }
.arcane-viewport canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; filter: drop-shadow(0 10px 17px rgb(0 0 0 / .45)); }
.ore-engine { position: absolute; top: 55%; left: 50%; width: 130px; height: 65px; transform: translate(-50%, -50%); border: 8px solid #494037; border-radius: 50%; background: radial-gradient(ellipse, #a65429, #332720 68%); box-shadow: 0 14px 0 #302d29, 0 75px 0 -38px #484039, 0 95px 0 -35px #302d29; animation: none; }
.ore-engine::before { content: ""; position: absolute; left: 37px; bottom: 28px; width: 45px; height: 115px; border: 0; background: radial-gradient(ellipse at 50% 80%, #eec27d 3%, #cc632e 50%, transparent 72%); clip-path: polygon(50% 0, 83% 49%, 100% 78%, 82% 100%, 18% 100%, 0 72%); animation: none; }
.ore-engine::after { display: none; }
.ore-engine-ring, .ore-engine-core { display: none; }
.arcane-viewport.is-ready .ore-engine { display: none; }
.auth-showcase .arcane-viewport { width: 59%; opacity: .96; }
.forge-action { position: absolute; z-index: 4; padding: 8px 0; border: 0; border-bottom: 1px solid rgb(225 185 122 / .58); background: transparent; color: #f0d4a7; font: 650 .65rem var(--mono); letter-spacing: .13em; text-transform: uppercase; cursor: pointer; transition: color .2s, border-color .2s, transform .2s; }
.forge-action::before { content: '✦'; margin-right: 9px; color: #d59050; }
.forge-action:hover, .forge-action:focus-visible { color: #fff1d2; border-color: #ffdf9f; transform: translateY(-2px); }
.forge-action:focus-visible { outline: 2px solid #e5b977; outline-offset: 4px; }
.is-ignited .forge-action { color: #ffe1a3; border-color: #eeb062; text-shadow: 0 0 14px rgb(255 159 70 / .72); }
.auth-showcase.is-ignited::before, .dashboard-lead.is-ignited::before { background: radial-gradient(ellipse at 74% 48%, rgb(255 136 53 / .3), transparent 51%); animation: forge-flash 1.5s ease-out both; }
@keyframes forge-flash { from { opacity: 1; } to { opacity: 0; } }
.auth-showcase .forge-action { right: 32px; bottom: 86px; }

/* Feine Arbeitsflächen statt der zuvor massiven, gerahmten Kacheln. */
.dashboard-lead { position: relative; isolation: isolate; display: block; min-height: 250px; margin: -8px 0 18px; padding: 43px 30px 26px; overflow: visible; border: 0; border-bottom: 1px solid rgb(185 150 99 / .35); border-radius: 0; background: linear-gradient(90deg, rgb(19 18 15 / .61), transparent 68%); box-shadow: none; clip-path: none; }
.dashboard-lead::before { content: ""; position: absolute; z-index: -1; inset: 0; width: auto; height: auto; border: 0; border-radius: 0; background: radial-gradient(ellipse at 80% 72%, rgb(147 105 59 / .12), transparent 42%); animation: none; }
.dashboard-lead::after { content: ""; position: absolute; right: auto; bottom: -1px; left: 0; width: 180px; height: 1px; background: var(--accent); opacity: .8; }
.dashboard-lead > :not(.arcane-viewport) { position: relative; z-index: 2; }
.dashboard-lead .eyebrow { font-size: .72rem; }
.dashboard-lead p { max-width: 35ch; margin-top: 12px; color: #ccc5b6; font-family: var(--display); font-size: 1.45rem; line-height: 1.4; }
.dashboard-lead .arcane-viewport { top: -84px; right: 3%; bottom: -22px; width: 45%; opacity: 1; }
.dashboard-lead > .forge-action { position: absolute; z-index: 4; right: 33px; bottom: 22px; }
.live-indicator { margin-top: 31px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #aaa995; font: 600 .68rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 292px); align-items: start; gap: clamp(24px, 3vw, 48px); }
.overview-layout > .grid { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid rgb(185 150 99 / .3); }
.card {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(205px, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: 20px;
  min-height: 125px;
  padding: 20px 4px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid rgb(185 150 99 / .24);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
}
.card::before { content: ""; position: absolute; top: 19px; bottom: 19px; left: -14px; width: 1px; height: auto; background: var(--accent); opacity: 0; transition: opacity .2s; }
.card::after { display: none; }
.card:hover { transform: none; border-color: rgb(185 150 99 / .43); background: rgb(185 150 99 / .035); box-shadow: none; }
.card:hover::before { opacity: 1; }
.card.disabled { opacity: .55; }
.card.disabled:hover { transform: none; background: transparent; box-shadow: none; }
.card-head { display: flex; align-items: baseline; flex-wrap: nowrap; gap: 14px; }
.card-head h2 { max-width: none; font-size: clamp(1.3rem, 1.55vw, 1.65rem); line-height: 1.18; }
.flag { display: inline; min-width: 0; height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent-light); font-size: .67rem; line-height: 1.8; }
.status-list { grid-template-columns: max-content minmax(0,1fr); gap: 5px 11px; align-items: center; font-size: .79rem; }
.status-list dt { color: #a79b88; font-family: var(--mono); font-size: .68rem; text-transform: uppercase; }
.status-list dd { min-width: 0; }
.card > .button { justify-self: end; align-self: center; margin: 0; white-space: nowrap; }
.card > .button::after { content: "↗"; margin-left: 5px; color: var(--accent-light); }
.badge { padding: 2px 7px; border: 0; border-radius: 2px; font-family: var(--mono); font-size: .66rem; font-weight: 650; }
.badge::before { width: 4px; height: 4px; }
.badge.good { background: rgb(168 186 151 / .1); }
.badge.warn { background: rgb(213 166 106 / .1); }
.badge.bad { background: rgb(205 130 116 / .1); }

.news-panel { margin: 0; padding: 3px 0 0 23px; border: 0; border-left: 1px solid rgb(185 150 99 / .3); border-radius: 0; background: transparent; box-shadow: none; }
.news-panel::before { display: none; }
.news-heading { display: grid; gap: 5px; padding-bottom: 16px; border-bottom: 1px solid rgb(185 150 99 / .24); }
.news-heading h2 { font-size: 1.37rem; }
.news-list { display: grid; }
.news-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 16px 0; border-bottom: 1px solid rgb(185 150 99 / .14); }
.news-item:last-child { border-bottom: 0; }
.news-index { color: #8f7757; font: 600 .66rem var(--mono); }
.news-label { color: #aa9674; font: 650 .58rem var(--mono); letter-spacing: .045em; }
.news-item h3 { margin: 5px 0; font-size: .99rem; line-height: 1.28; }
.news-item p { margin: 0; color: #aca99e; font-size: .77rem; line-height: 1.5; }

/* Formulare, Detailseiten und Logs folgen demselben Material. */
input, select, textarea { min-height: 42px; border-color: #5a5041; border-radius: 2px; background: rgb(13 14 12 / .82); }
input:hover, select:hover, textarea:hover { border-color: #9a8464; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: #1b1b17; box-shadow: 0 0 0 3px rgb(185 150 99 / .14); }
input[type=checkbox] { min-height: 17px; accent-color: var(--accent); }
.language { min-height: 35px; border-radius: 2px; font-size: .8rem; }
.field > span { color: #d8cdb9; font-size: .8rem; }
.button { border-radius: 2px; border-color: #6c5e49; background: rgb(152 120 76 / .08); color: #e9dbc1; font-size: .79rem; font-weight: 650; }
.button:hover { border-color: var(--accent); background: rgb(152 120 76 / .15); box-shadow: none; }
.button.primary { border-color: #c9aa78; background: linear-gradient(120deg, #e2c99d, #b99663); color: #271f16; box-shadow: 0 7px 22px rgb(0 0 0 / .13); }
.button.primary:hover { background: linear-gradient(120deg, #f0d7ac, #c7a572); box-shadow: 0 9px 25px rgb(0 0 0 / .18); }
.button.discord { background: #6067ad; color: #fff; }
.notice { border-color: rgb(185 150 99 / .35); border-left-color: var(--accent); border-radius: 1px; background: rgb(185 150 99 / .07); color: #ddc9aa; }
.panel { border-color: #51483a; border-radius: 2px; background: linear-gradient(150deg, rgb(39 36 29 / .84), rgb(22 22 19 / .89)); box-shadow: 0 15px 30px rgb(0 0 0 / .13); }
.panel.news-panel { margin: 0; padding: 3px 0 0 23px; border: 0; border-left: 1px solid rgb(185 150 99 / .3); border-radius: 0; background: transparent; box-shadow: none; }
.tabs a { border-radius: 0; }
.tabs a:hover, .tabs a.active { color: #eee0c8; background: rgb(185 150 99 / .08); }
.tabs a.active { border-color: rgb(185 150 99 / .28); }
.log { border-color: #4b473d; border-radius: 1px; background: #111411; color: #d8d4c9; }
.entry .cmd { color: var(--accent-light); }
.table th, .matrix th { color: #cfbb96; }
.table tbody tr:hover, .matrix tbody tr:hover { background: rgb(185 150 99 / .045); }
.toast { border-color: #75654d; border-left-color: var(--accent); border-radius: 2px; background: #29261f; }
.qr-frame, .manual-key, .secret { border-radius: 2px; }

@media (max-width: 1250px) {
  .card { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr); }
  .card > .button { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-card { align-self: stretch; }
  .auth-showcase { min-height: 425px; }
  .auth-showcase .arcane-viewport { width: 50%; }
  .overview-layout { grid-template-columns: 1fr; }
  .card { grid-template-columns: minmax(190px, 1.15fr) minmax(200px, 1fr) auto; }
  .card > .button { grid-column: auto; justify-self: end; }
  .panel.news-panel { padding: 24px 0 0; border-left: 0; border-top: 1px solid rgb(185 150 99 / .3); }
  .news-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .news-item { border-bottom: 0; }
}
@media (max-width: 680px) {
  .topbar { gap: 9px; min-height: 62px; }
  .brand { font-size: .95rem; }
  .brand img { width: 31px; height: 31px; }
  .brand-lockup small { font-size: .46rem; }
  .main { padding-top: 28px; }
  .page h1 { font-size: 2.75rem; }
  .auth-showcase { min-height: 310px; padding: 27px; }
  .auth-showcase-copy h2 { max-width: 11ch; font-size: clamp(2.5rem, 9vw, 3.7rem); }
  .auth-showcase-copy p { max-width: 27ch; font-size: .87rem; }
  .auth-showcase .arcane-viewport { width: 64%; opacity: .52; }
  .auth-showcase .forge-action { right: 24px; bottom: 75px; }
  .auth-card { padding: 26px 22px; }
  .dashboard-lead { min-height: 220px; padding: 28px 12px; }
  .dashboard-lead p { max-width: 25ch; font-size: 1.2rem; }
  .dashboard-lead .arcane-viewport { top: -17px; right: -12%; bottom: -14px; width: 64%; opacity: .55; }
  .dashboard-lead .forge-action { right: 14px; bottom: 12px; }
  .overview-layout > .grid { grid-template-columns: 1fr; }
  .card { grid-template-columns: 1fr; gap: 12px; min-height: 0; padding: 22px 4px; }
  .card-head h2 { font-size: 1.38rem; }
  .card > .button { grid-column: auto; justify-self: start; }
  .news-list { grid-template-columns: 1fr; gap: 0; }
  .news-item { border-bottom: 1px solid rgb(185 150 99 / .14); }
}
@media (prefers-reduced-motion: reduce) {
  .topbar::before, .ore-engine { animation: none !important; }
  .auth-showcase.is-ignited::before, .dashboard-lead.is-ignited::before { animation: none; opacity: .2; }
}
