:root {
  color-scheme: dark;

  --bg: #101114;
  --bg-2: #181a20;

  --panel: rgba(29, 31, 38, 0.92);
  --panel-strong: rgba(38, 41, 50, 0.96);

  --line: rgba(220, 255, 120, 0.16);

  --text: #f7f7ef;
  --muted: #b3b5aa;
  --muted-strong: #d6d8cc;

  --cyan: #bef264;
  --amber: #eab308;
  --orange: #f97316;
  --green: #86efac;
  --red: #fb7185;
  --violet: #c084fc;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(190, 242, 100, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 179, 8, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 20% 10%, rgba(190, 242, 100, 0.12), transparent 32%),
    radial-gradient(circle at 80% 0%, rgba(134, 239, 172, 0.10), transparent 28%),
    linear-gradient(145deg, #101114 0%, #181a20 48%, #202216 100%);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(190, 242, 100, 0.42);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 24px;
}

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, rgba(190, 242, 100, 0.12), transparent 36%),
    linear-gradient(135deg, rgba(38, 41, 50, 0.96), rgba(29, 31, 38, 0.92));
  box-shadow: var(--shadow);
}

.site-header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 42%;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--amber), var(--cyan));
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.tagline {
  margin: 12px 0 0;
  color: var(--muted-strong);
  font-size: 1.16rem;
}

.intro {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.lab-badge {
  position: relative;
  width: 124px;
  height: 124px;
  border: 1px solid rgba(190, 242, 100, 0.25);
  border-radius: 50%;
  background:
    conic-gradient(from 210deg, rgba(190, 242, 100, 0.1), rgba(190, 242, 100, 0.35), rgba(249, 115, 22, 0.16), rgba(190, 242, 100, 0.1)),
    rgba(16, 17, 20, 0.46);
  animation: soft-spin 20s linear infinite;
}

.header-side {
  display: grid;
  gap: 14px;
  justify-items: end;
  align-content: center;
  min-width: 0;
}

.pwa-install-box {
  display: grid;
  gap: 6px;
  justify-items: end;
  max-width: 220px;
  min-width: 0;
  text-align: right;
}

.pwa-install-box .button {
  width: 100%;
}

.pwa-install-box .small-note {
  margin: 0;
  font-size: 0.78rem;
}

.badge-core {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--amber), var(--orange));
  box-shadow: 0 0 30px rgba(190, 242, 100, 0.42);
}

.badge-line {
  position: absolute;
  top: 60px;
  left: 14px;
  width: 96px;
  height: 2px;
  background: var(--cyan);
  transform: rotate(-24deg);
}

.badge-dot {
  position: absolute;
  right: 20px;
  bottom: 28px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  grid-column: span 4;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.game-panel,
.wide-panel {
  grid-column: span 8;
}

.panel-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 38px;
  margin-bottom: 18px;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.panel-description {
  max-width: 68ch;
  margin: -2px 0 16px;
  color: var(--muted-strong);
  font-size: 0.92rem;
  line-height: 1.55;
}

.status-pill {
  flex: 0 0 auto;
  max-width: 48%;
  padding: 7px 10px;
  border: 1px solid rgba(190, 242, 100, 0.28);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(190, 242, 100, 0.09);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.status-pill.warm {
  border-color: rgba(190, 242, 100, 0.28);
  color: var(--amber);
  background: rgba(190, 242, 100, 0.1);
}

.ip-display {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 16px;
  border: 1px solid rgba(190, 242, 100, 0.22);
  border-radius: var(--radius);
  color: #fff8d6;
  background: rgba(190, 242, 100, 0.08);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(1.45rem, 5vw, 2.1rem);
  font-weight: 800;
}

.connection-summary {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(220, 255, 120, 0.14);
}

.connection-label {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.connection-summary p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.connection-meta {
  margin-top: 18px;
}

.connection-meta h3 {
  margin: 0 0 8px;
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 800;
}

.connection-list {
  margin: 0;
}

.connection-list div {
  display: grid;
  grid-template-columns: minmax(110px, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(220, 255, 120, 0.12);
}

.connection-list div:first-child {
  border-top: 1px solid rgba(220, 255, 120, 0.12);
}

.connection-list dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.connection-list dd {
  margin: 0;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.router-defender {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(220, 255, 120, 0.14);
  min-width: 0;
}

.router-defender-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  min-width: 0;
}

.router-kicker {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.router-defender-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 850;
}

.router-defender-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.router-lives {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(190, 242, 100, 0.28);
  border-radius: 999px;
  color: var(--amber);
  background: rgba(190, 242, 100, 0.09);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.packet-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 255, 120, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(190, 242, 100, 0.07), transparent),
    rgba(16, 17, 20, 0.4);
  min-width: 0;
}

.packet-card span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.packet-card strong {
  color: #fff8d6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.router-routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  min-width: 0;
}

.route-button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 255, 120, 0.22);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
  font-weight: 500;
}

.route-button[data-route="10"] {
  border-color: rgba(190, 242, 100, 0.28);
  color: var(--cyan);
  background: rgba(190, 242, 100, 0.08);
}

.route-button[data-route="172"] {
  border-color: rgba(134, 239, 172, 0.28);
  color: var(--green);
  background: rgba(134, 239, 172, 0.08);
}

.route-button[data-route="192"] {
  border-color: rgba(190, 242, 100, 0.3);
  color: var(--amber);
  background: rgba(190, 242, 100, 0.08);
}

.route-button[data-route="public"] {
  border-color: rgba(192, 132, 252, 0.28);
  color: var(--violet);
  background: rgba(192, 132, 252, 0.08);
}

.route-button:hover {
  border-color: rgba(190, 242, 100, 0.52);
  background: rgba(255, 255, 255, 0.08);
}

.router-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  min-width: 0;
}

.router-footer > span {
  min-width: 0;
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 750;
}

.router-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.small-button {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.small-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.button,
.control-button {
  min-height: 42px;
  border: 1px solid rgba(220, 255, 120, 0.24);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 500;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button {
  padding: 10px 14px;
}

.button:hover,
.control-button:hover {
  border-color: rgba(190, 242, 100, 0.5);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.button.primary {
  border-color: rgba(190, 242, 100, 0.52);
  color: #17190f;
  background: linear-gradient(180deg, #d9ff88, #bef264);
  font-weight: 500;
}

.button.ghost {
  color: var(--muted-strong);
}

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(220, 255, 120, 0.26);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(16, 17, 20, 0.76);
}

.field input,
.field select {
  min-height: 42px;
  padding: 10px 42px 10px 12px;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: dark;
  accent-color: var(--amber);
  background:
    linear-gradient(45deg, transparent 50%, var(--amber) 50%),
    linear-gradient(135deg, var(--amber) 50%, transparent 50%),
    rgba(16, 17, 20, 0.76);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

.field select:hover {
  border-color: rgba(190, 242, 100, 0.42);
}

.field select option {
  color: var(--text);
  background: var(--bg-2);
}

.field textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(214, 216, 204, 0.54);
}

.field-meta {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: right;
}

.range-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.range-field input {
  grid-column: 1 / -1;
  padding: 0;
  accent-color: var(--amber);
}

.range-field output {
  min-width: 34px;
  color: var(--amber);
  text-align: right;
}

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

.check-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid rgba(220, 255, 120, 0.2);
  border-radius: var(--radius);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.check-grid input {
  accent-color: var(--amber);
}

.strength-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.strength-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  transition: width 180ms ease, background 180ms ease;
}

.message {
  min-height: 1.25em;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.message.error {
  color: #ffc2cc;
}

.message.ok {
  color: #c8fbd6;
}

.security-notes {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(190, 242, 100, 0.22);
  border-radius: var(--radius);
  color: var(--muted-strong);
  background: rgba(190, 242, 100, 0.07);
  font-size: 0.9rem;
  line-height: 1.45;
}

.security-notes p {
  margin: 0;
}

.key-options {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.key-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.key-output {
  min-width: 0;
}

.key-output textarea {
  min-height: 220px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.key-output.private textarea {
  min-height: 300px;
}

.qr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.45fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.wifi-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.toggle-field {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(220, 255, 120, 0.2);
  border-radius: var(--radius);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  font-weight: 750;
}

.toggle-field input {
  accent-color: var(--amber);
}

.qr-preview {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 18px;
  border: 1px solid rgba(190, 242, 100, 0.22);
  border-radius: var(--radius);
  color: var(--muted);
  background:
    linear-gradient(rgba(190, 242, 100, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 242, 100, 0.055) 1px, transparent 1px),
    rgba(16, 17, 20, 0.48);
  background-size: 24px 24px, 24px 24px, auto;
  text-align: center;
}

.qr-preview canvas {
  width: min(100%, 256px);
  height: auto;
  border: 10px solid #ffffff;
  border-radius: 6px;
  background: #ffffff;
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.game-stats span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(190, 242, 100, 0.16);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(16, 17, 20, 0.5);
  font-size: 0.82rem;
  text-align: center;
}

.game-stats strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 1rem;
}

.game-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(190, 242, 100, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(192, 132, 252, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 242, 100, 0.06) 1px, transparent 1px),
    #101114;
  background-size: 32px 32px, 32px 32px, auto;
}

#arribaGame {
  display: block;
  width: 100%;
  height: clamp(300px, 42vw, 460px);
  touch-action: pan-y;
}

.game-stage.is-playing #arribaGame {
  touch-action: none;
}

.game-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  margin-top: 12px;
}

.legend-section {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(220, 255, 120, 0.18);
  border-radius: var(--radius);
  background: rgba(16, 17, 20, 0.38);
}

.legend-section.danger {
  border-color: rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.055);
}

.legend-section.bonus {
  border-color: rgba(134, 239, 172, 0.28);
  background: rgba(134, 239, 172, 0.055);
}

.legend-title {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.legend-section.danger .legend-title {
  color: #ffc2cc;
}

.legend-section.bonus .legend-title {
  color: #c8fbd6;
}

.legend-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 7px;
}

.legend-item {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(220, 255, 120, 0.15);
  border-radius: var(--radius);
  color: var(--muted-strong);
  background: rgba(16, 17, 20, 0.46);
  font-size: 0.78rem;
  font-weight: 750;
}

.legend-section.danger .legend-item {
  border-color: rgba(251, 113, 133, 0.16);
}

.legend-section.bonus .legend-item {
  border-color: rgba(134, 239, 172, 0.16);
}

.legend-item svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.milestone {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--amber);
  font-weight: 800;
  text-align: center;
}

.game-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.mobile-controls {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.control-button {
  width: 52px;
  height: 42px;
  padding: 0;
  color: var(--amber);
  font-size: 1.25rem;
}

.file-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  margin-top: 16px;
}

.textarea-full {
  margin-top: 14px;
}

.subnet-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 96px);
  gap: 12px;
  align-items: end;
}

#calculateSubnet {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 130px;
}

.subnet-form .field {
  min-width: 0;
}

#subnetIp {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding-right: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

#subnetCidr {
  min-width: 86px;
  padding-left: 12px;
  padding-right: 6px;
  text-align: left;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.result-list {
  display: grid;
  grid-template-columns: minmax(120px, 0.72fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 16px 0 0;
}

.result-list dt,
.result-list dd {
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(220, 255, 120, 0.13);
}

.result-list dt {
  color: var(--muted);
}

.result-list dd {
  margin: 0;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 18px 4px 0;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  color: var(--muted-strong);
  font-weight: 750;
}

.site-footer span {
  color: rgba(214, 216, 204, 0.68);
}

@keyframes soft-spin {
  to {
    transform: rotate(360deg);
  }
}

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

@media (max-width: 980px) {
  .panel,
  .game-panel,
  .wide-panel {
    grid-column: span 6;
  }

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

  .header-side {
    justify-items: start;
  }

  .pwa-install-box {
    justify-items: start;
    max-width: min(100%, 280px);
    text-align: left;
  }

  .lab-badge {
    position: relative;
    width: 76px;
    height: 76px;
    opacity: 0.72;
  }

  .badge-core {
    inset: 24px;
  }

  .badge-line {
    top: 37px;
    left: 10px;
    width: 56px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 22px, 620px);
    padding-top: 16px;
  }

  .site-header {
    padding: 22px;
  }

  .dashboard {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .panel,
  .game-panel,
  .wide-panel {
    grid-column: auto;
    padding: 16px;
  }

  .panel-heading {
    display: grid;
  }

  .status-pill {
    max-width: none;
    justify-self: start;
  }

  .file-grid,
  .key-options,
  .key-output-grid,
  .qr-layout,
  .wifi-options,
  .subnet-form,
  .game-actions {
    grid-template-columns: 1fr;
  }

  #calculateSubnet {
    grid-column: auto;
    width: 100%;
    justify-self: stretch;
  }

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

  .field-meta {
    text-align: left;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  #arribaGame {
    height: clamp(340px, 88vw, 520px);
  }

  .mobile-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .control-button {
    width: 100%;
    height: 48px;
  }

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

  .result-list dt {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .result-list dd {
    padding-top: 2px;
  }

  .connection-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .connection-list dd {
    text-align: left;
  }

  .router-defender-header,
  .router-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .router-lives {
    align-self: flex-start;
  }

  .router-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .router-routes {
    grid-template-columns: 1fr;
  }
}

.not-found-shell {
  display: grid;
  min-height: 100vh;
  grid-template-rows: 1fr auto;
  align-items: center;
}

.not-found-card {
  position: relative;
  overflow: hidden;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 7vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 80% 20%, rgba(190, 242, 100, 0.18), transparent 28%),
    radial-gradient(circle at 20% 80%, rgba(134, 239, 172, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(38, 41, 50, 0.96), rgba(29, 31, 38, 0.92));
  box-shadow: var(--shadow);
  text-align: center;
}

.not-found-code {
  margin: 10px 0;
  color: var(--amber);
  font-size: clamp(5rem, 22vw, 12rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.08em;
  text-shadow: 0 0 34px rgba(190, 242, 100, 0.25);
}

.not-found-card h1 {
  max-width: 680px;
  margin: 0 auto;
  font-size: clamp(2rem, 7vw, 4rem);
  letter-spacing: -0.04em;
}

.not-found-card .tagline {
  max-width: 560px;
  margin: 18px auto 0;
  line-height: 1.6;
}

.not-found-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  text-decoration: none;
}

.not-found-orbit {
  position: relative;
  width: 150px;
  height: 70px;
  margin: 28px auto 0;
  opacity: 0.95;
}

.orbit-core {
  position: absolute;
  top: 22px;
  left: 53px;
  width: 44px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--amber));
  box-shadow: 0 0 28px rgba(190, 242, 100, 0.22);
}

.orbit-line {
  position: absolute;
  inset: 12px 12px;
  border: 1px solid rgba(190, 242, 100, 0.36);
  border-radius: 50%;
  transform: rotate(-10deg);
}

.orbit-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-one {
  top: 10px;
  left: 28px;
  background: var(--amber);
}

.dot-two {
  right: 28px;
  bottom: 9px;
  background: var(--cyan);
}

.not-found-tip {
  color: var(--muted-strong);
}

@media (max-width: 760px) {
  .not-found-shell {
    align-items: start;
  }

  .not-found-card {
    margin-top: 20px;
  }
}
