:root {
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: #07141a;
  font-family: "Segoe UI", "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}
body {
  position: relative;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: -2px;
  pointer-events: none;
}
body::before {
  z-index: -3;
  background:
    radial-gradient(circle at 50% 20%, rgba(35, 126, 163, 0.46), rgba(7, 20, 26, 0) 34%),
    linear-gradient(180deg, #081821 0%, #0a1e27 50%, #07141a 100%);
}
body::after {
  z-index: -2;
  opacity: 0.07;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(119, 229, 255, 0.42) 0,
      rgba(119, 229, 255, 0.42) 1px,
      transparent 1px,
      transparent 4px
    );
}
#game {
  display: block;
  width: 100vw;
  height: 100dvh;
  cursor: default;
  position: fixed;
  inset: 0;
  z-index: 1;
}
#scene-overlays {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.wall-board-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 360px;
  height: 220px;
  overflow: hidden;
  opacity: 0;
  transform-origin: 0 0;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 1px rgba(170, 237, 249, 0.18),
    0 10px 18px rgba(0, 0, 0, 0.24);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
  transition: box-shadow 180ms ease, filter 180ms ease;
}
.wall-board-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(170, 237, 249, 0.18);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(100, 220, 239, 0.08);
  pointer-events: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.wall-board-frame:hover {
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.18)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}
.wall-board-frame:hover::after {
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 12px rgba(255, 255, 255, 0.14);
}
.wall-board-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #10242e;
  transform-origin: 0 0;
  pointer-events: none;
}
.light-switch {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.24));
}
.light-switch-plate {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1px solid rgba(199, 209, 214, 0.84);
  background: linear-gradient(180deg, rgba(246, 247, 248, 0.98), rgba(199, 205, 209, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(104, 118, 126, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.16);
}
.light-switch-toggle {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 14px;
  height: 40px;
  margin-left: -7px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(147, 160, 166, 0.26), rgba(58, 73, 80, 0.08));
}
.light-switch-thumb {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 18px;
  height: 22px;
  margin-left: -9px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #cdd7dc);
  box-shadow:
    0 4px 7px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(124, 136, 142, 0.2);
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}
.light-switch.is-on .light-switch-thumb {
  transform: translateY(0);
  background: linear-gradient(180deg, #ffffff, #dce5e9);
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.18),
    0 4px 7px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
.light-switch.is-off .light-switch-thumb {
  transform: translateY(16px);
  background: linear-gradient(180deg, #d3dade, #a9b7bd);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.light-switch:hover .light-switch-plate {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.56),
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 16px rgba(255, 255, 255, 0.14);
}
.board-modal {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}
.board-modal.is-open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}
.board-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(20, 59, 71, 0.2), rgba(2, 10, 14, 0.82)),
    rgba(2, 10, 14, 0.65);
  backdrop-filter: blur(8px);
}
.board-modal-panel {
  position: relative;
  width: min(1120px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 56px));
  border-radius: 24px;
  border: 1px solid rgba(170, 237, 249, 0.22);
  background: linear-gradient(180deg, rgba(14, 35, 43, 0.96), rgba(6, 18, 24, 0.98));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(100, 220, 239, 0.08);
  overflow: hidden;
  padding: 18px;
}
.board-modal-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  pointer-events: none;
}
.board-modal-close {
  appearance: none;
  border: 1px solid rgba(170, 237, 249, 0.24);
  border-radius: 999px;
  background: rgba(14, 31, 38, 0.9);
  color: #e7f8fc;
  padding: 10px 16px;
  font: 600 14px "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.board-modal-close:hover {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.12);
  background: rgba(20, 40, 50, 0.94);
}
.board-modal-close-floating {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  backdrop-filter: blur(8px);
}
.board-modal-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  background: #10242e;
  box-shadow: inset 0 0 0 1px rgba(100, 220, 239, 0.12);
}
@media (max-width: 768px) {
  .board-modal-panel {
    width: calc(100vw - 22px);
    height: calc(100vh - 24px);
    border-radius: 18px;
    padding: 12px;
  }
  .board-modal-close-floating {
    top: 12px;
    right: 12px;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
