:root {
  --ink: #122033;
  --muted: #627089;
  --blue: #1f80ff;
  --cyan: #4de7ff;
  --green: #57d99a;
  --orange: #f59a3d;
  --panel: rgba(255, 255, 255, 0.93);
  --line: rgba(255, 255, 255, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #062b51;
}

button {
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.river-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 14px 18px 10px;
  background:
    radial-gradient(circle at 18% 12%, rgba(36, 169, 232, 0.38), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(90, 230, 255, 0.18), transparent 24%),
    linear-gradient(180deg, #05294f 0%, #073e6a 54%, #17a9bc 100%);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(250px, 0.62fr) auto minmax(0, 1.38fr);
  gap: 16px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #ffffff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #c9f7ff;
  font-size: 30px;
  box-shadow: 0 8px 24px rgba(0, 11, 35, 0.24), inset 0 0 18px rgba(110, 231, 255, 0.2);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 23px;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.back-link,
.result-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  white-space: nowrap;
}

.home-link {
  background: rgba(255, 255, 255, 0.23);
}

.back-link:hover,
.back-link:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.status-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 0;
  min-width: 0;
  min-height: 72px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 250, 255, 0.88));
  box-shadow: 0 12px 30px rgba(0, 15, 44, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.status-card i {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  align-self: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #f1fbff, #e4f3ff);
  color: var(--blue);
  font-style: normal;
  font-size: 28px;
  box-shadow: inset 0 0 0 1px rgba(31, 128, 255, 0.1);
}

.status-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.status-card strong {
  min-height: 28px;
  color: #0f2d50;
  font-size: 21px;
  line-height: 1.15;
}

.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 255, 255, 0.45), transparent 28%),
    linear-gradient(180deg, rgba(218, 252, 255, 0.5), rgba(120, 219, 232, 0.3)),
    #9becff;
  box-shadow: 0 22px 60px rgba(0, 19, 47, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  touch-action: none;
}

#camera,
#gameCanvas,
.stage-vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#camera {
  z-index: 1;
  object-fit: cover;
  opacity: 0;
  transform: scaleX(-1);
  filter: saturate(0.9) contrast(1.02) brightness(1.16) blur(0.2px);
  transition: opacity 200ms ease;
}

#camera.is-live {
  opacity: 0.48;
}

#gameCanvas {
  z-index: 2;
}

.stage-vignette {
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 18%, transparent 72%, rgba(12, 69, 92, 0.18)),
    radial-gradient(circle at 48% 52%, transparent 0 60%, rgba(255, 255, 255, 0.16) 100%);
}

.cue-panel {
  position: absolute;
  z-index: 4;
  top: 34px;
  left: 28px;
  display: grid;
  gap: 16px;
  width: min(330px, calc(100% - 56px));
}

.cue-panel article {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  background: rgba(238, 250, 255, 0.86);
  box-shadow: 0 16px 34px rgba(0, 37, 78, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(7px);
}

.cue-panel strong {
  color: #1267ba;
  font-size: 28px;
}

.cue-panel p {
  margin: 4px 0 0;
  color: #19324d;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.45;
}

.cue-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #ecf8ff;
}

.legato-icon {
  background:
    radial-gradient(circle at 28% 50%, var(--blue) 0 4px, transparent 5px),
    radial-gradient(circle at 72% 50%, var(--blue) 0 4px, transparent 5px),
    linear-gradient(135deg, transparent 0 41%, var(--blue) 42% 54%, transparent 55%);
}

.staccato-icon {
  background:
    radial-gradient(circle at 50% 44%, #777 0 11px, transparent 12px),
    radial-gradient(circle at 50% 45%, #a5a5a5 0 24px, #ecf8ff 25px);
}

.motion-mirror {
  position: absolute;
  z-index: 4;
  right: 22px;
  bottom: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(420px, calc(100% - 44px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  background: rgba(11, 54, 84, 0.58);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.motion-mirror span,
.time-readout span {
  display: block;
  font-size: 12px;
  font-weight: 900;
  opacity: 0.75;
}

.motion-mirror strong,
.time-readout strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1.2;
}

#cameraButton {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  background: #ffffff;
  color: #165173;
}

.timeline-panel {
  position: absolute;
  z-index: 5;
  right: 20px;
  bottom: 20px;
  left: 20px;
  display: grid;
  grid-template-columns: 62px 140px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 22px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background: rgba(6, 44, 68, 0.72);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(18, 32, 51, 0.16);
  backdrop-filter: blur(10px);
}

.round-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #ffffff;
  color: #0e6591;
  font-size: 20px;
}

.timeline {
  position: relative;
  height: 48px;
}

.timeline-track {
  position: absolute;
  inset: 15px 0;
  overflow: hidden;
  border-radius: 999px;
  border: 3px solid rgba(150, 227, 255, 0.62);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 2px 8px rgba(0, 30, 70, 0.28);
}

.segment {
  position: absolute;
  top: 0;
  bottom: 0;
}

.segment.legato {
  background: linear-gradient(90deg, #31b7ff, #34e2ff);
}

.segment.staccato {
  background: linear-gradient(90deg, #ffac4b, #ff7f43);
}

.jump-marker {
  position: absolute;
  top: 6px;
  width: 14px;
  height: 36px;
  margin-left: -7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd66b, #ff902e);
  box-shadow: 0 0 0 5px rgba(255, 173, 61, 0.26), 0 5px 10px rgba(91, 44, 0, 0.22);
}

.timeline-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
  transform: translateX(-1.5px);
}

.guide-overlay,
.result-overlay {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.18), transparent 34%),
    rgba(4, 30, 58, 0.5);
  backdrop-filter: blur(8px);
}

.guide-overlay.is-hidden,
.result-overlay.is-hidden {
  display: none;
}

.guide-card,
.result-card {
  width: min(760px, 100%);
  padding: 26px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: rgba(241, 251, 255, 0.94);
  box-shadow: 0 22px 70px rgba(0, 20, 54, 0.34);
}

.guide-card:has(.prestart-demo) {
  width: min(860px, 96%);
  padding: 20px;
}

.guide-card:has(.prestart-demo) h1 {
  margin-bottom: 12px;
  font-size: clamp(26px, 3.2vw, 42px);
}

.result-card {
  width: min(860px, 100%);
  max-height: min(86vh, 780px);
  overflow: auto;
}

.guide-kicker {
  color: #1680c6;
  font-weight: 900;
}

.guide-card h1,
.result-card h1 {
  margin: 8px 0 18px;
  color: #0f2d50;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.result-summary {
  margin: -6px 0 18px;
  color: #19324d;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.45;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.result-metrics article {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(21, 126, 176, 0.12);
}

.result-metrics span,
.result-metrics small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.result-metrics strong {
  display: block;
  margin: 6px 0;
  color: #0f2d50;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
}

.result-feedback {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.result-feedback article,
.result-details {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(21, 126, 176, 0.12);
}

.result-feedback strong,
.result-details summary {
  color: #1267ba;
  font-size: 18px;
  font-weight: 900;
}

.result-feedback p {
  margin: 8px 0 0;
  color: #19324d;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
}

.result-details {
  margin-top: 12px;
}

.result-details summary {
  cursor: pointer;
}

#resultDetailList {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: #19324d;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

#resultReplay {
  background: #1680ff;
  color: #ffffff;
}

#resultClose {
  background: rgba(15, 45, 80, 0.08);
  color: #0f2d50;
}

.result-back-link {
  background: rgba(15, 45, 80, 0.08);
  color: #0f2d50;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-card:has(.prestart-demo) .guide-steps {
  display: none;
}

.guide-steps article {
  padding: 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(21, 126, 176, 0.12);
}

.guide-steps strong {
  color: #1267ba;
  font-size: 22px;
}

.guide-steps p {
  margin: 8px 0 0;
  color: #19324d;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.prestart-demo {
  position: relative;
  height: min(42vh, 330px);
  min-height: 250px;
  overflow: hidden;
  border: 1px solid rgba(25, 126, 166, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(237, 253, 255, 0.94), rgba(169, 233, 238, 0.82)),
    #c5f3f7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.demo-title {
  position: absolute;
  z-index: 10;
  left: 22px;
  top: 18px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(15, 45, 80, 0.88);
  color: #ffffff;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1;
}

.title-press {
  opacity: 0;
}

.guide-card:has(.prestart-demo) .title-line {
  animation: prestartTitleLine 11s linear infinite;
}

.guide-card:has(.prestart-demo) .title-press {
  animation: prestartTitlePress 11s linear infinite;
}

.demo-wave {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(24, 193, 218, 0.65));
  animation: prestartWaveFollow 11s ease-in-out infinite;
}

.demo-wave path {
  fill: none;
  stroke: #1fc9df;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 34 17;
  animation: prestartWaveDash 1.3s linear infinite;
}

.demo-playhead {
  position: absolute;
  z-index: 5;
  left: 28%;
  top: 46px;
  bottom: 24px;
  border-left: 4px dashed rgba(255, 255, 255, 0.95);
}

.demo-boat,
.demo-nibbler {
  position: absolute;
  z-index: 7;
  left: 23%;
  top: 50%;
  width: 96px;
  height: 58px;
  transform: translateY(34px);
  animation: prestartRideAndJump 11s ease-in-out infinite;
}

.demo-boat::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 4px;
  bottom: 0;
  height: 36px;
  border-radius: 0 0 48px 48px;
  background: linear-gradient(180deg, #d4862d, #8f4c1a);
  box-shadow: 0 9px 0 rgba(11, 71, 91, 0.18);
}

.demo-boat::after {
  content: "";
  position: absolute;
  left: 42px;
  top: -14px;
  width: 48px;
  height: 34px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: #ffffff;
  box-shadow: -6px 0 0 #98561d;
}

.demo-nibbler {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 68% 33%, #122033 0 4px, transparent 5px), conic-gradient(from 35deg, transparent 0 70deg, #ffd968 71deg 360deg);
  box-shadow: 0 9px 0 rgba(11, 71, 91, 0.18);
}

.demo-obstacle {
  position: absolute;
  z-index: 6;
  left: 104%;
  top: 52%;
  display: grid;
  place-items: center;
  min-width: 66px;
  min-height: 46px;
  padding: 6px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.86);
  color: #4a5860;
  font-size: 13px;
  font-weight: 1000;
  animation: prestartObstacle 11s linear infinite;
}

.reef-obstacle::before {
  content: "";
  display: block;
  width: 58px;
  height: 32px;
  margin-bottom: 3px;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(180deg, #cfd5d8, #66747c);
}

.note-obstacle {
  color: #823a1f;
  font-size: 28px;
}

.demo-coin,
.demo-note {
  position: absolute;
  z-index: 4;
  right: -8%;
  top: 45%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffd968;
  color: #176d82;
  font-size: 18px;
  font-weight: 1000;
  animation: prestartCollectable 11s linear infinite;
}

.coin-b,
.note-b {
  top: 62%;
  animation-delay: 2.2s;
}

.demo-hand-panel {
  position: absolute;
  z-index: 9;
  right: 18px;
  top: 46px;
  width: 140px;
  height: 200px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 2px rgba(29, 145, 166, 0.2);
}

.hand-caption {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 10px;
  z-index: 3;
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: #1c5871;
  font-size: 12px;
  font-weight: 1000;
  text-align: center;
}

.caption-short {
  opacity: 0;
}

.hand-track {
  position: absolute;
  right: 28px;
  top: 40px;
  width: 28px;
  height: 108px;
  border-radius: 999px;
  background: rgba(31, 201, 223, 0.18);
}

.hand-track::before,
.hand-track::after {
  position: absolute;
  left: 50%;
  color: #208999;
  font-size: 22px;
  font-weight: 1000;
  transform: translateX(-50%);
}

.hand-track::before {
  content: "↑";
  top: 6px;
}

.hand-track::after {
  content: "↓";
  bottom: 6px;
}

.press-track {
  position: absolute;
  left: 28px;
  top: 72px;
  height: 72px;
  border-left: 4px solid rgba(255, 160, 48, 0.8);
  opacity: 0;
}

.gesture-hand {
  position: absolute;
  left: 34px;
  top: 84px;
  width: 48px;
  height: 56px;
  border-radius: 18px 18px 22px 22px;
  background: linear-gradient(180deg, #ffe0a6, #ef9d55);
  box-shadow: 0 10px 18px rgba(96, 55, 30, 0.16);
  animation: prestartHandMove 11s ease-in-out infinite;
}

.finger {
  position: absolute;
  bottom: 44px;
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe9bd, #f2a864);
  transform-origin: bottom center;
}

.f1 { left: 5px; height: 46px; transform: rotate(-16deg); }
.f2 { left: 17px; height: 52px; }
.f3 { left: 29px; height: 47px; transform: rotate(8deg); }
.f4 { left: 40px; height: 36px; transform: rotate(18deg); }

.gesture-hand b {
  position: absolute;
  left: -10px;
  top: 20px;
  width: 28px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f1a45e, #ffe1aa);
  transform: rotate(-34deg);
}

.guide-card:has(.prestart-demo) .caption-long {
  animation: prestartTitleLine 11s linear infinite;
}

.guide-card:has(.prestart-demo) .caption-short,
.guide-card:has(.prestart-demo) .press-track {
  animation: prestartTitlePress 11s linear infinite;
}

@keyframes prestartWaveDash {
  to { stroke-dashoffset: -51; }
}

@keyframes prestartWaveFollow {
  0%, 14% { transform: translateY(35px); }
  28%, 40% { transform: translateY(-46px); }
  50%, 60% { transform: translateY(36px); }
  68%, 76% { transform: translateY(4px); }
  88%, 100% { transform: translateY(35px); }
}

@keyframes prestartRideAndJump {
  0%, 14% { transform: translateY(35px) rotate(-2deg); }
  28%, 40% { transform: translateY(-46px) rotate(3deg); }
  50%, 60% { transform: translateY(36px) rotate(-2deg); }
  66% { transform: translateY(4px) rotate(0deg); }
  70%, 78% { transform: translateY(-88px) rotate(-8deg); }
  84% { transform: translateY(-22px) rotate(-3deg); }
  92%, 100% { transform: translateY(35px) rotate(-2deg); }
}

@keyframes prestartObstacle {
  0%, 46% { left: 104%; opacity: 0; }
  52% { left: 58%; opacity: 1; }
  61%, 70% {
    left: 31%;
    opacity: 1;
    box-shadow: 0 0 0 14px rgba(255, 211, 107, 0.55), 0 0 30px rgba(255, 211, 107, 0.9);
  }
  82% { left: 18%; opacity: 1; }
  94%, 100% { left: -18%; opacity: 0; }
}

@keyframes prestartCollectable {
  0% { right: -8%; opacity: 1; transform: translateY(0) scale(1); }
  38% { right: 70%; opacity: 1; transform: translateY(-52px) scale(1); }
  48%, 100% { right: 74%; opacity: 0; transform: translateY(-52px) scale(1.6); }
}

@keyframes prestartHandMove {
  0%, 14% { transform: translateY(34px) scale(1); }
  28%, 40% { transform: translateY(-32px) scale(1); }
  50%, 60% { transform: translateY(34px) scale(1); }
  66% { transform: translateY(0) scale(1); }
  70%, 78% { transform: translateY(52px) scale(0.94); }
  84% { transform: translateY(-4px) scale(1); }
  92%, 100% { transform: translateY(34px) scale(1); }
}

@keyframes prestartTitleLine {
  0%, 54%, 86%, 100% { opacity: 1; }
  60%, 80% { opacity: 0; }
}

@keyframes prestartTitlePress {
  0%, 54%, 86%, 100% { opacity: 0; }
  60%, 80% { opacity: 1; }
}

.guide-actions button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
}

#guideStart {
  background: #1680ff;
  color: #ffffff;
}

#guideSkip {
  background: rgba(15, 45, 80, 0.08);
  color: #0f2d50;
}

.sync-guide-card {
  width: min(920px, 96%);
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: min(88dvh, 760px);
  overflow: hidden;
}

.sync-guide-card h1 {
  margin-bottom: 12px;
  font-size: clamp(26px, 3vw, 42px);
}

.sync-guide {
  position: relative;
  min-height: 0;
  height: min(54dvh, 500px);
  overflow: hidden;
  border: 1px solid rgba(25, 126, 166, 0.22);
  border-radius: 18px;
  background: #c5f3f7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.sync-guide video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #dff9fc;
}

.sync-guide audio {
  display: none;
}

.sync-guide-card .guide-actions {
  position: relative;
  z-index: 8;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(21, 126, 176, 0.14);
  background: rgba(241, 251, 255, 0.96);
}

.sync-dim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 22, 34, 0.02), rgba(6, 22, 34, 0.18));
}

.sync-status {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 4;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #1680c6;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 1000;
}

.sync-caption {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 5%;
  z-index: 4;
  display: grid;
  gap: 8px;
  border: 2px solid rgba(121, 241, 255, 0.5);
  border-radius: 16px;
  background: rgba(8, 30, 46, 0.78);
  color: #ffffff;
  padding: clamp(14px, 2vw, 22px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

.sync-caption.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sync-caption strong {
  color: #ffe99b;
  font-size: clamp(22px, 3vw, 40px);
  line-height: 1.05;
  font-weight: 1000;
}

.sync-caption span {
  font-size: clamp(16px, 1.8vw, 25px);
  font-weight: 900;
  line-height: 1.38;
}

.helper {
  color: rgba(238, 252, 255, 0.8);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.helper p {
  margin: 0;
}

.orientation-lock {
  display: none;
}

.orientation-card {
  width: min(360px, calc(100vw - 42px));
  padding: 26px 22px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background: rgba(239, 252, 255, 0.94);
  color: #0f2d50;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 24, 54, 0.32);
}

.orientation-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: linear-gradient(145deg, #1f80ff, #4de7ff);
  color: #ffffff;
  font-size: 44px;
  font-weight: 900;
}

.orientation-card h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.1;
}

.orientation-card p {
  margin: 0;
  color: #4d6279;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.55;
}

.orientation-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 18px;
  padding: 0 16px;
  border-radius: 14px;
  background: #0f6b85;
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .river-app {
    height: 100dvh;
    min-height: 100dvh;
    padding: 10px;
    gap: 8px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .brand {
    display: none;
  }

  .status-grid {
    grid-column: 1 / 2;
    grid-row: 1;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
  }

  .topbar-actions {
    grid-column: 2 / 3;
    grid-row: 1;
    gap: 6px;
  }

  .back-link {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 13px;
  }

  .status-card {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 48px;
    padding: 6px 8px;
    border-radius: 11px;
    column-gap: 7px;
  }

  .status-card i {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 18px;
  }

  .status-card span {
    font-size: 10px;
  }

  .status-card strong {
    min-height: 18px;
    font-size: 14px;
    line-height: 1.12;
  }

  .stage {
    min-height: 0;
    border-width: 2px;
    border-radius: 20px;
  }

  .cue-panel {
    top: 10px;
    left: 10px;
    gap: 8px;
    width: min(250px, 36vw);
  }

  .cue-panel article {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
    padding: 8px;
    border-radius: 14px;
  }

  .cue-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .cue-panel strong {
    font-size: 18px;
  }

  .cue-panel p {
    margin-top: 1px;
    font-size: 12px;
    line-height: 1.25;
  }

  .motion-mirror {
    right: auto;
    bottom: 66px;
    left: 10px;
    width: min(340px, 46vw);
    padding: 8px;
    border-radius: 14px;
  }

  .motion-mirror strong,
  .time-readout strong {
    font-size: 13px;
  }

  #cameraButton {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 12px;
  }

  .timeline-panel {
    right: 10px;
    bottom: 8px;
    left: 10px;
    grid-template-columns: 42px 82px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 10px;
    border-radius: 18px;
  }

  .round-button {
    width: 38px;
    height: 38px;
  }

  .timeline {
    height: 38px;
  }

  .timeline-track {
    inset: 12px 0;
    border-width: 2px;
  }

  .jump-marker {
    top: 5px;
    width: 10px;
    height: 28px;
    margin-left: -5px;
  }

  .guide-steps,
  .result-metrics,
  .result-feedback {
    grid-template-columns: 1fr;
  }

  .guide-overlay,
  .result-overlay {
    padding: 12px;
  }

  .guide-card,
  .result-card {
    max-height: calc(100dvh - 28px);
    overflow: auto;
    padding: 18px;
    border-radius: 18px;
  }

  .guide-card h1,
  .result-card h1 {
    font-size: clamp(24px, 6vw, 34px);
  }

  .guide-steps {
    gap: 8px;
  }

  .guide-steps article {
    padding: 10px;
  }

  .guide-steps strong {
    font-size: 18px;
  }

  .guide-steps p {
    font-size: 14px;
  }

  .guide-actions {
    margin-top: 12px;
  }

  .sync-guide-card {
    max-height: calc(100dvh - 28px);
    overflow: auto;
  }

  .sync-guide {
    height: min(48dvh, 390px);
  }

  .helper {
    display: none;
  }
}

@media (max-width: 560px) {
  .river-app {
    padding: 8px;
  }

  .status-grid {
    gap: 5px;
  }

  .status-card {
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 44px;
    padding: 5px 6px;
  }

  .status-card strong {
    font-size: 12px;
  }

  .status-card i {
    width: 24px;
    height: 24px;
    font-size: 15px;
  }

  .cue-panel {
    width: min(210px, 44vw);
  }

  .cue-panel article {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 7px;
  }

  .cue-icon {
    width: 34px;
    height: 34px;
  }

  .cue-panel strong {
    font-size: 16px;
  }

  .cue-panel p {
    font-size: 11px;
  }

  .motion-mirror {
    bottom: 60px;
  }

  #cameraButton {
    width: 100%;
  }

  .timeline-panel {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .time-readout {
    display: none;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .river-app {
    filter: blur(10px);
    pointer-events: none;
  }

  .orientation-lock {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
      radial-gradient(circle at 50% 18%, rgba(78, 220, 255, 0.26), transparent 34%),
      linear-gradient(180deg, #062b51 0%, #0f7592 100%);
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  .river-app {
    padding: 6px;
    gap: 5px;
  }

  .topbar {
    gap: 6px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .back-link {
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .status-grid {
    grid-template-columns: repeat(5, minmax(74px, 1fr));
    gap: 5px;
  }

  .status-card {
    min-height: 38px;
    grid-template-columns: 22px minmax(0, 1fr);
    padding: 4px 6px;
  }

  .status-card i {
    width: 22px;
    height: 22px;
    font-size: 14px;
  }

  .status-card span {
    font-size: 9px;
  }

  .status-card strong {
    min-height: 15px;
    font-size: 11px;
  }

  .cue-panel {
    width: 178px;
    gap: 6px;
  }

  .cue-panel article {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
  }

  .cue-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .cue-panel strong {
    font-size: 14px;
  }

  .cue-panel p {
    font-size: 10px;
  }

  .motion-mirror {
    bottom: 52px;
    width: min(300px, 44vw);
    padding: 6px;
  }

  .motion-mirror span,
  .time-readout span {
    font-size: 9px;
  }

  .motion-mirror strong {
    font-size: 11px;
  }

  #cameraButton {
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .timeline-panel {
    bottom: 6px;
    right: 8px;
    left: 8px;
    grid-template-columns: 34px 70px minmax(0, 1fr);
    gap: 8px;
    padding: 6px 8px;
  }

  .round-button {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .timeline {
    height: 32px;
  }

  .timeline-track {
    inset: 10px 0;
  }

  .time-readout strong {
    font-size: 11px;
  }
}

/* v88: mobile and in-app browser fit layer for small landscape viewports. */
html,
body {
  height: var(--pml-app-height, 100dvh);
  min-height: var(--pml-app-height, 100dvh);
}

.river-app {
  height: var(--pml-app-height, 100dvh);
  min-height: var(--pml-app-height, 100dvh);
  padding-right: max(10px, env(safe-area-inset-right));
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  padding-left: max(10px, env(safe-area-inset-left));
}

body.pml-mobile-game .guide-overlay,
body.pml-mobile-game .result-overlay {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

body.pml-mobile-game .sync-guide-card,
body.pml-mobile-game .guide-card,
body.pml-mobile-game .result-card {
  max-height: calc(var(--pml-app-height, 100dvh) - 20px);
  overflow: auto;
}

body.pml-mobile-game .guide-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding-top: 10px;
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(239, 252, 255, 0.94) 34%);
}

body.pml-compact-game .river-app {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  padding-top: max(6px, env(safe-area-inset-top));
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

body.pml-compact-game .helper,
body.pml-compact-game .brand {
  display: none;
}

body.pml-compact-game .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

body.pml-compact-game .status-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

body.pml-compact-game .status-card {
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 36px;
  padding: 4px 6px;
  border-radius: 9px;
  column-gap: 5px;
}

body.pml-compact-game .status-card i {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 14px;
}

body.pml-compact-game .status-card span {
  font-size: 9px;
}

body.pml-compact-game .status-card strong {
  min-height: 14px;
  font-size: 11px;
  line-height: 1.05;
}

body.pml-compact-game .back-link {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 11px;
}

body.pml-compact-game .cue-panel {
  top: 6px;
  left: 6px;
  width: min(178px, 32vw);
}

body.pml-compact-game .motion-mirror {
  bottom: 48px;
  left: 6px;
  width: min(260px, 40vw);
}

body.pml-compact-game .timeline-panel {
  right: 6px;
  bottom: max(4px, env(safe-area-inset-bottom));
  left: 6px;
  grid-template-columns: 32px 62px minmax(0, 1fr);
  gap: 6px;
  padding: 5px 7px;
}

body.pml-compact-game .sync-guide-card {
  width: min(760px, calc(100vw - 20px));
  padding: 12px;
  border-radius: 16px;
}

body.pml-compact-game .sync-guide-card h1,
body.pml-compact-game .guide-card h1,
body.pml-compact-game .result-card h1 {
  font-size: clamp(22px, 5.2vw, 30px);
}

body.pml-compact-game .sync-guide {
  height: clamp(150px, 44dvh, 250px);
}

body.pml-compact-game .sync-caption {
  right: 10px;
  bottom: 10px;
  left: 10px;
  max-width: none;
  padding: 9px 11px;
}

body.pml-compact-game .guide-actions button {
  min-height: 42px;
  padding: 0 16px;
  font-size: 15px;
}

/* v89: immersive play mode for phone browsers and in-app browsers */
body.pml-game-immersive .river-app {
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: var(--pml-app-height, 100dvh);
  min-height: var(--pml-app-height, 100dvh);
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
}

body.pml-game-immersive .topbar {
  position: fixed;
  z-index: 20;
  top: max(6px, env(safe-area-inset-top));
  right: max(6px, env(safe-area-inset-right));
  left: max(6px, env(safe-area-inset-left));
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: none;
}

body.pml-game-immersive .brand,
body.pml-game-immersive .topbar-actions {
  display: none;
}

body.pml-game-immersive .status-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 5px;
  width: auto;
  max-width: calc(100vw - 16px);
  pointer-events: auto;
}

body.pml-game-immersive .status-card {
  display: grid;
  grid-template-columns: 24px minmax(0, auto);
  min-height: 40px;
  max-width: 29vw;
  padding: 5px 8px;
  border-radius: 12px;
}

body.pml-game-immersive .status-card i {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 16px;
}

body.pml-game-immersive .status-card span {
  font-size: 10px;
}

body.pml-game-immersive .status-card strong {
  min-height: 18px;
  font-size: clamp(13px, 2.2vw, 18px);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.pml-game-immersive .stage {
  width: 100%;
  height: 100%;
  border-width: 2px;
  border-radius: 18px;
}

body.pml-game-immersive .cue-panel {
  top: auto;
  right: auto;
  bottom: calc(max(8px, env(safe-area-inset-bottom)) + 78px);
  left: max(10px, env(safe-area-inset-left));
  width: min(270px, 38vw);
  gap: 6px;
}

body.pml-game-immersive .cue-panel article {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 14px;
}

body.pml-game-immersive .cue-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

body.pml-game-immersive .cue-panel strong {
  font-size: clamp(17px, 2.4vw, 22px);
}

body.pml-game-immersive .cue-panel p {
  margin-top: 2px;
  font-size: clamp(12px, 1.7vw, 15px);
  line-height: 1.25;
}

body.pml-game-immersive .motion-mirror {
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(max(8px, env(safe-area-inset-bottom)) + 74px);
  width: min(360px, 48vw);
  padding: 8px 10px;
  border-radius: 14px;
}

body.pml-game-immersive .motion-mirror span,
body.pml-game-immersive .time-readout span {
  font-size: 10px;
}

body.pml-game-immersive .motion-mirror strong,
body.pml-game-immersive .time-readout strong {
  font-size: clamp(12px, 1.7vw, 15px);
}

body.pml-game-immersive #cameraButton {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

body.pml-game-immersive .timeline-panel {
  right: max(10px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  grid-template-columns: 42px 92px minmax(0, 1fr);
  gap: 9px;
  padding: 8px 10px;
  border-radius: 16px;
}

body.pml-game-immersive .round-button {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

body.pml-game-immersive .guide-overlay,
body.pml-game-immersive .result-overlay {
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
}

body.pml-game-immersive .result-card {
  max-height: calc(var(--pml-app-height, 100dvh) - 20px);
  overflow: auto;
}

@media (max-height: 430px) and (orientation: landscape) {
  body.pml-game-immersive .status-card:nth-child(2),
  body.pml-game-immersive .status-card:nth-child(5) {
    display: none;
  }

  body.pml-game-immersive .cue-panel {
    display: none;
  }

  body.pml-game-immersive .motion-mirror {
    width: min(310px, 42vw);
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 58px);
  }

  body.pml-game-immersive .timeline-panel {
    grid-template-columns: 38px 78px minmax(0, 1fr);
    padding: 6px 8px;
  }
}

/* v90: proportional stage scaling during active play */
:root {
  --pml-game-design-width: 1366px;
  --pml-game-design-height: 768px;
}

body.pml-game-proportional {
  width: 100%;
  height: var(--pml-app-height, 100dvh);
  min-height: var(--pml-app-height, 100dvh);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(36, 169, 232, 0.38), transparent 28%),
    linear-gradient(180deg, #05294f 0%, #073e6a 54%, #17a9bc 100%);
}

body.pml-game-proportional .river-app {
  position: fixed;
  top: 50%;
  left: 50%;
  width: var(--pml-game-design-width);
  height: var(--pml-game-design-height);
  min-height: 0;
  padding: 14px 18px 10px;
  transform: translate(-50%, -50%) scale(var(--pml-game-scale, 1));
  transform-origin: center center;
}

/* v92: phone landscape play layout for River Boat. Portrait remains a friendly rotate prompt. */
@media (max-width: 920px) and (orientation: portrait) {
  .orientation-card h1 {
    font-size: 30px;
  }

  .orientation-card p::after {
    content: " 横屏后会自动显示游戏画面。";
  }
}

@media (max-width: 960px) and (orientation: landscape) {
  body.pml-game-immersive {
    width: 100%;
    height: var(--pml-app-height, 100dvh);
    min-height: var(--pml-app-height, 100dvh);
    overflow: hidden;
    background:
      radial-gradient(circle at 14% 12%, rgba(49, 183, 233, 0.32), transparent 30%),
      linear-gradient(180deg, #05294f 0%, #073d69 48%, #12a9bd 100%);
  }

  body.pml-game-immersive .river-app {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-rows: 42px minmax(0, 1fr) 34px;
    gap: 4px;
    width: 100%;
    height: var(--pml-app-height, 100dvh);
    min-height: 0;
    padding:
      max(4px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(4px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  body.pml-game-immersive .topbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: stretch;
    pointer-events: auto;
  }

  body.pml-game-immersive .brand {
    display: none;
  }

  body.pml-game-immersive .topbar-actions {
    display: flex;
    gap: 4px;
    align-items: stretch;
    justify-content: flex-end;
  }

  body.pml-game-immersive .back-link {
    min-height: 34px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 11px;
  }

  body.pml-game-immersive .status-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.65fr 1fr 1fr 0.9fr;
    gap: 4px;
    min-width: 0;
    max-width: none;
  }

  body.pml-game-immersive .status-card {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    min-height: 34px;
    max-width: none;
    padding: 3px 6px;
    border-radius: 8px;
    column-gap: 4px;
  }

  body.pml-game-immersive .status-card i {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    font-size: 12px;
  }

  body.pml-game-immersive .status-card span {
    font-size: 8px;
    line-height: 1;
  }

  body.pml-game-immersive .status-card strong {
    min-height: 12px;
    font-size: 10px;
    line-height: 1.05;
  }

  body.pml-game-immersive .stage {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-width: 2px;
    border-radius: 14px;
  }

  body.pml-game-immersive #camera.is-live {
    opacity: 0.26;
  }

  body.pml-game-immersive .stage-vignette {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 18%, transparent 76%, rgba(12, 69, 92, 0.1)),
      radial-gradient(circle at 50% 52%, transparent 0 72%, rgba(255, 255, 255, 0.14) 100%);
  }

  body.pml-game-immersive .cue-panel {
    top: 8px;
    bottom: auto;
    left: 8px;
    display: flex;
    gap: 5px;
    width: min(260px, 34vw);
  }

  body.pml-game-immersive .cue-panel article {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 5px;
    min-height: 42px;
    padding: 5px 6px;
    border-radius: 10px;
  }

  body.pml-game-immersive .cue-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }

  body.pml-game-immersive .cue-panel strong {
    font-size: 13px;
  }

  body.pml-game-immersive .cue-panel p {
    font-size: 9px;
    line-height: 1.18;
  }

  body.pml-game-immersive .motion-mirror {
    right: 8px;
    bottom: 44px;
    left: auto;
    width: min(250px, 33vw);
    padding: 5px 6px;
    border-radius: 10px;
    background: rgba(6, 44, 68, 0.46);
  }

  body.pml-game-immersive .motion-mirror span {
    font-size: 8px;
  }

  body.pml-game-immersive .motion-mirror strong {
    font-size: 10px;
    line-height: 1.15;
  }

  body.pml-game-immersive #cameraButton {
    min-height: 26px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 9px;
  }

  body.pml-game-immersive .timeline-panel {
    position: static;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
    align-self: stretch;
    padding: 3px 7px;
    border-radius: 10px;
  }

  body.pml-game-immersive .time-readout {
    display: none;
  }

  body.pml-game-immersive .round-button {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  body.pml-game-immersive .timeline {
    height: 28px;
  }

  body.pml-game-immersive .timeline-track {
    inset: 8px 0;
    border-width: 2px;
  }

  body.pml-game-immersive .guide-overlay,
  body.pml-game-immersive .result-overlay {
    padding:
      max(6px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(6px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
}

@media (max-width: 760px) and (orientation: landscape) {
  body.pml-game-immersive .river-app {
    grid-template-rows: 36px minmax(0, 1fr) 30px;
    gap: 3px;
  }

  body.pml-game-immersive .status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.pml-game-immersive .status-card:nth-child(2) {
    display: none;
  }

  body.pml-game-immersive .topbar-actions {
    display: none;
  }

  body.pml-game-immersive .topbar {
    grid-template-columns: 1fr;
  }

  body.pml-game-immersive .cue-panel {
    width: min(220px, 32vw);
  }

  body.pml-game-immersive .motion-mirror {
    width: min(210px, 31vw);
  }
}
