/* ===== シュールダッシュ 固有スタイル ===== */

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #1a0533 0%, #2d1b69 40%, #6b2fa0 70%, #ff6ec7 100%);
  font-family: 'Zen Maru Gothic', sans-serif;
  color: #fff;
  height: 100vh;
  height: 100dvh;
}

/* --- 画面切り替え --- */
.screen {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 10;
}
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* --- タイトル画面 --- */
#title-screen {
  background: linear-gradient(135deg, #1a0533 0%, #2d1b69 40%, #6b2fa0 70%, #ff6ec7 100%);
  text-align: center;
  padding: 20px;
}

.title-container {
  max-width: 400px;
  width: 100%;
}

.title-icon {
  font-size: 4rem;
  margin-bottom: 8px;
  animation: title-bounce 1.5s ease-in-out infinite;
}

@keyframes title-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.game-title {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(90deg, #ff6ec7, #00fff7, #39ff14);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  margin-bottom: 8px;
  line-height: 1.2;
}

.title-sub {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.highscore-display {
  margin-bottom: 12px;
}

.btn-primary {
  display: inline-block;
  padding: 14px 40px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff6ec7, #a855f7);
  border: none;
  border-radius: var(--sg-radius-pill, 999px);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(255, 110, 199, 0.4);
  font-family: 'Zen Maru Gothic', sans-serif;
}
.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(255, 110, 199, 0.6);
}
.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 28px;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--sg-radius-pill, 999px);
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
  font-family: 'Zen Maru Gothic', sans-serif;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.03);
}

.controls-help {
  margin-top: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--sg-radius-md, 12px);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
}
.controls-help .help-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.9);
}
.controls-help p {
  margin: 2px 0;
}
.help-tip {
  margin-top: 6px !important;
  color: #ffe066 !important;
  font-weight: 700;
}

/* --- アイテム図鑑 --- */
.items-help {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255, 200, 80, 0.10);
  border: 1px solid rgba(255, 200, 80, 0.35);
  border-radius: var(--sg-radius-md, 12px);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
}
.items-help .help-title {
  font-weight: 700;
  margin: 0 0 6px;
  color: #ffe066;
  text-align: center;
}
.items-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.items-list li {
  padding: 3px 0;
  line-height: 1.4;
}

/* --- ゲーム画面 --- */
#game-screen {
  background: #0d0221;
}

#game-canvas {
  display: block;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.game-hud {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 100;
  pointer-events: none;
}
.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}
.hud-zone {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 110, 199, 0.4);
}
.hud-label {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
}
.hud-value {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
}

/* --- リザルト画面 --- */
#result-screen {
  background: linear-gradient(135deg, #1a0533 0%, #2d1b69 50%, #6b2fa0 100%);
  text-align: center;
  padding: 20px;
}

.result-container {
  max-width: 400px;
  width: 100%;
}

.result-icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

.result-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #ff6ec7;
  margin-bottom: 16px;
}

.result-stats {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--sg-radius-md, 12px);
  padding: 16px;
  margin-bottom: 12px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.result-row:last-child {
  border-bottom: none;
}
.result-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}
.result-value {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--sg-brand-cyan, #00fff7);
}

.result-rank {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 12px;
}

/* --- トップに戻るリンク --- */
.back-to-top-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 5000;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  transition: color 0.2s;
}
.back-to-top-link:hover {
  color: #fff;
}

/* --- レスポンシブ --- */
@media (min-width: 700px) {
  .screen {
    padding-inline: 20px;
  }

  #title-screen.active,
  #result-screen.active {
    justify-content: flex-start;
    padding-top: clamp(88px, 11vh, 132px);
  }

  #game-screen.active {
    justify-content: flex-start;
    padding-top: 40px;
  }

  .title-container,
  .result-container {
    width: min(100%, 520px);
  }

  .title-icon {
    font-size: 4.4rem;
    margin-bottom: 14px;
  }

  .game-title {
    font-size: 2.6rem;
  }

  .title-sub {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .controls-help {
    padding: 16px 18px;
    font-size: 0.86rem;
  }

  #game-canvas {
    max-width: 560px;
  }

  .game-hud {
    gap: 16px;
  }

  .hud-item {
    padding: 6px 14px;
  }

  .hud-value {
    font-size: 1.1rem;
  }

  .result-stats {
    padding: 20px 22px;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 1.8rem;
  }
  .title-icon {
    font-size: 2.4rem;
    margin-bottom: 4px;
  }
  .title-sub {
    font-size: 0.82rem;
    margin-bottom: 10px;
  }
  .btn-primary {
    padding: 10px 28px;
    font-size: 1rem;
  }
  .controls-help,
  .items-help {
    padding: 8px 10px;
    font-size: 0.72rem;
    margin-top: 10px;
  }
  .items-list li {
    padding: 2px 0;
    line-height: 1.3;
  }
  .result-title {
    font-size: 1.5rem;
  }
  .game-hud {
    gap: 6px;
  }
  .hud-item {
    padding: 3px 7px;
  }
  .hud-value {
    font-size: 0.85rem;
  }
}

@media (max-height: 720px) {
  .title-icon {
    font-size: 2.6rem;
    margin-bottom: 4px;
  }
  .controls-help,
  .items-help {
    margin-top: 8px;
    padding: 8px 10px;
  }
}

@media (min-height: 700px) {
  .title-container {
    transform: scale(1.05);
  }
}
