/* JSSI 免震キッズクエスト モック — 共通スタイル */

:root {
  --color-primary: rgb(0, 106, 184);
  --color-primary-light: rgb(0, 135, 231);
  --color-accent-light: rgb(193, 220, 244);
  --color-accent-mid: rgb(168, 190, 227);
  --color-accent-soft: rgb(214, 222, 241);
  --color-bg-app: #fafafa;
  --color-bg-outer: #333;
  --color-text: #444;
  --color-success: #f9b233;
  --color-success-dark: #e58e0c;
  --color-pop: #ff6b9d;
  --color-leaf: #7cc576;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-soft: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-card: 0 6px 20px rgba(0,0,0,0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  font-family: "Sawarabi Gothic", "Roboto", sans-serif;
}

body {
  background-color: var(--color-bg-outer);
  color: var(--color-text);
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* スマホ筐体（実機の縦横比 19.5:9 を基準） */
.app {
  width: 100%;
  max-width: 390px;
  height: min(844px, calc(100svh - 32px));
  aspect-ratio: 390 / 844;
  background-color: var(--color-bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* スマホ実機表示時は筐体感を消す（縦いっぱい）、DEMOバーは下に */
@media (max-width: 480px) {
  body {
    padding: 0 0 56px;
    align-items: stretch;
    justify-content: stretch;
  }
  .app {
    max-width: 100%;
    height: calc(100svh - 56px);
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ===== ヘッダー ===== */
.app-header {
  background: linear-gradient(135deg, var(--color-accent-light), #e9f3fb);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #fff;
}
.app-header .header-icon {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: bold;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.app-header h1 {
  font-family: "Zen Maru Gothic", "Sawarabi Gothic", sans-serif;
  font-size: 1.1rem;
  color: var(--color-text);
  flex: 1;
}
.app-header .header-sub {
  font-size: 0.7rem;
  color: #888;
}
.app-header .header-stock {
  flex-shrink: 0;
  background: #fff;
  border: 2px solid var(--color-success);
  color: var(--color-success-dark);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ===== 画面コンテナ（疑似SPA） ===== */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 16px;
  animation: fadeIn 0.35s ease-out;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active {
  display: flex;
}
.app-header {
  flex-shrink: 0;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 共通ボタン ===== */
.btn {
  display: block;
  width: 100%;
  height: 54px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-family: "Zen Maru Gothic", "Sawarabi Gothic", sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  box-shadow: var(--shadow-soft);
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-primary-light);
}
.btn-secondary {
  background: #fff;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-success {
  background: var(--color-success);
  color: #fff;
}
.btn-success:hover {
  background: var(--color-success-dark);
}

/* ===== 進捗ゲージ（共通） ===== */
.progress-bar {
  height: 14px;
  background: #e6e6e6;
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-leaf), #a4d89c);
  transition: width 0.6s ease-out;
  border-radius: 7px;
}
.progress-label {
  font-size: 0.85rem;
  color: #666;
  text-align: right;
}

/* ===== カード ===== */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

/* ヘルパー */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex-spacer { flex: 1; }
.hidden { display: none !important; }

/* ===== ナビゲーション（モック用：画面切替ボタン） ===== */
/* PCでは画面右側に縦並びで配置 */
.mock-nav {
  position: fixed;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.95);
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 100;
  font-size: 0.75rem;
  min-width: 96px;
}
.mock-nav button {
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.75rem;
  color: #666;
  font-family: inherit;
  text-align: left;
  white-space: nowrap;
}
.mock-nav button:hover {
  background: #f0f3f7;
}
.mock-nav button.current {
  background: var(--color-primary);
  color: #fff;
}
.mock-nav button.reset {
  color: var(--color-pop);
  border-top: 1px solid #eee;
  margin-top: 2px;
}
.mock-nav .label {
  font-size: 0.65rem;
  color: #999;
  padding: 4px 10px;
  border-bottom: 1px solid #eee;
  margin-bottom: 2px;
}

/* スマホ実機表示時は画面下に横並び（従来通り） */
@media (max-width: 480px) {
  .mock-nav {
    top: auto;
    bottom: 8px;
    right: 50%;
    transform: translateX(50%);
    flex-direction: row;
    min-width: auto;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 24px;
  }
  .mock-nav button {
    padding: 6px 8px;
    text-align: center;
  }
  .mock-nav .label {
    border-bottom: none;
    margin-bottom: 0;
    padding: 6px 4px;
  }
}
