:root {
  --glass-bg: rgba(15, 18, 30, 0.56);
  --glass-border: rgba(255, 255, 255, 0.22);
  --glass-highlight: rgba(255, 255, 255, 0.12);
  --accent: #ff6ba9;
  --accent-2: #7c6cff;
  --good: #34e3a0;
  --warn: #ff5c7a;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.76);
  --radius: 22px;
}

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

html,
body {
  width: 100%;
  min-height: 100%;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  color: var(--text);
  background: #0d101b;
  overflow-x: hidden;
}

/* 背景レイヤー（奥：横長画面の左右を埋めるぼかし背景） */
#bg-backdrop {
  position: fixed;
  inset: -24px;
  background-color: #141828;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(28px) brightness(0.45);
  transition: background-image 0.5s ease;
  z-index: 0;
  transform: scale(1.06);
}

/* 背景レイヤー（手前：頭から足先まで全身を表示） */
#bg-layer {
  position: fixed;
  inset: 0;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  transition: filter 0.7s ease, background-image 0.5s ease;
  z-index: 1;
}

#bg-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(20, 14, 34, 0.2), rgba(8, 10, 18, 0.72));
  transition: opacity 0.6s ease;
  z-index: 2;
  pointer-events: none;
}

/* 鑑賞モード（UIを隠して背景をじっくり見る） */
body.peek-mode {
  overflow: hidden;
}

body.peek-mode .app-shell {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

#peek-viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  transition: opacity 0.28s ease;
}

body.peek-mode #peek-viewer {
  opacity: 1;
  pointer-events: auto;
}

body.peek-mode #bg-layer {
  opacity: 0;
}

#peek-scroll-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100%;
  padding: 10px 12px;
}

#peek-image-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#peek-image {
  display: block;
  max-width: calc(100vw - 24px);
  max-height: 96dvh;
  width: auto;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  transition: width 0.3s ease, max-height 0.3s ease;
}

/* 拡大スクロールモード（1段階目：大きめ中央表示で上下スクロール） */
body.peek-zoom-1 #peek-viewer,
body.peek-zoom-2 #peek-viewer {
  align-items: flex-start;
}

body.peek-zoom-1 #peek-scroll-inner {
  align-items: flex-start;
  padding: 12px 12px 76px;
}

body.peek-zoom-1 #peek-image {
  width: min(92vw, 880px);
  max-width: none;
  max-height: none;
  height: auto;
}

/* もっと拡大スクロールモード（2段階目：横画面いっぱい100%幅） */
body.peek-zoom-2 #peek-scroll-inner {
  align-items: flex-start;
  padding: 0 0 76px;
}

body.peek-zoom-2 #peek-image-wrap {
  width: 100%;
  border-radius: 0;
  box-shadow: none;
}

body.peek-zoom-2 #peek-image {
  width: 100%;
  max-width: none;
  max-height: none;
  height: auto;
}

/* スマホ縦画面では二本指ピンチ操作の方が自然なため、ズーム切替ボタンを非表示にしてスッキリ鑑賞！ */
@media (max-width: 768px) {
  .peek-mode-btn {
    display: none;
  }
}

#peek-controls {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

body.peek-mode #peek-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.peek-mode-btn,
#peek-exit-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 18, 30, 0.78);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.peek-mode-btn:hover,
#peek-exit-btn:hover {
  background: rgba(45, 50, 78, 0.9);
}

.peek-mode-btn:active,
#peek-exit-btn:active {
  transform: scale(0.96);
}

.peek-mode-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(255, 255, 255, 0.65);
}

/* メインシェル */
.app-shell {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  max-width: 640px;
  margin: 0 auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* トップバー */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.brand:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px var(--accent);
}

.top-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 540px) {
  .app-shell {
    padding: 12px 10px;
  }
  .top-bar {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
  }
  .brand {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .top-actions {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }
  .icon-btn {
    height: 38px;
    padding: 0 8px;
    font-size: 0.75rem;
  }
  .icon-btn-labeled {
    padding: 2px 5px;
    min-width: 36px;
  }
  .icon-lbl {
    font-size: 0.52rem;
  }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.icon-btn-labeled {
  flex-direction: column;
  gap: 1px;
  height: 40px;
  padding: 3px 8px;
  border-radius: 12px;
  min-width: 42px;
}

.icon-lbl {
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.icon-sym {
  font-size: 0.9rem;
  line-height: 1.1;
}

@media (max-width: 540px) {
  .icon-btn {
    height: 38px;
    padding: 0 8px;
    font-size: 0.74rem;
  }
  .icon-btn-labeled {
    padding: 2px 5px;
    min-width: 36px;
  }
  .icon-lbl {
    font-size: 0.52rem;
  }
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.42);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* スクリーン切り替え */
.main-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0;
}

.screen {
  display: none;
  width: 100%;
  animation: fadeUp 0.35s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* すりガラスカード */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

/* タイトル画面 */
.badge-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.32), rgba(124, 108, 255, 0.32));
  border: 1px solid rgba(255, 255, 255, 0.28);
  margin-bottom: 12px;
}

.game-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.game-desc {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.start-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.start-meta strong {
  font-size: 1.15rem;
  color: #ffd166;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s;
}

.switch input:checked + .slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* ボタン */
.btn-primary {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(255, 107, 169, 0.35);
  transition: transform 0.15s ease, filter 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* プレイ画面 HUD */
.hud-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.hud-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
}

.hud-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.hud-value {
  font-size: 0.98rem;
  font-weight: 800;
}

#hud-lives {
  color: #ff6b8b;
  letter-spacing: 2px;
}

/* 背景クリア度バー */
.reveal-meter {
  margin-bottom: 14px;
}

.reveal-meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.reveal-bar-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

#reveal-bar-fill {
  height: 100%;
  width: 20%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ffd166);
  transition: width 0.5s ease;
}

/* ステータスメッセージ */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 14px;
}

#game-status {
  font-size: 0.94rem;
  font-weight: 700;
}

#game-status[data-tone="success"] {
  color: var(--good);
}

#game-status[data-tone="warn"] {
  color: #ff8fa3;
}

#hud-combo {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd166, #ff6ba9);
  color: #1c1326;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#hud-combo.visible {
  opacity: 1;
  transform: scale(1);
}

/* パネルボード */
.board {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

.tile {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tile:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tile:active {
  transform: scale(0.94);
}

.tile-flash {
  background: linear-gradient(135deg, #ff7eb8, #8e7dff) !important;
  border-color: #fff !important;
  box-shadow: 0 0 24px rgba(255, 126, 184, 0.85), inset 0 0 12px rgba(255, 255, 255, 0.55);
  transform: scale(1.03);
}

.tile-correct {
  background: linear-gradient(135deg, #2ee59d, #1cc6c9) !important;
  border-color: rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 0 18px rgba(46, 229, 157, 0.65);
}

.tile-wrong {
  background: linear-gradient(135deg, #ff4d6d, #c9184a) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
  animation: shake 0.3s ease;
}

.tile-missed {
  background: rgba(255, 209, 102, 0.65) !important;
  border-color: #ffd166 !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.play-footer-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.btn-ghost {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* リザルト画面 */
.result-card {
  text-align: center;
}

.new-record {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd166, #ff6ba9);
  color: #1b1224;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.rank-circle {
  width: 84px;
  height: 84px;
  margin: 8px auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 30px rgba(255, 107, 169, 0.5);
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.result-stat-box {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.result-stat-box span {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.result-stat-box strong {
  font-size: 1.35rem;
}

.result-comment {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.reward-banner {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.reward-banner.unlocked {
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.28), rgba(255, 209, 102, 0.28));
  border: 1px solid rgba(255, 209, 102, 0.65);
  color: #fff5d6;
}

.reward-banner.locked {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

.result-actions {
  display: grid;
  gap: 10px;
}

.result-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ご褒美獲得時の紙吹雪＆祝福バナー */
#confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -18px;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: confettiFall;
  animation-timing-function: cubic-bezier(0.2, 0.65, 0.35, 1);
  animation-fill-mode: forwards;
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, -10px, 0) rotate(0deg);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift, 40px), 105vh, 0) rotate(var(--rot, 540deg));
    opacity: 0;
  }
}

#celebration-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) scale(0.75);
  z-index: 85;
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.92), rgba(124, 108, 255, 0.92));
  border: 2px solid rgba(255, 232, 150, 0.9);
  box-shadow: 0 12px 36px rgba(255, 107, 169, 0.55), 0 0 24px rgba(255, 209, 102, 0.45);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1.35, 0.36, 1);
}

#celebration-banner.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.cel-main {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.cel-sub {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff6db;
  margin-top: 2px;
}

/* トースト通知（NEW図鑑登録・ショップ案内など） */
#toast-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 90;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(18, 20, 36, 0.9);
  border: 1px solid rgba(255, 209, 102, 0.65);
  backdrop-filter: blur(12px);
  color: #fff6db;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

#toast-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 鑑賞モード上部のキャラ・コスプレ名ラベル */
#peek-meta {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 18, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(10px);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
}

.icon-btn-accent {
  border-color: rgba(255, 107, 169, 0.55);
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.28), rgba(124, 108, 255, 0.28));
}

.count-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.74rem;
}

.start-actions {
  display: grid;
  gap: 10px;
}

/* キャラ図鑑（ギャラリー）画面 */
.gallery-card-shell {
  padding: 20px 18px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.gallery-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.gallery-progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.gallery-progress-track {
  margin-bottom: 14px;
}

#gallery-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ffd166);
  transition: width 0.45s ease;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.chip-row-sub {
  margin-bottom: 14px;
}

.tab-chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tab-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.tab-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 46dvh;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}

.gallery-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.5);
}

.gallery-card.unlocked img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.gallery-reward-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.9), rgba(255, 209, 102, 0.9));
  color: #1c1224;
  font-size: 0.64rem;
  font-weight: 800;
}

.gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px 8px 6px;
  background: linear-gradient(to top, rgba(8, 10, 18, 0.88), transparent);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.gallery-caption strong {
  font-size: 0.76rem;
  color: #fff;
}

.gallery-caption span {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.78);
}

.gallery-card.locked {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 14, 26, 0.62);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.2);
}

.gallery-lock-inner {
  text-align: center;
  padding: 8px;
}

.lock-icon {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.lock-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 3px;
}

.lock-hint {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.56);
  line-height: 1.3;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ショップ・応援導線バナー */
.shop-promo-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(255, 107, 169, 0.18));
  border: 1px solid rgba(255, 209, 102, 0.45);
}

.shop-promo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shop-promo-text strong {
  font-size: 0.84rem;
  color: #fff6db;
}

.shop-promo-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.shop-promo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-shop {
  flex-shrink: 0;
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #ffd166, #ff6ba9);
  color: #1c1224;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.btn-shop-bundle {
  background: linear-gradient(135deg, #ffe066, #ff922b);
  box-shadow: 0 2px 10px rgba(255, 209, 102, 0.35);
}

.btn-shop:hover {
  filter: brightness(1.08);
}

.btn-shop:active {
  transform: scale(0.96);
}

/* ポータルホーム：公式BOOTHデジタル写真集ショーケース */
.portal-shop-showcase {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 209, 102, 0.14), rgba(255, 107, 169, 0.16));
  border: 1px solid rgba(255, 209, 102, 0.42);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portal-shop-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.portal-shop-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd166, #ff6ba9);
  color: #1c1224;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.portal-shop-head strong {
  font-size: 0.96rem;
  color: #fff6db;
}

.portal-shop-sub {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.portal-shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.portal-shop-item {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(16, 12, 28, 0.68);
  color: #fff;
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-shop-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.72);
  box-shadow: 0 6px 16px rgba(255, 107, 169, 0.24);
}

.portal-shop-item:active {
  transform: scale(0.97);
}

.portal-shop-item-featured {
  border-color: rgba(255, 209, 102, 0.75);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.16), rgba(20, 14, 34, 0.82));
  box-shadow: 0 4px 14px rgba(255, 209, 102, 0.18);
}

.portal-shop-badge {
  position: absolute;
  top: -7px;
  right: 6px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe066, #ff6ba9);
  color: #1c1224;
  font-size: 0.64rem;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.portal-shop-thumb-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.portal-shop-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.portal-shop-item-body {
  padding: 7px 2px 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-shop-item-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.portal-shop-item-meta {
  font-size: 0.64rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.portal-shop-price {
  margin-top: 2px;
  font-size: 0.88rem;
  font-weight: 900;
  color: #ffd166;
}

.portal-shop-all-btn {
  width: 100%;
  font-size: 0.82rem;
}

/* ポータルホーム画面（ゲーム選択カード） */
.portal-game-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.portal-game-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease;
}

.portal-game-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 107, 169, 0.65);
}

.portal-game-card:active {
  transform: scale(0.98);
}

.portal-game-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.35), rgba(124, 108, 255, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.portal-game-info {
  flex: 1;
  min-width: 0;
}

.portal-game-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffd166;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.portal-game-name {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.portal-game-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.portal-game-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.portal-best-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.85);
}

.portal-arrow {
  font-size: 0.85rem;
  color: var(--accent);
}

/* GAME 02: 1〜25 順番タップ */
.glass-card-light {
  background: rgba(15, 18, 30, 0.34);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-btn {
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.35), rgba(124, 108, 255, 0.35));
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.hud-box-accent {
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.32), rgba(124, 108, 255, 0.32));
  border-color: rgba(255, 255, 255, 0.38);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ffd166);
  transition: width 0.25s ease;
}

.game-status-text {
  font-size: 0.92rem;
  font-weight: 700;
}

.game-status-text[data-tone="success"] {
  color: var(--good);
}

.game-status-text[data-tone="warn"] {
  color: #ff8fa3;
}

.num-board {
  gap: 7px;
}

.num-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: rgba(22, 26, 44, 0.72);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: transform 0.14s ease, opacity 0.28s ease, background 0.16s ease;
}

.board-5x5 .num-tile {
  font-size: 1.15rem;
  border-radius: 10px;
}

.num-tile:hover {
  background: rgba(255, 255, 255, 0.22);
}

.num-tile:active {
  transform: scale(0.92);
}

/* 正解でふわっと消えて後ろの背景が見える！ */
.num-tile.cleared {
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}

.num-tile.wrong-flash {
  background: rgba(255, 77, 109, 0.85);
  border-color: #fff;
  animation: shake 0.28s ease;
}

/* GAME 03: いま何人？カフェカウント */
.combo-pill {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd166, #ff6ba9);
  color: #1c1326;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.combo-pill.visible {
  opacity: 1;
  transform: scale(1);
}

#pc-hud-lives {
  color: #ff6b8b;
  letter-spacing: 2px;
}

.pc-stage {
  position: relative;
  width: 100%;
  height: 236px;
  border-radius: 18px;
  background: rgba(10, 14, 28, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.pc-side-label {
  position: absolute;
  top: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.pc-side-in {
  left: 10px;
  color: #8bf5ca;
}

.pc-side-out {
  right: 10px;
  color: #ffadc0;
}

.pc-cafe-house {
  position: relative;
  z-index: 4;
  width: 138px;
  padding: 14px 10px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(45, 36, 68, 0.92), rgba(24, 26, 46, 0.94));
  border: 2px solid rgba(255, 209, 102, 0.65);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.pc-cafe-roof {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffd166;
  margin-bottom: 6px;
}

.pc-cafe-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

.pc-event-caption {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
}

.pc-walker {
  position: absolute;
  z-index: 3;
  font-size: 2.35rem;
  line-height: 1;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.pc-walker.has-img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  background: #1b1e30;
}

.pc-walker.walk-in.has-img {
  border-color: #8bf5ca;
  box-shadow: 0 0 14px rgba(52, 227, 160, 0.55), 0 6px 14px rgba(0, 0, 0, 0.45);
}

.pc-walker.walk-out.has-img {
  border-color: #ff9eb5;
  box-shadow: 0 0 14px rgba(255, 107, 169, 0.55), 0 6px 14px rgba(0, 0, 0, 0.45);
}

.pc-walker-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pc-walker.walk-in {
  left: 6%;
  animation-name: pcWalkIn;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

.pc-walker.walk-out {
  left: 50%;
  animation-name: pcWalkOut;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

@keyframes pcWalkIn {
  0% {
    left: 6%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -56%) scale(1.05);
  }
  50% {
    transform: translate(-50%, -46%) scale(1);
  }
  82% {
    opacity: 1;
    transform: translate(-50%, -54%) scale(1);
  }
  100% {
    left: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
}

@keyframes pcWalkOut {
  0% {
    left: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -56%) scale(1.05);
  }
  50% {
    transform: translate(-50%, -46%) scale(1);
  }
  82% {
    opacity: 1;
    transform: translate(-50%, -54%) scale(1);
  }
  100% {
    left: 94%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
  }
}

.pc-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  min-height: 118px;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pc-choices.visible {
  opacity: 1;
  pointer-events: auto;
}

.pc-choice-btn {
  padding: 15px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease;
}

.pc-choice-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.55);
}

.pc-choice-btn:active {
  transform: scale(0.96);
}

.pc-choice-btn.correct {
  background: linear-gradient(135deg, #2ee59d, #1cc6c9);
  border-color: #fff;
  box-shadow: 0 0 18px rgba(46, 229, 157, 0.65);
}

.pc-choice-btn.wrong {
  background: linear-gradient(135deg, #ff4d6d, #c9184a);
  border-color: #fff;
  animation: shake 0.3s ease;
}

/* GAME 04: 漢字まちがい探し */
#kf-hud-lives {
  color: #ff6b8b;
  letter-spacing: 2px;
}

.kf-timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.kf-timer-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.kf-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34e3a0, #4cc9f0);
  transition: width 0.08s linear;
}

.kf-timer-fill.low {
  background: linear-gradient(90deg, #ff4d6d, #ffb703);
}

.kf-timer-text {
  font-size: 0.78rem;
  font-weight: 800;
  min-width: 48px;
  text-align: right;
  color: var(--text-muted);
}

.kanji-board {
  gap: 6px;
}

.kanji-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(18, 22, 38, 0.72);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", "Yu Gothic UI", serif;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease;
}

.kanji-board[data-grid="4"] .kanji-tile {
  font-size: 1.75rem;
}

.kanji-board[data-grid="5"] .kanji-tile {
  font-size: 1.45rem;
}

.kanji-board[data-grid="6"] .kanji-tile {
  font-size: 1.2rem;
  border-radius: 8px;
}

.kanji-board[data-grid="7"] .kanji-tile {
  font-size: 1rem;
  border-radius: 7px;
}

.kanji-tile:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
}

.kanji-tile:active {
  transform: scale(0.93);
}

.kanji-tile.hint-row {
  border-color: rgba(255, 209, 102, 0.85);
  background: rgba(255, 209, 102, 0.2);
}

.kanji-tile.correct {
  background: linear-gradient(135deg, #2ee59d, #1cc6c9) !important;
  border-color: #fff !important;
  box-shadow: 0 0 20px rgba(46, 229, 157, 0.75);
  transform: scale(1.06);
}

.kanji-tile.wrong {
  background: linear-gradient(135deg, #ff4d6d, #c9184a) !important;
  border-color: #fff !important;
  animation: shake 0.28s ease;
}

.kf-footer-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.btn-hint {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.6);
  background: rgba(255, 209, 102, 0.18);
  color: #fff4d2;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.btn-hint:hover:not(:disabled) {
  background: rgba(255, 209, 102, 0.32);
}

.btn-hint:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 今日の美少女おみくじ（ポータルバナー＆専用画面） */
.omikuji-banner-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  margin-bottom: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 190, 120, 0.55);
  background: linear-gradient(135deg, rgba(210, 56, 88, 0.36), rgba(255, 180, 70, 0.24));
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, border-color 0.2s ease;
}

.omikuji-banner-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  border-color: rgba(255, 224, 150, 0.85);
}

.omikuji-banner-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.omikuji-banner-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.omikuji-banner-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff8e6;
}

.omikuji-banner-sub {
  font-size: 0.74rem;
  color: rgba(255, 240, 220, 0.85);
}

.omikuji-banner-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd166, #ff6ba9);
  color: #1c1224;
  font-size: 0.72rem;
  font-weight: 800;
}

/* おみくじ画面は巫女さんの顔が隠れないよう画面下寄せ＆見やすい文字サイズ */
#omikuji-screen.active {
  margin-top: auto;
  padding-top: 28dvh;
}

.omikuji-card {
  text-align: center;
  padding: 12px 14px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.95);
}

.omikuji-pill {
  background: linear-gradient(135deg, rgba(220, 50, 80, 0.45), rgba(255, 190, 80, 0.35));
  border-color: rgba(255, 215, 140, 0.5);
  margin-bottom: 6px;
  font-size: 0.68rem;
  padding: 3px 10px;
}

.omikuji-title {
  font-size: 1.42rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.omikuji-chips {
  justify-content: center;
  margin-bottom: 10px;
  gap: 8px;
}

.omikuji-chips .tab-chip {
  padding: 6px 14px;
  font-size: 0.9rem;
  background: rgba(14, 17, 32, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}

.omikuji-chips .tab-chip:hover {
  background: rgba(30, 36, 62, 0.9);
  border-color: #fff;
}

.omikuji-chips .tab-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: #fff;
}

.omikuji-box {
  padding: 2px 0;
}

.omikuji-lead {
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 14px;
}

.omikuji-draw-btn {
  padding: 13px 18px;
  font-size: 1.05rem;
  background: linear-gradient(135deg, #e63956, #ff8c42);
  box-shadow: 0 10px 26px rgba(230, 57, 86, 0.45);
}

.omikuji-shaker {
  font-size: 2.8rem;
  margin: 4px auto 6px;
  display: inline-block;
  animation: omikujiShake 0.24s ease-in-out infinite alternate;
}

@keyframes omikujiShake {
  0% { transform: rotate(-16deg) translateY(0); }
  100% { transform: rotate(16deg) translateY(-8px); }
}

.omikuji-drawing-text {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff3d6;
  margin-bottom: 8px;
}

.omikuji-fortune-badge {
  display: inline-block;
  padding: 7px 26px;
  border-radius: 999px;
  font-size: 1.42rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.omikuji-fortune-badge[data-tone="daikichi"] {
  background: linear-gradient(135deg, #ffd166, #ff5d8f);
  color: #1f1126;
  border: 2px solid #fff3c4;
}

.omikuji-fortune-badge[data-tone="chukichi"] {
  background: linear-gradient(135deg, #ff7eb8, #7c6cff);
  color: #fff;
}

.omikuji-fortune-badge[data-tone="shokichi"] {
  background: linear-gradient(135deg, #34e3a0, #2ec4b6);
  color: #10252b;
}

.omikuji-fortune-badge[data-tone="kyo"] {
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
  color: #fff;
}

.omikuji-char-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
}

.omikuji-message {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(10, 12, 24, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 10px;
}

.omikuji-lucky-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.omikuji-lucky-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(10, 12, 24, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.omikuji-lucky-item span {
  display: block;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2px;
}

.omikuji-lucky-item strong {
  font-size: 0.98rem;
  color: #fff6db;
}

.omikuji-card .result-actions {
  gap: 8px;
}

.omikuji-card .btn-primary {
  padding: 12px 16px;
  font-size: 1.02rem;
}

.omikuji-card .btn-secondary {
  padding: 9px 12px;
  font-size: 0.92rem;
  background: rgba(14, 17, 32, 0.68);
  border-color: rgba(255, 255, 255, 0.45);
}

.omikuji-card .btn-ghost {
  font-size: 0.88rem;
  background: rgba(14, 17, 32, 0.68);
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
}

.omikuji-card .play-footer-actions {
  margin-top: 8px;
}

/* ホーム・タイトル画面カードは後ろのキャラが綺麗に見えるよう透け感を少しアップ */
#portal-screen .glass-card,
#start-screen .glass-card,
#nt-start-screen .glass-card,
#pc-start-screen .glass-card,
#kf-start-screen .glass-card,
#cq-start-screen .glass-card,
#dt-start-screen .glass-card,
#os-start-screen .glass-card,
#bb-start-screen .glass-card {
  background: rgba(15, 18, 30, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ガジェット：美少女集中タイマー＆置き時計 */
.btn-gadget {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(76, 201, 240, 0.55);
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.22), rgba(124, 108, 255, 0.26));
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.btn-gadget:hover {
  filter: brightness(1.12);
}

#gadget-timer-screen.active {
  margin-top: auto;
  padding-top: 28dvh;
}

.gt-card {
  text-align: center;
  padding: 14px 16px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 0 5px rgba(0, 0, 0, 0.95);
}

.gt-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.gt-mode-tabs,
.gt-char-chips,
.gt-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 0;
}

.gt-card .tab-chip {
  background: rgba(14, 17, 32, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.52);
  color: #fff;
  font-size: 0.84rem;
  padding: 5px 12px;
}

.gt-card .tab-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: #fff;
}

.gt-phase-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff3c4;
  margin-bottom: 2px;
}

.gt-big-time {
  font-size: clamp(3rem, 11vw, 4.4rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: #fff;
  margin: 4px 0 10px;
  font-variant-numeric: tabular-nums;
}

.gt-clock-date {
  font-size: 1rem;
  font-weight: 800;
  color: #fff3c4;
  margin-bottom: 4px;
}

.gt-clock-bg-mode {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.gt-progress-track {
  margin-bottom: 10px;
  height: 8px;
}

.gt-message {
  font-size: 0.96rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(10, 12, 24, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.26);
  margin-bottom: 10px;
}

.gt-presets {
  margin-bottom: 12px;
}

.gt-controls {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.gt-break-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.gt-card .btn-secondary,
.gt-card .btn-ghost {
  background: rgba(14, 17, 32, 0.72);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

.gt-footer-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.btn-pip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(110, 215, 255, 0.85);
  background: linear-gradient(135deg, rgba(22, 62, 118, 0.86), rgba(78, 56, 152, 0.86));
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: filter 0.2s ease, transform 0.15s ease;
}

.btn-pip:hover {
  filter: brightness(1.12);
}

.gt-pip-hint {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff6db;
  line-height: 1.45;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(14, 17, 32, 0.56);
  display: inline-block;
}

/* GAME 05: 計算クエスト（RPGバトル） */
.portal-game-card-quest {
  border-color: rgba(255, 209, 102, 0.45);
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.14), rgba(124, 108, 255, 0.18));
}

.cq-hero-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff3c4;
  margin-bottom: 10px;
}

.cq-hero-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.cq-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(14, 17, 32, 0.62);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cq-hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.55);
}

.cq-hero-card.active {
  border-color: #ffd166;
  background: linear-gradient(160deg, rgba(255, 107, 169, 0.28), rgba(124, 108, 255, 0.34));
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.4);
}

.cq-hero-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: #141828;
}

.cq-hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.cq-hero-meta {
  text-align: center;
}

.cq-hero-role {
  display: block;
  font-size: 0.72rem;
  color: #ffd166;
  font-weight: 700;
}

.cq-hero-title {
  font-size: 1rem;
  font-weight: 900;
}

.cq-play-card {
  padding: 18px 16px;
}

#cq-hud-lives {
  color: #ff6b8b;
  letter-spacing: 2px;
}

.cq-stage {
  position: relative;
  border-radius: 16px;
  padding: 12px 10px 10px;
  margin-bottom: 10px;
  background: radial-gradient(circle at 50% 40%, rgba(48, 36, 82, 0.68), rgba(12, 14, 26, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cq-stage.boss-mode {
  background: radial-gradient(circle at 50% 40%, rgba(120, 22, 48, 0.72), rgba(16, 10, 22, 0.9));
  border-color: rgba(255, 92, 122, 0.8);
  box-shadow: 0 0 26px rgba(255, 77, 109, 0.4);
}

.cq-stage.damaged {
  animation: cqStageHit 0.36s ease;
}

@keyframes cqStageHit {
  0%, 100% { box-shadow: inset 0 0 0 rgba(255, 50, 80, 0); transform: translateX(0); }
  25% { box-shadow: inset 0 0 42px rgba(255, 50, 80, 0.85); transform: translateX(-6px); }
  75% { box-shadow: inset 0 0 42px rgba(255, 50, 80, 0.85); transform: translateX(6px); }
}

.cq-warning {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%) scaleY(0);
  z-index: 20;
  padding: 10px;
  text-align: center;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(90deg, rgba(220, 20, 60, 0.92), rgba(255, 110, 40, 0.92), rgba(220, 20, 60, 0.92));
  border-top: 2px solid #ffd166;
  border-bottom: 2px solid #ffd166;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.cq-warning.show {
  transform: translateY(-50%) scaleY(1);
  opacity: 1;
}

.cq-fx-layer {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.cq-dmg-pop {
  position: absolute;
  right: 18%;
  top: 32%;
  font-size: 1.9rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.95), 0 0 12px rgba(255, 107, 169, 0.9);
  animation: cqDmgFloat 0.8s ease-out forwards;
  text-align: center;
  line-height: 1.1;
}

.cq-dmg-pop.crit {
  font-size: 2.25rem;
  color: #ffd166;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.95), 0 0 18px rgba(255, 209, 102, 0.95);
}

.cq-dmg-pop span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: #ff6ba9;
}

@keyframes cqDmgFloat {
  0% { transform: translateY(10px) scale(0.7); opacity: 0; }
  20% { transform: translateY(-6px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-48px) scale(1); opacity: 0; }
}

.cq-fighters {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.cq-fighter {
  text-align: center;
}

.cq-portrait-box {
  width: 100%;
  max-width: 175px;
  margin: 0 auto 6px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(139, 245, 202, 0.7);
  background: #141828;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.16s ease, box-shadow 0.2s ease;
}

.cq-enemy-box {
  border-color: rgba(255, 120, 145, 0.75);
}

.cq-stage.boss-mode .cq-enemy-box {
  border-color: #ffd166;
  box-shadow: 0 0 22px rgba(255, 77, 109, 0.75);
}

.cq-portrait-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.cq-hero.attacking .cq-portrait-box {
  transform: translateX(18px) scale(1.06);
  border-color: #ffd166;
  box-shadow: 0 0 26px rgba(255, 209, 102, 0.9);
}

.cq-enemy.hit .cq-portrait-box {
  animation: cqEnemyHit 0.34s ease;
}

@keyframes cqEnemyHit {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  25% { transform: translateX(8px); filter: brightness(2.1); }
  65% { transform: translateX(-6px); filter: brightness(1.4); }
}

.cq-enemy.defeated .cq-portrait-box {
  opacity: 0.2;
  transform: scale(0.84) rotate(6deg);
  filter: grayscale(1);
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
}

.cq-fighter-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cq-vs {
  font-size: 0.95rem;
  font-weight: 900;
  color: #ffd166;
  text-shadow: 0 2px 10px rgba(255, 107, 169, 0.8);
}

.cq-bars {
  display: grid;
  gap: 5px;
}

.cq-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 800;
  color: #fff6db;
}

.cq-atk-label {
  font-size: 0.68rem;
  color: #ffadc0;
}

.cq-hp-track,
.cq-atk-track {
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.cq-hp-track {
  height: 10px;
}

.cq-atk-track {
  height: 5px;
}

.cq-hp-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff4d6d, #ff9f1c);
  transition: width 0.22s ease;
}

.cq-atk-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4cc9f0, #7c6cff);
}

.cq-atk-fill.danger {
  background: linear-gradient(90deg, #ffb703, #ff4d6d);
}

.cq-question {
  text-align: center;
  font-size: clamp(1.7rem, 6vw, 2.25rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(14, 17, 32, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.cq-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.cq-choice-btn {
  padding: 14px 10px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(22, 26, 46, 0.76);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.16s ease, border-color 0.16s ease;
}

.cq-choice-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.65);
}

.cq-choice-btn:active {
  transform: scale(0.95);
}

.cq-choice-btn.correct {
  background: linear-gradient(135deg, #2ee59d, #1cc6c9);
  border-color: #fff;
}

.cq-choice-btn.wrong {
  background: linear-gradient(135deg, #ff4d6d, #c9184a);
  border-color: #fff;
  animation: shake 0.28s ease;
}

/* GAME 06: 属性よけ×後出しじゃんけん（マルチタスク） */
.dt-element-guide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.dt-guide-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(14, 17, 32, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dt-guide-item strong {
  color: #fff3c4;
  font-size: 0.84rem;
}

.dt-guide-item span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.dt-play-card {
  padding: 16px 14px;
}

#dt-hud-lives {
  color: #ff6b8b;
  letter-spacing: 2px;
}

.dt-arena {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.dt-left-pane,
.dt-right-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(12, 15, 28, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dt-pane-title {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff3c4;
  margin-bottom: 8px;
  white-space: nowrap;
}

.dt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
  width: 100%;
  aspect-ratio: 3 / 5.4;
  margin-bottom: 8px;
  border-radius: 10px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.28);
}

.dt-grid.damaged {
  animation: cqStageHit 0.36s ease;
}

.dt-cell {
  position: relative;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.dt-cell.dt-player-row {
  background: rgba(124, 108, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

.dt-hazard {
  position: relative;
  width: 90%;
  height: 90%;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.dt-hazard img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dt-el-fire {
  border-color: #ff6b4a;
  box-shadow: 0 0 10px rgba(255, 107, 74, 0.7);
}

.dt-el-wind {
  border-color: #52f2b4;
  box-shadow: 0 0 10px rgba(82, 242, 180, 0.7);
}

.dt-el-earth {
  border-color: #e0a96d;
  box-shadow: 0 0 10px rgba(224, 169, 109, 0.7);
}

.dt-el-ice {
  border-color: #6ce5ff;
  box-shadow: 0 0 12px rgba(108, 229, 255, 0.85);
}

.dt-el-ice.charging {
  animation: dtIceBlink 0.22s ease-in-out infinite alternate;
}

@keyframes dtIceBlink {
  from { filter: brightness(1); transform: scale(0.92); }
  to { filter: brightness(1.8); transform: scale(1.06); }
}

.dt-wind-dir,
.dt-ice-warn {
  position: absolute;
  right: 2px;
  bottom: 1px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1.25;
}

.dt-ice-warn {
  background: #ff4d6d;
  color: #fff;
}

.dt-player {
  width: 92%;
  height: 92%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ffd166;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1e33;
}

.dt-player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dt-move-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.dt-move-btn {
  padding: 10px 4px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.dt-move-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: #fff;
}

.dt-move-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.28);
}

/* 右：後出しじゃんけん */
.dt-cpu-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 6px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.dt-cpu-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.dt-cpu-hand {
  font-size: clamp(2.8rem, 9vw, 3.8rem);
  line-height: 1;
}

.dt-rule-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.dt-rule-badge[data-tone="win"] {
  background: linear-gradient(135deg, #2ee59d, #1cc6c9);
  color: #0e2226;
}

.dt-rule-badge[data-tone="lose"] {
  background: linear-gradient(135deg, #ff5c7a, #e63956);
  color: #fff;
}

.dt-rule-badge[data-tone="draw"] {
  background: linear-gradient(135deg, #ffd166, #ff9f1c);
  color: #1f1426;
}

.dt-hand-btns {
  display: grid;
  gap: 7px;
}

.dt-hand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.14s ease;
}

.dt-hand-btn span {
  font-size: 1.4rem;
  line-height: 1;
}

.dt-hand-btn small {
  font-size: 0.88rem;
}

.dt-hand-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.dt-hand-btn:active {
  transform: scale(0.95);
}

.dt-hand-btn.correct {
  background: linear-gradient(135deg, #2ee59d, #1cc6c9);
  border-color: #fff;
}

.dt-hand-btn.wrong {
  background: linear-gradient(135deg, #ff4d6d, #c9184a);
  border-color: #fff;
}

/* GAME 07: 一筆書きパズル */
#os-hud-lives {
  color: #ff6b8b;
  letter-spacing: 2px;
}

.os-cell.os-goal {
  background: linear-gradient(135deg, rgba(46, 229, 157, 0.38), rgba(28, 198, 201, 0.42));
  border-color: #34e3a0;
  box-shadow: 0 0 14px rgba(52, 227, 160, 0.55);
  font-size: 1.45rem;
}

.os-cell.os-cp {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.36), rgba(255, 140, 66, 0.4));
  border-color: #ffd166;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.5);
  font-size: 1.45rem;
  color: #fff6db;
}

.os-cell.os-cp-done {
  border-color: #ffd166;
}

.os-board {
  gap: 8px;
  touch-action: none; /* スマホのスワイプなぞり中に画面スクロールしないよう防止 */
  user-select: none;
}

.os-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.34);
  background: rgba(18, 22, 42, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.os-cell.os-wall {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}

/* 通ったマスはうっすら透けて後ろのキャラが見える＆ピンク〜パープルに輝く！ */
.os-cell.os-visited {
  background: linear-gradient(135deg, rgba(255, 107, 169, 0.42), rgba(124, 108, 255, 0.45));
  border-color: rgba(255, 230, 170, 0.85);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.28);
}

.os-cell.os-start {
  border-color: #ffd166;
}

.os-cell.os-head {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.72), rgba(255, 107, 169, 0.72));
  border-color: #fff;
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.85);
  transform: scale(1.04);
}

.os-head-img {
  position: absolute;
  inset: 10%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  display: block;
  pointer-events: none;
}

.os-step-num {
  font-size: 1rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.os-cell.os-hint {
  border-color: #ffd166;
  background: rgba(255, 209, 102, 0.3);
  animation: dtIceBlink 0.35s ease-in-out infinite alternate;
  font-size: 1.25rem;
}

.os-footer-actions {
  gap: 8px;
  flex-wrap: wrap;
}

/* GAME 08: 美少女ブロック崩し（グラディウス式パワーアップ） */
.bb-power-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.bb-power-guide span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(14, 17, 32, 0.7);
  border: 1px solid rgba(255, 209, 102, 0.45);
  color: #fff3c4;
  font-size: 0.72rem;
  font-weight: 700;
}

.bb-play-card {
  padding: 14px 14px 12px;
}

#bb-hud-lives {
  color: #ff6b8b;
  letter-spacing: 2px;
}

.bb-canvas-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 10, 20, 0.2);
}

#bb-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 420 / 480;
  touch-action: none;
  cursor: default;
}

/* グラディウス式5段階パワーアップゲージ */
.bb-power-gauge {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.bb-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(14, 17, 32, 0.76);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bb-slot strong {
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.bb-slot small {
  font-size: 0.62rem;
}

.bb-slot.passed {
  border-color: rgba(76, 201, 240, 0.55);
  color: rgba(255, 255, 255, 0.85);
}

.bb-slot.selected {
  background: linear-gradient(135deg, #ffd166, #ff6ba9);
  border-color: #fff;
  color: #1b1224;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.85);
}

.bb-slot.maxed {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.36);
  cursor: not-allowed;
}

.bb-slot.selected-max {
  border-color: rgba(255, 209, 102, 0.65);
  color: rgba(255, 209, 102, 0.75);
}

.bb-power-trigger {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  background: rgba(14, 17, 32, 0.68);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: not-allowed;
  transition: transform 0.12s ease, filter 0.2s ease;
}

.bb-power-trigger.ready {
  background: linear-gradient(135deg, #ffd166, #ff6ba9);
  border-color: #fff;
  color: #1c1224;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 107, 169, 0.45);
  animation: dtIceBlink 0.45s ease-in-out infinite alternate;
}

.bb-power-trigger.ready:active {
  transform: scale(0.97);
}

/* ================= GAME 09: 美少女ドロップ合体パズル ================= */
.md-play-card {
  padding: 16px 14px 14px;
}

.md-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.md-shake-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.md-next-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 800;
}

.md-next-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  border: 1.5px solid #fff;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

.md-next-dot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.md-canvas-wrap {
  width: 100%;
  max-width: 380px;
  margin: 0 auto 10px;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 10, 20, 0.16);
}

#md-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 380 / 490;
  touch-action: none;
  cursor: pointer;
}

.md-evo-bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.md-evo-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 1px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(14, 17, 32, 0.55);
  opacity: 0.45;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.md-evo-chip span {
  font-size: 0.78rem;
  line-height: 1.1;
}

.md-evo-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  margin-bottom: 1px;
}

.md-evo-chip small {
  font-size: 0.58rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
}

.md-evo-chip.reached {
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.14);
}

.md-evo-chip.current-max {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.85);
}

.md-footer-actions {
  gap: 10px;
  flex-wrap: wrap;
}

/* ================= GAME 10: 美少女サバイバー（90秒無双アクション） ================= */
.sv-play-card {
  padding: 15px 14px 14px;
}

.sv-xp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sv-xp-track {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.sv-xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4cc9f0, #ffd166);
  transition: width 0.15s ease;
}

.sv-xp-text {
  font-size: 0.72rem;
  font-weight: 800;
  color: #e0f2fe;
  min-width: 78px;
  text-align: right;
}

.sv-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 8px;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 10, 20, 0.26);
}

#sv-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 420 / 480;
  touch-action: none;
  cursor: crosshair;
}

.sv-levelup-modal {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 22, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 10;
}

.sv-levelup-modal[hidden] {
  display: none;
}

.sv-levelup-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sv-levelup-head {
  text-align: center;
  font-size: 0.92rem;
  font-weight: 900;
  color: #ffd166;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.sv-levelup-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sv-upgrade-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 13px;
  border: 1.5px solid rgba(255, 209, 102, 0.6);
  background: linear-gradient(135deg, rgba(28, 34, 62, 0.94), rgba(48, 28, 68, 0.92));
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.sv-upgrade-card:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: #ffffff;
  box-shadow: 0 6px 20px rgba(255, 209, 102, 0.4);
}

.sv-up-key {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255, 209, 102, 0.22);
  border: 1px solid rgba(255, 209, 102, 0.7);
  color: #ffd166;
  font-size: 0.78rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sv-up-icon {
  font-size: 1.55rem;
  line-height: 1;
  flex-shrink: 0;
}

.sv-up-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sv-up-body strong {
  font-size: 0.9rem;
  color: #fff6d6;
}

.sv-up-body small {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.82);
}

/* フッター（将来のポータル・投げ銭導線用） */
.footer-bar {
  text-align: center;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.65);
  padding: 8px 0 2px;
  transition: opacity 0.45s ease;
}

/* 置き時計＆タイマー＆HIIT：10秒無操作スッキリ表示＆カスタム入力UI */
.gt-auto-hide {
  transition: opacity 0.45s ease, transform 0.45s ease;
}

body.gt-clean-mode .top-bar,
body.gt-clean-mode .footer-bar,
body.gt-clean-mode .gt-auto-hide {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.gt-clean-mode .gt-card {
  padding-bottom: 12px;
}

.gt-custom-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gt-custom-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(10, 14, 28, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.gt-custom-field input {
  width: 44px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 209, 102, 0.7);
  color: #fff4d2;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.gt-phase-label.hiit-work {
  color: #ff6ba9;
  text-shadow: 0 2px 12px rgba(255, 77, 109, 0.9);
}

.gt-phase-label.hiit-rest {
  color: #34e3a0;
  text-shadow: 0 2px 12px rgba(52, 227, 160, 0.85);
}

@media (max-width: 420px) {
  .glass-card {
    padding: 20px 16px;
  }
  .game-title {
    font-size: 1.65rem;
  }
  .board {
    gap: 8px;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .shop-promo-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .shop-promo-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  .portal-shop-showcase {
    padding: 12px 10px;
  }
  .portal-shop-grid {
    gap: 7px;
  }
  .portal-shop-item {
    padding: 5px;
    border-radius: 12px;
  }
  .portal-shop-item-title {
    font-size: 0.72rem;
  }
  .portal-shop-item-meta {
    font-size: 0.58rem;
  }
  .portal-shop-price {
    font-size: 0.82rem;
  }
  .portal-shop-badge {
    font-size: 0.58rem;
    padding: 2px 5px;
    right: 4px;
  }
}


/* ===== SNSシェアボタン（X / URLコピー） ===== */
.btn-share-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #171a26, #0d0f17);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.btn-share-x:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}

.btn-share-x:active {
  transform: translateY(0);
}

.portal-share-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.btn-share-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f3f5ff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s ease;
}

.btn-share-copy:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

@media (max-width: 520px) {
  .portal-share-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
