#title-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(48px, 11vh, 90px);
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #FFF9F0 0%, #FFE0CC 100%);
}

/* ===== タイトルロゴ ===== */
.title-logo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 2px;
  margin-bottom: 52px;
  position: relative;
  z-index: 25;
}

.title-logo-row {
  display: flex;
  justify-content: center;
  gap: 0;
  width: calc(100% - 32px);
  margin-inline: auto;
}

.title-logo span {
  display: inline-block;
  font-family: 'Ritsu', 'Ricchan', 'Noto Sans JP', var(--font-main);
  font-weight: normal;
  /* 新フォントは字幅が広いため、4文字＋揺れがスマホ幅に収まる比率にする */
  font-size: clamp(3.8rem, 20vw, 6.5rem);
  color: #fff;
  -webkit-text-stroke: 2px #111;
  animation: wobble 2s ease-in-out infinite;
  line-height: 1.05;
}

/* 新フォントの広い字幅を吸収し、発光と揺れのための左右余白を確保 */
.title-logo-row:last-child span {
  margin-inline: -0.025em;
}

/* ひらがな行（ふりっく）は上段らしく大きくしつつ、画面外には出さない */
.title-logo-row:first-child span {
  font-size: clamp(4.5rem, 24.5vw, 8rem);
  margin-inline: -0.04em;
  -webkit-text-stroke-width: 2.5px;
}

/* カタカナ行（フリック）は専用のオリジナルフォントを使う */
.title-logo-row:last-child span {
  font-family: 'Ritsu', 'Yusei Magic', 'Noto Sans JP', var(--font-main);
  font-weight: normal;
}
.title-logo-row:last-child span:nth-child(1) { rotate: -6deg; translate: 0  3px; }
.title-logo-row:last-child span:nth-child(2) { rotate:  4deg; translate: 0 -4px; }
.title-logo-row:last-child span:nth-child(3) { rotate: -3deg; translate: 0  5px; }
.title-logo-row:last-child span:nth-child(4) { rotate:  7deg; translate: 0 -2px; }

/* ================================================================
   各文字のネオングロー（虹色スプレー版）
   3層構造:
     ① 3px 無blur → ピクセル感のある輪郭（そのまま維持）
     ② 7px 2px blur → 中間のにじみ
     ③ 14-22px 大blur → 各文字固有色 + 隣接する虹色がにじみ出す
   ================================================================ */

/* ふ — マゼンタ / 外スプレー: ピンク・バイオレット・オレンジ */
.title-logo-row:first-child span:nth-child(1) {
  animation-delay: 0.0s;
  text-shadow:
    3px 0 0 #ff00ff, -3px 0 0 #ff00ff, 0 3px 0 #ff00ff, 0 -3px 0 #ff00ff,
    3px 3px 0 #ff00ff, -3px 3px 0 #ff00ff, 3px -3px 0 #ff00ff, -3px -3px 0 #ff00ff,
    7px 0 2px #ff00ff, -7px 0 2px #ff00ff, 0 7px 2px #ff00ff, 0 -7px 2px #ff00ff,
    14px 7px 10px #ff1493, -14px 7px 10px #cc00ff,
    7px -14px 10px #ff6600, -7px 14px 10px #ff0055,
    22px 0 16px rgba(255,0,255,.55), -22px 0 16px rgba(0,255,255,.3),
    0 22px 16px rgba(255,100,0,.3), 0 -22px 16px rgba(180,0,255,.4);
}
/* り — シアン / 外スプレー: ティール・ブルー・グリーン */
.title-logo-row:first-child span:nth-child(2) {
  animation-delay: 0.1s;
  text-shadow:
    3px 0 0 #00ffff, -3px 0 0 #00ffff, 0 3px 0 #00ffff, 0 -3px 0 #00ffff,
    3px 3px 0 #00ffff, -3px 3px 0 #00ffff, 3px -3px 0 #00ffff, -3px -3px 0 #00ffff,
    7px 0 2px #00ffff, -7px 0 2px #00ffff, 0 7px 2px #00ffff, 0 -7px 2px #00ffff,
    14px 7px 10px #00ffcc, -14px 7px 10px #0088ff,
    7px -14px 10px #44ffaa, -7px 14px 10px #00ccff,
    22px 0 16px rgba(0,255,255,.55), -22px 0 16px rgba(0,100,255,.35),
    0 22px 16px rgba(0,255,150,.3), 0 -22px 16px rgba(100,0,255,.3);
}
/* っ — オレンジ / 外スプレー: イエロー・レッド・ピンク */
.title-logo-row:first-child span:nth-child(3) {
  animation-delay: 0.2s;
  text-shadow:
    3px 0 0 #ff7700, -3px 0 0 #ff7700, 0 3px 0 #ff7700, 0 -3px 0 #ff7700,
    3px 3px 0 #ff7700, -3px 3px 0 #ff7700, 3px -3px 0 #ff7700, -3px -3px 0 #ff7700,
    7px 0 2px #ff7700, -7px 0 2px #ff7700, 0 7px 2px #ff7700, 0 -7px 2px #ff7700,
    14px 7px 10px #ffee00, -14px 7px 10px #ff3300,
    7px -14px 10px #ff9900, -7px 14px 10px #ff4400,
    22px 0 16px rgba(255,120,0,.55), -22px 0 16px rgba(255,200,0,.35),
    0 22px 16px rgba(255,50,0,.3), 0 -22px 16px rgba(255,180,0,.4);
}
/* く — ライム / 外スプレー: グリーン・イエロー・シアン */
.title-logo-row:first-child span:nth-child(4) {
  animation-delay: 0.3s;
  text-shadow:
    3px 0 0 #aaff00, -3px 0 0 #aaff00, 0 3px 0 #aaff00, 0 -3px 0 #aaff00,
    3px 3px 0 #aaff00, -3px 3px 0 #aaff00, 3px -3px 0 #aaff00, -3px -3px 0 #aaff00,
    7px 0 2px #aaff00, -7px 0 2px #aaff00, 0 7px 2px #aaff00, 0 -7px 2px #aaff00,
    14px 7px 10px #00ff88, -14px 7px 10px #ddff00,
    7px -14px 10px #44ff44, -7px 14px 10px #88ff00,
    22px 0 16px rgba(150,255,0,.55), -22px 0 16px rgba(0,255,100,.35),
    0 22px 16px rgba(200,255,0,.3), 0 -22px 16px rgba(0,200,100,.4);
}
/* フ — ホットピンク / 外スプレー: マゼンタ・レッド・バイオレット */
.title-logo-row:last-child span:nth-child(1) {
  animation-delay: 0.4s;
  text-shadow:
    3px 0 0 #ff1493, -3px 0 0 #ff1493, 0 3px 0 #ff1493, 0 -3px 0 #ff1493,
    3px 3px 0 #ff1493, -3px 3px 0 #ff1493, 3px -3px 0 #ff1493, -3px -3px 0 #ff1493,
    7px 0 2px #ff1493, -7px 0 2px #ff1493, 0 7px 2px #ff1493, 0 -7px 2px #ff1493,
    14px 7px 10px #ff00ff, -14px 7px 10px #ff4466,
    7px -14px 10px #ff0066, -7px 14px 10px #cc0066,
    22px 0 16px rgba(255,20,150,.55), -22px 0 16px rgba(255,0,200,.35),
    0 22px 16px rgba(200,0,100,.3), 0 -22px 16px rgba(255,50,150,.4);
}
/* リ — バイオレット / 外スプレー: パープル・ブルー・マゼンタ */
.title-logo-row:last-child span:nth-child(2) {
  animation-delay: 0.5s;
  text-shadow:
    3px 0 0 #cc00ff, -3px 0 0 #cc00ff, 0 3px 0 #cc00ff, 0 -3px 0 #cc00ff,
    3px 3px 0 #cc00ff, -3px 3px 0 #cc00ff, 3px -3px 0 #cc00ff, -3px -3px 0 #cc00ff,
    7px 0 2px #cc00ff, -7px 0 2px #cc00ff, 0 7px 2px #cc00ff, 0 -7px 2px #cc00ff,
    14px 7px 10px #8800ff, -14px 7px 10px #ff00cc,
    7px -14px 10px #aa00ff, -7px 14px 10px #6600ff,
    22px 0 16px rgba(200,0,255,.55), -22px 0 16px rgba(100,0,255,.35),
    0 22px 16px rgba(150,0,200,.3), 0 -22px 16px rgba(255,0,150,.4);
}
/* ッ — イエロー / 外スプレー: オレンジ・ライム・ホワイト */
.title-logo-row:last-child span:nth-child(3) {
  animation-delay: 0.6s;
  text-shadow:
    3px 0 0 #ffee00, -3px 0 0 #ffee00, 0 3px 0 #ffee00, 0 -3px 0 #ffee00,
    3px 3px 0 #ffee00, -3px 3px 0 #ffee00, 3px -3px 0 #ffee00, -3px -3px 0 #ffee00,
    7px 0 2px #ffee00, -7px 0 2px #ffee00, 0 7px 2px #ffee00, 0 -7px 2px #ffee00,
    14px 7px 10px #ffaa00, -14px 7px 10px #ddff00,
    7px -14px 10px #ff8800, -7px 14px 10px #eeee00,
    22px 0 16px rgba(255,220,0,.55), -22px 0 16px rgba(255,150,0,.35),
    0 22px 16px rgba(200,200,0,.3), 0 -22px 16px rgba(255,255,50,.4);
}
/* ク — ティール / 外スプレー: シアン・グリーン・ブルー */
.title-logo-row:last-child span:nth-child(4) {
  animation-delay: 0.7s;
  text-shadow:
    3px 0 0 #00ffcc, -3px 0 0 #00ffcc, 0 3px 0 #00ffcc, 0 -3px 0 #00ffcc,
    3px 3px 0 #00ffcc, -3px 3px 0 #00ffcc, 3px -3px 0 #00ffcc, -3px -3px 0 #00ffcc,
    7px 0 2px #00ffcc, -7px 0 2px #00ffcc, 0 7px 2px #00ffcc, 0 -7px 2px #00ffcc,
    14px 7px 10px #00ddff, -14px 7px 10px #44ffaa,
    7px -14px 10px #00ccff, -7px 14px 10px #00ffaa,
    22px 0 16px rgba(0,255,200,.55), -22px 0 16px rgba(0,200,255,.35),
    0 22px 16px rgba(0,150,200,.3), 0 -22px 16px rgba(0,255,150,.4);
}

@keyframes wobble {
  0%   { transform: translateY(0px) rotate(0deg)   scale(1); }
  20%  { transform: translateY(-8px) rotate(-4deg) scale(1.05); }
  40%  { transform: translateY(4px)  rotate(3deg)  scale(0.97); }
  60%  { transform: translateY(-5px) rotate(-2deg) scale(1.03); }
  80%  { transform: translateY(3px)  rotate(2deg)  scale(0.99); }
  100% { transform: translateY(0px) rotate(0deg)   scale(1); }
}

/* ===== スタートボタン ===== */
.start-btn {
  margin-top: 64px;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-main);
  font-size: clamp(1.95rem, 7.5vw, 2.7rem);
  font-weight: 900;
  border: none;
  border-radius: 50px;
  width: min(258px, calc(100% - 48px));
  padding: 16px clamp(28px, 10vw, 56px);
  cursor: pointer;
  box-shadow: 0 6px 0 #BF360C, 0 8px 16px rgba(0,0,0,0.2);
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
  z-index: 10;
  letter-spacing: 0.15em;
}

.start-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #BF360C, 0 4px 8px rgba(0,0,0,0.15);
}

/* ===== サブメニュー（きろく・せってい） ===== */
.menu-row {
  display: flex;
  gap: clamp(10px, 4vw, 16px);
  width: min(340px, calc(100% - 32px));
  margin-top: 22px;
  position: relative;
  z-index: 10;
}

.menu-btn {
  background: var(--color-white);
  color: var(--color-primary);
  font-family: var(--font-main);
  font-size: clamp(1.15rem, 4.5vw, 1.6rem);
  font-weight: 900;
  border: 3px solid var(--color-primary);
  border-radius: 40px;
  flex: 1 1 0;
  min-width: 0;
  padding: 10px clamp(12px, 5vw, 30px);
  cursor: pointer;
  box-shadow: 0 4px 0 #BF360C, 0 6px 12px rgba(0,0,0,0.15);
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 0.12em;
}

.menu-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #BF360C, 0 3px 6px rgba(0,0,0,0.1);
}

/* ===== きろく・せってい 共通パネル ===== */
.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.panel-overlay[hidden] { display: none; }

.panel-card {
  background: #fff;
  border-radius: 24px;
  padding: 22px 22px 18px;
  width: min(420px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--color-primary);
  text-align: center;
  letter-spacing: 0.15em;
}

.panel-close {
  align-self: center;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 10px 40px;
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 4px 0 #BF360C;
  cursor: pointer;
}
.panel-close:active { transform: translateY(3px); box-shadow: 0 1px 0 #BF360C; }

/* --- きろく --- */
.rec-section-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #8D6E63;
  margin-bottom: 6px;
  letter-spacing: 0.1em;
}

.rec-best {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.rec-best-item {
  flex: 1;
  background: #FFF3E0;
  border-radius: 14px;
  padding: 10px 4px;
  text-align: center;
}
.rec-best-label { font-size: 0.72rem; color: #8D6E63; font-weight: bold; }
.rec-best-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1.2;
}

.rec-history { display: flex; flex-direction: column; gap: 5px; }
.rec-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FAFAFA;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.92rem;
  font-weight: bold;
  color: #5D4037;
}
.rec-row-date { color: #9E9E9E; min-width: 3.2em; }
.rec-row-stats { display: flex; gap: 12px; flex: 1; justify-content: space-between; }

.rec-empty {
  text-align: center;
  color: #9E9E9E;
  font-size: 0.95rem;
  padding: 12px 0;
}

/* --- せってい --- */
.set-item { margin-bottom: 14px; }
.set-label {
  font-size: 1rem;
  font-weight: 900;
  color: #5D4037;
  margin-bottom: 7px;
  letter-spacing: 0.08em;
}
.set-options { display: flex; gap: 8px; flex-wrap: wrap; }
.set-options.speed-options {
  flex-wrap: nowrap;
  gap: 4px;
}
.set-option {
  background: #F5F5F5;
  color: #757575;
  border: 2.5px solid #E0E0E0;
  border-radius: 30px;
  padding: 8px 18px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
}
.speed-options .set-option {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 3px;
  font-size: clamp(0.68rem, 2.7vw, 0.84rem);
  letter-spacing: -0.04em;
}
.set-option.selected {
  background: #FFF3E0;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ===== キャラクターたち（右→左 歩行） ===== */
.title-char-wrap {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform;
}

.title-char-bob {
  animation: title-bob 0.5s ease-in-out infinite;
}

.title-char-img {
  display: block;
  height: auto;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.35));
}

@keyframes title-bob {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-9px); }
  100% { transform: translateY(0px); }
}
