:root {
  color-scheme: dark;
  --bg: #101312;
  --panel: #1b201c;
  --line: #42483b;
  --text: #f4e9d9;
  --muted: #c2b6a5;
  --accent: #ffac3f;
  --gold: #ffcb83;
  --font: Prompt, "Noto Sans Thai", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  isolation: isolate;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
}

.terrain-backdrop, .hero-art {
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.terrain-backdrop { position: fixed; z-index: -1; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid #724818;
  background: #0b0b0a;
}

.hero-art { position: absolute; z-index: -2; }

.hero::after {
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 1px solid #a4682b;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  content: "";
  pointer-events: none;
}

.hero-inner {
  padding: clamp(24px, 4.2vw, 40px) 22px clamp(26px, 4.5vw, 42px);
  text-align: center;
}

.brand-logo {
  display: block;
  width: clamp(110px, 13vw, 150px);
  height: auto;
  margin: 0 auto 8px;
  filter: drop-shadow(0 6px 16px #000) drop-shadow(0 0 24px #ff8f2338);
}

.hero h1 {
  margin: 0;
  color: #fff1df;
  font: 800 clamp(2.45rem, 6.8vw, 4rem)/1.08 Impact, "Arial Narrow", "DejaVu Sans Condensed", sans-serif;
  letter-spacing: .045em;
  text-shadow: 0 3px 18px #000;
}

.hero h1 span { color: var(--accent); }
.hero p { margin: 9px 0 0; color: #e8d7c1; }

.shell {
  width: min(1140px, 100%);
  margin-inline: auto;
  padding: clamp(16px, 3.2vw, 32px) clamp(14px, 4vw, 38px) 14px;
}

.dashboard {
  padding: clamp(14px, 3vw, 27px);
  border: 1px solid var(--line);
  border-top: 2px solid #855a2e;
  border-radius: 8px;
  background: linear-gradient(145deg, #222a22e8, #1b201cef 65%);
  box-shadow: 0 12px 28px #0005;
}

.dashboard-header, .dashboard-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-header {
  justify-content: space-between;
  padding-bottom: 15px;
  margin-bottom: clamp(15px, 2.2vw, 22px);
  border-bottom: 1px solid var(--line);
}

.dashboard-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid #755130;
  border-radius: 5px;
  background: #292017;
  color: var(--accent);
}

.dashboard-mark svg { width: 21px; height: 21px; }

.section-label {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .12em;
}

.dashboard h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.15;
}

.system-count {
  flex: none;
  padding: 4px 10px;
  border: 1px solid #725130;
  border-radius: 4px;
  color: var(--gold);
  background: #262017;
  font-size: .78rem;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.system-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #6c5237;
  border-radius: 7px;
  background: #1a1c17;
  color: inherit;
  text-decoration: none;
  text-align: start;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 15px #0005;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.card-art {
  position: relative;
  display: grid;
  min-height: 174px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid #65492e;
  background:
    linear-gradient(#dc8c2e18 1px, transparent 1px) center / 24px 24px,
    linear-gradient(90deg, #dc8c2e18 1px, transparent 1px) center / 24px 24px,
    radial-gradient(ellipse at center, #593518, #161410 74%);
}

.card-art img {
  display: block;
  width: 133px;
  height: auto;
  margin: 16px 0;
  filter: drop-shadow(0 6px 8px #000a);
  transition: transform 180ms ease, filter 180ms ease;
}

.card-body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 13px 15px 14px; }
.card-title { font-size: 1.11rem; font-weight: 750; line-height: 1.35; }
.card-description { color: var(--muted); font-size: .82rem; }

.card-action {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 6px;
  color: var(--accent);
  font-size: .83rem;
  font-weight: 750;
}

.card-action svg { width: 17px; height: 17px; transition: transform 160ms ease; }

.system-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (hover: hover) {
  .system-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 10px 23px #0008, 0 0 18px #ff942529;
  }

  .system-card:hover img {
    transform: scale(1.07);
    filter: drop-shadow(0 6px 8px #000a) drop-shadow(0 0 12px #ff9b3866);
  }

  .system-card:hover .card-action svg { transform: translateX(4px); }
}

.system-card:active, .system-card.is-activating {
  transform: scale(.98);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px #ffac3f59, 0 0 24px #ffac3f33;
  transition-duration: 85ms;
}

.development-dialog {
  width: min(390px, calc(100% - 32px));
  padding: 25px;
  border: 1px solid #986331;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: center;
  box-shadow: 0 16px 36px #0009;
}

.development-dialog::backdrop { background: #080907bd; }
.development-dialog h2 { margin: 0; font-size: 1.55rem; }
.development-dialog p { margin: 8px 0 19px; color: var(--gold); }

.development-dialog button {
  min-height: 44px;
  padding: 7px 24px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #231405;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.development-dialog button:hover { background: var(--gold); }
.development-dialog button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 12px 0 2px;
  margin-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
}

.footer span:first-child { color: var(--gold); font-weight: 750; letter-spacing: .08em; }

@media (prefers-reduced-motion: reduce) {
  .system-card, .system-card img, .card-action svg { transition: none; }
  .system-card:hover, .system-card:active, .system-card:hover img,
  .system-card:hover .card-action svg { transform: none; }
}
