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

body {
  background: #0a0a20;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Consolas', 'Monaco', 'メイリオ', monospace;
  overflow: hidden;
}

#game-container {
  position: relative;
  width: 800px;
  height: 600px;
  background: #060614;
  border: 2px solid #00ccff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 200, 255, 0.55);
}

#game-canvas {
  display: block;
}

/* --- タイトル画面 --- */
#title-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #020c1c 0%, #061c3a 40%, #030d18 100%);
  z-index: 100;
}

#title-screen h1 {
  font-size: 42px;
  color: #00ffcc;
  text-shadow: 0 0 20px #00ccff, 0 0 40px #0066ff;
  letter-spacing: 6px;
  margin-bottom: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
}

.subtitle {
  font-size: 16px;
  color: #0088aa;
  margin-bottom: 40px;
  letter-spacing: 2px;
}

.menu-options button {
  display: block;
  width: 220px;
  padding: 12px;
  margin: 8px auto;
  font-size: 16px;
  background: rgba(0, 200, 255, 0.08);
  color: #00ccff;
  border: 1px solid #00ccff;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Consolas', 'Monaco', monospace;
  letter-spacing: 2px;
}

.menu-options button:hover {
  background: rgba(0, 200, 255, 0.25);
  box-shadow: 0 0 15px rgba(0, 200, 255, 0.4);
  transform: scale(1.05);
}

#btn-continue #save-info {
  display: block;
  font-size: 11px;
  color: #0088aa;
  margin-top: 2px;
}

.controls-hint {
  position: absolute;
  bottom: 20px;
  font-size: 12px;
  color: #666;
  text-align: center;
  line-height: 1.8;
}

/* --- HUD --- */
#hud {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  pointer-events: none;
  z-index: 10;
}

#hud-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

#hud-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bar-label {
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  width: 28px;
  text-align: right;
  text-shadow: 1px 1px 2px #000;
}

.bar {
  width: 150px;
  height: 14px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.hp-fill { background: linear-gradient(180deg, #ff4444, #cc0000); }
.mp-fill { background: linear-gradient(180deg, #4488ff, #0044cc); }
.exp-fill { background: linear-gradient(180deg, #44ff44, #00aa00); }

.bar-text {
  color: #fff;
  font-size: 10px;
  width: 55px;
  text-shadow: 1px 1px 2px #000;
}

#hud-info {
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 4px;
}

#hud-info span {
  color: #fff;
  font-size: 13px;
  text-shadow: 1px 1px 2px #000;
}

#hud-level { color: #00ffcc; font-weight: bold; }

/* --- スキルHUD --- */
#hud-skill {
  background: rgba(0, 0, 0, 0.7);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: #aaa;
}
.skill-name { color: #888; }
.skill-name.skill-ready { color: #44ffff; font-weight: bold; }
.skill-mp { color: #4488ff; margin-left: 4px; }
.skill-cd { color: #ff8844; margin-left: 4px; }

#hud-buffs {
  background: rgba(0, 0, 0, 0.7);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #ffcc44;
}

/* --- スキルダメージ --- */
.damage-num.skill-damage { color: #44ffff; font-size: 20px; }

/* --- スキルタッチボタン --- */
.skill-btn {
  background: rgba(0, 200, 255, 0.3) !important;
  border-color: #44ffff !important;
  color: #44ffff !important;
  font-size: 11px !important;
  margin-top: 4px;
}

.dodge-btn {
  background: rgba(0, 255, 160, 0.25) !important;
  border-color: #00ffaa !important;
  color: #00ffaa !important;
  font-size: 11px !important;
  margin-top: 4px;
}

/* --- ダイアログ --- */
#dialogue-box {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: rgba(0, 0, 20, 0.92);
  border: 2px solid #668;
  border-radius: 8px;
  padding: 16px;
  z-index: 50;
  min-height: 100px;
}

#dialogue-name {
  color: #00ffcc;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
}

#dialogue-text {
  color: #eee;
  font-size: 15px;
  line-height: 1.6;
  min-height: 48px;
}

#dialogue-choices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.dialogue-choice {
  padding: 6px 12px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid #664;
  border-radius: 4px;
  color: #eee;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.dialogue-choice:hover, .dialogue-choice.selected {
  background: rgba(0, 200, 255, 0.2);
  border-color: #00ccff;
}

#dialogue-next {
  position: absolute;
  bottom: 8px;
  right: 16px;
  color: #888;
  font-size: 12px;
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0.3; }
}

/* --- オーバーレイ共通 --- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 60;
}

.overlay-panel {
  background: #1a1a2e;
  border: 2px solid #555;
  border-radius: 8px;
  padding: 24px;
  width: 600px;
  max-height: 500px;
  color: #eee;
  overflow-y: auto;
}

.overlay-panel h2 {
  color: #00ffcc;
  margin-bottom: 16px;
  text-align: center;
}

.close-btn {
  display: block;
  margin: 16px auto 0;
  padding: 8px 24px;
  background: #333;
  color: #fff;
  border: 1px solid #666;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.close-btn:hover {
  background: #555;
}

/* --- インベントリ --- */
#inventory-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 8px;
  background: #222;
  color: #aaa;
  border: 1px solid #444;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-size: 13px;
}

.tab.active {
  background: #112;
  color: #00ccff;
  border-color: #00ccff;
}

#inventory-content {
  min-height: 250px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #333;
}

.item-row.equipped {
  background: rgba(0, 180, 255, 0.08);
  border-left: 3px solid #0af;
}

.item-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.item-category {
  padding: 6px 12px 4px;
  font-size: 11px;
  color: #6af;
  border-bottom: 1px solid #224;
  letter-spacing: 1px;
  margin-top: 4px;
}

.equip-badge {
  display: inline-block;
  background: #0af;
  color: #000;
  font-size: 10px;
  font-weight: bold;
  padding: 0 4px;
  border-radius: 2px;
  margin-left: 4px;
}

.item-name {
  font-size: 14px;
}

.item-count {
  color: #888;
  font-size: 12px;
}

.item-btn {
  padding: 4px 12px;
  background: #335;
  color: #8bf;
  border: 1px solid #558;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.item-btn:hover {
  background: #447;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #222;
  font-size: 14px;
}

.stat-label { color: #aaa; }
.stat-value { color: #fff; font-weight: bold; }

.equip-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #222;
  border-radius: 4px;
  border: 1px solid #444;
}

.equip-slot-name { color: #aaa; font-size: 12px; }
.equip-item-name { color: #00ccff; font-size: 14px; }

/* --- ショップ --- */
#shop-gold {
  text-align: right;
  color: #00ffcc;
  margin-bottom: 12px;
}

.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #333;
}

.shop-item-info {
  flex: 1;
}

.shop-item-name {
  font-size: 14px;
  color: #fff;
}

.shop-item-desc {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.shop-item-price {
  color: #00ffcc;
  margin: 0 16px;
  min-width: 60px;
  text-align: right;
}

.shop-buy-btn {
  padding: 6px 16px;
  background: #353;
  color: #8f8;
  border: 1px solid #585;
  border-radius: 3px;
  cursor: pointer;
}

.shop-buy-btn:hover { background: #474; }
.shop-buy-btn:disabled { opacity: 0.4; cursor: default; }

/* --- ゲームオーバー --- */
.gameover h2 {
  font-size: 36px;
  color: #ff4444;
  text-shadow: 0 0 20px #ff0000;
}

.gameover p {
  text-align: center;
  margin: 16px 0 24px;
  color: #aaa;
}

.gameover button {
  display: block;
  margin: 0 auto;
  padding: 12px 32px;
  font-size: 16px;
  background: #533;
  color: #faa;
  border: 1px solid #855;
  border-radius: 4px;
  cursor: pointer;
}

.gameover button:hover { background: #744; }

/* --- ボスHPバー --- */
#boss-hp-bar {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  z-index: 10;
  pointer-events: none;
}

#boss-name {
  color: #ff4444;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
  text-shadow: 1px 1px 3px #000;
}

.boss-bar {
  width: 100%;
  height: 18px;
}

.boss-fill {
  background: linear-gradient(180deg, #ff6666, #cc0000);
}

/* --- レベルアップ通知 --- */
#levelup-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  pointer-events: none;
}

#levelup-notification span {
  font-size: 32px;
  font-weight: bold;
  color: #00ffcc;
  text-shadow: 0 0 20px #00ccff, 0 0 40px #0066ff;
  animation: levelup-anim 2s forwards;
}

@keyframes levelup-anim {
  0% { opacity: 0; transform: scale(0.5); }
  20% { opacity: 1; transform: scale(1.3); }
  40% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-40px); }
}

/* --- ダメージ数字 --- */
#damage-numbers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.damage-num {
  position: absolute;
  font-weight: bold;
  font-size: 18px;
  text-shadow: 1px 1px 2px #000;
  animation: damage-float 1s forwards;
  pointer-events: none;
}

.damage-num.player-damage { color: #ff4444; }
.damage-num.enemy-damage { color: #ffff44; }
.damage-num.heal { color: #44ff44; }
.damage-num.miss { color: #888; font-size: 14px; }

@keyframes damage-float {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-40px); }
}

/* --- イースターエッグ: GBカラーテーマ --- */
.easter-hint {
  color: #888;
  text-align: center;
  font-size: 12px;
  margin-bottom: 16px;
}

.easter-color-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Consolas', 'Monaco', monospace;
  text-align: left;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  transition: border-color 0.2s, transform 0.1s;
}

.easter-color-btn:hover, .easter-color-btn.selected {
  border-color: #00ccff;
  transform: scale(1.02);
}

#gb-body.gb-theme-cobalt {
  background: linear-gradient(180deg, #5b8dd9 0%, #4070bb 50%, #305aaa 100%) !important;
  border-top-color: #6a9de8 !important;
  border-left-color: #6a9de8 !important;
  border-right-color: #6a9de8 !important;
}

#gb-body.gb-theme-cobalt #joystick-base {
  background: radial-gradient(circle, #4a7ab8 0%, #3a6aaa 70%, #305098 100%);
  border-color: #6090c8;
}
#gb-body.gb-theme-cobalt #joystick-thumb {
  background: radial-gradient(circle at 40% 38%, #283878, #1c2860);
  border-color: #3a5098;
}
#gb-body.gb-theme-cobalt .center-btn,
#gb-body.gb-theme-cobalt #btn-bgm-toggle {
  background: #4a7ab0;
}
#gb-body.gb-theme-cobalt .center-btn:active {
  background: #3a6aa0;
}

#gb-body.gb-theme-red {
  background: linear-gradient(180deg, #d94040 0%, #bb3030 50%, #9a2020 100%) !important;
  border-top-color: #e85050 !important;
  border-left-color: #e85050 !important;
  border-right-color: #e85050 !important;
}

#gb-body.gb-theme-red #joystick-base {
  background: radial-gradient(circle, #b83030 0%, #982020 70%, #7a1818 100%);
  border-color: #c84040;
}
#gb-body.gb-theme-red #joystick-thumb {
  background: radial-gradient(circle at 40% 38%, #701818, #501010);
  border-color: #901a1a;
}
#gb-body.gb-theme-red .center-btn,
#gb-body.gb-theme-red #btn-bgm-toggle {
  background: #9a2828;
}
#gb-body.gb-theme-red .center-btn:active {
  background: #7a1818;
}

#gb-body.gb-theme-pearl {
  background: linear-gradient(180deg, #b8d4e8 0%, #9abcd4 50%, #7aaabf 100%) !important;
  border-top-color: #c8e4f8 !important;
  border-left-color: #c8e4f8 !important;
  border-right-color: #c8e4f8 !important;
}

#gb-body.gb-theme-pearl #joystick-base {
  background: radial-gradient(circle, #88b0c8 0%, #78a0b8 70%, #6890a8 100%);
  border-color: #98c0d8;
}
#gb-body.gb-theme-pearl #joystick-thumb {
  background: radial-gradient(circle at 40% 38%, #506878, #405868);
  border-color: #688898;
}
#gb-body.gb-theme-pearl .center-btn,
#gb-body.gb-theme-pearl #btn-bgm-toggle {
  background: #7aaabf;
}
#gb-body.gb-theme-pearl .center-btn:active {
  background: #6090a8;
}

#gb-body.gb-theme-emerald {
  background: linear-gradient(180deg, #40b870 0%, #309a58 50%, #208040 100%) !important;
  border-top-color: #50c880 !important;
  border-left-color: #50c880 !important;
  border-right-color: #50c880 !important;
}

#gb-body.gb-theme-emerald #joystick-base {
  background: radial-gradient(circle, #308858 0%, #287848 70%, #206038 100%);
  border-color: #40a068;
}
#gb-body.gb-theme-emerald #joystick-thumb {
  background: radial-gradient(circle at 40% 38%, #185030, #103820);
  border-color: #286040;
}
#gb-body.gb-theme-emerald .center-btn,
#gb-body.gb-theme-emerald #btn-bgm-toggle {
  background: #208040;
}
#gb-body.gb-theme-emerald .center-btn:active {
  background: #186030;
}

#gb-body.gb-theme-rainbow {
  background: linear-gradient(180deg, #ff6b6b 0%, #ffd93d 25%, #6bcb77 50%, #4d96ff 75%, #c77dff 100%) !important;
  border-top-color: #ff9a9a !important;
  border-left-color: #ff9a9a !important;
  border-right-color: #ff9a9a !important;
  animation: gb-rainbow-hue 3s linear infinite;
}

#gb-body.gb-theme-matblack {
  background: linear-gradient(180deg, #3a3a3a 0%, #222222 50%, #1a1a1a 100%) !important;
  border-top-color: #444 !important;
  border-left-color: #444 !important;
  border-right-color: #444 !important;
}
#gb-body.gb-theme-matblack #joystick-base {
  background: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 70%, #111 100%);
  border-color: #383838;
}
#gb-body.gb-theme-matblack #joystick-thumb {
  background: radial-gradient(circle at 40% 38%, #181818, #0e0e0e);
  border-color: #303030;
}
#gb-body.gb-theme-matblack .center-btn,
#gb-body.gb-theme-matblack #btn-bgm-toggle {
  background: #2a2a2a;
}
#gb-body.gb-theme-matblack .center-btn:active {
  background: #1a1a1a;
}

@keyframes gb-rainbow-hue {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}

/* --- ユーティリティ --- */
.hidden { display: none !important; }

/* --- ミニマップ --- */
#minimap {
  position: absolute;
  top: 60px;
  right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  z-index: 10;
  pointer-events: none;
}

/* --- エンディング画面 --- */
#ending-screen {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#ending-message {
  color: #00ccff;
  font-size: 18px;
  font-family: 'Consolas', 'Monaco', monospace;
  text-align: center;
  line-height: 2.2;
  padding: 20px 24px;
  opacity: 0;
  transition: opacity 1.5s ease-in;
  max-width: 100%;
  box-sizing: border-box;
}

#ending-message.visible {
  opacity: 1;
}

#credits-roll {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1s ease-in;
}

#credits-roll.visible {
  opacity: 1;
}

#credits-content {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Consolas', 'Monaco', monospace;
  color: #ccc;
  will-change: transform;
}

.credits-title {
  font-size: 32px;
  color: #00ccff;
  font-weight: bold;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(0, 200, 255, 0.5);
  margin-bottom: 8px;
}

.credits-subtitle {
  font-size: 16px;
  color: #00ffcc;
  margin-bottom: 16px;
}

.credits-heading {
  font-size: 18px;
  color: #00ccff;
  font-weight: bold;
  margin: 24px 0 12px;
  letter-spacing: 3px;
}

.credits-item {
  font-size: 14px;
  color: #aab;
  line-height: 2;
}

#btn-ending-title {
  position: absolute;
  bottom: 60px;
  z-index: 310;
  background: transparent;
  border: 2px solid #00ccff;
  color: #00ccff;
  padding: 12px 32px;
  font-size: 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 1s ease-in;
}

#btn-ending-title.visible {
  opacity: 1;
}

#btn-ending-title:hover {
  background: rgba(0, 200, 255, 0.15);
}

/* --- タッチコントロール（ゲームボーイ風） --- */
#touch-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  touch-action: none;
}

#gb-body {
  background: linear-gradient(180deg, #b8b8c0 0%, #a0a0a8 50%, #909098 100%);
  border-top: 2px solid #c8c8d0;
  border-left: 2px solid #c8c8d0;
  border-right: 2px solid #c8c8d0;
  padding: 12px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

#gb-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

/* --- バーチャルジョイスティック --- */
#joystick-zone {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

#joystick-base {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, #8a8a94 0%, #7a7a84 70%, #6e6e78 100%);
  border: 2px solid #9a9aa4;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.25);
}

#joystick-thumb {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #606068, #4a4a54);
  border: 2px solid #70707a;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* --- A/B/Yボタン（三角配置） --- */
#gb-ab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ab-row {
  display: flex;
  gap: 14px;
}

.ab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #6b2050;
  border: 3px solid #8a3068;
  color: #eee;
  font-size: 15px;
  font-weight: bold;
  font-family: 'Consolas', 'Monaco', monospace;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: 0 3px 0 #4a1038, inset 0 1px 2px rgba(255,255,255,0.1);
}

.ab-btn:active {
  background: #8a3068;
  box-shadow: 0 1px 0 #4a1038;
  transform: translateY(2px);
}

#btn-touch-item {
  background: #1a5068;
  border-color: #2a7090;
  box-shadow: 0 3px 0 #0e3848, inset 0 1px 2px rgba(255,255,255,0.1);
}

#btn-touch-item:active {
  background: #2a7090;
  box-shadow: 0 1px 0 #0e3848;
}

#btn-bgm-toggle {
  width: 60px;
  height: 22px;
  border-radius: 11px;
  background: #7a7a84;
  border: none;
  color: #00ffcc;
  font-size: 10px;
  font-family: 'Consolas', 'Monaco', monospace;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transform: rotate(-5deg);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
  cursor: pointer;
  padding: 0;
  line-height: 22px;
  text-align: center;
}
#btn-bgm-toggle.muted {
  color: #666;
}

/* --- START/SAVEボタン --- */
#version-label {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: #888;
  margin-top: 2px;
  font-family: monospace;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

#gb-center-btns {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.center-btn {
  width: 60px;
  height: 22px;
  border-radius: 11px;
  background: #7a7a84;
  border: none;
  color: #444;
  font-size: 9px;
  font-family: 'Consolas', 'Monaco', monospace;
  letter-spacing: 1px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transform: rotate(-5deg);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.center-btn:active {
  background: #68686e;
  color: #222;
}

/* --- モバイル対応 --- */
.controls-hint-mobile {
  display: none;
}

@media (max-width: 840px), (hover: none) and (pointer: coarse) {
  body {
    background: linear-gradient(180deg, #b8b8c0 0%, #a8a8b0 100%);
    align-items: flex-start;
  }

  body.gb-theme-cobalt { background: linear-gradient(180deg, #5b8dd9 0%, #4a7ac0 100%); }
  body.gb-theme-red { background: linear-gradient(180deg, #d94040 0%, #b82828 100%); }
  body.gb-theme-pearl { background: linear-gradient(180deg, #b8d4e8 0%, #9abcd4 100%); }
  body.gb-theme-emerald { background: linear-gradient(180deg, #40b870 0%, #309a58 100%); }
  body.gb-theme-rainbow {
    background: linear-gradient(180deg, #ff6b6b 0%, #ffd93d 25%, #6bcb77 50%, #4d96ff 75%, #c77dff 100%);
    animation: gb-rainbow-hue 3s linear infinite;
  }
  body.gb-theme-matblack { background: linear-gradient(180deg, #3a3a3a 0%, #222222 100%); }

  #game-container {
    width: calc(100vw - 12px) !important;
    margin: calc(40px + env(safe-area-inset-top, 0px)) auto 0 auto;
    border: none;
    border-radius: 8px;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.3);
    overflow: hidden;
  }

  #game-canvas {
    width: 100%;
    height: 100%;
  }

  /* HUD adjustments */
  .bar {
    width: 100px;
  }

  .bar-text {
    width: 45px;
    font-size: 9px;
  }

  .bar-label {
    font-size: 9px;
    width: 22px;
  }

  #hud-info {
    gap: 6px;
    padding: 3px 6px;
  }

  #hud-info span {
    font-size: 10px;
  }

  /* Dialogue */
  #dialogue-box {
    bottom: 8px;
    left: 8px;
    right: 8px;
    padding: 10px;
    min-height: 70px;
  }

  #dialogue-text {
    font-size: 13px;
    min-height: 36px;
  }

  /* Ending epilogue */
  #ending-message {
    font-size: 15px;
    line-height: 2;
    padding: 16px 16px;
  }

  /* Overlay panels */
  .overlay-panel {
    width: calc(100vw - 32px);
    max-height: calc(100% - 32px);
    padding: 16px;
  }

  /* Boss HP */
  #boss-hp-bar {
    width: 70%;
    bottom: 90px;
  }

  /* Title screen */
  #title-screen h1 {
    font-size: 28px;
    letter-spacing: 3px;
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 24px;
  }

  .menu-options button {
    width: 180px;
    padding: 10px;
    font-size: 14px;
  }

  .controls-hint-pc {
    display: none;
  }
  .controls-hint-mobile {
    display: block;
  }

  /* Level up */
  #levelup-notification span {
    font-size: 24px;
  }
}
