:root {
  --bg: #0c1715;
  --panel: #12221f;
  --panel-soft: #172a26;
  --line: #2d423d;
  --text: #f1eee4;
  --muted: #98a8a2;
  --screen: #b8c99a;
  --screen-dark: #1b2b24;
  --orange: #f06a3c;
  --yellow: #e6b84a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(rgba(184, 201, 154, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 201, 154, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--text);
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(240, 106, 60, 0.7);
  outline-offset: 3px;
}

.site-header,
main,
footer {
  width: min(1400px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  text-decoration: none;
}

.brand-screen {
  width: 48px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 5px solid #364b46;
  border-radius: 4px;
  background: var(--screen);
  box-shadow: inset 0 0 0 2px rgba(27, 43, 36, 0.25);
  color: var(--screen-dark);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.quick-link {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--screen);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quick-link:hover {
  border-color: var(--screen);
  background: rgba(184, 201, 154, 0.08);
}

.intro {
  padding: 54px 0 38px;
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 70px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.intro h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.97;
  text-transform: uppercase;
}

.intro-note {
  padding: 18px 20px;
  border-left: 3px solid var(--screen);
  background: rgba(184, 201, 154, 0.06);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.intro-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: #5fcc7b;
  box-shadow: 0 0 0 5px rgba(95, 204, 123, 0.12);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.24);
}

.emulator-panel {
  min-width: 0;
  padding: 26px;
  border-right: 1px solid var(--line);
}

.panel-bar {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.panel-bar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 11px;
}

.panel-kicker {
  color: var(--orange);
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.panel-bar strong {
  font-size: 17px;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
}

.connection-state.is-online i {
  background: #5fcc7b;
}

.connection-state.is-offline i {
  background: var(--orange);
}

.emulator-stage {
  min-height: 680px;
  position: relative;
  border: 10px solid #253632;
  border-radius: 5px;
  background: #050908;
  overflow: hidden;
}

.emulator-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.emulator-stage iframe {
  width: 100%;
  height: 100%;
  min-height: 660px;
  display: block;
  border: 0;
  background: #050908;
}

.loading-card {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: #09100f;
  text-align: center;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.loading-card.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-card strong {
  margin-top: 8px;
  font-size: 15px;
}

.loading-card small {
  color: var(--muted);
  font-size: 11px;
}

.loading-bars {
  height: 24px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.loading-bars i {
  width: 5px;
  height: 9px;
  background: var(--screen);
  animation: bars 0.8s ease-in-out infinite alternate;
}

.loading-bars i:nth-child(2) {
  height: 16px;
  animation-delay: 0.15s;
}

.loading-bars i:nth-child(3) {
  height: 22px;
  animation-delay: 0.3s;
}

@keyframes bars {
  to { opacity: 0.3; transform: scaleY(0.5); }
}

.panel-actions {
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.panel-actions button,
.panel-actions a {
  min-height: 43px;
  padding: 0 15px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-actions .primary-action {
  border-color: var(--orange);
  background: var(--orange);
  color: #160d09;
}

.panel-actions button:hover,
.panel-actions a:hover {
  border-color: var(--screen);
}

.panel-actions a {
  margin-left: auto;
  color: var(--screen);
}

.guide-panel {
  padding: 30px 26px;
  background: var(--panel-soft);
}

.guide-heading h2,
.guide-heading p {
  margin: 0;
}

.guide-heading h2 {
  font-size: 30px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.guide-heading > p:last-child {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.warning-card {
  margin-top: 23px;
  padding: 15px;
  border: 1px solid rgba(230, 184, 74, 0.42);
  background: rgba(230, 184, 74, 0.08);
  display: flex;
  gap: 12px;
}

.warning-card > span {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #1c1606;
  font-weight: 900;
}

.warning-card strong {
  color: var(--yellow);
  font-size: 12px;
}

.warning-card p {
  margin: 4px 0 0;
  color: #c3c8b6;
  font-size: 11px;
  line-height: 1.45;
}

kbd {
  min-width: 25px;
  padding: 2px 5px;
  border: 1px solid #53635f;
  border-bottom-width: 2px;
  border-radius: 2px;
  background: #263834;
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
  font-weight: 800;
}

.guide-list {
  margin: 25px 0 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: 12px;
}

.guide-list li > span {
  color: var(--orange);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}

.guide-list strong {
  display: block;
  font-size: 12px;
}

.guide-list p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.source-card {
  margin-top: 10px;
  padding: 16px;
  background: #0e1d1a;
}

.source-card > span {
  color: var(--screen);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.source-card p {
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.source-card a {
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.source-card a:hover {
  color: var(--screen);
}

.usage-notes {
  margin: 52px 0 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.usage-notes article {
  padding-top: 17px;
  border-top: 3px solid var(--screen-dark);
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
}

.usage-notes article > span {
  color: var(--orange);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}

.usage-notes strong {
  font-size: 13px;
  text-transform: uppercase;
}

.usage-notes p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

footer {
  min-height: 86px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  color: #71817c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

footer p {
  margin: 0;
  text-align: center;
}

footer > span:last-child {
  text-align: right;
}

@media (max-width: 1040px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .intro-note {
    max-width: 620px;
  }

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

  .emulator-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .guide-panel {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 25px;
  }

  .warning-card {
    grid-column: 1;
  }

  .guide-list {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0;
  }

  .source-card {
    grid-column: 1;
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1400px);
  }

  .site-header {
    min-height: 72px;
  }

  .quick-link {
    width: 43px;
    padding: 0;
    font-size: 0;
  }

  .quick-link span {
    font-size: 18px;
  }

  .intro {
    padding: 38px 0 28px;
  }

  .intro h1 {
    font-size: clamp(35px, 11vw, 52px);
  }

  .emulator-panel,
  .guide-panel {
    padding: 18px 12px;
  }

  .panel-bar {
    align-items: flex-start;
  }

  .connection-state span {
    max-width: 90px;
    text-align: right;
  }

  .emulator-stage {
    min-height: 540px;
    border-width: 6px;
  }

  .emulator-stage iframe {
    min-height: 528px;
  }

  .panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .panel-actions button,
  .panel-actions a {
    padding-inline: 8px;
    font-size: 9px;
  }

  .panel-actions a {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .guide-panel {
    display: block;
  }

  .guide-list {
    margin-top: 23px;
  }

  .source-card {
    margin-top: 16px;
  }

  .usage-notes {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  footer {
    padding: 24px 0;
    grid-template-columns: 1fr;
    gap: 12px;
    justify-items: center;
  }

  footer > span:last-child {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
