.tram-intro {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 60px;
  align-items: center;
  padding-top: 50px;
  padding-bottom: 48px;
}
.tram-intro h1 > span { color: #85ded5; }
.tram-legend { justify-self: end; max-width: 480px; }
.tram-legend p { color: #d7cfe3; margin: 18px 0 0; }
.tram-game { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 26px; align-items: start; padding-bottom: 55px; }
.tram-map-panel { overflow: hidden; border: 1px solid #58426f; border-radius: 16px; background: #201932; }
.tram-map-panel .scene-top { flex-wrap: wrap; padding: 14px 17px; font-size: 13px; }
.tram-map { position: relative; aspect-ratio: 3 / 2; }
.tram-map > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.map-stop {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  transform: translate(-50%, -50%);
  border: 2px solid #171128;
  border-radius: 9px;
  background: #fff2d9;
  padding: 5px 9px 5px 5px;
  color: #21162e;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 3px 4px 0 #17112899;
  min-height: 44px;
}
.map-stop:hover { background: #fff; }
.map-stop[aria-pressed=true] { background: #85ded5; border-color: #153d3a; }
.map-stop:disabled { cursor: default; }
.stop-number { display: grid; place-items: center; width: 27px; height: 29px; border: 1px solid #17112855; border-radius: 5px; font-size: 17px; }
.stop-post { left: 18%; top: 38%; }
.stop-bridge { left: 55%; top: 22%; }
.stop-park { left: 43%; top: 68%; }
.stop-square { left: 78%; top: 39%; }
.stop-depot { left: 80%; top: 78%; }
.map-instructions { margin: 0; padding: 17px; color: var(--muted); font-size: 16px; }
.passenger-notes { margin-top: 35px; }
.notes-heading h2 { font-size: 27px; margin-bottom: 10px; }
.notes-heading > p { color: var(--muted); }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.passenger-note { position: relative; background: #302440; border: 1px solid #5e466d; border-radius: 11px; padding: 20px; }
.passenger-note h3 { margin: 0 0 10px; font-size: 17px; color: #85ded5; }
.passenger-note p { margin: 0; color: #e1d6eb; }
.route-panel { border: 1px solid #56817b; border-radius: 16px; background: #261f35; padding: 25px; }
.route-panel .section-label { color: #85ded5; }
.route-panel h2 { font-size: 29px; }
.route-panel-top > p { color: var(--muted); }
.route-list { padding: 0; margin: 20px 0; list-style: none; }
.route-stop { padding: 12px; margin-bottom: 10px; border: 1px solid #665475; border-radius: 9px; background: #17112866; }
.route-stop-heading { display: flex; align-items: center; gap: 10px; }
.route-position { display: grid; place-items: center; border-radius: 50%; background: #85ded51a; color: #85ded5; font-size: 14px; width: 27px; height: 27px; }
.route-stop-heading strong { font-size: 16px; font-weight: 500; }
.route-stop-number { margin-left: auto; color: #85ded5; font-size: 17px; white-space: nowrap; }
.route-actions { display: flex; justify-content: space-between; gap: 7px; margin-top: 11px; }
.route-actions button { min-height: 36px; border: 1px solid #675375; border-radius: 5px; background: #342642; padding: 5px 8px; font-size: 14px; }
.route-actions button:disabled { opacity: .35; cursor: default; }
.empty-route { background: #17112866; border: 1px dashed #665475; border-radius: 8px; padding: 18px; color: var(--muted); }
.route-announcement { color: #85ded5; font-size: 14px; margin: 0 0 16px; }
.route-announcement:empty { display: none; }
#tram-form label { display: block; font-weight: 500; margin-bottom: 8px; }
#code-instructions { color: var(--muted); font-size: 16px; }
#tram-code { width: 100%; padding: 12px 14px; background: #171128; color: var(--ink); border: 1px solid #8a728c; border-radius: 8px; font-size: 23px; letter-spacing: .1em; margin-bottom: 15px; }
#tram-code::placeholder { font-size: 16px; letter-spacing: 0; }
#tram-code[aria-invalid=true] { border-color: #ffbc98; }
.tram-page .primary { background: #85ded5; }
.route-panel .primary { width: 100%; font-size: 14px; }
.tram-feedback { font-size: 14px; color: #ffbc98; margin: 13px 0; }
.tram-feedback:empty { display: none; }
.tram-hint-list { padding-left: 20px; color: #d7e4b0; font-size: 14px; }
.tram-hint-list li { margin: 12px 0; }
.tram-hint-list:empty { display: none; }
#tram-hint:disabled { cursor: default; text-decoration: none; color: var(--muted); }
.tram-save { font-size: 12px; color: var(--muted); margin-top: 20px; }
.tram-victory { border-top: 1px solid #56817b; padding-top: 20px; }
.tram-victory h3 { color: #85ded5; font-size: 28px; line-height: 1.2; margin: 15px 0; }
.tram-victory p { color: #d7cfe3; }
.night-ticket { display: grid; gap: 8px; background: #85ded5; color: #153330; padding: 20px 16px; margin: 23px 0; border: 2px dashed #28534d; border-radius: 9px; transform: rotate(-2deg); }
.night-ticket span { font-size: 12px; }
.night-ticket strong { font-size: 23px; line-height: 1.25; }
.tram-complete .tram-map-panel .scene-top { background: #244b44; }

@media (max-width: 1050px) {
  .tram-game { grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
  .route-panel { padding: 20px; }
  .tram-intro { gap: 35px; }
}
@media (max-width: 800px) {
  .tram-intro { grid-template-columns: 1fr; gap: 25px; padding: 35px 0; }
  .tram-intro h1 { font-size: clamp(45px, 9vw, 68px); }
  .tram-legend { max-width: 100%; justify-self: start; }
  .tram-game { grid-template-columns: 1fr; }
  .notes-grid { gap: 12px; }
  .route-panel { padding: 24px; }
}
@media (max-width: 600px) {
  .tram-page .header nav a:first-child { display: block; }
  .tram-page .header nav a:last-child { display: none; }
  .tram-map-panel .scene-top { font-size: 12px; padding: 12px; gap: 5px; }
  .map-stop { font-size: 14px; padding: 4px; gap: 4px; min-height: 42px; border-radius: 7px; }
  .stop-number { width: 22px; height: 26px; font-size: 14px; }
  .stop-square { left: 77%; top: 39%; }
  .stop-depot { left: 82%; top: 80%; }
  .notes-grid { grid-template-columns: 1fr; }
  .notes-heading h2 { font-size: 25px; }
  .passenger-note { padding: 18px; }
  .route-actions button { font-size: 14px; min-height: 42px; }
}
