/* Keep play readable; give movies their own screen instead of cropping them. */
:root {
  color-scheme: dark;
  --game-line: #513d3b;
  --game-muted: #c7b8ad;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #f2d196;
  outline-offset: 4px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  grid-template-rows: 64px minmax(0, 1fr) 132px;
  width: 100%;
  height: 100dvh;
  background: #0b0b10;
}
.board-area,
.board-area--full {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}
.board-area::after {
  display: none;
}
.board-view-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--game-line);
  border-radius: 10px;
  background: #17151bea;
  box-shadow: 0 3px 12px #0005;
}
.board-view-tools button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #eadcc8;
  font-size: 1.2rem;
  cursor: pointer;
  touch-action: manipulation;
}
.board-view-tools button:nth-child(2) {
  font-size: 0.75rem;
}
.board-view-tools button:hover:not(:disabled) {
  background: #3d3034;
}
@media (max-height: 520px) and (min-width: 600px) {
  .board-view-tools {
    flex-direction: column;
    top: 8px;
    right: 8px;
  }
  .board-view-tools button {
    width: 48px;
    padding: 0 2px;
  }
  .board-view-tools button:nth-child(2) {
    font-size: 0.65rem;
  }
}
.devil-stage {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  min-height: 0;
  height: 180px;
  margin: 12px 14px 0 0;
  border: 1px solid var(--game-line);
  border-radius: 14px;
  background: #120a0d;
}
.devil-eye {
  object-fit: cover;
  mask-image: none;
  -webkit-mask-image: none;
  opacity: 0.8;
}
.devil-caption {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 12px 10px;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.45;
  border-radius: 0;
  background: linear-gradient(transparent, #070509 30%);
  color: #e8d3bf;
}
.hud-mini {
  inset: 0 0 auto;
  height: 64px;
  gap: 12px;
  padding: 0 max(14px, env(safe-area-inset-left));
  background: #111016f5;
  border-bottom: 1px solid #3d2d30;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
.hud-handle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-color: var(--game-line);
  background: #20191d;
  color: #eadcc8;
}
.hud-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hud-brand {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #f0ddc5;
}
.mini-phase {
  padding: 0;
  font-size: 0.72rem;
  border: none;
  background: none;
  color: var(--game-muted);
}
.quick-controls {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.quick-controls button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--game-line);
  border-radius: 8px;
  color: #e2d4c5;
  background: #20191d;
  font-size: 0.8rem;
}
.quick-controls button:hover {
  background: #35282b;
}
.quick-controls button[aria-pressed="true"] {
  border-color: #aa8050;
  background: #3c2d22;
}
.hud-edge {
  display: none;
}
.drawer-backdrop {
  position: fixed;
  inset: 64px 0 0;
  background: #0009;
  z-index: 69;
  border: 0;
}
.hud-drawer {
  top: 64px;
  width: min(350px, 90vw);
  padding: 20px;
  gap: 18px;
  border-color: var(--game-line);
  background: #151016;
  transition: transform 0.18s ease;
}
.hud-drawer:not(.hud-drawer--open) {
  visibility: hidden;
}
.hud-title {
  margin: 0;
  font-family: Georgia, serif;
  color: #f0ddc5;
  font-size: 1.3rem;
}
.drawer-label {
  margin: 0 0 5px;
  color: #cfb798;
  font-size: 0.74rem;
}
.drawer-copy {
  margin: 0;
  color: #d5c7bd;
  font-size: 0.85rem;
  line-height: 1.65;
}
.drawer-section {
  gap: 10px;
}
.difficulty {
  gap: 8px;
}
.difficulty button {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 0.85rem;
  border-color: var(--game-line);
}
.arcade-return {
  color: #efd1a6;
  padding: 10px 0;
  font-size: 0.85rem;
}
.game-guidance {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 132px;
  padding: 22px 440px 12px 26px;
  border-top: 1px solid #3d2d30;
  background: #141016;
  z-index: 54;
}
.guide-title {
  margin: 0 0 6px;
  color: #f3e0c4;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
}
.guide-detail {
  margin: 0 0 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #cbbeb4;
}
.team-key {
  color: #aa9484;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}
.judge-side {
  top: auto;
  left: auto;
  right: 24px;
  bottom: 26px;
  transform: none;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 380px;
  max-width: calc(100vw - 48px);
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  transition: none;
}
.judge-q {
  width: 100%;
  margin: 0;
  font-size: 0.78rem;
  color: #cfb798;
}
.judge-btn {
  flex: 1;
  min-height: 48px;
  padding: 10px 16px;
  font-size: 0.95rem;
  border-radius: 8px;
  box-shadow: none;
}
.judge-trust {
  background: #2c694c;
}
.judge-accuse {
  background: #912e34;
}
.panel-dock {
  bottom: 18px;
  left: auto;
  right: 24px;
  transform: none;
  width: 380px;
  max-height: 116px;
  overflow-y: auto;
}
.panel {
  padding: 12px;
  border-color: var(--game-line);
  background: #20171c;
  box-shadow: none;
  border-radius: 10px;
}
.resolved-msg {
  font-size: 0.86rem;
  line-height: 1.35;
}
.replay-note {
  font-size: 0.75rem;
  margin-bottom: 8px;
}
.panel-actions .btn {
  min-height: 42px;
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-ghost {
  color: #dfc9bb;
  background: #39272d;
  border-color: var(--game-line);
}
.devil-stage--cinematic {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  z-index: 90;
  filter: none;
}
.devil-stage--cinematic .devil-video {
  object-fit: contain;
  object-position: center;
  mask-image: none;
  -webkit-mask-image: none;
}
.devil-stage--cinematic .devil-caption {
  bottom: 24px;
  width: auto;
  max-width: calc(100% - 190px);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #101014df;
}
.dim-overlay {
  z-index: 90;
}
.dim-overlay--cinematic,
.melt-overlay {
  pointer-events: auto;
}
.dim-overlay:not(:has(.blackout-video)):not(:has(.dim-caption)) {
  display: none;
}
.dim-black {
  z-index: 0;
  transition: opacity 0.2s ease;
}
.blackout-video {
  z-index: 1;
  object-fit: contain;
  background: #000;
}
.dim-caption {
  z-index: 2;
  bottom: 30px;
  padding: 10px 170px 10px 20px;
  text-align: left;
  color: #e7d5c8;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  animation: none;
}
.melt-overlay {
  z-index: 95;
  inset: 0;
  width: 100%;
  height: 100dvh;
  transform: none;
  justify-content: center;
  background: #000;
  animation: none;
}
.melt-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: auto;
  border-radius: 0;
  filter: none;
  box-shadow: none;
}
.melt-label {
  position: absolute;
  left: 20px;
  bottom: 24px;
  font-size: 0.85rem;
  color: #e7d5c8;
  letter-spacing: 0.02em;
}
.cinematic-controls,
.cinema-controls {
  position: fixed;
  z-index: 110;
  right: max(20px, env(safe-area-inset-right));
  top: max(76px, env(safe-area-inset-top));
  bottom: auto;
}
.cinema-skip {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #917b6b;
  border-radius: 9px;
  color: #f2e6d6;
  background: #181014ee;
  font-size: 0.85rem;
}
.cinema-status {
  display: block;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #101014df;
  color: #e4d7c9;
  text-align: right;
  font-size: 0.8rem;
}
.boot {
  padding: max(16px, env(safe-area-inset-top)) 16px;
}
.age-card {
  border-color: var(--game-line);
  border-radius: 14px;
  box-shadow: 0 24px 80px #0008;
}
.age-foot,
.menu-foot {
  color: #bcaaa0 !important;
}
.menu-content {
  min-height: min(820px, 94dvh);
  gap: 22px;
  padding: 24px 16px;
}
.menu-head {
  gap: 6px;
}
.menu-title {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3.8rem);
  color: #eed2ae;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 24px #000;
}
.menu-sub {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  color: #d4ae7b;
}
.menu-actions {
  gap: 10px;
}
.menu-diff {
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.diff-pill {
  min-height: 42px;
  padding: 9px 16px;
  font-size: 0.85rem;
  border-color: #806052;
}
.diff-pill.diff-on {
  background: #72242c;
  box-shadow: none;
  border-color: #d8ad80;
}
.menu-tag {
  font-size: 0.95rem;
  line-height: 1.5;
}
.menu-diff-note {
  font-size: 0.82rem;
  line-height: 1.5;
  min-height: 2.5em;
  max-width: 40ch;
  color: #d3bfb3;
}
.menu-play {
  animation: none;
  box-shadow: 0 8px 30px #0006;
  background: #912e34;
  padding: 15px 36px;
  font-size: 1.05rem;
  border-radius: 9px;
}
.menu-versus {
  margin-top: 0;
  padding: 12px 22px;
  font-size: 0.9rem;
}
.menu-help-link {
  margin-top: 4px;
  min-height: 40px;
}
.menu-anim-toggle {
  min-height: 42px;
  padding: 10px 18px;
  line-height: 1.4;
}
.help-overlay {
  position: fixed;
  z-index: 220;
  overflow-y: auto;
}
.help-card {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-color: var(--game-line);
}
.app-mp {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.mp-bar {
  height: 64px;
  background: #141016;
  align-items: center;
}
.mp-actions {
  top: auto;
  bottom: 24px;
  right: 24px;
  transform: none;
}
.mp-waiting {
  bottom: 22px;
}
@media (max-width: 820px) {
  .embedded .quick-controls {
    display: none;
  }
  .embedded .hud-mini {
    padding-right: 100px;
  }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr) 174px;
  }
  .devil-stage {
    position: fixed;
    grid-column: auto;
    grid-row: auto;
    bottom: 102px;
    right: 12px;
    width: 68px;
    height: 58px;
    margin: 0;
    border-radius: 8px;
    z-index: 55;
  }
  .devil-stage:not(.devil-stage--cinematic) .devil-caption {
    display: none;
  }
  .devil-stage--cinematic {
    inset: 0;
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    z-index: 90;
  }
  .hud-mini {
    gap: 8px;
    padding: 0 10px;
  }
  .hud-brand {
    font-size: 0.85rem;
  }
  .hud-heading {
    flex: 1;
  }
  .quick-controls {
    gap: 4px;
  }
  .quick-controls button {
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.7rem;
  }
  .quick-controls button:nth-child(2) {
    display: none;
  }
  .game-guidance {
    height: 174px;
    padding: 14px 94px 82px 14px;
  }
  .guide-title {
    font-size: 0.86rem;
    margin-bottom: 4px;
  }
  .guide-detail {
    font-size: 0.76rem;
    line-height: 1.4;
    margin-bottom: 4px;
  }
  .team-key {
    font-size: 0.55rem;
    letter-spacing: 0.035em;
  }
  .judge-side {
    inset: auto 14px 18px;
    transform: none;
    width: auto;
    max-width: none;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .judge-side .judge-q {
    display: none;
  }
  .judge-side .judge-btn {
    min-height: 48px;
    padding: 10px 8px;
    font-size: 0.88rem;
    flex: 1;
  }
  .investigate-side .judge-btn.btn-ghost {
    flex: 1;
  }
  .panel-dock {
    inset: auto 14px 14px;
    transform: none;
    width: auto;
    max-height: 78px;
  }
  .panel {
    padding: 8px 10px;
  }
  .resolved-msg,
  .replay-note {
    display: none;
  }
  .panel-prompt {
    font-size: 0.78rem;
    margin-bottom: 6px;
  }
  .verdict .panel-prompt {
    display: none;
  }
  .panel-actions .btn {
    min-height: 44px;
  }
  .menu-content {
    min-height: calc(100dvh - 32px);
    width: 100%;
    max-width: 560px;
    padding: 14px 0;
    gap: 28px;
  }
  .menu-diff {
    gap: 6px;
  }
  .diff-pill {
    padding: 8px 13px;
    font-size: 0.78rem;
  }
  .menu-diff-note {
    min-height: 3em;
  }
  .menu-actions {
    gap: 8px;
  }
  .menu-play {
    width: min(300px, 100%);
  }
}
@media (max-height: 520px) and (min-width: 600px) {
  .app {
    grid-template-columns: minmax(0, 1fr) 230px;
    grid-template-rows: 54px minmax(0, 1fr);
  }
  .hud-mini,
  .mp-bar {
    height: 54px;
  }
  .board-area {
    grid-column: 1;
    grid-row: 2;
  }
  .devil-stage:not(.devil-stage--cinematic) {
    position: fixed;
    top: 64px;
    bottom: auto;
    right: 16px;
    width: 70px;
    height: 56px;
    z-index: 55;
  }
  .devil-stage:not(.devil-stage--cinematic) .devil-caption {
    display: none;
  }
  .game-guidance {
    top: 54px;
    bottom: 0;
    left: auto;
    right: 0;
    width: 230px;
    height: auto;
    padding: 80px 14px 90px;
    border-top: 0;
    border-left: 1px solid #3d2d30;
  }
  .guide-title {
    font-size: 0.9rem;
  }
  .guide-detail {
    font-size: 0.78rem;
  }
  .team-key {
    font-size: 0.56rem;
  }
  .judge-side {
    left: auto;
    right: 12px;
    bottom: 12px;
    width: 206px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .judge-side .judge-btn {
    min-height: 44px;
    font-size: 0.8rem;
  }
  .judge-q {
    display: none;
  }
  .panel-dock {
    left: auto;
    right: 12px;
    bottom: 12px;
    width: 206px;
    max-height: 100px;
  }
  .drawer-backdrop,
  .hud-drawer {
    top: 54px;
  }
  .menu-content {
    min-height: 100%;
    padding: 10px;
    gap: 14px;
  }
  .menu-title {
    font-size: 1.9rem;
  }
  .menu-actions {
    gap: 5px;
  }
  .menu-tag,
  .menu-foot {
    display: none;
  }
  .menu-diff-note {
    min-height: 0;
    margin: 0;
  }
  .menu-play {
    padding: 10px 30px;
  }
  .menu-help-link {
    min-height: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Two-player panels keep their complete instructions and evidence controls. */
.app.app-mp {
  display: flex;
  flex-direction: column;
  padding-top: 64px;
}
.app-mp .board-area--full {
  flex: 1;
  min-height: 0;
}
.app-mp .panel-dock {
  left: 50%;
  right: auto;
  bottom: 1.4rem;
  transform: translateX(-50%);
  width: min(560px, 92vw);
  max-height: none;
  overflow: visible;
}
.app-mp .resolved-msg,
.app-mp .verdict .panel-prompt {
  display: block;
}
