.echo-page{--violet:#d6a6ff;--cyan:#7fe8ff;--ink:#050610;--panel:#0b0d18;--line:#2d3048;--muted:#8f93aa}
.echo-header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:28px;align-items:end}.echo-page h1{margin:8px 0 0;font-size:clamp(3.4rem,11vw,8.4rem);line-height:.8;letter-spacing:-.07em;color:#f4efff;text-shadow:0 0 54px rgba(214,166,255,.18)}.game-lead{max-width:820px;margin:24px 0 0;color:#a8a8bb}.echo-back{align-self:end;border:1px solid #393d59;border-radius:999px;padding:10px 14px;color:#c9c8d8;background:#0a0c16;text-decoration:none;font:800 .68rem/1 ui-monospace,monospace}
.echo-shell{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(280px,.62fr);margin-top:36px;overflow:hidden;border:1px solid #363954;border-radius:24px;background:#04050b;box-shadow:0 36px 100px rgba(0,0,0,.4),0 0 76px rgba(167,111,255,.07)}.echo-stage{min-width:0;background:radial-gradient(circle at 50% 42%,#18152a 0,#090a13 52%,#03040a 100%)}.echo-stage-head{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;border-bottom:1px solid var(--line);background:#24263a}.echo-stage-head div{padding:11px 14px;background:#090b14}.echo-stage-head span,.echo-readout span{display:block;color:#777c9a;font:800 .58rem/1.2 ui-monospace,monospace;letter-spacing:.14em}.echo-stage-head strong{display:block;margin-top:3px;color:#ecebff;font:900 .77rem/1.2 ui-monospace,monospace}.echo-canvas-wrap{display:grid;place-items:center;min-height:420px;padding:28px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.echo-canvas-wrap canvas{display:block;width:min(100%,960px);height:auto;aspect-ratio:16/5;border:1px solid #252842;border-radius:18px;background:#050711;box-shadow:inset 0 0 70px rgba(123,88,200,.06),0 20px 50px rgba(0,0,0,.2);touch-action:manipulation}.echo-mobile-controls{display:none;width:min(100%,960px);grid-template-columns:1fr 1.12fr 1fr;gap:8px;margin-top:10px}.echo-mobile-controls button{min-height:54px;border:1px solid #4a4f74;border-radius:12px;color:#f1edff;background:rgba(17,20,33,.94);font:900 .72rem/1 ui-monospace,monospace;letter-spacing:.04em;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.echo-mobile-controls [data-command="shift"]{border-color:#845cb1;color:#f6e7ff;background:#28173a}.echo-mobile-controls [data-command="shift"].sync-ready{border-color:#7fe8ff;color:#e9fdff;background:#12313a;box-shadow:0 0 0 1px rgba(127,232,255,.16),0 0 22px rgba(127,232,255,.18)}.echo-mobile-controls button:active{transform:scale(.98)}
.echo-legend{display:flex;flex-wrap:wrap;gap:16px;padding:12px 16px;border-top:1px solid var(--line);color:#6f748f;font:800 .58rem/1 ui-monospace,monospace;letter-spacing:.08em}.echo-legend span{display:flex;gap:6px;align-items:center}.echo-legend i{width:10px;height:10px;border-radius:50%;display:block}.legend-player{background:#f7f4ff;box-shadow:0 0 10px #fff}.legend-echo{background:#b985ff}.legend-plate{border-radius:2px!important;background:#7fe8ff}.legend-gate{border-radius:2px!important;background:#6b4d88}
.echo-console{padding:24px 22px;border-left:1px solid var(--line);background:linear-gradient(180deg,#0d0f1a,#080912)}.panel-kicker{margin:0;color:#c28cff;font:900 .64rem/1.3 ui-monospace,monospace;letter-spacing:.15em}.echo-console h2{margin:9px 0 8px;color:#faf7ff;font-size:1.5rem}.echo-console>p:not(.panel-kicker):not(.echo-status){color:#8f93aa;font-size:.84rem;line-height:1.55}.echo-readout{margin-top:22px;padding:14px;border:1px solid #30344f;border-radius:12px;background:#0b0d17}.echo-readout strong{display:block;margin-top:5px;color:#c9f6ff;font:900 1.05rem/1.2 ui-monospace,monospace;letter-spacing:.08em}.echo-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:18px}.echo-controls button,.echo-actions button{border:1px solid #383d5d;border-radius:10px;padding:11px;color:#e7e5f3;background:#111421;cursor:pointer;font:800 .72rem/1 ui-sans-serif,system-ui,sans-serif}.echo-controls button:hover,.echo-actions button:hover{border-color:#7b65a0;background:#18162a}.echo-controls #echo-action{grid-column:1/-1;border-color:#805aa8;color:#f3ddff;background:#241534}.echo-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.echo-actions #next-button{border-color:#4c8a99;color:#dffbff;background:#10272d}.echo-status{min-height:4.5em;margin:16px 0 0;color:#b4b6c7;font-size:.8rem;line-height:1.55}.mono-note{margin-top:18px;padding-top:16px;border-top:1px solid #272b41}.mono-note strong{color:#d9b8ff;font:900 .63rem/1 ui-monospace,monospace;letter-spacing:.14em}.mono-note p{margin:7px 0 0;color:#7e829b;font-size:.76rem;line-height:1.55}
.echo-howto{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:18px}.echo-howto article{padding:18px;border:1px solid #282b42;border-radius:14px;background:#090b14}.echo-howto span{color:#b786eb;font:900 .65rem/1 ui-monospace,monospace}.echo-howto h2{margin:7px 0 5px;color:#eee9f8;font-size:.88rem}.echo-howto p{margin:0;color:#7f8398;font-size:.74rem;line-height:1.45}.back-link{margin:26px 0 0;color:var(--muted)}
@media(max-width:900px){.echo-shell{grid-template-columns:1fr}.echo-console{border-left:0;border-top:1px solid var(--line)}.echo-canvas-wrap{min-height:300px;padding:16px}.echo-mobile-controls{display:grid}.echo-console .echo-controls{display:none}.echo-howto{grid-template-columns:repeat(2,1fr)}}@media(max-width:620px){.echo-header{grid-template-columns:1fr}.echo-back{justify-self:start}.echo-stage-head{grid-template-columns:1fr 1fr}.echo-stage-head div:nth-child(2){display:none}.echo-canvas-wrap{padding:8px;min-height:230px}.echo-mobile-controls{gap:6px;margin-top:8px}.echo-mobile-controls button{min-height:58px;font-size:.68rem}.echo-howto{grid-template-columns:1fr 1fr}.echo-console{padding:20px 16px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

.echo-readout+.echo-readout{margin-top:10px}

.echo-readout-trace{border-color:#4d456b;background:#100f1c}
.echo-readout-trace strong{font-size:.72rem;line-height:1.5;letter-spacing:.015em;color:#e2d6ff}
.echo-readout-trace small{display:block;margin-top:8px;color:#8f93aa;font-size:.68rem;line-height:1.5}
.echo-readout-sync{border-color:#5c4c78;background:#100d1c}
.echo-readout-sync strong{font-size:.78rem;line-height:1.45;letter-spacing:.03em}
#phase-status{font-size:.72rem;line-height:1.45;letter-spacing:.02em;color:#e2d6ff}
.echo-controls #echo-action.sync-ready{border-color:#7fe8ff;color:#e9fdff;background:#12313a;box-shadow:0 0 0 1px rgba(127,232,255,.16),0 0 22px rgba(127,232,255,.18)}

/* Keep the phase puzzle and its readouts together inside the viewport session. */
.echo-shell.game-session-active { display:grid; grid-template-columns:minmax(0,1fr) minmax(255px,34%); grid-template-rows:auto minmax(0,1fr); gap:0; width:100%; height:100%; min-height:0; margin:0; border:0; border-radius:0; box-shadow:none; }
.echo-shell.game-session-active > .game-session-toolbar { grid-column:1/-1; grid-row:1; }
.echo-shell.game-session-active > .echo-stage { grid-column:1; grid-row:2; display:grid; grid-template-rows:auto minmax(0,1fr) auto; min-width:0; min-height:0; }
.echo-shell.game-session-active .echo-stage-head { grid-template-columns:repeat(3,minmax(0,1fr)); }
.echo-shell.game-session-active .echo-stage-head div:nth-child(2) { display:block; }
.echo-shell.game-session-active .echo-stage-head > div { min-width:0; padding:7px 9px; }
.echo-shell.game-session-active .echo-stage-head strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:clamp(.58rem,1.7dvh,.75rem); }
.echo-shell.game-session-active .echo-canvas-wrap { display:grid; grid-template-rows:minmax(0,1fr) auto; place-items:center; gap:6px; min-width:0; min-height:0; padding:6px; overflow:hidden; }
.echo-shell.game-session-active .echo-canvas-wrap canvas { width:min(100%,960px,calc((100dvh - 170px)*3.2)); height:auto; max-height:100%; aspect-ratio:16/5; }
.echo-shell.game-session-active .echo-mobile-controls { display:none; }
.echo-shell.game-session-active .echo-legend { gap:8px 14px; padding:7px 10px; font-size:.54rem; }
.echo-shell.game-session-active > .echo-console { grid-column:2; grid-row:2; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto repeat(6,auto) auto; align-content:start; gap:5px; min-width:0; min-height:0; padding:8px; overflow:hidden; border-top:0; border-left:1px solid var(--line); }
.echo-shell.game-session-active .echo-console > .panel-kicker,
.echo-shell.game-session-active .echo-console > #stage-description,
.echo-shell.game-session-active .echo-console > .mono-note { display:none; }
.echo-shell.game-session-active .echo-console > #stage-title { grid-column:1/-1; min-width:0; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.88rem; }
.echo-shell.game-session-active #echo-presence-readout { grid-column:1; grid-row:2; }
.echo-shell.game-session-active #trace-readout { grid-column:2; grid-row:2; }
.echo-shell.game-session-active #phase-readout { grid-column:1/-1; grid-row:3; }
.echo-shell.game-session-active #sync-readout { grid-column:1/-1; grid-row:4; }
.echo-shell.game-session-active #plate-readout { grid-column:1; grid-row:5; }
.echo-shell.game-session-active #gate-readout { grid-column:2; grid-row:5; }
.echo-shell.game-session-active .echo-readout { display:flex; flex-direction:column; justify-content:center; min-width:0; min-height:0; margin:0; padding:5px 7px; overflow:hidden; }
.echo-shell.game-session-active .echo-readout+.echo-readout { margin:0; }
.echo-shell.game-session-active .echo-readout span { font-size:.5rem; }
.echo-shell.game-session-active .echo-readout strong { display:block; margin-top:3px; overflow:visible; overflow-wrap:anywhere; font-size:clamp(.58rem,1.55dvh,.72rem); line-height:1.3; letter-spacing:0; }
.echo-shell.game-session-active #phase-readout strong,
.echo-shell.game-session-active #sync-readout strong { font-size:clamp(.58rem,1.4dvh,.68rem); line-height:1.25; }
.echo-shell.game-session-active .echo-readout-trace small { display:none; }
.echo-shell.game-session-active .echo-controls { grid-column:1/-1; grid-row:6; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; min-width:0; margin:0; }
.echo-shell.game-session-active .echo-controls button,
.echo-shell.game-session-active .echo-actions button { min-width:0; min-height:32px; padding:6px; font-size:.6rem; }
.echo-shell.game-session-active .echo-controls #echo-action { grid-column:1/-1; }
.echo-shell.game-session-active .echo-actions { grid-column:1/-1; grid-row:7; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; min-width:0; margin:0; }
.echo-shell.game-session-active .echo-status { position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

.echo-timeboard {
  min-width: 0;
  margin: 10px 18px 0;
  padding: 10px 12px;
  border: 1px solid #30344f;
  border-radius: 14px;
  background: linear-gradient(180deg, #0b0d18, #080a13);
  font-family: ui-monospace, monospace;
}

.echo-timeboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: #aaa4c3;
  font: 800 .62rem/1.2 ui-monospace, monospace;
  letter-spacing: .08em;
}

.echo-timeboard-head strong {
  color: #dffbff;
  font-size: .64rem;
  white-space: nowrap;
}

.echo-timeboard-note {
  margin: 0 0 5px;
  color: #8f93aa;
  font: 500 .57rem/1.25 ui-sans-serif, system-ui, sans-serif;
}

.echo-time-chart {
  min-width: 0;
}

.echo-time-axis,
.echo-time-row {
  display: grid;
  grid-template-columns: minmax(64px, 15%) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.echo-time-axis {
  margin-bottom: 3px;
}

.echo-time-axis-labels {
  display: grid;
  grid-column: 2;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  color: #777c9a;
  font: 700 .55rem/1.2 ui-monospace, monospace;
}

.echo-time-axis-labels > span {
  text-align: center;
  white-space: nowrap;
}

.echo-time-axis-labels > span:first-child {
  text-align: left;
}

.echo-time-axis-labels > span:last-child {
  text-align: right;
}

.echo-time-rows {
  display: grid;
  gap: 2px;
}

.echo-time-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  margin-top: 5px;
  color: #8f93aa;
  font: 800 .52rem/1.2 ui-monospace, monospace;
  letter-spacing: .08em;
}

.echo-time-group:first-child {
  margin-top: 0;
}

.echo-time-group-detail {
  color: #73788f;
  letter-spacing: 0;
}

.echo-time-plate-key {
  display: inline-flex;
  gap: 5px;
  letter-spacing: 0;
}

.echo-time-plate-key > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.echo-time-plate-key > span::before {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #b985ff;
  content: "";
}

.echo-time-plate-key > [data-plate="b"]::before {
  background: #9a91ff;
}

.echo-time-plate-key > [data-plate="c"]::before {
  background: #d38cff;
}

.echo-time-row {
  min-height: 14px;
}

.echo-time-label {
  overflow: hidden;
  color: #bbb5d0;
  font: 800 .57rem/1.1 ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.echo-time-track {
  position: relative;
  display: block;
  height: 9px;
  min-width: 0;
  overflow: visible;
  border-radius: 3px;
  background-color: #101323;
  background-image: linear-gradient(to right, rgba(116, 123, 161, .18) 1px, transparent 1px);
  background-size: 1.666667% 100%;
}

.echo-time-window {
  position: absolute;
  top: 1px;
  bottom: 1px;
  display: block;
  overflow: hidden;
  border-radius: 2px;
  background: #b985ff;
  color: #0c0c18;
  font: 900 6px/7px ui-monospace, monospace;
  text-align: center;
  white-space: nowrap;
}

.echo-time-window[data-plate="b"] {
  background: #9a91ff;
}

.echo-time-window[data-plate="c"] {
  background: #d38cff;
}

.echo-time-gate .echo-time-comparison {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.echo-time-gate .echo-time-track {
  height: 5px;
}

.echo-time-gate .is-continue .echo-time-window {
  background: #7899ff;
}

.echo-time-gate .is-shift .echo-time-window {
  background: #7fe8ff;
}

.echo-time-window.is-point {
  right: auto;
  width: 3px !important;
  border-radius: 0;
}

.echo-time-row.is-trace .echo-time-label {
  color: #d9b8ff;
}

.echo-time-row.is-trace .echo-time-window {
  background: #7fe8ff;
}

.echo-time-unavailable {
  position: absolute;
  top: 50%;
  left: 2px;
  overflow: hidden;
  color: #cfb5dd;
  font: 800 9px/1 ui-monospace, monospace;
  white-space: nowrap;
  transform: translateY(-50%);
}

.echo-time-empty {
  padding: 2px 0 3px 16%;
  color: #73788f;
  font: 700 .55rem/1.2 ui-monospace, monospace;
}

.echo-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.echo-shell.game-session-active > .echo-stage {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.echo-shell.game-session-active .echo-timeboard {
  min-height: 0;
  margin: 0;
  padding: 6px 8px;
  border-width: 0 0 1px;
  border-color: #252942;
  border-radius: 0;
}

.echo-shell.game-session-active .echo-timeboard-head,
.echo-shell.game-session-active .echo-timeboard-head strong {
  font-size: 9px;
}

.echo-shell.game-session-active .echo-timeboard-head {
  margin-bottom: 4px;
}

.echo-shell.game-session-active .echo-timeboard-note {
  margin-bottom: 3px;
  font-size: 9px;
  line-height: 1.15;
}

.echo-shell.game-session-active .echo-time-axis,
.echo-shell.game-session-active .echo-time-row {
  grid-template-columns: minmax(50px, 15%) minmax(0, 1fr);
  gap: 5px;
}

.echo-shell.game-session-active .echo-time-axis {
  margin-bottom: 2px;
}

.echo-shell.game-session-active .echo-time-axis-labels,
.echo-shell.game-session-active .echo-time-group,
.echo-shell.game-session-active .echo-time-label {
  font-size: 9px;
}

.echo-shell.game-session-active .echo-time-group {
  margin-top: 3px;
  line-height: 1;
}

.echo-shell.game-session-active .echo-time-rows {
  gap: 1px;
}

.echo-shell.game-session-active .echo-time-row {
  min-height: 12px;
}

.echo-shell.game-session-active .echo-time-track {
  height: 8px;
}

.echo-shell.game-session-active .echo-time-window {
  font-size: 6px;
  line-height: 6px;
}

.echo-shell.game-session-active .echo-time-gate .echo-time-track {
  height: 4px;
}

.echo-shell.game-session-active .echo-stage .echo-legend {
  display: none;
}

.echo-shell.game-session-active .echo-console > #phase-readout,
.echo-shell.game-session-active .echo-console > #sync-readout {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width:700px), (orientation:portrait) {
  .echo-shell.game-session-active {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, .54fr) minmax(0, .46fr);
  }

  .echo-shell.game-session-active > .echo-stage {
    grid-column: 1;
    grid-row: 2;
  }

  .echo-shell.game-session-active > .echo-console {
    grid-column: 1;
    grid-row: 3;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .echo-shell.game-session-active .echo-mobile-controls {
    display: grid;
    width: min(100%, 520px);
    grid-template-columns: 1fr 1.12fr 1fr;
    gap: 6px;
    margin: 0;
  }

  .echo-shell.game-session-active .echo-mobile-controls button {
    min-width: 0;
    min-height: 42px;
    padding: 6px 4px;
    font-size: .62rem;
  }

  .echo-shell.game-session-active .echo-controls {
    display: none;
  }

  .echo-shell.game-session-active .echo-canvas-wrap {
    padding: 4px;
  }

  .echo-shell.game-session-active .echo-legend {
    gap: 5px 10px;
    padding: 5px 8px;
    font-size: .5rem;
  }
}

@media (max-height:650px) {
  .echo-shell.game-session-active .echo-timeboard {
    padding: 3px 5px;
  }

  .echo-shell.game-session-active .echo-timeboard-head {
    margin-bottom: 2px;
  }

  .echo-shell.game-session-active .echo-timeboard-note {
    margin-bottom: 2px;
    font-size: 9px;
  }

  .echo-shell.game-session-active .echo-time-axis,
  .echo-shell.game-session-active .echo-time-row {
    grid-template-columns: minmax(42px, 14%) minmax(0, 1fr);
    gap: 3px;
  }

  .echo-shell.game-session-active .echo-time-axis-labels,
  .echo-shell.game-session-active .echo-time-group,
  .echo-shell.game-session-active .echo-time-label {
    font-size: 9px;
  }

  .echo-shell.game-session-active .echo-time-group {
    margin-top: 1px;
  }

  .echo-shell.game-session-active .echo-time-row {
    min-height: 10px;
  }

  .echo-shell.game-session-active .echo-time-track {
    height: 6px;
  }

  .echo-shell.game-session-active .echo-time-gate .echo-time-track {
    height: 4px;
  }

  .echo-shell.game-session-active .echo-time-window {
    top: 0;
    bottom: 0;
  }
}

@media (max-width:700px) and (max-height:650px) {
  .echo-shell.game-session-active .echo-canvas-wrap {
    max-height: 125px;
    padding: 2px;
  }

  .echo-shell.game-session-active .echo-canvas-wrap canvas {
    width: min(100%, 240px);
    max-height: 75px;
  }
}

@media (max-width:620px) {
  .echo-page .echo-stage-head {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .echo-page .echo-stage-head div {
    padding: 7px 5px;
  }

  .echo-page .echo-stage-head div:nth-child(2) {
    display: block;
  }

  .echo-page .echo-stage-head strong {
    font-size: .55rem;
    letter-spacing: -.03em;
  }
}

@media (max-width:400px) {
  .echo-page .echo-stage-head,
  .echo-shell.game-session-active .echo-stage-head {
    grid-template-columns: minmax(70px, 1fr) minmax(128px, 1.8fr) minmax(55px, .8fr);
  }

  .echo-page .echo-stage-head strong,
  .echo-shell.game-session-active .echo-stage-head strong {
    font-size: 8.5px;
    letter-spacing: -.04em;
    text-overflow: clip;
  }

  .echo-shell.game-session-active .echo-stage-head > div {
    padding: 6px 3px;
  }
}
@media (max-width:400px) {
  .echo-shell.game-session-active > .echo-console { gap:3px; padding:5px; }
  .echo-shell.game-session-active .echo-readout { padding:4px 5px; }
  .echo-shell.game-session-active .echo-readout span { font-size:.44rem; letter-spacing:.07em; }
  .echo-shell.game-session-active .echo-readout strong { font-size:.56rem; }
  .echo-shell.game-session-active .echo-status { font-size:.58rem; }
}
