.inter-game {
  display: grid;
  gap: 14px;
}

.inter-brief,
.inter-status {
  min-width: 0;
  border: 1px solid #d2dbe7;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.inter-brief {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.inter-brief span {
  min-height: 28px;
  border-radius: 999px;
  background: #17202a;
  color: #ffffff;
  display: inline-grid;
  place-items: center;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.inter-brief strong {
  min-width: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #17202a;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.inter-status {
  min-height: 54px;
  background: #ffffff;
}

.inter-status-good {
  border-color: #0f766e;
  background: #d7f4ef;
  color: #0f514b;
}

.inter-status-warn {
  border-color: #b45309;
  background: #fff7ed;
  color: #8a3b07;
}

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

.inter-stat,
.inter-switch-card,
.inter-switch-row,
.inter-route {
  min-width: 0;
  border: 1px solid #d2dbe7;
  border-radius: 8px;
  background: #ffffff;
}

.inter-stat {
  padding: 9px 10px;
  box-shadow: 0 8px 18px rgba(20, 31, 50, 0.05);
}

.inter-stat span,
.inter-switch-card span,
.inter-switch-row span,
.inter-route-head span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.inter-stat strong {
  display: block;
  min-height: 24px;
  margin-top: 3px;
  color: #17202a;
  font-size: 19px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.inter-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(178px, 0.42fr);
  gap: 10px;
  align-items: stretch;
}

.inter-map,
.inter-side {
  min-width: 0;
  border: 1px solid #d2dbe7;
  border-radius: 8px;
  background: #fbfcfe;
}

.inter-map {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 250, 0.96)),
    repeating-linear-gradient(90deg, rgba(15, 118, 110, 0.045) 0, rgba(15, 118, 110, 0.045) 1px, transparent 1px, transparent 18px);
  touch-action: manipulation;
}

.inter-rails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.inter-rail {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.4;
}

.inter-rail-a {
  stroke: #2563eb;
}

.inter-rail-b {
  stroke: #be5a10;
}

.inter-rail-c {
  stroke: #0f766e;
  stroke-width: 5;
}

.inter-rail-gate {
  stroke: #94a3b8;
  stroke-width: 1.7;
  stroke-dasharray: 5 6;
}

.inter-station,
.inter-car {
  font: inherit;
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  touch-action: manipulation;
}

.inter-station {
  width: 48px;
  min-height: 48px;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #17202a;
  display: grid;
  place-items: center;
  padding: 4px;
  box-shadow: 0 8px 16px rgba(20, 31, 50, 0.09);
}

.inter-station span {
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.inter-station-a {
  border-color: #93c5fd;
}

.inter-station-b {
  border-color: #fdba74;
}

.inter-station-c {
  border-color: #5eead4;
  background: #ecfdf5;
}

.inter-station-n {
  border-color: #a7b0be;
  background: #eef2f6;
  color: #475467;
}

.inter-station-live {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 8px 16px rgba(20, 31, 50, 0.09);
}

.inter-station-meet {
  border-color: #d97706;
  background: #fef3c7;
  box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.18), 0 8px 16px rgba(20, 31, 50, 0.09);
}

.inter-station-wrong {
  border-color: #b42318;
  background: #fff1f0;
  animation: inter-station-wrong 360ms ease;
}

.inter-car {
  z-index: 4;
  width: 48px;
  min-height: 44px;
  border: 2px solid #17202a;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 4px;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(20, 31, 50, 0.16);
  transform: translate(calc(-50% + var(--inter-car-x, 0px)), calc(-50% + var(--inter-car-y, 0px)));
  transition: left 300ms ease, top 300ms ease, transform 300ms ease, background 180ms ease;
}

.inter-car span {
  width: 28px;
  min-height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.inter-car-a {
  background: #1d4ed8;
}

.inter-car-b {
  background: #c2410c;
}

.inter-car-null {
  background: #64748b;
}

.inter-car-meet {
  border-color: #f59e0b;
  animation: inter-car-meet 780ms ease infinite;
}

.inter-station:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.inter-car:active {
  transform: translate(calc(-50% + var(--inter-car-x, 0px)), calc(-50% + var(--inter-car-y, 0px))) scale(0.96);
}

.inter-btn:active,
.inter-step-btn:active {
  transform: scale(0.98);
}

.inter-side {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
}

.inter-switch-card {
  padding: 10px;
}

.inter-switch-card strong {
  display: block;
  margin-top: 4px;
  color: #17202a;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.inter-switch-log {
  display: grid;
  gap: 8px;
}

.inter-switch-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}

.inter-switch-row strong {
  color: #17202a;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.inter-switch-hot {
  border-color: #b45309;
  background: #fff7ed;
}

.inter-equalizer {
  display: grid;
  gap: 8px;
}

.inter-equalizer span {
  min-height: 40px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #075985;
  display: grid;
  place-items: center;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.inter-equalizer span:last-child {
  background: #ffedd5;
  color: #9a3412;
}

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

.inter-route {
  display: grid;
  gap: 9px;
  padding: 10px;
}

.inter-route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inter-route-head strong {
  min-width: 0;
  color: #17202a;
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: right;
}

.inter-route-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 44px;
  align-items: center;
}

.inter-route-dot {
  min-width: 42px;
  min-height: 38px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  display: inline-grid;
  place-items: center;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.inter-route-done {
  background: #d7f4ef;
  border-color: #0f766e;
  color: #0f514b;
}

.inter-route-current {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.inter-route-null {
  background: #eef2f6;
  color: #475467;
}

.inter-route-shared {
  border-color: #d97706;
}

.inter-actions {
  display: grid;
  grid-template-columns: minmax(96px, 0.7fr) minmax(130px, 1fr) minmax(128px, 0.9fr);
  gap: 10px;
  align-items: stretch;
}

.inter-btn,
.inter-step-btn {
  min-width: 0;
  min-height: 46px;
  border-radius: 8px;
  padding: 0 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}

.inter-btn {
  border: 1px solid #d2dbe7;
  background: #ffffff;
  color: #17202a;
}

.inter-btn-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.inter-step-btn {
  border: 1px solid #17202a;
  background: #17202a;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(20, 31, 50, 0.12);
}

.inter-step-btn:disabled {
  border-color: #d2dbe7;
  background: #eef2f6;
  color: #667085;
  cursor: default;
  box-shadow: none;
}

@keyframes inter-station-wrong {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% - 6px), -50%); }
  75% { transform: translate(calc(-50% + 6px), -50%); }
}

@keyframes inter-car-meet {
  0%, 100% { box-shadow: 0 10px 18px rgba(20, 31, 50, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.24), 0 10px 18px rgba(20, 31, 50, 0.16); }
}

@media (max-width: 760px) {
  .inter-brief {
    grid-template-columns: 1fr;
  }

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

  .inter-map {
    min-height: 286px;
  }

  .inter-side {
    grid-template-columns: 1fr 1fr;
    align-content: stretch;
  }

  .inter-switch-card {
    grid-row: span 2;
  }

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

@media (max-width: 480px) {
  .inter-score {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .inter-stat {
    padding: 8px 7px;
  }

  .inter-stat span {
    font-size: 11px;
  }

  .inter-stat strong {
    font-size: 16px;
  }

  .inter-map {
    min-height: 266px;
  }

  .inter-station {
    width: 44px;
    min-height: 44px;
  }

  .inter-station span {
    font-size: 13px;
  }

  .inter-car {
    width: 46px;
    min-height: 44px;
  }

  .inter-side {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .inter-switch-card {
    grid-row: auto;
  }

  .inter-route {
    padding: 9px;
  }

  .inter-route-dot {
    min-width: 39px;
    min-height: 36px;
    padding: 5px 7px;
    font-size: 11px;
  }

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

  .inter-btn,
  .inter-step-btn {
    width: 100%;
    min-height: 48px;
  }
}
