.echo-page { background: radial-gradient(ellipse at 65% 0, #26364b, #0c172a 65%); color: #e4e9e8; }
.echo-page .arcade-main { max-width: 1280px; }
.echo-page .eyebrow { color: #a3cfcf; text-transform: uppercase; letter-spacing: .16em; font: .67rem "Courier New", monospace; }
.echo-page h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 800; letter-spacing: -.06em; color: #e6e7df; }
.echo-page h1 span { color: #9fdad7; margin-left: .12em; }
.echo-subtitle { letter-spacing: .45em; font: .72rem "Courier New", monospace; color: #e4bca2 !important; }
.echo-page .game-message { max-width: 350px; color: #bfd3db; font-size: .82rem; line-height: 1.6; }
.echo-page .arcade-stage { border-color: #8abfc955; border-radius: 12px; background: #111f34; scroll-margin-top: 90px; box-shadow: 0 28px 80px #030a1b99; }
.echo-page .canvas-wrap { aspect-ratio: 16 / 9; max-height: none; }
.echo-page canvas { image-rendering: auto; cursor: crosshair; }
.echo-overlay { position: absolute; inset: 0; display: flex; align-items: center; gap: 3%; padding: 4%; background: linear-gradient(100deg, #0b0618f0, #0b0618c8 55%, #0b061860); overflow-y: auto; }
.echo-overlay[hidden], .echo-choices[hidden], .echo-story-actions button[hidden] { display: none; }
.echo-portrait { width: 22%; flex-shrink: 0; aspect-ratio: 3 / 4; position: relative; border: 2px solid #8a5cc4; background: #3d2a6e url("../images/echo/backgrounds/city-1/layer-1.png") 40% 0 / auto 100%; image-rendering: pixelated; overflow: hidden; box-shadow: inset 0 -40px 50px #0b0618cc; }
.echo-portrait[hidden] { display: none; }
/* Shows the head-and-shoulders crop (sprite pixels 4-24 x 12-32) of the 4-frame idle sheet. */
.echo-portrait span { position: absolute; left: 0; bottom: 0; width: 100%; aspect-ratio: 1; background: url("../images/echo/sprites/punk/idle.png") 2.326% 42.86% / 960% auto no-repeat; image-rendering: pixelated; animation: echo-portrait-idle .7s steps(4) infinite; }
.echo-portrait[data-speaker="CURATOR"] { border-color: #ffb35c; filter: saturate(1.1); }
.echo-portrait[data-speaker="CURATOR"] span { background-image: url("../images/echo/sprites/cyborg/idle.png"); filter: hue-rotate(60deg) saturate(1.3); }
.echo-portrait[data-speaker="MOTH"] { border-color: #5fd8cf; }
.echo-portrait[data-speaker="MOTH"] span { animation: echo-moth-bob 1.6s steps(4) infinite; background: url("../images/echo/moth.svg") center / contain no-repeat; width: 76%; aspect-ratio: 15 / 11; left: 12%; bottom: 34%; filter: drop-shadow(0 0 14px #a9fff1aa); }
@keyframes echo-portrait-idle { from { background-position-x: 2.326%; } to { background-position-x: 113.95%; } }
@keyframes echo-moth-bob { 50% { transform: translateY(-6%); } }
@media (prefers-reduced-motion: reduce) { .echo-portrait span { animation: none; } }
.echo-story-copy { min-width: 0; flex: 1; }
.echo-scene-heading { color: #c9ad94; font: .68rem "Courier New", monospace; letter-spacing: .12em; margin: 0 0 1rem; }
.echo-story-copy h2 { color: #b7e4df; margin: 0 0 .8rem; font: 700 clamp(.9rem, 2vw, 1.3rem) "Courier New", monospace; letter-spacing: .08em; }
#story-line { color: #e2e5df; font-size: clamp(.8rem, 1.65vw, 1.18rem); line-height: 1.7; margin: 0 0 1.5rem; max-width: 650px; }
.echo-story-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.echo-choices { display: grid; gap: .7rem; }
.echo-choices button { text-align: left; font-size: .8rem; white-space: normal; line-height: 1.5; }
.echo-page .button { background: #a8d9d0; color: #122a39; border-radius: 5px; min-height: 44px; border: 1px solid #b9e8dc; }
.echo-page .button-secondary { background: #223b51; border-color: #7b9cae; color: #d8e5e7; }
.echo-page .arcade-toolbar { background: #14273e; border-top: 1px solid #8db3c655; flex-wrap: wrap; }
.echo-hud { display: flex; gap: 1.7rem; font: .6rem "Courier New", monospace; color: #9cb5c7; letter-spacing: .08em; flex-wrap: wrap; }
.echo-hud strong { display: block; color: #e2dfcb; font-size: 1rem; margin-top: .35rem; }
.echo-page .game-actions { flex-wrap: wrap; }
.echo-touch { background: #182a40; justify-content: space-between; flex-wrap: wrap; gap: .7rem; touch-action: none; }
.echo-touch > div { display: flex; flex-wrap: wrap; gap: .4rem; }
.echo-touch button { min-width: 52px; min-height: 52px; font-size: .7rem; font-weight: 700; background: #294258; border-color: #87a3b6; border-radius: 5px; }
.echo-touch button[data-input="fire"], .echo-touch button[data-input="interact"] { background: #406d72; color: #d5f6eb; }
.echo-touch button.is-held { background: #628d90; border-color: #f6dfbe; color: #fff7df; }
.echo-objective { padding: .9rem 1.1rem; border-left: 3px solid #c7ae88; background: #152c40; color: #d6e6e4; font-size: .87rem; line-height: 1.6; }
.echo-save { display: flex; gap: .7rem 1.3rem; flex-wrap: wrap; align-items: center; color: #a2bdca; font-size: .78rem; }
.echo-save button { background: none; border: none; font: inherit; color: #d5c3a4; cursor: pointer; }
.echo-save button[hidden] { display: none; }
.echo-audio-status { color: #e6c4a4; font-size: .8rem; }
.echo-page .detail-panel { background: #14263c; border-color: #7195a544; }
.echo-page .detail-panel h2 { color: #b6dfda; font-size: 1.05rem; }
.echo-page .detail-panel p, .echo-page details { color: #b7cbd4; line-height: 1.75; font-size: .87rem; }
.echo-page summary { cursor: pointer; color: #d3c3a7; }
#story-log { padding-left: 1.2rem; }
#story-log li { margin-block: .6rem; }
.echo-credit { color: #96afc1; font-size: .78rem; line-height: 1.7; margin-top: 2rem; }
.echo-page button:focus-visible, .echo-page canvas:focus-visible { outline: 3px solid #f1d2a4; outline-offset: 3px; }
#echo-stage:fullscreen { display: flex; flex-direction: column; justify-content: center; overflow: auto; background: #101e30; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#echo-stage:fullscreen .canvas-wrap { flex: 0 1 auto; width: min(100%, calc((100dvh - 190px) * 16 / 9)); align-self: center; }
@media (max-width: 620px) {
  .echo-page .arcade-heading { gap: .5rem; }
  .echo-page h1 { font-size: 2.3rem; }
  .echo-page .game-message { margin-bottom: 0; }
  .echo-overlay { gap: .7rem; padding: 1rem; align-items: flex-start; }
  .echo-portrait { display: none; }
  .echo-story-copy h2 { margin-bottom: .5rem; font-size: .75rem; }
  .echo-scene-heading { margin-bottom: .5rem; font-size: .55rem; }
  #story-line { font-size: .78rem; line-height: 1.5; margin-bottom: .7rem; }
  .echo-overlay .button { min-height: 44px; padding: .5rem .8rem; font-size: .7rem; }
  .echo-page .canvas-wrap:has(.echo-overlay:not([hidden])) { min-height: 280px; }
  .echo-hud { width: 100%; justify-content: space-between; gap: .5rem; font-size: .55rem; }
  .echo-hud strong { font-size: .85rem; }
  .echo-page .game-actions { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .echo-page .game-actions .button { font-size: .7rem; padding-inline: .35rem; }
  .echo-touch > div:last-child { display: grid; grid-template-columns: repeat(3, 1fr); }
  .echo-touch { padding: .6rem; }
}
