:root {
  color-scheme: dark;
  --ink: #f4f1df;
  --muted: #b8b3a2;
  --panel: #1b1a20;
  --panel-2: #252230;
  --line: #4b4655;
  --green: #75e36f;
  --yellow: #ffd55f;
  --red: #ff6b57;
  --blue: #6fc3ff;
  --bg: #101014;
  --shadow: #050507;
  font-family: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px;
  line-height: 1.6;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--yellow);
  color: #15120f;
  padding: 8px 12px;
  z-index: 10;
}

.skip-link:focus {
  top: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 32px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-icon {
  image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 var(--shadow));
}

.language-switcher {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--shadow);
}

.lang-button {
  min-height: 38px;
  border: 0;
  border-right: 3px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.lang-button:last-child {
  border-right: 0;
}

.lang-button.is-active {
  background: var(--green);
  color: #11140f;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: clamp(24px, 5vw, 60px);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  min-height: calc(100vh - 190px);
  padding: 28px clamp(16px, 4vw, 32px) 56px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 6.7rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 5px 5px 0 var(--shadow);
}

.hero-text {
  max-width: 720px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  border: 3px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
  text-decoration: none;
  font-weight: 900;
}

.button.primary {
  background: var(--yellow);
  color: #17130b;
}

.button:hover,
.lang-button:hover {
  transform: translate(1px, 1px);
}

.hero-console,
.status-strip,
.check-card,
.llm-note,
.region-list,
.monitor-card,
.admin-form,
.admin-note,
.auth-panel {
  border: 4px solid var(--line);
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--shadow);
}

.hero-console {
  position: relative;
  padding: 0 22px 24px;
}

.console-bar {
  display: flex;
  gap: 8px;
  margin: 0 -22px 20px;
  padding: 12px;
  border-bottom: 4px solid var(--line);
  background: var(--panel-2);
}

.console-bar span {
  width: 14px;
  height: 14px;
  background: var(--red);
}

.console-bar span:nth-child(2) {
  background: var(--yellow);
}

.console-bar span:nth-child(3) {
  background: var(--green);
}

.score-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.score-wrap img {
  image-rendering: pixelated;
  width: clamp(72px, 16vw, 112px);
  height: auto;
}

.score-label {
  margin: 0;
  color: var(--muted);
}

.score {
  display: block;
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 0.9;
  color: var(--green);
}

.signal-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
}

.signal-grid span,
.signal-grid b {
  padding: 8px;
  background: #121216;
}

.signal-grid b {
  color: var(--green);
}

.signal-grid b:last-child {
  color: var(--yellow);
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: -30px auto 64px;
  padding: 16px clamp(16px, 4vw, 24px);
}

.status-strip div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-strip p {
  margin: 0;
  color: var(--muted);
}

.status-dot {
  width: 16px;
  height: 16px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(117, 227, 111, 0.18);
}

.panel-section,
.geo-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px) 76px;
}

.section-heading {
  margin-bottom: 22px;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.05;
}

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

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.monitor-card {
  display: grid;
  gap: 16px;
  min-height: 250px;
  padding: 18px;
}

.monitor-card h3 {
  margin: 10px 0 6px;
  font-size: 1.15rem;
}

.monitor-card a {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.monitor-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.monitor-card dl div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
}

.monitor-card dt {
  color: var(--blue);
  font-weight: 900;
}

.monitor-card dd {
  margin: 0;
}

.monitor-actions,
.form-actions,
.console-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.status-badge {
  display: inline-flex;
  padding: 4px 8px;
  background: var(--yellow);
  color: #17130b;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--shadow);
}

.status-ok {
  background: var(--green);
  color: #11140f;
}

.status-down {
  background: var(--red);
  color: #150806;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px;
  border: 4px dashed var(--line);
  color: var(--muted);
}

.check-card {
  min-height: 260px;
  padding: 18px;
}

.pixel-chip {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 36px;
  margin-bottom: 18px;
  background: var(--blue);
  color: #071016;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--shadow);
}

.check-card h3,
.llm-note h3 {
  margin: 0 0 12px;
  font-size: 1.08rem;
  line-height: 1.3;
}

.check-card p,
.llm-note p {
  margin: 0;
  color: var(--muted);
}

.geo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
  gap: 20px;
}

.region-list,
.llm-note {
  padding: 20px;
}

.region-list {
  display: grid;
  gap: 12px;
}

.region-list div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 12px;
}

meter {
  width: 100%;
  height: 24px;
}

meter::-webkit-meter-bar {
  border: 3px solid var(--line);
  background: #121216;
}

meter::-webkit-meter-optimum-value {
  background: var(--green);
}

.llm-note {
  border-color: var(--yellow);
}

.admin-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px) 76px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 20px;
}

.admin-form,
.admin-note,
.auth-panel {
  padding: 20px;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 900;
}

.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 46px;
  border: 3px solid var(--line);
  background: #121216;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}

.admin-message,
.console-session {
  margin: 0;
  color: var(--yellow);
}

.button.danger {
  border-color: var(--red);
}

.auth-page,
.console-page {
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  align-content: center;
  gap: 26px;
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.auth-panel h1 {
  font-size: clamp(2rem, 7vw, 4.8rem);
}

.auth-panel p {
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 32px) 40px;
  color: var(--muted);
}

@media (max-width: 880px) {
  .hero,
  .geo-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

  .monitor-grid {
    grid-template-columns: 1fr;
  }

  .status-strip {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .topbar,
  .footer,
  .hero-actions,
  .console-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .language-switcher {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .check-grid {
    grid-template-columns: 1fr;
  }

  .check-card {
    min-height: 0;
  }

  .region-list div {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .region-list b {
    grid-column: 2;
  }
}
