/**
 * おまけタウン（3D空間 & 施設内Webアプリ基盤）スタイルシート
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Meiryo', system-ui, -apple-system, sans-serif;
  background-color: #0f172a;
  color: #0f172a;
  -webkit-tap-highlight-color: transparent;
}

.is-hidden {
  display: none !important;
}

/* 3Dメインビュー */
.viewport-root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
}

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

#world-canvas:active {
  cursor: grabbing;
}

/* ミニチュア被写界深度（遠景・手前端ソフトボケ） */

/* 上部HUD */
.hud-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
  z-index: 10;
}

.hud-brand-card {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  max-width: min(360px, calc(100vw - 184px));
}

.hud-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hud-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hud-coords {
  font-size: 0.72rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.hud-chip-btn {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.hud-chip-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.hud-chip-btn:active {
  transform: scale(0.96);
}

.hud-chip-btn.is-zoomed {
  border-color: rgba(250, 204, 21, 0.72);
  background: rgba(250, 204, 21, 0.22);
  color: #fef08a;
}

.hud-env-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.hud-env-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
}

.hud-env-select {
  appearance: auto;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  padding: 3px 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.hud-env-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.42);
  color: #e0f2fe;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.73rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hud-audio-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hud-audio-toggle.is-on {
  border-color: rgba(52, 211, 153, 0.78);
  background: rgba(16, 185, 129, 0.28);
  color: #d1fae5;
}

.hud-audio-volume-wrap {
  display: inline-flex;
  align-items: center;
}

.hud-audio-slider {
  width: 68px;
  height: 4px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hud-help-line {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: #e2e8f0;
  line-height: 1.4;
}

/* 右上ミニマップ */
.minimap-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.minimap-card:hover {
  transform: translateY(-1px);
  border-color: #38bdf8;
}

#minimap-canvas {
  display: block;
  margin: 0 auto;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: #0f291e;
}

.minimap-caption {
  margin-top: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #f8fafc;
}

/* トースト通知 */
.world-toast {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  color: #fef08a;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.45);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 15;
  pointer-events: none;
  text-align: center;
  max-width: 90vw;
}

/* 施設接近時のアクション案内 */
.interaction-prompt {
  position: absolute;
  left: 50%;
  bottom: 138px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 16px;
  padding: 10px 22px;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.48);
  cursor: pointer;
  z-index: 14;
  animation: promptPulse 1.6s infinite ease-in-out;
}

.interaction-prompt-title {
  font-size: 1rem;
  font-weight: 800;
}

.interaction-prompt-sub {
  font-size: 0.72rem;
  opacity: 0.92;
}

@keyframes promptPulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.04);
  }
}

/* 画面下部 半透明タッチ操作パッド */
.touch-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  z-index: 12;
}

.pad-group {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  padding: 8px;
}

.pad-dpad {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(2, 46px);
  gap: 6px;
}

.pad-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 800;
  min-width: 48px;
  min-height: 46px;
  padding: 4px 8px;
  cursor: pointer;
  touch-action: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: background 0.1s ease, transform 0.08s ease;
}

.pad-btn span {
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.92;
}

.pad-btn.is-active,
.pad-btn:active {
  background: rgba(56, 189, 248, 0.62);
  border-color: #ffffff;
  transform: scale(0.94);
}

.pad-forward {
  grid-column: 2;
  grid-row: 1;
}

.pad-strafe-left {
  grid-column: 1;
  grid-row: 2;
}

.pad-backward {
  grid-column: 2;
  grid-row: 2;
}

.pad-strafe-right {
  grid-column: 3;
  grid-row: 2;
}

.pad-turn-group {
  display: flex;
  gap: 8px;
}

.pad-turn-btn {
  min-width: 64px;
  min-height: 58px;
}

.touch-center-action {
  pointer-events: auto;
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.65);
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border-radius: 999px;
  padding: 14px 20px;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, background 0.15s ease;
}

.touch-center-action.is-ready {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-color: #fef08a;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.55);
}

.touch-center-action:active {
  transform: scale(0.95);
}

/* 汎用ボタン */
.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 9px 15px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-accent {
  background: #059669;
  color: #ffffff;
}

.btn-stop {
  background: #dc2626;
  color: #ffffff;
  width: 100%;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 1rem;
}

/* モーダル共通 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 40;
}

.modal-window {
  width: min(760px, 100%);
  max-height: 90vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.modal-subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

.modal-close-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-close-btn:hover {
  background: #f1f5f9;
}

.modal-body {
  padding: 18px 20px 22px;
  overflow-y: auto;
}

/* 全体マップモーダル */
.fullmap-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

.fullmap-canvas-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
}

#fullmap-canvas {
  width: 100%;
  max-width: 380px;
  height: auto;
  border-radius: 14px;
  border: 2px solid #cbd5e1;
  cursor: pointer;
}

.fullmap-note {
  margin: 0;
  font-size: 0.78rem;
  color: #475569;
  text-align: center;
}

.map-guide-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.map-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.map-filter-tab {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #334155;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.map-filter-tab:hover {
  background: #e2e8f0;
}

.map-filter-tab.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.map-facility-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.map-facility-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px 13px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.map-facility-item:hover {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.map-facility-item.is-selected {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}

.map-facility-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 5px;
}

.map-facility-info strong {
  display: block;
  font-size: 0.96rem;
  line-height: 1.35;
}

.map-facility-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.map-facility-visited {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.map-facility-best {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-variant-numeric: tabular-nums;
}

.map-facility-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.map-facility-tag--3d {
  background: #dbeafe;
  color: #1d4ed8;
}

.map-facility-tag--minigame {
  background: #dcfce7;
  color: #15803d;
}

.map-facility-tag--guide {
  background: #fef3c7;
  color: #b45309;
}

.map-facility-dist {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.map-facility-info p {
  margin: 0;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
}

.map-facility-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 1. 町の案内掲示板 */
.guide-hero {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.guide-lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #1e293b;
}

.guide-section {
  margin-top: 16px;
}

.guide-heading {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

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

.control-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
}

.control-card h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.control-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #334155;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.76rem;
  font-family: monospace;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  box-shadow: 0 1px 0 #cbd5e1;
}

.facility-guide-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.facility-guide-card {
  height: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.facility-guide-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.facility-guide-icon {
  font-size: 1.7rem;
}

.facility-guide-titles strong {
  display: block;
  font-size: 0.95rem;
}

.facility-category-badge {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 7px;
  border-radius: 999px;
}

.facility-guide-desc {
  margin: 0;
  flex: 1;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
}

.facility-guide-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* 2. ラッキースロット館 */
.slot-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #0f172a;
  color: #fef08a;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.slot-cost {
  font-size: 0.78rem;
  color: #cbd5e1;
}

.slot-machine {
  background: linear-gradient(180deg, #9f1239, #881337);
  border-radius: 18px;
  padding: 16px;
  color: #ffffff;
  box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.2);
}

.slot-reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.slot-reel-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-reel {
  background: #ffffff;
  color: #0f172a;
  border: 4px solid #facc15;
  border-radius: 14px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.16);
}

.slot-reel.is-spinning {
  animation: slotBounce 0.14s infinite alternate;
}

@keyframes slotBounce {
  from {
    transform: translateY(-2px);
  }
  to {
    transform: translateY(2px);
  }
}

.slot-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.slot-result-box {
  background: rgba(15, 23, 42, 0.45);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.slot-result-box.outcome-jackpot {
  background: linear-gradient(135deg, #ca8a04, #ea580c);
  border-color: #fef08a;
}

.slot-result-box.outcome-big_win,
.slot-result-box.outcome-small_win {
  background: rgba(5, 150, 105, 0.8);
  border-color: #6ee7b7;
}

.slot-result-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 10px;
  border-radius: 999px;
}

.slot-result-title {
  margin: 6px 0 0;
  font-size: 0.96rem;
  font-weight: 700;
}

.lucky-number-panel {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #f8fafc;
}

.lucky-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.lucky-header h3 {
  margin: 0;
  font-size: 0.98rem;
}

.lucky-mode-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-select,
.app-input {
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.88rem;
  background: #ffffff;
  color: #0f172a;
}

.lucky-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}

.lucky-ball {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.35);
}

.lucky-fortune {
  margin: 0;
  text-align: center;
  font-size: 0.84rem;
  color: #334155;
  font-weight: 600;
}

/* 3. 数字早押し道場 */
.rush-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.rush-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.rush-label {
  display: block;
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 700;
}

.rush-value {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.rush-next {
  color: #2563eb;
}

.rush-best {
  color: #059669;
}

.rush-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
}

.rush-banner.is-finish {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.rush-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 400px;
  margin: 0 auto 16px;
}

.rush-tile {
  aspect-ratio: 1 / 1;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #cbd5e1;
  transition: transform 0.08s ease, background 0.15s ease;
}

.rush-tile:hover:not(:disabled) {
  background: #f0f9ff;
  border-color: #38bdf8;
}

.rush-tile:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #cbd5e1;
}

.rush-tile.is-cleared {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
  box-shadow: none;
  opacity: 0.72;
  cursor: default;
}

.rush-tile.is-wrong {
  animation: tileShake 0.25s ease;
  background: #fee2e2;
  border-color: #ef4444;
}

@keyframes tileShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.rush-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 4. なんでもルーレット広場 */
.roulette-stage {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

.roulette-wheel-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.roulette-pointer {
  font-size: 1.6rem;
  line-height: 1;
  color: #dc2626;
  margin-bottom: -8px;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#roulette-canvas {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.roulette-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roulette-result {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 0.94rem;
}

.roulette-result.is-winner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #92400e;
  font-size: 1.05rem;
}

.roulette-add-form {
  display: flex;
  gap: 8px;
}

.roulette-add-form .app-input {
  flex: 1;
  min-width: 0;
}

.roulette-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #475569;
}

.roulette-items-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roulette-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.roulette-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.roulette-del-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.roulette-del-btn:hover:not(:disabled) {
  color: #dc2626;
}

.roulette-hint {
  margin: 0;
  min-height: 18px;
  font-size: 0.78rem;
  color: #dc2626;
  font-weight: 600;
}

.app-placeholder {
  text-align: center;
  padding: 20px 10px;
}

.placeholder-icon {
  font-size: 3rem;
  margin: 0 0 8px;
}

.placeholder-note {
  font-size: 0.8rem;
  color: #64748b;
}

/* =========================================================================
   5. 3Dホラーゲーム「呪われた廃病院」専用スタイル
   ========================================================================= */
#app-modal.modal-backdrop {
  padding: 0;
  background: #0f172a;
  backdrop-filter: none;
}

#app-modal .modal-window {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

#app-modal .modal-body {
  flex: 1;
  overflow: auto;
}

.modal-backdrop.is-fullscreen-game {
  padding: 0;
}

.modal-backdrop.is-fullscreen-game .modal-window {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  background: #020617;
  color: #f8fafc;
}

.modal-backdrop.is-fullscreen-game .modal-header {
  background: #0f172a;
  border-bottom-color: #1e293b;
  padding: 10px 16px;
}

.modal-backdrop.is-fullscreen-game .modal-title {
  color: #fca5a5;
}

.modal-backdrop.is-fullscreen-game .modal-subtitle {
  color: #94a3b8;
}

.modal-backdrop.is-fullscreen-game .modal-close-btn {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

.modal-backdrop.is-fullscreen-game .modal-body {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.horror-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #020617;
  color: #f8fafc;
}

.horror-stage {
  position: relative;
  flex: 1;
  min-height: 240px;
  overflow: hidden;
  background: #020617;
  user-select: none;
}

#horror-canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  z-index: 1;
}

.horror-hud-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2;
}

.horror-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(127, 29, 29, 0) 42%, rgba(185, 28, 28, 0.85) 100%);
  transition: opacity 0.12s linear;
  z-index: 3;
}

.horror-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border: 1.5px solid rgba(248, 250, 252, 0.55);
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
}

/* 画面上部ヘッダーバー（目標・経過時間・操作） */
.horror-header-bar {
  background: linear-gradient(180deg, #0b1324 0%, #060b16 100%);
  border-bottom: 1px solid #1e293b;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.horror-header-objective {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}

.horror-objective-label {
  flex-shrink: 0;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fde047;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.horror-objective {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fef08a;
  line-height: 1.35;
}

.horror-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 左上リアルタイム見取り図ミニマップ */
.horror-minimap-card {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(2, 6, 23, 0.86);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  padding: 6px;
  color: #f8fafc;
  cursor: pointer;
  z-index: 7;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.horror-minimap-card:hover {
  border-color: #7dd3fc;
  transform: translateY(-1px);
}

.horror-minimap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-size: 0.7rem;
}

.horror-area {
  font-weight: 800;
  color: #e0f2fe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.horror-minimap-zoom {
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.64rem;
  flex-shrink: 0;
}

#horror-minimap-canvas {
  display: block;
  width: 128px;
  height: 160px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.horror-timer {
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 2px 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #334155;
  border-radius: 999px;
}

.horror-ghost-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.horror-ghost-badge.state-dormant {
  background: rgba(30, 41, 59, 0.9);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.horror-ghost-badge.state-omen {
  background: rgba(124, 45, 18, 0.85);
  color: #fed7aa;
  border: 1px solid rgba(249, 115, 22, 0.45);
}

.horror-ghost-badge.state-patrol {
  background: rgba(51, 65, 85, 0.9);
  color: #cbd5e1;
}

.horror-ghost-badge.state-alert {
  background: rgba(217, 119, 6, 0.9);
  color: #fef3c7;
}

.horror-ghost-badge.state-chase {
  background: rgba(220, 38, 38, 0.95);
  color: #ffffff;
  animation: promptPulse 0.6s infinite alternate;
}

.horror-hud-btn {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.horror-hud-btn:hover {
  border-color: #94a3b8;
  color: #ffffff;
}

.horror-hud-btn.is-on {
  background: rgba(202, 138, 4, 0.35);
  border-color: #facc15;
  color: #fef08a;
}

/* 右上擬似心拍数モニター */
.horror-heart-monitor {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 164px;
  background: rgba(2, 6, 23, 0.86);
  border: 1px solid rgba(74, 222, 128, 0.42);
  border-radius: 10px;
  padding: 6px 8px;
  pointer-events: none;
  z-index: 7;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.horror-heart-monitor.is-elevated {
  border-color: rgba(250, 204, 21, 0.72);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.32);
}

.horror-heart-monitor.is-danger {
  border-color: rgba(239, 68, 68, 0.9);
  box-shadow: 0 0 18px rgba(220, 38, 38, 0.5);
}

.horror-hr-header {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.horror-hr-icon {
  font-size: 0.82rem;
}

.horror-heart-monitor.is-danger .horror-hr-icon,
.horror-heart-monitor.is-elevated .horror-hr-icon {
  animation: promptPulse 0.45s infinite alternate;
}

.horror-hr-bpm {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #4ade80;
}

.horror-heart-monitor.is-elevated .horror-hr-bpm {
  color: #facc15;
}

.horror-heart-monitor.is-danger .horror-hr-bpm {
  color: #ef4444;
}

.horror-hr-unit {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 700;
}

.horror-hr-status {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #86efac;
}

.horror-heart-monitor.is-elevated .horror-hr-status {
  color: #fde047;
}

.horror-heart-monitor.is-danger .horror-hr-status {
  color: #fca5a5;
}

#horror-ecg-canvas {
  display: block;
  width: 100%;
  height: 38px;
  background: rgba(2, 16, 12, 0.85);
  border-radius: 6px;
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.horror-locker-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(2, 6, 23, 0.92) 0px,
    rgba(2, 6, 23, 0.92) 48px,
    rgba(2, 6, 23, 0.28) 48px,
    rgba(2, 6, 23, 0.28) 64px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
}

.locker-slit-text {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #475569;
  border-radius: 14px;
  padding: 16px 22px;
  text-align: center;
  pointer-events: auto;
}

.locker-slit-text p {
  margin: 6px 0 12px;
  font-size: 0.84rem;
  color: #cbd5e1;
}

.horror-action-prompt {
  position: absolute;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(185, 28, 28, 0.92);
  color: #ffffff;
  border: 1.5px solid #fca5a5;
  border-radius: 12px;
  padding: 8px 18px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 7;
}

.horror-action-prompt small {
  font-size: 0.68rem;
  opacity: 0.9;
}

/* 3D画面下部の探索・恐怖演出字幕エリア */
.horror-subtitle-bar {
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  width: min(880px, calc(100% - 28px));
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 7;
}

.horror-subtitle-box {
  background: rgba(2, 6, 23, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 9px 18px;
  max-width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.horror-subtitle-box.is-fade-in {
  animation: horrorSubtitleFade 0.28s ease-out;
}

@keyframes horrorSubtitleFade {
  from {
    opacity: 0.15;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.horror-log {
  font-size: 1.26rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.horror-touch-controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 7;
}

.horror-pad-left,
.horror-pad-right {
  pointer-events: auto;
  display: flex;
  gap: 6px;
}

.hpad-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.62);
  color: #f8fafc;
  border-radius: 10px;
  min-width: 44px;
  min-height: 40px;
  padding: 5px 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: none;
}

.hpad-btn.is-active {
  background: rgba(239, 68, 68, 0.72);
  border-color: #ffffff;
}

.hpad-action.is-ready {
  background: rgba(217, 119, 6, 0.9);
  border-color: #fde68a;
}

.horror-overlay-dialog {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 8;
}

.keypad-card,
.horror-end-card,
.item-detail-card,
.fullmap-card {
  width: min(340px, 100%);
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65);
}

/* アイテム・メモ詳細モーダル */
.item-detail-card {
  width: min(460px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  text-align: left;
  border-color: #64748b;
}

.item-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.item-detail-icon {
  font-size: 2rem;
  line-height: 1;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 12px;
  padding: 8px;
}

.item-detail-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-detail-category {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.04em;
}

.item-detail-titles h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #f8fafc;
}

.item-detail-summary {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.item-detail-fulltext {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.86rem;
  line-height: 1.65;
  color: #e2e8f0;
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: 42vh;
  margin-bottom: 14px;
}

.item-detail-close-btn {
  width: 100%;
}

/* 全体見取り図拡大モーダル */
.fullmap-card {
  width: min(440px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.fullmap-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fullmap-header h3 {
  margin: 0;
  font-size: 1rem;
}

.fullmap-area-badge {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

#horror-fullmap-canvas {
  width: min(320px, 72vw);
  height: auto;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  border: 1px solid #475569;
}

.fullmap-legend {
  margin: 0;
  font-size: 0.74rem;
  color: #94a3b8;
}

.fullmap-close-btn {
  width: 100%;
}

.keypad-card.is-shake {
  animation: tileShake 0.26s ease;
}

.keypad-card h3,
.horror-end-card h3 {
  margin: 0 0 6px;
}

.keypad-sub {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.keypad-display {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #facc15;
}

.keypad-error {
  min-height: 18px;
  margin: 6px 0;
  font-size: 0.78rem;
  color: #f87171;
  font-weight: 700;
}

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

.keypad-key {
  border: 1px solid #475569;
  background: #1e293b;
  color: #f8fafc;
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.keypad-key:hover {
  background: #334155;
}

.keypad-submit {
  background: #059669;
  border-color: #10b981;
}

.keypad-fn {
  background: #475569;
  font-size: 0.82rem;
}

.keypad-cancel {
  width: 100%;
}

.horror-end-card.is-gameover h3 {
  color: #ef4444;
  font-size: 1.6rem;
}

.horror-end-card.is-cleared h3 {
  color: #4ade80;
  font-size: 1.45rem;
}

.horror-end-card p {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 8px 0 16px;
}

.horror-end-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 最下段タスクバー（クリック可能な所持アイテム一覧） */
.horror-taskbar-bottom {
  background: #080f1d;
  border-top: 1px solid #1e293b;
  padding: 8px 14px;
}

.horror-inventory {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.horror-item-slot {
  appearance: none;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.horror-item-slot.is-owned {
  background: #1e293b;
  border-color: #facc15;
  color: #fef08a;
  cursor: pointer;
}

.horror-item-slot.is-owned:hover {
  background: #283548;
  border-color: #fef08a;
  transform: translateY(-1px);
}

.horror-item-slot.is-owned.is-inspecting {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #e0f2fe;
}

.horror-item-slot.is-empty {
  background: #020617;
  color: #475569;
  cursor: default;
}

/* モバイル・タブレット向けレスポンシブ調整 */
@media (max-width: 760px) {
  .horror-header-bar {
    padding: 6px 10px;
    gap: 6px;
  }

  .horror-objective {
    font-size: 0.78rem;
  }

  #horror-minimap-canvas {
    width: 96px;
    height: 120px;
  }

  .horror-heart-monitor {
    top: 10px;
    right: 8px;
    width: 132px;
    padding: 5px 6px;
  }

  .horror-subtitle-bar {
    bottom: 54px;
    width: calc(100% - 16px);
  }

  .horror-log {
    font-size: 1.11rem;
  }

  .horror-taskbar-bottom {
    padding: 6px 8px;
  }

  .horror-item-slot {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .horror-action-prompt {
    bottom: 106px;
    padding: 6px 12px;
    font-size: 0.82rem;
  }
  .hud-brand-card {
    padding: 8px 10px;
    max-width: calc(100vw - 148px);
  }

  .hud-help-line {
    display: none;
  }

  #minimap-canvas {
    width: 104px;
    height: 104px;
  }

  .pad-dpad {
    grid-template-columns: repeat(3, 42px);
    grid-template-rows: repeat(2, 42px);
    gap: 4px;
  }

  .pad-btn {
    min-width: 42px;
    min-height: 42px;
    font-size: 0.78rem;
  }

  .pad-turn-btn {
    min-width: 52px;
    min-height: 52px;
  }

  .touch-center-action {
    padding: 12px 14px;
    font-size: 0.82rem;
  }

  .interaction-prompt {
    bottom: 126px;
    padding: 8px 16px;
  }

  .fullmap-layout,
  .controls-grid,
  .facility-guide-list,
  .roulette-stage {
    grid-template-columns: 1fr;
  }
}


/* =========================================================================
   6. 天体・不思議博物館「CHRONO-CELESTIAL CAL. 89」専用スタイル
   ========================================================================= */
.orrery-root {
  display: grid;
  grid-template-columns: 1fr 290px;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #07090f;
  color: #f8fafc;
}

.orrery-stage {
  position: relative;
  min-width: 0;
  min-height: 260px;
  overflow: hidden;
  user-select: none;
}

#orrery-canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  z-index: 1;
}

#orrery-canvas:active {
  cursor: grabbing;
}

.orrery-hud-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* 左上：折りたたみ可能な操作ガイド */
.orrery-guide-card {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  width: min(260px, calc(100% - 24px));
  background: rgba(10, 15, 28, 0.84);
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 10px;
  padding: 8px 10px;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

.orrery-guide-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fde68a;
}

.orrery-guide-list {
  margin: 6px 0 0;
  padding-left: 16px;
  font-size: 0.72rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.orrery-guide-card.is-collapsed .orrery-guide-list {
  display: none;
}

/* 左下：テレメトリ HUD */
.orrery-telemetry-hud {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 4;
  background: rgba(10, 15, 28, 0.86);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 240px;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

.orrery-tele-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #facc15;
  margin-bottom: 5px;
}

.orrery-tele-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  font-size: 0.71rem;
  align-items: center;
}

.orrery-tele-grid span {
  color: #94a3b8;
}

.orrery-tele-grid strong {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #e2e8f0;
}

/* 右側：コントロールパネル */
.orrery-control-panel {
  background: linear-gradient(180deg, #0d1322 0%, #070b14 100%);
  border-left: 1px solid #1e293b;
  padding: 9px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.orrery-panel-section {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.orrery-panel-heading {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.03em;
}

.orrery-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
}

.orrery-slider-head span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #facc15;
}

.orrery-range {
  width: 100%;
  accent-color: #f59e0b;
  cursor: pointer;
}

.orrery-btn-stack,
.orrery-toggle-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.orrery-quick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.orrery-chip-btn {
  appearance: none;
  text-align: left;
  background: #111b2e;
  border: 1px solid #334155;
  color: #cbd5e1;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.orrery-chip-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.orrery-chip-btn:hover {
  background: #1e293b;
  border-color: #64748b;
  color: #f8fafc;
}

.orrery-chip-btn.is-active {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #fef08a;
}

.orrery-mini-btn {
  appearance: none;
  background: #1e293b;
  border: 1px solid #475569;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.orrery-mini-btn:hover {
  background: #334155;
  border-color: #94a3b8;
}

.orrery-track-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.orrery-track-btn {
  text-align: center;
  padding: 4px 2px;
  font-size: 0.58rem;
  white-space: nowrap;
  overflow: hidden;
}

.orrery-track-btn.is-active {
  background: rgba(245, 158, 11, 0.24);
  border-color: #f59e0b;
  color: #fef08a;
}

@media (max-width: 820px) {
  .orrery-root {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .orrery-control-panel {
    border-left: none;
    border-top: 1px solid #1e293b;
    max-height: 42vh;
  }

  .orrery-telemetry-hud {
    min-width: 195px;
    padding: 6px 8px;
  }
}

/* ==========================================================================
   長距離スナイパー射的場 (450m 精密狙撃＆弾丸カメラUI)
   ========================================================================== */

.sniper-root {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #070b11;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  user-select: none;
}

.sniper-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #0d1520;
}

.sniper-gl-canvas,
.sniper-hud-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.sniper-hud-canvas {
  cursor: crosshair;
  touch-action: none;
}

.sniper-top-bar {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}

.sniper-wind-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(10, 17, 28, 0.84);
  border: 1px solid rgba(132, 204, 22, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.sniper-wind-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(132, 204, 22, 0.16);
  color: #bef264;
  font-size: 18px;
  font-weight: 800;
  transition: transform 0.2s ease;
}

.sniper-wind-speed {
  font-size: 13px;
  font-weight: 700;
  color: #bef264;
}

.sniper-wind-dir {
  font-size: 11px;
  color: #cbd5e1;
}

.sniper-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.sniper-telemetry span {
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(10, 17, 28, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
}

.sniper-status-banner {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(10, 17, 28, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 12px;
  color: #cbd5e1;
  text-align: center;
  pointer-events: none;
}

.sniper-control-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: #0f172a;
  border-left: 1px solid #1e293b;
  overflow-y: auto;
}

.sniper-panel-section {
  padding: 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #1e293b;
}

.sniper-panel-section h3 {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #bef264;
}

.sniper-select {
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid #334155;
  background: #020617;
  color: #f8fafc;
  font-size: 12px;
}

.sniper-desc {
  margin: 7px 0 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #94a3b8;
}

.sniper-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sniper-btn-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 6px;
  margin-top: 8px;
}

.sniper-btn {
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sniper-btn:hover {
  background: #273549;
  border-color: #64748b;
}

.sniper-btn.is-active {
  background: #365314;
  border-color: #84cc16;
  color: #ecfccb;
}

.sniper-btn.is-fire {
  background: #991b1b;
  border-color: #ef4444;
  color: #fef2f2;
}

.sniper-btn.is-fire:hover {
  background: #b91c1c;
}

.sniper-breath-wrap {
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
}

.sniper-breath-bar {
  margin-top: 4px;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #334155;
  overflow: hidden;
}

.sniper-breath-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #84cc16);
  transition: width 0.08s linear;
}

.sniper-target-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 210px;
  overflow-y: auto;
}

.sniper-target-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #0b1220;
  font-size: 11px;
  color: #cbd5e1;
}

.sniper-target-list li.is-down {
  opacity: 0.55;
  text-decoration: line-through;
  color: #86efac;
}

.sniper-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: auto;
}

@media (max-width: 860px) {
  .sniper-root {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 1fr) auto;
  }

  .sniper-control-panel {
    border-left: none;
    border-top: 1px solid #1e293b;
    max-height: 44vh;
  }
}

/* ==========================================================================
   占いの館（星霧の館 — 水晶玉とフードの占い師）
   ========================================================================== */
.fortune-root {
  width: 100%;
  height: 100%;
  background: #070312;
  display: flex;
  flex-direction: column;
}

.fortune-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 460px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #241147, #070312 75%);
}

#fortune-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.fortune-top-bar {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.fortune-badge,
.fortune-sound-btn {
  pointer-events: auto;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 1.45rem;
  font-weight: 700;
  color: #f3e8ff;
  background: rgba(24, 10, 48, 0.82);
  border: 1px solid rgba(192, 132, 252, 0.42);
  backdrop-filter: blur(6px);
}

.fortune-sound-btn {
  cursor: pointer;
}

.fortune-sound-btn.is-active {
  border-color: #facc15;
  color: #fef08a;
  background: rgba(88, 28, 135, 0.78);
}

.fortune-dialog-box {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(1060px, calc(100% - 28px));
  max-height: none;
  overflow: visible;
  overflow-y: visible;
  background: rgba(14, 6, 32, 0.92);
  border: 1px solid rgba(192, 132, 252, 0.52);
  border-radius: 16px;
  padding: 16px 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  color: #f8fafc;
}

.fortune-dialog-box.is-result-mode {
  width: min(1200px, 94vw);
  padding: 14px 20px;
}

.fortune-teller-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.fortune-teller-name {
  font-size: 1.65rem;
  font-weight: 800;
  color: #e9d5ff;
}

.fortune-mode-pill {
  font-size: 1.35rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.24);
  border: 1px solid rgba(216, 180, 254, 0.36);
  color: #f3e8ff;
}

.fortune-dialog-text {
  margin: 0 0 14px;
  font-size: 1.75rem;
  line-height: 1.6;
  color: #f1f5f9;
  white-space: pre-line;
}

.fortune-theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.fortune-theme-chip {
  border: 1px solid rgba(192, 132, 252, 0.40);
  background: rgba(46, 16, 101, 0.70);
  color: #e9d5ff;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 1.45rem;
  font-weight: 700;
  cursor: pointer;
}

.fortune-theme-chip.is-active {
  background: rgba(168, 85, 247, 0.48);
  border-color: #fde047;
  color: #fef08a;
}

.fortune-form-row {
  display: flex;
  gap: 10px;
}

.fortune-input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(192, 132, 252, 0.48);
  background: rgba(7, 3, 18, 0.90);
  color: #f8fafc;
  font-size: 1.60rem;
}

.fortune-primary-btn {
  border: 1px solid rgba(250, 204, 21, 0.66);
  background: linear-gradient(135deg, #6b21a8, #4c1d95);
  color: #fef08a;
  font-weight: 800;
  font-size: 1.60rem;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.fortune-key-hint {
  margin: 8px 0 0;
  font-size: 1.25rem;
  line-height: 1.45;
  color: #c4b5fd;
}

.fortune-error-msg {
  margin: 8px 0 0;
  font-size: 1.40rem;
  color: #fca5a5;
}

.fortune-tarot-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.fortune-tarot-emblem {
  font-size: 1.50rem;
  font-weight: 800;
  color: #e9d5ff;
  background: rgba(88, 28, 135, 0.55);
  border: 1px solid rgba(216, 180, 254, 0.45);
  padding: 5px 14px;
  border-radius: 8px;
}

.fortune-tarot-badge {
  font-size: 1.65rem;
  font-weight: 800;
  color: #fde047;
  background: rgba(234, 179, 8, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.45);
  padding: 5px 14px;
  border-radius: 8px;
}

.fortune-tarot-keyword {
  font-size: 1.45rem;
  color: #d8b4fe;
}

.fortune-result-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: stretch;
  overflow: visible;
}

.fortune-result-panel.is-hidden {
  display: none;
}

.fortune-result-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fortune-result-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.fortune-result-text {
  margin: 0;
  overflow: visible;
}

.fortune-again-btn {
  align-self: flex-end;
}

.fortune-lucky-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.fortune-lucky-grid > div {
  background: rgba(30, 27, 75, 0.76);
  border: 1px solid rgba(192, 132, 252, 0.34);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fortune-lucky-grid span {
  font-size: 1.30rem;
  color: #c4b5fd;
}

.fortune-lucky-grid strong {
  font-size: 1.50rem;
  color: #fef08a;
}

.fortune-lucky-note {
  font-style: normal;
  font-size: 1.15rem;
  line-height: 1.35;
  color: #e9d5ff;
}

@media (max-width: 900px) {
  .fortune-result-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .fortune-form-row {
    flex-direction: column;
  }
  .fortune-lucky-grid {
    grid-template-columns: 1fr;
  }
}

/* 🎨 光と砂の粒子美術館 */
.pam-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  color: #f8fafc;
}

.pam-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
}

.pam-mode-tabs,
.pam-sub-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pam-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.pam-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(56, 189, 248, 0.65);
}

.pam-btn.is-active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #7dd3fc;
  color: #ffffff;
}

.pam-btn-accent {
  background: linear-gradient(135deg, #d97706, #ea580c);
  border-color: #fde047;
  color: #ffffff;
}

.pam-stage-wrap {
  position: relative;
  flex: 1;
  min-height: 360px;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #0f172a 0%, #020617 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.pam-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.pam-canvas:active {
  cursor: grabbing;
}

.pam-hud-overlay {
  position: absolute;
  left: 14px;
  bottom: 12px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.pam-hud-pill {
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
}

.pam-guide-card {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: 290px;
  background: rgba(2, 6, 23, 0.84);
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.80rem;
  line-height: 1.45;
  color: #e2e8f0;
  z-index: 5;
  backdrop-filter: blur(6px);
}

.pam-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  color: #7dd3fc;
}

.pam-guide-toggle {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.75rem;
  cursor: pointer;
}

.pam-guide-body {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pam-guide-body.is-collapsed {
  display: none;
}

.pam-season-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pam-btn-season {
  font-size: 0.96rem;
  font-weight: 700;
  padding: 8px 14px;
}
