/* ========================================
   みうのブロック崩し - スタイル
   ======================================== */

/* --- 基本 --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0a0014;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: #fff;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(255, 45, 170, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 245, 255, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(185, 103, 255, 0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* --- レイアウト（縦画面スマホ向け） --- */
.game-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  max-height: 100dvh;
  padding: env(safe-area-inset-top, 8px) 10px env(safe-area-inset-bottom, 8px);
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  flex: 1;
  width: 100%;
  min-height: 0;
}

.screen.active {
  display: flex;
}

/* --- タイトル画面（tital.png + 参考レイアウト） --- */
#title-screen {
  justify-content: stretch;
  padding: 0;
  position: relative;
  margin: -8px -10px 0;
  width: calc(100% + 20px);
  flex: 1;
  min-height: 0;
}

.title-layout {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 24px rgba(255, 45, 170, 0.25),
    0 0 60px rgba(0, 245, 255, 0.1);
}

.title-tap-gate {
  position: absolute;
  inset: 0;
  z-index: 20;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(8, 0, 18, 0.42);
  color: #ffd3f4;
  cursor: pointer;
  touch-action: manipulation;
}

.title-tap-gate.hidden {
  display: none;
}

.title-tap-gate-label {
  position: absolute;
  left: 50%;
  bottom: clamp(5.5rem, 14vh, 7.5rem);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: max-content;
  max-width: calc(100% - 2rem);
  pointer-events: none;
}

.title-tap-gate-text {
  font-size: clamp(1.2rem, 6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #ff6ec7;
  text-shadow:
    0 0 12px rgba(255, 45, 170, 0.95),
    0 0 28px rgba(255, 45, 170, 0.55);
  animation: title-tap-pulse 1.6s ease-in-out infinite;
}

.title-tap-gate-sub {
  font-size: clamp(0.72rem, 3.2vw, 0.88rem);
  letter-spacing: 0.2em;
  color: rgba(255, 211, 244, 0.85);
}

@keyframes title-tap-pulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

body.title-locked #title-screen .title-overlay {
  visibility: hidden;
  pointer-events: none;
}

.title-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}

.title-overlay {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(
    to bottom,
    rgba(8, 0, 22, 0.35) 0%,
    transparent 22%,
    transparent 45%,
    rgba(8, 0, 22, 0.15) 60%,
    rgba(8, 0, 22, 0.92) 100%
  );
}

.title-header {
  text-align: center;
  padding-top: 4px;
  pointer-events: none;
  user-select: none;
}

.title-header-sub {
  font-size: clamp(0.85rem, 3.5vw, 1rem);
  font-weight: bold;
  letter-spacing: 0.35em;
  color: #ff8fd8;
  text-shadow:
    0 0 8px #ff6ec7,
    0 0 18px rgba(255, 110, 199, 0.8);
  margin-bottom: 2px;
}

.title-header-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
  margin: 0 0 6px;
}

.title-header-line {
  display: block;
  font-size: clamp(1.85rem, 9vw, 2.35rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff5fc 0%, #ff9ee0 35%, #ff4db8 70%, #d020a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(255, 80, 180, 0.9)) drop-shadow(0 2px 0 rgba(120, 0, 80, 0.5));
  -webkit-text-stroke: 1px rgba(255, 200, 240, 0.35);
}

.title-header-en {
  font-size: clamp(0.62rem, 2.8vw, 0.75rem);
  font-weight: bold;
  letter-spacing: 0.18em;
  color: #ffb8e8;
  text-shadow: 0 0 10px rgba(255, 110, 199, 0.7);
  margin-bottom: 8px;
}

.title-heart {
  color: #ff6ec7;
  text-shadow: 0 0 8px #ff6ec7;
}

.title-header-tagline {
  display: inline-block;
  font-size: clamp(0.68rem, 3vw, 0.8rem);
  font-weight: bold;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow:
    0 0 8px rgba(0, 245, 255, 0.5),
    0 0 14px rgba(255, 110, 199, 0.35);
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(10, 0, 30, 0.45);
  border: 1px solid rgba(0, 245, 255, 0.25);
  box-shadow: 0 0 12px rgba(185, 103, 255, 0.2);
}

.title-bottom {
  position: relative;
  display: flex;
  flex-direction: column;
}

.title-action-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
  margin-bottom: 10px;
}

.title-side-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.title-side-left {
  align-items: flex-start;
}

.title-side-right {
  align-items: flex-end;
}

.title-square-btn {
  width: 74px;
  height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 0.62rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  color: #fff;
  border-radius: 14px;
  border: 2px solid;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  line-height: 1.15;
}

.title-square-btn.purple {
  background: linear-gradient(145deg, rgba(120, 40, 200, 0.85), rgba(80, 20, 140, 0.9));
  border-color: rgba(200, 120, 255, 0.7);
  box-shadow: 0 0 16px rgba(185, 103, 255, 0.45);
}

.title-square-btn.cyan {
  background: linear-gradient(145deg, rgba(0, 120, 160, 0.85), rgba(0, 60, 120, 0.9));
  border-color: rgba(0, 245, 255, 0.65);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.35);
}

.title-square-btn:active {
  transform: scale(0.94);
}

.title-square-btn.off {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.title-square-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.title-square-label {
  font-size: 0.62rem;
}

.title-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 168px;
  padding: 18px 22px;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #fff;
  background: linear-gradient(180deg, #ff5ec8 0%, #e020a0 45%, #b01080 100%);
  border: 3px solid rgba(255, 180, 230, 0.85);
  border-radius: 18px;
  cursor: pointer;
  box-shadow:
    0 0 24px rgba(255, 45, 170, 0.65),
    0 4px 0 rgba(120, 0, 80, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
  text-shadow: 0 0 12px rgba(255, 100, 200, 0.8);
}

.title-start-btn:active {
  transform: scale(0.96) translateY(2px);
  box-shadow: 0 0 32px rgba(255, 45, 170, 0.9);
}

.title-start-hearts {
  font-size: 1rem;
  color: #ffe0f5;
  text-shadow: 0 0 8px #ff6ec7;
}

.title-stage-footer {
  text-align: center;
  font-size: 0.9rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
  margin-bottom: 4px;
}

.title-sub-link {
  display: block;
  margin: 0 auto 6px;
  padding: 6px 12px;
  font-size: 0.72rem;
  color: rgba(0, 245, 255, 0.75);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.title-save-status {
  text-align: center;
  margin: 0 0 4px;
}

.stage-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  max-height: 62%;
  padding: 14px 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(12, 0, 28, 0.96);
  border-top: 2px solid rgba(255, 110, 199, 0.55);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  transform: translateY(0);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.stage-panel.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.stage-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stage-panel-title {
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  color: #ff6ec7;
  text-shadow: 0 0 10px rgba(255, 110, 199, 0.6);
}

.stage-panel-close {
  width: 32px;
  height: 32px;
  font-size: 1rem;
  color: #00f5ff;
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
}

.stage-rank-line {
  font-size: 0.75rem;
  color: #ffe066;
  text-shadow: 0 0 8px rgba(255, 200, 50, 0.5);
  margin-bottom: 6px;
  letter-spacing: 0.08em;
}

.stage-continue-btn {
  margin-top: 12px;
  max-width: none;
}

/* --- タイトル・結果画面（共通ボックス） --- */
#clear-screen {
  justify-content: center;
}

.neon-box {
  text-align: center;
  padding: 32px 20px;
  border-radius: 20px;
  background: rgba(20, 0, 40, 0.88);
  border: 2px solid rgba(255, 110, 199, 0.5);
  box-shadow:
    0 0 20px rgba(255, 45, 170, 0.3),
    0 0 60px rgba(0, 245, 255, 0.1),
    inset 0 0 30px rgba(185, 103, 255, 0.05);
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
}

/* --- ゲームオーバー画面 --- */
#gameover-screen {
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 6px;
  background: rgba(0, 0, 0, 0.72);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#gameover-screen .gameover-card {
  width: min(100%, 268px);
  max-height: calc(100dvh - 20px);
  overflow: hidden;
  padding: 12px 10px 8px;
  border-radius: 12px;
  background: rgba(8, 0, 16, 0.94);
  border: 2px solid #ff2daa;
  box-shadow:
    0 0 16px rgba(255, 45, 170, 0.32),
    inset 0 0 20px rgba(255, 45, 170, 0.04);
  text-align: center;
  flex-shrink: 0;
}

#gameover-screen .gameover-card-title {
  font-size: clamp(1.2rem, 5.5vw, 1.5rem);
  letter-spacing: 0.12em;
  color: #ff2daa;
  text-shadow: 0 0 14px rgba(255, 45, 170, 0.75);
  margin-bottom: 2px;
  line-height: 1.1;
}

#gameover-screen .gameover-card-score {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: #ff6ec7;
  margin-bottom: 8px;
}

#gameover-screen .gameover-card-score span {
  color: #ff6ec7;
  font-weight: bold;
}

#gameover-screen .gameover-promo-card {
  padding: 8px 8px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 45, 170, 0.75);
  background: rgba(255, 45, 170, 0.04);
}

#gameover-screen .gameover-jacket-wrap {
  position: relative;
  width: min(100%, 88px);
  margin: 0 auto 6px;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 110, 199, 0.35);
  background: rgba(0, 0, 0, 0.35);
}

#gameover-screen .gameover-jacket-wrap img,
#gameover-screen .gameover-jacket-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

#gameover-screen .gameover-promo-label {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 1px;
  line-height: 1.2;
}

#gameover-screen .gameover-promo-song {
  font-size: 0.92rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: #fff;
  margin-bottom: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#gameover-screen .gameover-promo-sub {
  font-size: 0.52rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
  line-height: 1.2;
}

#gameover-screen .gameover-spotify-btn {
  display: block;
  width: 100%;
  padding: 7px 8px;
  font-size: 0.64rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  border: 1.5px solid #ff2daa;
  background: rgba(255, 45, 170, 0.08);
  box-shadow: 0 0 10px rgba(255, 45, 170, 0.18);
  line-height: 1.2;
}

#gameover-screen .gameover-spotify-btn:active {
  background: rgba(255, 45, 170, 0.18);
}

#gameover-screen .gameover-nav-card {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 45, 170, 0.75);
  background: rgba(255, 45, 170, 0.03);
  margin-bottom: 6px;
}

#gameover-screen .gameover-nav-btn,
#gameover-screen .gameover-save-btn {
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

#gameover-screen .gameover-nav-btn {
  flex: 1;
  min-height: 34px;
  padding: 6px 4px;
  font-size: 0.66rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: #fff;
  border-radius: 999px;
  border: 1.5px solid #ff2daa;
  background: rgba(255, 45, 170, 0.08);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 45, 170, 0.12);
}

#gameover-screen .gameover-nav-btn:active {
  background: rgba(255, 45, 170, 0.2);
  transform: scale(0.98);
}

#gameover-screen .gameover-save-btn {
  display: block;
  width: 100%;
  max-width: 120px;
  margin: 0 auto;
  padding: 5px 8px;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  cursor: pointer;
  line-height: 1.2;
}

#gameover-screen .gameover-save-btn:active {
  background: rgba(255, 255, 255, 0.08);
}

.subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: #00f5ff;
  text-shadow: 0 0 10px #00f5ff;
  margin-bottom: 6px;
}

.title {
  font-size: clamp(1.6rem, 7vw, 2rem);
  line-height: 1.3;
  background: linear-gradient(135deg, #ff6ec7, #b967ff, #00f5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(255, 110, 199, 0.6));
  margin-bottom: 12px;
}

.hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 14px;
}

/* --- ステージ選択 --- */
.stage-select-area {
  width: 100%;
  margin-bottom: 16px;
}

.stage-select-label {
  font-size: 0.75rem;
  color: #00f5ff;
  text-shadow: 0 0 6px rgba(0, 245, 255, 0.5);
  margin-bottom: 10px;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  width: 100%;
  margin: 0 auto;
}

.stage-btn {
  aspect-ratio: 1;
  min-height: 38px;
  font-size: 0.78rem;
  font-weight: bold;
  color: #fff;
  background: rgba(20, 0, 40, 0.9);
  border: 2px solid rgba(255, 110, 199, 0.5);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 110, 199, 0.2);
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}

.stage-btn:not(.locked):active {
  transform: scale(0.95);
}

.stage-btn.selected {
  border-color: #00f5ff;
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.5);
  background: rgba(0, 245, 255, 0.12);
}

.stage-btn.locked {
  color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  cursor: not-allowed;
  font-size: 0.75rem;
}

#start-continue-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* --- セーブ --- */
.save-status {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 10px 0 4px;
  line-height: 1.4;
}

.save-status.unsaved {
  color: #ff9966;
  text-shadow: 0 0 6px rgba(255, 150, 50, 0.4);
}

.save-status.saved {
  color: rgba(0, 245, 255, 0.7);
}

.save-toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
  background: rgba(0, 200, 150, 0.9);
  border: 1px solid #50ffbb;
  border-radius: 30px;
  box-shadow: 0 0 20px rgba(80, 255, 187, 0.4);
  z-index: 100;
  pointer-events: none;
  animation: saveToast 2s ease forwards;
}

.save-toast.hidden {
  display: none;
}

@keyframes saveToast {
  0%   { opacity: 0; transform: translateX(-50%) translateY(12px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* --- ボタン --- */
.neon-btn {
  display: block;
  width: 100%;
  max-width: 260px;
  margin: 6px auto;
  padding: 16px 24px;
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(135deg, #ff2daa, #b967ff);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 45, 170, 0.5);
  transition: transform 0.12s, box-shadow 0.12s;
  min-height: 52px;
}

.neon-btn:active {
  transform: scale(0.97);
  box-shadow: 0 0 30px rgba(255, 45, 170, 0.8);
}

.neon-btn.secondary {
  background: transparent;
  border: 2px solid #00f5ff;
  color: #00f5ff;
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.3);
}

.neon-btn.secondary:active {
  background: rgba(0, 245, 255, 0.12);
}

/* --- サウンド切替 --- */
.sound-toggle {
  margin-top: 16px;
  padding: 10px 20px;
  font-size: 0.85rem;
  color: #00f5ff;
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid rgba(0, 245, 255, 0.4);
  border-radius: 30px;
  cursor: pointer;
  min-height: 44px;
  min-width: 100px;
}

.sound-toggle.off {
  color: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.sound-toggle.mini {
  margin-top: 0;
  padding: 6px 10px;
  font-size: 1rem;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}

/* --- HUD --- */
#game-screen {
  gap: 6px;
}

.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: rgba(20, 0, 40, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(0, 245, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.12);
  flex-shrink: 0;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.hud-label {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: #00f5ff;
  text-shadow: 0 0 6px #00f5ff;
  line-height: 1;
}

.hud-value {
  font-size: 1.15rem;
  font-weight: bold;
  color: #ff6ec7;
  text-shadow: 0 0 8px #ff6ec7;
  line-height: 1.2;
}

.hud-value.small {
  font-size: 1rem;
}

.hud-value.combo {
  color: #ffe066;
  text-shadow: 0 0 8px #ffe066;
  transition: transform 0.15s;
}

.hud-value.combo.active {
  transform: scale(1.2);
  color: #00f5ff;
  text-shadow: 0 0 12px #00f5ff;
}

.hud-btn {
  margin-top: 0;
  padding: 4px 6px;
  font-size: 0.62rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  color: #00f5ff;
  background: rgba(0, 245, 255, 0.1);
  border: 1.5px solid rgba(0, 245, 255, 0.55);
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.1;
}

.title-back-btn {
  min-width: 58px;
  padding: 4px 8px;
}

.title-back-icon {
  font-size: 1rem;
  line-height: 1;
}

.title-back-label {
  font-size: 0.58rem;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0, 245, 255, 0.8);
  white-space: nowrap;
}

.hud-btn:active {
  background: rgba(0, 245, 255, 0.22);
  transform: scale(0.96);
}

/* --- キャンバスエリア --- */
.canvas-area {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid rgba(185, 103, 255, 0.45);
  box-shadow:
    0 0 20px rgba(185, 103, 255, 0.35),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  background: #0d0020;
  touch-action: none;
}

.overlay-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.4rem, 6vw, 2rem);
  font-weight: bold;
  letter-spacing: 0.1em;
  color: #00f5ff;
  text-shadow: 0 0 20px #00f5ff, 0 0 40px #b967ff;
  background: rgba(10, 0, 20, 0.6);
  border-radius: 12px;
  pointer-events: none;
  animation: pulse 0.6s ease-in-out infinite alternate;
}

.overlay-msg.hidden,
.combo-popup.hidden {
  display: none;
}

.combo-popup {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  font-weight: bold;
  color: #ffe066;
  text-shadow: 0 0 15px #ffe066, 0 0 30px #ff6ec7;
  pointer-events: none;
  animation: comboPop 0.5s ease-out forwards;
}

@keyframes pulse {
  from { opacity: 0.8; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.05); }
}

@keyframes comboPop {
  0%   { opacity: 1; transform: translateX(-50%) scale(0.5); }
  50%  { transform: translateX(-50%) scale(1.3); }
  100% { opacity: 0; transform: translateX(-50%) scale(1) translateY(-30px); }
}

/* --- スマホ用操作ボタン（大きめ） --- */
.mobile-controls {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 8vw, 40px);
  width: 100%;
  padding: 4px 0;
  flex-shrink: 0;
}

.control-btn {
  width: clamp(88px, 22vw, 110px);
  height: clamp(88px, 22vw, 110px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(20, 0, 40, 0.92);
  border: 3px solid #ff6ec7;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(255, 110, 199, 0.45);
  transition: transform 0.1s, background 0.1s, box-shadow 0.1s;
  user-select: none;
}

.btn-icon {
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  line-height: 1;
  pointer-events: none;
}

.control-btn:active,
.control-btn.pressed {
  transform: scale(0.9);
  background: rgba(255, 110, 199, 0.35);
  box-shadow: 0 0 36px rgba(255, 110, 199, 0.8);
  border-color: #00f5ff;
}

/* チャージボタン */
.charge-btn {
  width: clamp(96px, 24vw, 118px);
  height: clamp(88px, 22vw, 110px);
  flex-direction: column;
  gap: 2px;
  border-radius: 18px;
  border-color: #ffe066;
  box-shadow: 0 0 24px rgba(255, 224, 102, 0.35);
}

.charge-label {
  font-size: clamp(0.75rem, 3.2vw, 0.9rem);
  font-weight: bold;
  letter-spacing: 0.05em;
  line-height: 1.1;
  pointer-events: none;
  color: #ffe066;
  text-shadow: 0 0 8px rgba(255, 224, 102, 0.8);
}

.charge-sub {
  font-size: clamp(0.55rem, 2.4vw, 0.65rem);
  line-height: 1;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.45);
}

.charge-btn.charging {
  border-color: #ff9966;
  background: rgba(255, 150, 50, 0.2);
  box-shadow: 0 0 32px rgba(255, 150, 50, 0.55);
}

.charge-btn.charging .charge-label {
  color: #ffcc66;
}

.charge-btn.ready {
  border-color: #00f5ff;
  background: rgba(0, 245, 255, 0.18);
  box-shadow: 0 0 36px rgba(0, 245, 255, 0.65);
  animation: chargeReadyPulse 0.35s ease-in-out infinite alternate;
}

.charge-btn.ready .charge-label {
  color: #00f5ff;
  text-shadow: 0 0 12px #00f5ff;
}

.charge-btn.ready .charge-sub {
  color: rgba(0, 245, 255, 0.8);
}

@keyframes chargeReadyPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

.charge-btn.pressed {
  border-color: #00f5ff;
}

.control-hint {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  flex-shrink: 0;
  padding-bottom: 2px;
}

/* --- クリア画面 --- */
#clear-screen {
  justify-content: center;
  overflow-y: auto;
}

.result-title {
  font-size: clamp(1.6rem, 7vw, 2rem);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.result-title.gameover {
  color: #ff2daa;
  text-shadow: 0 0 20px #ff2daa;
}

.result-title.clear {
  color: #00f5ff;
  text-shadow: 0 0 20px #00f5ff, 0 0 40px #b967ff;
}

.clear-message {
  font-size: 0.95rem;
  color: #ff6ec7;
  margin-bottom: 6px;
}

.result-score {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.85);
}

.result-score span {
  color: #00f5ff;
  text-shadow: 0 0 10px #00f5ff;
  font-weight: bold;
}

.result-sub {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}

/* --- みう宣伝エリア --- */
.promo-box {
  max-height: 95dvh;
  overflow-y: auto;
}

.miu-promo {
  margin: 16px 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 245, 255, 0.06);
  border: 1px solid rgba(0, 245, 255, 0.25);
  box-shadow: 0 0 20px rgba(185, 103, 255, 0.2);
}

.miu-avatar {
  width: 100px;
  height: 100px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #ff6ec7;
  box-shadow: 0 0 20px rgba(255, 110, 199, 0.6);
  background: linear-gradient(135deg, #ff2daa, #b967ff, #00f5ff);
  display: flex;
  align-items: center;
  justify-content: center;
}

.miu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.miu-initial {
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.promo-name {
  font-size: 1rem;
  font-weight: bold;
  color: #ff6ec7;
  text-shadow: 0 0 8px #ff6ec7;
}

.promo-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 4px 0 12px;
}

.promo-link {
  display: inline-block;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #00c8e8, #b967ff);
  border-radius: 30px;
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.4);
  min-height: 48px;
  line-height: 1.4;
}

.promo-link:active {
  transform: scale(0.97);
}

/* --- PC向け微調整 --- */
@media (min-width: 768px) {
  .control-btn {
    width: 90px;
    height: 90px;
  }
}
