:root {
  --black: #080b10;
  --ink: #111827;
  --muted: #667085;
  --paper: #f7fbff;
  --line: rgba(8, 11, 16, 0.16);
  --blue: #00b5ff;
  --blue-deep: #0b4f8a;
  --blue-soft: #eaf5ff;
  --white: #ffffff;
  --panel: rgba(255, 255, 255, 0.88);
  --shadow: 0 24px 70px rgba(8, 11, 16, 0.08);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100svh;
}

body {
  margin: 0;
  background:
    linear-gradient(112deg, transparent 0 58%, rgba(8, 11, 16, 0.96) 58% 71%, var(--blue) 71% 83%, transparent 83%),
    linear-gradient(148deg, rgba(20, 120, 200, 0.16), transparent 42%),
    linear-gradient(90deg, rgba(8, 11, 16, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(8, 11, 16, 0.032) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 36px 36px, 36px 36px;
  color: var(--ink);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.wrap {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.94rem;
}

.home-link {
  font-weight: 850;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-weight: 750;
}

.context-bar {
  position: relative;
  z-index: 2;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.context-trail,
.context-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.context-trail {
  overflow-wrap: anywhere;
}

.context-trail a,
.context-actions a {
  color: inherit;
}

.context-trail a:hover,
.context-trail a:focus-visible,
.context-actions a:hover,
.context-actions a:focus-visible {
  color: var(--blue-deep);
  outline: none;
}

.context-actions {
  justify-content: flex-end;
}

.context-actions .button {
  min-height: 38px;
  padding: 8px 12px;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.home-link:hover,
.home-link:focus-visible {
  color: var(--blue-deep);
  outline: none;
}

.page {
  position: relative;
  z-index: 1;
  min-height: calc(100svh - 76px);
  display: grid;
  align-items: center;
  padding: clamp(30px, 7vw, 78px) 0;
}

.hero {
  width: min(640px, 100%);
  margin-left: clamp(0px, 2vw, 24px);
}

.mark {
  width: 86px;
  height: 8px;
  margin-bottom: 28px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--black) 0 38%, var(--white) 38% 62%, var(--blue) 62%);
  border: 1px solid var(--black);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(3.2rem, 7.3vw, 5.15rem);
  line-height: 0.94;
  letter-spacing: 0;
  white-space: nowrap;
}

.subline {
  max-width: 620px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.25vw, 1rem);
  font-weight: 750;
  white-space: nowrap;
}

.subline strong {
  color: var(--ink);
  font-weight: 850;
}

.links,
.link-list {
  max-width: 540px;
  display: grid;
  border-top: 2px solid var(--black);
}

.link,
.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 14px 0;
  border-bottom: 2px solid var(--black);
  background: transparent;
  font-weight: 850;
  transition: color 140ms ease, padding 140ms ease;
}

.link:hover,
.link:focus-visible,
.link-row:hover,
.link-row:focus-visible {
  padding-inline: 10px;
  color: var(--blue-deep);
  outline: none;
}

.link span:last-child,
.link-row .meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  overflow-wrap: anywhere;
  text-align: right;
}

.panel {
  width: min(540px, 100%);
  padding: clamp(24px, 4vw, 34px);
  border: 2px solid var(--black);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--blue-deep);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 3px;
  background: var(--blue);
}

.lead {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 1rem;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.92rem;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 2px solid var(--black);
  border-radius: 8px;
  background: var(--white);
}

.field input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.button {
  min-height: 48px;
  padding: 12px 16px;
  border: 2px solid var(--black);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.button.primary {
  background: var(--blue);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.6);
}

.feedback {
  min-height: 1.5em;
  margin-top: 6px;
  color: #b42318;
  font-size: 0.92rem;
  font-weight: 750;
}

.dashboard {
  display: grid;
  gap: 34px;
}

.media-page .page,
.files-page .page,
.emulator-page .page {
  align-items: start;
  padding-top: clamp(44px, 6vw, 72px);
}

.media-page .dashboard,
.files-page .dashboard,
.emulator-page .dashboard {
  width: min(760px, 100%);
}

.media-page .section-heading,
.files-page .section-heading,
.emulator-page .section-heading {
  align-items: start;
  justify-content: start;
  flex-direction: column;
  flex-wrap: wrap;
}

.media-page .muted-note,
.files-page .muted-note,
.emulator-page .muted-note {
  max-width: 52ch;
}

.dashboard-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-top p {
  margin-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.section {
  display: grid;
  gap: 10px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 1rem;
  text-transform: uppercase;
}

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

.tile {
  min-height: 164px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 2px solid var(--black);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 6px 6px 0 rgba(8, 11, 16, 0.07);
}

.tile:hover,
.tile:focus-visible {
  outline: none;
  transform: translate(1px, 1px);
  box-shadow: 5px 5px 0 rgba(8, 11, 16, 0.07);
}

.tile[data-disabled="true"] {
  cursor: default;
}

.system-card-active {
  border-color: var(--blue-deep);
  box-shadow: 6px 6px 0 rgba(11, 79, 138, 0.15);
}

.tile-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.tile h3 {
  margin-bottom: 6px;
  font-size: 1.12rem;
}

.tile p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.status.live {
  color: var(--blue-deep);
  border-color: rgba(0, 181, 255, 0.35);
  background: rgba(0, 181, 255, 0.12);
}

.muted-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.notes-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.notes-list li + li {
  margin-top: 8px;
}

.emulator-stage {
  width: min(100%, 960px);
  aspect-ratio: 4 / 3;
  min-height: 320px;
  border: 2px solid var(--black);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.emulator-stage #game {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.emulator-stage canvas,
.emulator-stage video,
.emulator-stage iframe {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.auth-page .page {
  align-items: start;
  padding-top: clamp(56px, 9vw, 110px);
}

.auth-page .panel {
  width: min(500px, 100%);
}

.auth-page h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4.2vw, 2.8rem);
  line-height: 1;
  white-space: normal;
}

.auth-page .lead {
  max-width: 46ch;
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(162deg, transparent 0 92%, rgba(8, 11, 16, 0.96) 92% 96%, var(--blue) 96% 99%, transparent 99%),
      linear-gradient(148deg, rgba(20, 120, 200, 0.16), transparent 42%),
      linear-gradient(90deg, rgba(8, 11, 16, 0.04) 1px, transparent 1px),
      linear-gradient(0deg, rgba(8, 11, 16, 0.032) 1px, transparent 1px),
      var(--paper);
    background-size: auto, auto, 36px 36px, 36px 36px;
  }

  .wrap {
    width: min(100% - 32px, 1040px);
  }

  .nav {
    min-height: auto;
    display: grid;
    padding: 16px 0 14px;
  }

  .nav-links {
    justify-content: space-between;
    gap: 10px;
    font-size: 0.88rem;
  }

  .context-bar {
    min-height: auto;
    display: grid;
    padding: 12px 0 0;
  }

  .context-actions {
    justify-content: start;
    gap: 8px 14px;
  }

  .hero {
    width: min(100%, 640px);
    margin-left: 0;
  }

  h1 {
    font-size: clamp(2.45rem, 12.7vw, 3.35rem);
    white-space: normal;
  }

  .subline {
    margin-bottom: 30px;
    white-space: normal;
  }

  .link span:last-child,
  .link-row .meta {
    text-align: left;
  }

  .dashboard-top,
  .section-heading {
    display: grid;
  }

  .media-page .dashboard,
  .files-page .dashboard,
  .emulator-page .dashboard {
    width: 100%;
  }

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

  .auth-page .page {
    padding-top: 34px;
  }

  .auth-page h1 {
    font-size: clamp(1.8rem, 8vw, 2.25rem);
  }

  .emulator-stage,
  .emulator-stage #game {
    min-height: 260px;
  }
}

@media (max-height: 820px) and (min-width: 761px) {
  .page {
    align-items: start;
    padding-top: 72px;
  }

  .mark {
    margin-bottom: 20px;
  }

  h1 {
    margin-bottom: 10px;
    font-size: clamp(3rem, 6vw, 4.4rem);
  }

  .subline {
    margin-bottom: 24px;
    font-size: 0.94rem;
  }
}
