:root {
  --color-bg: #0d1b3d;
  --color-bg-panel: #14285c;
  --color-text: #ffffff;
  --color-accent: #ffcb3d;
  --color-accent-dark: #d69f00;
  --color-good: #4caf50;
  --color-button: #1f3a7a;
  --color-button-border: #ffcb3d;
  --font-base: 24px;
  --font-heading: 36px;
  --btn-min: 80px;
  --btn-main: 120px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Yu Gothic", "Meiryo", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: var(--font-base);
  line-height: 1.5;
  user-select: none;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-size: var(--font-heading);
  margin: 0.4em 0;
  text-align: center;
  color: var(--color-accent);
}

button {
  font-family: inherit;
  font-size: var(--font-base);
  min-width: var(--btn-min);
  min-height: var(--btn-min);
  padding: 12px 20px;
  background: var(--color-button);
  color: var(--color-text);
  border: 4px solid var(--color-button-border);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}

button:active {
  transform: scale(0.95);
  background: var(--color-accent-dark);
}

button.btn-main {
  min-width: var(--btn-main);
  min-height: var(--btn-main);
  font-size: 28px;
  font-weight: bold;
}

.btn-back {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1000;
  background: var(--color-bg-panel);
}

.btn-settings {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 18px;
  font-weight: bold;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-bg-panel);
  border: 3px solid var(--color-button-border);
  border-radius: 30px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

.btn-settings span {
  font-size: 24px;
}

/* 「職員用設定の下にログアウトボタンをつけたい」との要望(2026-08-21)。
   右列の縦積み(職員用設定→ログアウト→BGM→アンケート)に割り込ませる形
   になるため、これより下のボタン(.btn-ambient-bgm/.ambient-bgm-panel/
   .btn-survey)のtop位置もこのボタンの分だけ下へずらしてある。 */
.btn-header-logout {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 18px;
  font-weight: bold;
  /* buttonタグは共通の`button{min-height:var(--btn-min)}`(80px)を継承する
     ため、.btn-settings/.btn-survey(aタグ、この規則の対象外)と高さが
     揃わなかった。.btn-profile-badge/.btn-inventoryと同じ理由で明示的に
     打ち消す。 */
  min-width: auto;
  min-height: auto;
  color: var(--color-text);
  background: var(--color-bg-panel);
  border: 3px solid var(--color-button-border);
  border-radius: 30px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

.btn-header-logout span {
  font-size: 24px;
}

/* 「アンケートの上に、簡単に状況を報告したり意見をメールできる場所を
   作りたい(問い合わせフォームとは別で)」との要望(2026-08-21)。BGMパネル
   (top208、開いた時の高さ約151px = 359px付近まで)と重ならないよう、
   その下に置く。これに伴い.btn-surveyのtop位置もさらに下へずらした。 */
.btn-feedback {
  position: fixed;
  top: 380px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 18px;
  font-weight: bold;
  min-width: auto; /* buttonタグの共通min-height:80px対策(.btn-header-logoutと同じ理由) */
  min-height: auto;
  color: var(--color-text);
  background: var(--color-bg-panel);
  border: 3px solid var(--color-button-border);
  border-radius: 30px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

.btn-feedback span {
  font-size: 24px;
}

.feedback-panel {
  position: fixed;
  top: 441px;
  right: 16px;
  z-index: 1000;
  width: 280px;
  padding: 16px;
  background: var(--color-bg-panel);
  border: 3px solid var(--color-button-border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.feedback-panel-title {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
}

.feedback-panel textarea {
  width: 100%;
  min-height: 100px;
  font-size: 16px;
  font-family: inherit;
  padding: 8px;
  border-radius: 10px;
  border: 3px solid var(--color-accent);
  background: var(--color-bg);
  color: var(--color-text);
  resize: vertical;
  box-sizing: border-box;
}

.feedback-panel button {
  width: 100%;
  margin-top: 10px;
}

.btn-survey {
  position: fixed;
  top: 452px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 18px;
  font-weight: bold;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-bg-panel);
  border: 3px solid var(--color-button-border);
  border-radius: 30px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

.btn-survey span {
  font-size: 24px;
}

.btn-settings:hover,
.btn-settings:active {
  background: var(--color-accent-dark);
}

.btn-profile-badge {
  position: fixed;
  top: 104px;
  left: 16px;
  z-index: 1000;
  min-height: auto;
  padding: 8px 16px;
  font-size: 18px;
  font-weight: bold;
  color: var(--color-text);
  background: var(--color-bg-panel);
  border: 3px solid var(--color-button-border);
  border-radius: 30px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

.btn-inventory {
  position: fixed;
  top: 160px;
  left: 16px;
  z-index: 1000;
  min-height: auto;
  padding: 8px 16px;
  font-size: 18px;
  font-weight: bold;
  color: var(--color-text);
  background: var(--color-bg-panel);
  border: 3px solid var(--color-button-border);
  border-radius: 30px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

.inventory-pet-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px auto 16px;
  padding: 10px 20px;
  width: fit-content;
  background: var(--color-button);
  border: 3px solid var(--color-button-border);
  border-radius: 20px;
}

.inventory-pet-emoji {
  font-size: 40px;
}

.inventory-pet-name {
  font-size: 20px;
  font-weight: bold;
}

.profile-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin: 20px 0;
}

.profile-tile {
  position: relative;
  width: 200px;
  min-height: 120px;
  background: var(--color-button);
  border: 3px solid var(--color-button-border);
  border-radius: 18px;
  padding: 14px;
}

.profile-tile-select {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.profile-tile-select:active {
  transform: scale(0.96);
}

.profile-tile-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 0;
  min-height: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 16px;
  border-radius: 50%;
  background: var(--color-bg-panel);
  border: 2px solid var(--color-button-border);
}

.profile-edit-input {
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  font-size: 20px;
  text-align: center;
  border: 3px solid var(--color-button-border);
  border-radius: 10px;
  background: var(--color-bg-panel);
  color: var(--color-text);
}

.profile-edit-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.profile-edit-save-btn,
.profile-edit-cancel-btn {
  min-width: 0;
  min-height: auto;
  padding: 8px 12px;
  font-size: 15px;
  border-radius: 20px;
}

.profile-edit-save-btn {
  background: var(--color-accent-dark);
}

.profile-tile-name {
  font-size: 26px;
  font-weight: bold;
  color: var(--color-accent);
}

.profile-tile-id {
  font-size: 16px;
  opacity: 0.8;
}

.profile-tile-coins {
  font-size: 20px;
}

.profile-select-new {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

.profile-new-input {
  width: 240px;
  min-height: 56px;
  padding: 10px 16px;
  font-size: 22px;
  border: 3px solid var(--color-button-border);
  border-radius: 14px;
  background: var(--color-bg-panel);
  color: var(--color-text);
}

.btn-ambient-bgm {
  position: fixed;
  top: 144px;
  right: 16px;
  z-index: 1000;
  width: 56px;
  height: 56px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  font-size: 26px;
  border-radius: 50%;
  background: var(--color-bg-panel);
  border: 3px solid var(--color-button-border);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

.btn-ambient-bgm.playing {
  border-color: var(--color-good);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.5);
}

.ambient-bgm-panel {
  position: fixed;
  top: 208px;
  right: 16px;
  z-index: 1000;
  width: 260px;
  padding: 16px;
  background: var(--color-bg-panel);
  border: 3px solid var(--color-button-border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.ambient-bgm-title {
  font-size: 18px;
  text-align: center;
  margin-bottom: 12px;
  min-height: 1.4em;
}

.ambient-bgm-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ambient-bgm-controls button {
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  font-size: 16px;
}

.ambient-bgm-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 16px;
}

.ambient-bgm-volume-row input[type="range"] {
  flex: 1;
}

.pin-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 60px;
}

.pin-box input {
  font-size: 32px;
  padding: 10px;
  width: 220px;
  text-align: center;
  border-radius: 12px;
  border: 3px solid var(--color-accent);
  background: var(--color-bg-panel);
  color: var(--color-text);
}

.facility-code-input {
  font-size: 32px;
  padding: 10px;
  width: 280px;
  text-align: center;
  text-transform: uppercase;
  border-radius: 12px;
  border: 3px solid var(--color-accent);
  background: var(--color-bg-panel);
  color: var(--color-text);
}

.facility-code-error {
  color: #ff8080;
  font-size: 20px;
  min-height: 1.4em;
}

.facility-save-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
}

.toggle-btn {
  min-width: 80px;
  padding: 8px 18px;
  font-size: 20px;
  font-weight: bold;
  border-radius: 20px;
  border: 3px solid var(--color-button-border);
  background: var(--color-button);
  color: var(--color-text);
  cursor: pointer;
}

.toggle-btn[data-on="true"] {
  background: var(--color-good);
  border-color: var(--color-good);
  color: #fff;
}

.toggle-btn[data-on="false"] {
  background: var(--color-bg-panel);
  color: var(--color-text-light, #999);
}

.facility-signup-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 420px;
}

.facility-signup-form input,
.facility-signup-form textarea {
  font-size: 22px;
  padding: 10px 14px;
  width: 100%;
  border-radius: 12px;
  border: 3px solid var(--color-accent);
  background: var(--color-bg-panel);
  color: var(--color-text);
  font-family: inherit;
  box-sizing: border-box;
}

.facility-signup-form textarea {
  resize: vertical;
}

.screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.hud {
  position: fixed;
  top: 140px;
  right: 16px;
  z-index: 1000;
  background: var(--color-bg-panel);
  border: 3px solid var(--color-accent);
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 28px;
  text-align: right;
}

.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 61, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  text-align: center;
  padding: 24px;
}

.result-stamp {
  font-size: 64px;
  color: var(--color-accent);
  margin-bottom: 12px;
  animation: pop-in 0.4s ease;
}

.result-message {
  font-size: 32px;
  margin-bottom: 24px;
}

.result-coin-reward {
  margin-top: 14px;
  font-size: 26px;
  font-weight: bold;
  color: var(--color-accent);
}

@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.feedback-gentle {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-panel);
  border: 3px solid var(--color-accent);
  border-radius: 16px;
  padding: 16px 28px;
  font-size: 28px;
  z-index: 1500;
  animation: fade-in-out 1.6s ease forwards;
  pointer-events: none;
}

@keyframes fade-in-out {
  0% { opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.choice-grid {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 900px;
  margin-top: 24px;
}

.choice-btn {
  min-height: var(--btn-main);
  font-size: 30px;
}

canvas {
  touch-action: manipulation;
  background: #a9d8ff;
  border-radius: 12px;
  max-width: 100%;
}

#launcher-grid {
  display: flex;
  flex-direction: column;
  gap: 36px;
  width: 100%;
  max-width: 1100px;
  margin-top: 16px;
}

.game-category-title {
  font-size: 26px;
  text-align: left;
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--color-button-border);
  color: var(--color-accent);
}

.game-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.game-tile {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 22px;
  font-weight: bold;
  line-height: 1.3;
}

.game-tile-emoji {
  font-size: 56px;
}

.game-tile-label {
  text-align: center;
}

.game-screen-inner {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.level-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin: 20px 0;
}

.level-select-tile {
  width: 220px;
  min-height: 130px;
  background: var(--color-button);
  border: 3px solid var(--color-button-border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  padding: 14px;
}

.level-select-tile:active {
  transform: scale(0.96);
}

.level-select-emoji {
  font-size: 40px;
}

.level-select-title {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-accent);
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 18px;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px;
  min-height: auto;
  min-width: auto;
}

/* 2026-08-19: 健康チェック画面(血圧・脈拍・体温の記録＋一覧)。 */
.health-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 480px;
  margin: 24px auto;
}
.health-form .volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-size: 22px;
}
.health-form .volume-row label {
  min-width: 130px;
  text-align: right;
}
.health-form input[type="number"],
.health-form input[type="text"] {
  flex: 1;
  min-width: 0;
  font-size: 22px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 3px solid var(--color-accent);
  background: var(--color-bg-panel);
  color: var(--color-text);
}
#health-record-status {
  margin-top: 8px;
  font-size: 20px;
  min-height: 28px;
}
.health-history-link-row {
  text-align: center;
  margin: 8px auto 24px;
}
#health-history {
  max-width: 960px;
  width: 100%;
  margin: 16px auto 24px;
  padding: 0 16px;
  overflow-x: auto;
}
.health-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 20px;
}
.health-history-table th,
.health-history-table td {
  border: 1px solid var(--color-button-border);
  padding: 10px 12px;
  text-align: center;
}
.health-history-table th {
  background: var(--color-button);
}
.health-section-title {
  margin-top: 0;
}
.health-toolbar {
  max-width: 960px;
  width: 100%;
  margin: 16px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.health-toggle-row,
.health-period-row,
.health-metric-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.health-toggle-btn,
.health-period-btn,
.health-metric-btn {
  /* 以前はfont-size:18px・min-height:autoで、アプリ全体の「大きなボタン」
     という方針(button基本スタイルのmin-height:80px)から大きく外れていた
     (2026-08-19のレビューで発見)。完全に80pxまでは戻さないものの、
     読みやすく押しやすい大きさに引き上げる。 */
  font-size: 20px;
  padding: 10px 18px;
  min-height: 64px;
}
.health-toggle-btn.is-active,
.health-period-btn.is-active,
.health-metric-btn.is-active {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}
#health-graph-wrap {
  max-width: 1100px;
  width: 100%;
  margin: 16px auto;
  padding: 0 16px;
  text-align: center;
}
#health-graph-canvas {
  width: 100%;
  max-width: 1100px;
  height: auto;
  background: var(--color-bg-panel);
  border-radius: 10px;
  border: 2px solid var(--color-button-border);
}
#health-graph-empty {
  font-size: 18px;
}
.health-csv-row {
  text-align: center;
  margin: 8px auto 20px;
}

/* 2026-08-19: トップメニュー(モード選択画面)に、おもいで小路の映画館の
   宣伝バナーを設置(「昭和っぽい」との要望より、往年の名画座の看板・
   マッチ箱広告を意識した金縁×臙脂色のデザイン)。押すとおもいで小路へ
   直行する(mode-select-omoideタイルと同じ遷移)。 */
.eigakan-banner {
  width: 100%;
  max-width: 640px;
  margin: 4px auto 20px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(160deg, #7a1620, #4a0f16 75%);
  border: 4px solid #d4a437;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  text-align: left;
  position: relative;
}
.eigakan-banner::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px dashed rgba(255, 214, 130, 0.55);
  border-radius: 8px;
  pointer-events: none;
}
.eigakan-banner:active {
  transform: scale(0.98);
}
.eigakan-banner-reel {
  font-size: 40px;
  flex-shrink: 0;
}
.eigakan-banner-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
.eigakan-banner-kicker {
  font-size: 14px;
  color: #ffcb3d;
  letter-spacing: 0.06em;
}
.eigakan-banner-title {
  font-size: 22px;
  font-weight: bold;
  color: #fff6e6;
}
.eigakan-banner-until {
  font-size: 15px;
  color: #ffcb3d;
  margin-top: 1px;
}
.eigakan-banner-desc {
  font-size: 15px;
  color: #e8c9a0;
  line-height: 1.5;
  margin-top: 4px;
}

