/* ========================================================
   勝浦朝市アクションゲーム スタイルシート（SFC超美麗版）
   16-bit JRPG Masterpiece Styling & Responsive
   ======================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  touch-action: auto;
}

body {
  background-color: #080c10;
  color: #f0f4f8;
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'BIZ UDPGothic', Meiryo, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 96vw;
  max-width: 1040px;
  height: 94vh;
  max-height: 720px;
  padding: 8px 12px;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
  position: relative;
}

/* 上部ヘッダーUI（視認性抜群・大迫力ネオンHUD） */
#ui-header {
  width: 100%;
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #38bdf8;
  border-radius: 8px;
  padding: 6px 14px;
  margin-bottom: 6px;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

#ui-header.hidden {
  display: none !important;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.stage-badge {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.5);
  border: 1.5px solid #f87171;
}

/* 注文チケット */
#order-tray {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
}

.order-ticket {
  background: #fffdf2;
  color: #0f172a;
  border-radius: 5px;
  border: 2px solid #eab308;
  padding: 3px 6px;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 900;
  color: #64748b;
}

.ticket-body {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ticket-name {
  font-size: 11px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
}

.ticket-recipe {
  font-size: 8.5px;
  color: #475569;
  background: #f1f5f9;
  padding: 0 3px;
  border-radius: 2px;
}

.ticket-bar-container {
  width: 100%;
  height: 5px;
  background: #cbd5e1;
  border-radius: 3px;
  overflow: hidden;
}

.ticket-bar {
  height: 100%;
  background: #10b981;
  width: 100%;
  transition: width 0.2s linear, background-color 0.2s linear;
}

.ticket-bar.warning { background: #f59e0b; }
.ticket-bar.danger { background: #ef4444; }

/* ヘッダー右側 */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.status-box {
  background: #090d12;
  border: 1.5px solid #334155;
  border-radius: 6px;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 74px;
}

.status-box .label {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-box .value {
  font-size: 17px;
  font-weight: 900;
  color: #fbbf24;
  font-family: 'Courier New', Courier, monospace;
}

.status-box.ko-box .value {
  color: #facc15;
}

.status-box.urgent .value {
  color: #ef4444;
  animation: blink 0.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.combo-box .value { color: #38bdf8; }

.ui-btn {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: #f8fafc;
  border: 1.5px solid #475569;
  border-radius: 6px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.ui-btn:hover {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.ui-btn:active {
  transform: translateY(0);
}

/* キャンバス領域 */
#canvas-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  border: 2px solid #2d3b4d;
  border-radius: 6px;
  overflow: hidden;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* スタミナゲージはボタン撤廃に伴い非表示 */
#stamina-container {
  display: none !important;
}

/* ミニマップレーダー（右下） */
#radar-container {
  display: none !important;
}

.radar-title {
  font-size: 8px;
  font-weight: 900;
  color: #94a3b8;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

#radarCanvas {
  border: 1px solid #334155;
  border-radius: 3px;
  background: #0f172a;
}

/* オーバーレイ */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 12, 18, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

/* ========================================================
   0. ローディング画面（Now Loading...）
   ======================================================== */
#loading-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: radial-gradient(circle at center, #0f172a 0%, #020617 100%) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 99999 !important; /* 最前面・全画面で確実に表示 */
  transition: opacity 0.45s ease, visibility 0.45s ease !important;
}

#loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-card {
  background: rgba(15, 23, 42, 0.94);
  border: 2px solid #38bdf8;
  border-radius: 14px;
  padding: 20px 24px;
  width: 88%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(56, 189, 248, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.loading-mascot-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 32px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

.loading-cat {
  display: inline-block;
  animation: catBob 0.6s infinite alternate ease-in-out;
}

.loading-fish {
  display: inline-block;
  animation: fishFlip 0.8s infinite alternate ease-in-out;
}

@keyframes catBob {
  from { transform: translateY(0) rotate(-6deg); }
  to { transform: translateY(-8px) rotate(6deg); }
}

@keyframes fishFlip {
  from { transform: translateY(0) scaleX(1); }
  to { transform: translateY(-6px) scaleX(-1); }
}

.loading-title {
  font-size: 19px;
  font-weight: 900;
  color: #facc15;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(250, 204, 21, 0.4);
}

.loading-status-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #94a3b8;
  min-height: 18px;
}

.loading-bar-wrap {
  width: 100%;
  height: 14px;
  background: #020617;
  border-radius: 8px;
  border: 1.5px solid #475569;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
  position: relative;
}

.loading-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #facc15 50%, #22c55e 100%);
  border-radius: 6px;
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

.loading-percent {
  font-size: 14px;
  font-weight: 900;
  font-family: 'Courier New', Courier, monospace;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.loading-tip-banner {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 10.5px;
  color: #cbd5e1;
  line-height: 1.35;
  margin-top: 2px;
}

#title-overlay {
  background: #080c10 url('assets/title_bg.webp?v=20260929_webp_lightweight_v1') center center / cover no-repeat;
  backdrop-filter: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 100;
  cursor: pointer;
}

.title-art { display: none; }

.sfc-start-hitbox {
  position: absolute;
  left: 50%;
  top: 83.2%;
  transform: translateX(-50%);
  width: 27%;
  height: 8.8%;
  border-radius: 8px;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.1s ease;
  z-index: 10;
}

.sfc-start-hitbox:hover {
  transform: translateX(-50%) scale(1.02);
}

.sfc-start-hitbox:active {
  transform: translateX(-50%) scale(0.96);
}

.sfc-help-button {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 12px 24px;
  background: rgba(30, 41, 59, 0.9);
  color: #38bdf8;
  border: 2px solid #38bdf8;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transition: all 0.15s ease;
}

.sfc-help-button:hover {
  background: #0284c7;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.6);
}

.title-footer-note {
  font-size: 11px;
  color: #cbd5e1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  margin-bottom: 2px;
}

@keyframes sfcStartPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.03); filter: brightness(1.2); }
}

.hidden,
.ending-banner.hidden,
#title-overlay.hidden,
.overlay.hidden { 
  display: none !important; 
}

.overlay-card {
  background: #16202c;
  border: 3px solid #eab308;
  border-radius: 10px;
  padding: 18px 22px;
  max-width: 580px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 35px rgba(0,0,0,0.9);
}

.sub-title {
  color: #38bdf8;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 2px;
  letter-spacing: 1px;
}

.main-title {
  color: #fbbf24;
  font-size: 26px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #b45309, 3px 3px 0 #000;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.catchphrase {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 10px;
}

.story-box {
  background: #0b1118;
  border: 1px dashed #475569;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 10px;
  text-align: left;
}

.instruction-box {
  display: flex;
  gap: 10px;
  background: #1f2d3d;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10.5px;
  line-height: 1.5;
  text-align: left;
  margin-bottom: 14px;
}

.inst-col { flex: 1; }

.inst-col span {
  background: #0b1118;
  color: #38bdf8;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: bold;
}

.start-button {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  color: #ffffff;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.4);
  transition: transform 0.1s;
}

.start-button:hover {
  transform: translateY(-2px);
}

/* リザルト画面 */
.result-title { color: #38bdf8; font-size: 22px; margin-bottom: 4px; }
.stars { font-size: 34px; color: #fbbf24; margin-bottom: 4px; letter-spacing: 3px; }
.result-rank-title {
  display: inline-block;
  background: #eab308;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  padding: 3px 14px;
  border-radius: 16px;
  margin-bottom: 12px;
}

.result-stats {
  background: #0b1118;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
}

.stat-row strong { color: #f1f5f9; font-size: 14px; }

/* ========================================================
   スマートフォン用：仮想ジョイスティック
   ======================================================== */
#mobile-controller-zone {
  display: none; /* デスクトップ環境では非表示 */
}

.controller-guide-text {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  margin-top: 8px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

#joystick-zone {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 124px;
  height: 124px;
  z-index: 45;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

#joystick-zone:active, #joystick-zone.is-dragging {
  opacity: 1;
}

#joystick-base {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.5) 0%, rgba(2, 6, 23, 0.82) 100%);
  border: 2px solid rgba(245, 158, 11, 0.65);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), inset 0 0 14px rgba(245, 158, 11, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.joystick-ring {
  position: absolute;
  width: 66%;
  height: 66%;
  border-radius: 50%;
  border: 1px dashed rgba(245, 158, 11, 0.35);
  pointer-events: none;
}

.joystick-cross {
  position: absolute;
  background: rgba(245, 158, 11, 0.2);
  pointer-events: none;
}

.joystick-cross.h {
  width: 82%;
  height: 1px;
}

.joystick-cross.v {
  width: 1px;
  height: 82%;
}

#joystick-knob {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fbbf24 0%, #d97706 65%, #78350f 100%);
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65), inset 0 2px 4px rgba(255, 255, 255, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  transform: translate(0px, 0px);
  transition: none;
}

.knob-icon {
  font-size: 24px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
  transform: translateY(-1px);
  pointer-events: none;
}

/* PC（非タッチかつ大画面）でのスティック表示切り替え：PCはマウス操作がメインのため控えめ・または半透明表示 */
@media (hover: hover) and (pointer: fine) {
  #joystick-zone {
    opacity: 0.55;
  }
  #joystick-zone:hover {
    opacity: 0.9;
  }
}

/* ========================================================
   OPシネマティック演出 ＆ チュートリアル スタイル
   ======================================================== */

.menu-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.sub-action-button {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #38bdf8;
  border: 1px solid #38bdf8;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-action-button:hover {
  background: #38bdf8;
  color: #0f172a;
  transform: translateY(-2px);
}

/* OPシネマティック画面 */
.cinema-frame {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #020617;
  position: relative;
}

.cinema-letterbox {
  width: 100%;
  height: 50px;
  background: #000000;
  z-index: 2;
}

.cinema-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px 40px;
  text-align: center;
  position: relative;
}

.op-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.op-scene-title {
  color: #fbbf24;
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.op-scene-text {
  color: #f1f5f9;
  font-size: 15px;
  line-height: 1.8;
  max-width: 650px;
  min-height: 90px;
  margin-bottom: 20px;
  text-align: left;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid #334155;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}

.op-cat-portrait {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  background: #1e293b;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid #475569;
}

.cat-face-icon {
  font-size: 20px;
}

.cat-name {
  color: #fbbf24;
  font-size: 12px;
  font-weight: bold;
}

.op-nav-bar {
  display: flex;
  gap: 16px;
  z-index: 3;
}

.cinema-btn {
  padding: 8px 22px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  transition: transform 0.1s;
}

.cinema-btn.next {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.5);
}

.cinema-btn.skip {
  background: #334155;
  color: #94a3b8;
}

.cinema-btn:hover {
  transform: translateY(-2px);
}

/* ========================================================
   ダダサバイバー風HUD ＆ レベルアップ選択UI
   ======================================================== */

/* レベル ＆ EXPバー */
.level-box {
  flex-shrink: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-badge {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid #60a5fa;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  letter-spacing: 0.5px;
}

.exp-bar-container {
  width: 110px;
  height: 20px;
  background: #0f172a;
  border: 1.5px solid #38bdf8;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.exp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #7dd3fc);
  border-radius: 10px;
  transition: width 0.2s ease-out;
  box-shadow: 0 0 8px #38bdf8;
}

.exp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11.5px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
  white-space: nowrap;
  pointer-events: none;
}

/* HPバー */
.hp-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #090d12;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1.5px solid #334155;
}

.hp-icon {
  font-size: 16px;
}

.hp-bar-container {
  width: 80px;
  height: 18px;
  background: #1e293b;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid #475569;
}

.hp-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
  border-radius: 9px;
  transition: width 0.15s ease-out;
}

.hp-text {
  font-size: 12.5px;
  font-weight: 900;
  color: #f1f5f9;
}

.ending-banner {
  width: 100%;
  max-width: 480px;
  margin: 12px auto 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #fbbf24;
  box-shadow: 0 6px 24px rgba(251, 191, 36, 0.45);
  background: #000;
}

.ending-banner img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: auto;
}

#gameover-banner {
  border-color: #ef4444;
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.45);
}

.ending-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 14px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #431407 100%);
  text-align: center;
}

.ending-badge {
  font-size: 13px;
  font-weight: 900;
  color: #fef08a;
  background: rgba(234, 88, 12, 0.4);
  border: 1px solid #f59e0b;
  padding: 3px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.ending-subtext {
  font-size: 12px;
  color: #fed7aa;
  margin: 0;
  line-height: 1.4;
  font-weight: bold;
}

/* ========================================================
   縦持ちスマホ向け：横向き回転推奨オーバーレイ
   ======================================================== */
#orientation-prompt {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 1) 100%);
  z-index: 99999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  color: #ffffff;
  pointer-events: auto;
}

#orientation-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  background: rgba(3, 7, 18, 0.96);
  color: #f1f5f9;
  text-align: center;
  touch-action: pan-y pinch-zoom;
}

#orientation-overlay.hidden { display: none !important; }
.orientation-card {
  width: min(100%, 460px);
  padding: 28px 24px;
  border: 2px solid #38bdf8;
  border-radius: 18px;
  background: linear-gradient(155deg, #16202c, #0f172a);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.6);
}
.orientation-icon { color: #fbbf24; font-size: 52px; line-height: 1; }
.orientation-card h1 { margin: 12px 0; color: #fbbf24; font-size: clamp(22px, 6vw, 30px); line-height: 1.35; }
.orientation-card p { color: #f1f5f9; font-size: 16px; line-height: 1.6; }
#orientation-resume-btn {
  min-height: 48px;
  margin: 20px 0 12px;
  padding: 10px 20px;
  border: 2px solid #fca5a5;
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  font: inherit;
  font-weight: 800;
}
.orientation-card .orientation-note { color: #cbd5e1; font-size: 14px; }

#tutorial-overlay p, #tutorial-overlay h2, #result-overlay p { user-select: text; -webkit-user-select: text; }

button:focus-visible, [tabindex]:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
button, #gameCanvas, #joystick-zone { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
