:root {
  color-scheme: dark;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --ink: #f6f2e9;
  --muted: #bcb7ad;
  --panel: rgba(18, 21, 22, .9);
  --panel-strong: rgba(10, 12, 13, .96);
  --line: rgba(238, 230, 211, .25);
  --amber: #f2b85b;
  --mint: #7ed7bd;
  --coral: #e47767;
  --stage: #080a0b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 0;
  min-height: 100%;
}

body.cinema-seat-view {
  background: #0d1011;
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}

button,
a,
kbd,
span,
strong,
p,
h1,
h2,
dt,
dd {
  letter-spacing: 0;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
#minimapCanvas:focus-visible {
  outline: 3px solid rgba(126, 215, 189, .65);
  outline-offset: 2px;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.cinema-header {
  align-items: center;
  background: #15191a;
  border-bottom: 1px solid #343a3b;
  display: grid;
  gap: 18px;
  grid-template-columns: 120px minmax(0, 1fr) minmax(260px, 360px);
  min-height: 112px;
  padding: 12px 20px;
  position: relative;
  z-index: 20;
}

.cinema-home {
  align-items: center;
  color: var(--mint);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  text-decoration: none;
}

.cinema-home span:first-child {
  font-size: 20px;
}

.cinema-title-block {
  min-width: 0;
}

.cinema-kicker {
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  margin: 0 0 2px;
}

.cinema-title-block h1 {
  font-size: 40px;
  line-height: 1.12;
  margin: 0;
  max-width: 860px;
}

.cinema-title-block > p:last-child {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 0;
}

.cinema-disclaimer {
  border-left: 2px solid var(--amber);
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  padding-left: 12px;
}

.cinema-app,
.theater-stage {
  min-width: 0;
  width: 100%;
}

.theater-stage {
  background: var(--stage);
  height: calc(100svh - 112px);
  min-height: 608px;
  overflow: hidden;
  position: relative;
}

#cinemaCanvas {
  cursor: grab;
  display: block;
  height: 100%;
  touch-action: none;
  width: 100%;
}

#cinemaCanvas.is-dragging {
  cursor: grabbing;
}

.scene-loading {
  align-items: center;
  background: #101415;
  display: flex;
  inset: 0;
  justify-content: center;
  position: absolute;
  z-index: 12;
}

.scene-loading[hidden] {
  display: none;
}

.scene-reticle {
  border: 1px solid rgba(246, 242, 233, .62);
  border-radius: 50%;
  height: 16px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
}

.scene-reticle::before,
.scene-reticle::after {
  background: rgba(246, 242, 233, .62);
  content: "";
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.scene-reticle::before {
  height: 1px;
  width: 24px;
}

.scene-reticle::after {
  height: 24px;
  width: 1px;
}

.hud-panel,
.candidate-hud,
.control-hud,
.hud-toolbar,
.seat-prompt {
  position: absolute;
  z-index: 7;
}

.hud-panel,
.candidate-hud,
.seat-prompt {
  backdrop-filter: blur(8px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.location-hud {
  display: grid;
  gap: 2px;
  left: 16px;
  padding: 12px 14px;
  top: 16px;
  width: 220px;
}

.hud-label,
.candidate-heading > span {
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
}

.location-hud strong {
  font-size: 18px;
  line-height: 1.25;
}

.location-hud > span:not(.hud-label):not(.status-chip) {
  color: var(--muted);
  font-size: 12px;
}

.status-chip {
  background: #183a33;
  border: 1px solid rgba(126, 215, 189, .42);
  border-radius: 999px;
  color: var(--mint);
  font-size: 11px;
  justify-self: start;
  margin-top: 5px;
  padding: 2px 8px;
}

.hud-toolbar {
  display: flex;
  gap: 8px;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
}

.segmented-control {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  padding: 3px;
}

.segmented-control button,
.candidate-hud button,
.mobile-controls button {
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  min-height: 36px;
}

.segmented-control button {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
}

.segmented-control button:hover,
.segmented-control button.is-selected {
  background: #273133;
  border-color: rgba(126, 215, 189, .34);
  color: var(--ink);
}

.angle-hud {
  padding: 12px;
  right: 16px;
  top: 16px;
  width: 256px;
}

.angle-hud h2,
.minimap-hud h2 {
  font-size: 12px;
  line-height: 1.3;
  margin: 0;
}

.angle-heading,
.candidate-heading {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.hud-disclosure {
  align-items: center;
  background: #202728;
  border: 1px solid rgba(238, 230, 211, .22);
  border-radius: 4px;
  color: var(--mint);
  cursor: pointer;
  display: none;
  font-size: 9px;
  font-weight: 800;
  gap: 4px;
  justify-content: center;
  min-height: 26px;
  padding: 3px 6px;
  white-space: nowrap;
}

.hud-disclosure::after {
  content: "⌄";
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  transform-origin: center;
}

.hud-disclosure[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.hud-disclosure:hover,
.hud-disclosure:focus-visible {
  border-color: var(--mint);
  color: var(--ink);
}

.angle-primary {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.angle-primary div {
  background: #222829;
  border-radius: 4px;
  padding: 7px;
}

.angle-primary span,
.angle-detail dt {
  color: var(--muted);
  display: block;
  font-size: 10px;
}

.angle-primary strong {
  color: var(--mint);
  display: block;
  font-size: 18px;
}

.angle-detail {
  display: grid;
  gap: 3px 10px;
  grid-template-columns: repeat(3, 1fr);
  margin: 8px 0 0;
}

.angle-detail-panel[hidden],
.candidate-grid[hidden] {
  display: none;
}

.angle-detail div {
  min-width: 0;
}

.angle-detail div:last-child {
  grid-column: 1 / -1;
}

.angle-detail dd {
  font-size: 11px;
  margin: 0;
}

.section-diagram {
  height: 66px;
  margin-top: 4px;
  overflow: visible;
  width: 100%;
}

.section-diagram text {
  fill: var(--muted);
  font-size: 8px;
}

.diagram-floor {
  stroke: #6d7473;
}

.diagram-screen {
  stroke: #f7f1dd;
  stroke-width: 4;
}

.diagram-sight {
  stroke: var(--amber);
  stroke-width: 1.5;
}

.diagram-eye {
  fill: var(--mint);
}

.angle-summary {
  color: var(--amber);
  font-size: 11px;
  margin: 1px 0 0;
}

.minimap-hud {
  bottom: 16px;
  left: 16px;
  padding: 9px;
  width: 250px;
}

.minimap-title {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.minimap-title span {
  color: var(--muted);
  font-size: 9px;
}

#minimapCanvas {
  cursor: pointer;
  display: block;
  height: 150px;
  margin-top: 6px;
  width: 100%;
}

.candidate-hud {
  bottom: 16px;
  padding: 9px;
  right: 16px;
  width: 280px;
}

.candidate-grid {
  display: grid;
  gap: 5px;
  margin-top: 5px;
}

.candidate-slot {
  display: grid;
  gap: 5px;
  grid-template-columns: 1fr 48px;
}

.candidate-hud button {
  background: #202728;
  border-color: rgba(238, 230, 211, .18);
  color: var(--ink);
  font-size: 11px;
  padding: 4px 7px;
}

.candidate-hud button:hover:not(:disabled) {
  border-color: var(--amber);
}

.candidate-hud button:disabled {
  color: #777d7d;
  cursor: default;
}

.seat-prompt {
  bottom: 80px;
  font-size: 12px;
  left: 50%;
  max-width: 520px;
  padding: 8px 12px;
  text-align: center;
  transform: translateX(-50%);
}

.control-hud {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.desktop-controls {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  font-size: 11px;
  gap: 4px;
  margin: 0;
  padding: 8px 12px;
  white-space: nowrap;
}

.desktop-controls span {
  border-left: 1px solid var(--line);
  height: 18px;
  margin: 0 5px;
}

kbd {
  background: #f0eadb;
  border: 1px solid #fff;
  border-bottom-color: #a8a293;
  border-radius: 3px;
  color: #202526;
  font-size: 10px;
  font-weight: 800;
  min-width: 20px;
  padding: 2px 4px;
  text-align: center;
}

.mobile-controls {
  display: none;
}

@media (max-width: 1180px) {
  .cinema-header {
    grid-template-columns: 100px minmax(0, 1fr) 280px;
  }

  .cinema-title-block h1 {
    font-size: 34px;
  }

  .location-hud {
    width: 200px;
  }

  .angle-hud {
    width: 232px;
  }

  .segmented-control button {
    padding-inline: 7px;
  }
}

@media (max-width: 820px) {
  .cinema-header {
    gap: 12px;
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 126px;
    padding: 10px 14px;
  }

  .cinema-title-block h1 {
    font-size: 30px;
  }

  .cinema-disclaimer {
    grid-column: 2;
  }

  .theater-stage {
    height: calc(100svh - 126px);
    min-height: 590px;
  }

  .hud-toolbar {
    top: 10px;
  }

  .location-hud,
  .angle-hud {
    top: 70px;
  }

  .seat-prompt {
    bottom: 76px;
  }
}

@media (max-width: 700px) {
  .cinema-header {
    display: grid;
    gap: 5px 8px;
    grid-template-columns: 54px minmax(0, 1fr);
    min-height: 140px;
    padding: 8px 10px;
  }

  .cinema-home {
    align-self: start;
    font-size: 0;
    padding-top: 5px;
  }

  .cinema-home span:first-child {
    font-size: 22px;
  }

  .cinema-title-block h1 {
    font-size: 28px;
    line-height: 1.18;
  }

  .cinema-title-block h1 span {
    display: block;
  }

  .cinema-title-block > p:last-child {
    display: none;
  }

  .cinema-disclaimer {
    border-left: 0;
    border-top: 1px solid #343a3b;
    font-size: 10px;
    grid-column: 1 / -1;
    line-height: 1.35;
    padding: 5px 0 0;
  }

  .theater-stage {
    height: calc(100svh - 140px);
    min-height: 527px;
  }

  .scene-reticle {
    height: 13px;
    width: 13px;
  }

  .hud-toolbar {
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr;
    left: 8px;
    right: 8px;
    top: 7px;
    transform: none;
  }

  .segmented-control {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 2px;
  }

  .aim-control {
    grid-template-columns: repeat(2, 1fr);
  }

  .segmented-control button {
    font-size: 10px;
    min-height: 27px;
    padding: 3px 5px;
  }

  .location-hud {
    gap: 1px;
    left: 7px;
    padding: 7px 8px;
    top: 78px;
    width: 150px;
  }

  .location-hud strong {
    font-size: 14px;
  }

  .location-hud > span:not(.hud-label):not(.status-chip),
  .status-chip {
    font-size: 9px;
  }

  .status-chip {
    margin-top: 2px;
    padding: 1px 6px;
  }

  .angle-hud {
    padding: 7px;
    right: 7px;
    top: 78px;
    width: 184px;
  }

  .angle-hud h2 {
    font-size: 10px;
  }

  .angle-primary {
    gap: 4px;
    margin-top: 4px;
  }

  .angle-primary div {
    padding: 4px;
  }

  .angle-primary span,
  .angle-detail dt {
    font-size: 8px;
  }

  .angle-primary strong {
    font-size: 13px;
  }

  .angle-detail {
    gap: 1px 5px;
    margin-top: 4px;
  }

  .angle-detail dd,
  .angle-summary {
    font-size: 8px;
  }

  .section-diagram {
    height: 42px;
    margin-top: 0;
  }

  .minimap-hud {
    bottom: 119px;
    left: 7px;
    padding: 6px;
    width: 168px;
  }

  .minimap-title {
    display: block;
  }

  .minimap-title h2 {
    font-size: 9px;
  }

  .minimap-title span {
    display: none;
  }

  #minimapCanvas {
    height: 104px;
    margin-top: 2px;
  }

  .candidate-hud {
    bottom: 119px;
    padding: 6px;
    right: 7px;
    width: 174px;
  }

  .candidate-grid {
    gap: 3px;
    margin-top: 3px;
  }

  .candidate-slot {
    gap: 3px;
    grid-template-columns: 1fr 40px;
  }

  .candidate-hud button {
    font-size: 9px;
    min-height: 27px;
    padding: 2px 4px;
  }

  .seat-prompt,
  .desktop-controls {
    display: none;
  }

  .control-hud {
    bottom: 7px;
    left: 7px;
    right: 7px;
    transform: none;
  }

  .mobile-controls {
    backdrop-filter: blur(8px);
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px;
  }

  .mobile-controls[hidden] {
    display: none;
  }

  .mobile-controls button {
    background: #222a2b;
    border-color: rgba(238, 230, 211, .18);
    color: var(--ink);
    font-size: 10px;
    min-height: 42px;
    padding: 4px 2px;
  }

  .mobile-controls button:active {
    background: #364344;
    border-color: var(--mint);
  }

  .seated-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


@media (max-width: 700px) and (max-height: 720px) {
  .theater-stage {
    height: calc(100svh - 140px);
    min-height: 0;
  }

  .hud-disclosure {
    display: inline-flex;
  }

  .angle-heading {
    gap: 4px;
  }

  .angle-heading h2 {
    flex: 1;
    min-width: 0;
  }

  .angle-hud .angle-summary {
    line-height: 1.25;
    margin-top: 3px;
  }

  .angle-hud.is-expanded .section-diagram {
    height: 38px;
  }

  .candidate-heading > span {
    display: none;
  }

  .candidate-hud:not(.is-expanded) {
    padding: 4px;
    width: auto;
  }

  .candidate-hud:not(.is-expanded) .candidate-heading {
    justify-content: flex-end;
  }

  .candidate-hud.is-expanded {
    width: 174px;
  }

  .candidate-hud .candidate-toggle {
    background: #202728;
    border-color: rgba(238, 230, 211, .22);
    color: var(--mint);
    font-size: 9px;
    min-height: 28px;
    padding: 3px 7px;
  }
}

@media (max-width: 374px) {
  .cinema-title-block h1 {
    font-size: 27px;
  }

  .angle-hud {
    width: 174px;
  }

  .minimap-hud {
    width: 162px;
  }

  .candidate-hud {
    width: 168px;
  }
}

.cinema-support {
  background: #f3f5f2;
  color: #1d2424;
  color-scheme: light;
  padding: 40px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}

.cinema-ad-reserve,
.cinema-comments,
.cinema-return-links {
  margin-inline: auto;
  max-width: 960px;
}

.cinema-ad-reserve {
  min-height: 112px;
  text-align: center;
}

.cinema-ad-reserve > span {
  color: #687272;
  display: block;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 8px;
}

.cinema-comments {
  margin-top: 24px;
}

.cinema-return-links {
  align-items: center;
  border-top: 1px solid #cfd5d2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  justify-content: center;
  margin-top: 30px;
  padding-top: 22px;
}

.cinema-return-links a {
  color: #166b5d;
  font-weight: 800;
  text-underline-offset: 3px;
}

@media (max-width: 700px) {
  .cinema-support {
    padding-top: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
