/* ==========================================================================
   大正酔いどれクエストⅡ - レトロRPGテーマ スタイルシート
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DotGothic16&family=Press+Start+2P&display=swap');

:root {
  --bg-dark: #090a10;
  --bg-panel: #000000;
  --border-white: #ffffff;
  --border-gold: #f7d070;
  --title-blue-start: #0a2380;
  --title-blue-end: #020b38;
  --text-white: #ffffff;
  --text-yellow: #f8e16c;
  --text-green: #52f38d;
  --text-cyan: #5ce1e6;
  --text-pink: #ff77a8;
  --text-red: #ff4757;
  --text-dim: #a0a5ba;
  
  --font-pixel: 'DotGothic16', monospace, sans-serif;
  --font-en-pixel: 'Press Start 2P', monospace, cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(#1c2035 15%, transparent 16%),
    radial-gradient(#151828 15%, transparent 16%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  color: var(--text-white);
  font-family: var(--font-pixel);
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 0;
  overflow-x: hidden;
}

/* スマホ風コンテナ */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: #050508;
  border-left: 2px solid #1a1c2e;
  border-right: 2px solid #1a1c2e;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 10px rgba(92, 225, 230, 0.2);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* スキャンラインエフェクト (レトロCRT風) */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  z-index: 999;
  pointer-events: none;
  opacity: 0.6;
}

/* ヘッダー */
.app-header {
  background: #000;
  border-bottom: 4px double var(--border-white);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-yellow);
  text-shadow: 2px 2px 0px #000, -1px -1px 0px #805000;
  letter-spacing: 1px;
}

.header-subtitle {
  font-size: 11px;
  color: var(--text-cyan);
  background: #002244;
  padding: 1px 6px;
  border: 1px solid var(--text-cyan);
  border-radius: 2px;
}

.sound-toggle-btn {
  background: #111;
  border: 2px solid var(--border-white);
  color: var(--text-white);
  font-family: var(--font-pixel);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.1s;
}

.sound-toggle-btn:active {
  transform: scale(0.95);
  background: #333;
}


/* メインコンテンツ領域 */
.app-content {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 85px; /* ナビゲーションバーの高さぶん空ける */
}

/* 白い二重枠RPGウィンドウ */
.rpg-window {
  background-color: var(--bg-panel);
  border: 4px double var(--border-white);
  box-shadow: inset 0 0 0 2px #000, 4px 4px 0px rgba(0, 0, 0, 0.6);
  padding: 12px;
  position: relative;
  border-radius: 2px;
}

.rpg-window.gold-border {
  border-color: var(--border-gold);
}

/* 青いタイトルバー付きウィンドウ */
.rpg-window-header {
  background: linear-gradient(180deg, var(--title-blue-start) 0%, var(--title-blue-end) 100%);
  border: 2px solid var(--border-white);
  color: var(--text-white);
  padding: 6px 12px;
  font-weight: bold;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -12px -12px 12px -12px;
  text-shadow: 1px 1px 0px #000;
}

.rpg-window-header .header-badge {
  font-size: 11px;
  color: var(--text-yellow);
}

#hero-banner-wrapper {
  padding: 12px 12px 0 12px;
}

/* メッセージウィンドウ */
.message-window {
  background: #000;
  border: 4px double var(--border-white);
  padding: 10px 14px;
  margin: 12px 12px 0 12px;
  min-height: 64px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  color: var(--text-white);
}

.message-window::after {
  content: "▼";
  position: absolute;
  bottom: 6px;
  right: 12px;
  font-size: 10px;
  color: var(--text-yellow);
  animation: blink 0.8s infinite;
}

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

/* コマンドリスト (レトロ選択メニュー) */
.command-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.command-item {
  background-color: #0b0d18;
  border: 2px solid #2a2d48;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
  position: relative;
}

.command-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.command-cursor {
  color: var(--text-yellow);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.15s ease;
  font-size: 14px;
}

.command-item:hover,
.command-item:focus,
.command-item.active {
  background-color: #1a1e3a;
  border-color: var(--border-white);
  box-shadow: inset 0 0 8px rgba(92, 225, 230, 0.3);
}

.command-item:hover .command-cursor,
.command-item:focus .command-cursor,
.command-item.active .command-cursor {
  opacity: 1;
  transform: translateX(0);
}

.command-label {
  font-size: 15px;
  color: var(--text-white);
}

.command-badge {
  font-size: 11px;
  background: #182858;
  color: var(--text-cyan);
  padding: 2px 6px;
  border: 1px solid #3858a8;
  border-radius: 2px;
}

/* バナー画像 */
.hero-banner-box {
  width: 100%;
  border: 4px double var(--border-white);
  overflow: hidden;
  position: relative;
  background: #000;
  margin-bottom: 4px;
}

/* 案内所（トップ画面）のメイン画像のみスキャンラインエフェクト(z-index:9999)を除外 */
.hero-banner-box.top-hero-banner {
  position: relative;
  z-index: 2;
}

.hero-banner-img {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
  filter: contrast(1.05) brightness(0.95);
}

/* 一覧・選択ページ用コンパクトバナー (パターンB) */
.hero-banner-box.compact .hero-banner-img {
  height: 95px;
  object-fit: cover;
  object-position: center 35%;
}

.hero-banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.85) 100%);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.hero-banner-title {
  font-size: 16px;
  color: var(--text-yellow);
  text-shadow: 2px 2px 0 #000;
}

.hero-banner-tag {
  font-size: 10px;
  background: var(--text-red);
  color: #fff;
  padding: 2px 6px;
  font-weight: bold;
}

/* 店舗カード形式 */
.store-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.store-card {
  background: #000;
  border: 3px double var(--border-white);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, margin 0.1s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-card:hover, .store-card:active {
  border-color: var(--text-yellow);
  box-shadow: 0 0 12px rgba(248, 225, 108, 0.4);
  margin-top: -2px;
  margin-bottom: 2px;
}

.store-card-top-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px dashed #333;
  padding-bottom: 10px;
}

.store-card-info-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.store-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.store-card-logo-box {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border: 2px solid var(--border-gold);
  border-radius: 6px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(247, 208, 112, 0.4);
  position: relative;
  z-index: 10000; /* スキャンライン(z-index: 999)の上に表示して特殊フィルターを除外 */
}

.store-card-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  image-rendering: auto;
}

.store-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-yellow);
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-word;
  line-height: 1.45;
}

.store-status-badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 2px;
  font-weight: normal;
}

.status-open {
  background: #004d20;
  color: var(--text-green);
  border: 1px solid var(--text-green);
}

.status-closed {
  background: #4d0010;
  color: var(--text-red);
  border: 1px solid var(--text-red);
}

.store-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.tag {
  font-size: 13px;
  padding: 3px 8px;
  background: #111e38;
  color: var(--text-cyan);
  border: 1px solid #203c70;
}

.tag.tag-area {
  background: #2b1f0c;
  color: var(--text-yellow);
  border-color: #6d4f18;
}

.tag.tag-type {
  background: #2a1024;
  color: var(--text-pink);
  border-color: #682057;
}

.event-active-badge {
  background: linear-gradient(90deg, #b81414, #ff5500);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid #ffaa00;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulse-glow 1.5s infinite alternate;
}

.quest-fee-badge {
  display: inline-block;
  font-size: 13px;
  padding: 3px 8px;
  background: #003822;
  color: #00ffaa;
  border: 1px solid #00aa66;
  border-radius: 3px;
  font-weight: bold;
  margin-left: 6px;
  vertical-align: middle;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 2px #ff5500; }
  100% { box-shadow: 0 0 8px #ffaa00; }
}

.store-previews {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.store-set-preview, .store-quest-preview {
  background: #0a0d18;
  border: 1px solid #283250;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 2px;
}

.store-quest-preview {
  background: #140d1e;
  border-color: #4a205a;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.preview-label {
  font-weight: bold;
  font-size: 15px;
  color: var(--text-yellow);
  white-space: nowrap;
}

.store-quest-preview .preview-label {
  color: #ff9900;
}

.preview-title {
  font-size: 15px;
  color: #ffffff;
  white-space: normal;
  word-break: break-word;
  line-height: 1.6;
  font-weight: 500;
}

.quest-price-badge {
  font-size: 13px;
  padding: 3px 8px;
  background: #003822;
  color: #00ffaa;
  border: 1px solid #00aa66;
  border-radius: 2px;
  white-space: nowrap;
}

.store-price {
  font-size: 16px;
  color: var(--text-green);
  font-weight: bold;
  white-space: nowrap;
}

/* 店舗詳細画面 */
.detail-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-img-box {
  width: 100%;
  height: 180px;
  border: 3px double var(--border-white);
  overflow: hidden;
  position: relative;
}

.detail-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.detail-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.detail-logo-box {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(247, 208, 112, 0.5);
  position: relative;
  z-index: 10000; /* スキャンライン(z-index: 999)の上に表示して特殊フィルターを除外 */
}

.detail-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  image-rendering: auto;
}

.detail-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.detail-store-name {
  font-size: 20px;
  color: var(--text-yellow);
  text-shadow: 1px 1px 0 #000;
  word-break: break-word;
  line-height: 1.45;
}

.detail-catchphrase {
  font-size: 14px;
  color: var(--text-cyan);
  line-height: 1.5;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.info-table th {
  text-align: left;
  width: 28%;
  color: var(--text-yellow);
  padding: 8px 6px;
  border-bottom: 1px dashed #333;
  vertical-align: top;
  font-size: 15px;
  white-space: nowrap;
}

.info-table td {
  padding: 8px 6px;
  color: var(--text-white);
  border-bottom: 1px dashed #333;
  vertical-align: top;
  font-size: 15px;
  line-height: 1.6;
}

.payment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.payment-tag {
  background: #112211;
  color: var(--text-green);
  border: 1px solid #225522;
  font-size: 12px;
  padding: 2px 8px;
}

.external-link-btn {
  background: linear-gradient(180deg, #183880 0%, #081840 100%);
  border: 2px solid var(--border-white);
  color: var(--text-white);
  padding: 10px 14px;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

.external-link-btn:hover, .external-link-btn:active {
  background: linear-gradient(180deg, #2858b0 0%, #102860 100%);
  border-color: var(--text-yellow);
  transform: translateY(-1px);
}

/* 戻るボタン */
.back-btn {
  background: #200000;
  border: 2px solid var(--text-red);
  color: var(--text-white);
  padding: 10px;
  text-align: center;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
}

.back-btn:hover {
  background: #400000;
}

/* 簡易インタラクティブマップ */
.map-canvas-container {
  width: 100%;
  height: 280px;
  background-color: #121c24;
  border: 4px double var(--border-white);
  position: relative;
  overflow: hidden;
  background-image: 
    radial-gradient(#1e303c 20%, transparent 20%),
    radial-gradient(#1a2a35 20%, transparent 20%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

.map-river {
  position: absolute;
  top: 0;
  right: 20%;
  width: 40px;
  height: 100%;
  background: #184888;
  border-left: 2px dashed #3070c0;
  border-right: 2px dashed #3070c0;
  opacity: 0.8;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s;
}

.map-pin:hover {
  transform: translate(-50%, -60%) scale(1.2);
  z-index: 20;
}

.map-pin-icon {
  background: #ff0044;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 0 8px rgba(255, 0, 68, 0.8);
  animation: map-pulse 2s infinite;
}

@keyframes map-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 12px rgba(255, 230, 0, 0.9); }
  100% { transform: scale(1); }
}

.map-pin-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--border-white);
  color: var(--text-yellow);
  font-size: 10px;
  padding: 1px 4px;
  white-space: nowrap;
  pointer-events: none;
  margin-top: 2px;
}

/* ボトム固定ナビゲーション */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #000;
  border-top: 4px double var(--border-white);
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  z-index: 10000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-dim);
  font-size: 10px;
  cursor: pointer;
  text-decoration: none;
  padding: 2px 8px;
  transition: color 0.15s;
}

.nav-item-icon {
  font-size: 16px;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-yellow);
}

/* 検索＆フィルターフォーム */
.filter-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-row {
  display: flex;
  gap: 8px;
}

.filter-select, .search-input {
  background: #000;
  border: 2px solid var(--border-white);
  color: var(--text-white);
  font-family: var(--font-pixel);
  padding: 6px 8px;
  font-size: 13px;
  width: 100%;
  outline: none;
}

.filter-select:focus, .search-input:focus {
  border-color: var(--text-yellow);
}

.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  background: #101428;
  border: 1px solid #303860;
  color: var(--text-dim);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip.active {
  background: #1a3880;
  border-color: var(--text-cyan);
  color: var(--text-white);
  font-weight: bold;
}

/* ユーティリティ */
.text-yellow { color: var(--text-yellow); }
.text-green { color: var(--text-green); }
.text-cyan { color: var(--text-cyan); }
.text-pink { color: var(--text-pink); }
.text-red { color: var(--text-red); }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* スタート画面（レトロRPG風オーバーレイ） */
.start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #05050c;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(4px);
}

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

.start-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

.start-title-badge {
  font-size: 13px;
  color: var(--text-cyan);
  margin-bottom: 10px;
  letter-spacing: 1.5px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(0, 224, 255, 0.4);
}

.start-hero-full-box {
  width: 100%;
  max-width: 380px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(247, 208, 112, 0.45));
}

.start-hero-full-img {
  width: 100%;
  height: auto;
  max-height: 58vh;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  border: 3px double var(--border-gold);
  image-rendering: pixelated;
  background: #000;
}

.start-btn-box {
  margin-bottom: 16px;
}

.start-game-btn {
  background: linear-gradient(180deg, #1f4e79 0%, #0d274c 100%);
  color: var(--text-white);
  border: 3px double var(--border-gold);
  padding: 14px 22px;
  font-family: var(--font-pixel);
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 4px 0 #061122, 0 0 12px rgba(247, 208, 112, 0.4);
  animation: pulse-start-btn 1.5s infinite alternate;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s;
}

.start-game-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #061122;
}

@keyframes pulse-start-btn {
  0% {
    box-shadow: 0 4px 0 #061122, 0 0 8px rgba(247, 208, 112, 0.3);
    border-color: var(--border-gold);
  }
  100% {
    box-shadow: 0 4px 0 #061122, 0 0 22px rgba(255, 225, 108, 0.85);
    border-color: #ffffff;
  }
}

.start-hint {
  font-size: 11px;
  color: var(--text-green);
  margin-top: 8px;
}

/* 店舗写真ギャラリー */
.detail-photo-box {
  width: 100%;
  margin-top: 8px;
  border: 2px solid var(--border-gold);
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.detail-photo-img {
  width: 100%;
  height: auto;
  display: block;
}
