/* ========== 共通 ========== */
* { box-sizing: border-box; }

.hidden { display: none !important; }

/* デフォルト＝トップページの背景（top.png） */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #fff;

  display: flex;
  flex-direction: column;
  align-items: center;

  background-image: url("data/assets/stage/top.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

/* ゲーム中はJSで background-image を差し替えるので、ここは共通の見た目だけ */
body.stage-easy,
body.stage-normal,
body.stage-hard,
body.stage-kanji {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

.section-title {
  margin-top: 16px;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 0 0 4px #000;
}

/* ========== トップページ ========== */

.top-page {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.top-page-inner {
  max-width: 640px;
  width: 100%;
  padding: 24px 24px 32px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
  overflow: hidden;
}

.title {
  font-size: 32px;
  margin-bottom: 16px;
  text-shadow: 0 0 6px #000, 0 0 12px #000;
}

.top-page p {
  margin: 8px 0;
  font-size: 16px;
  text-shadow: 0 0 4px #000;
}

/* プレイヤー選択 */
.player-selection {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2×2固定 */
  gap: 16px;
  justify-items: center;
  margin: 16px 0 24px;
}

.player-selection img {
  width: 170px;
  height: 200px;
  padding: 10px;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center bottom;
  display: block;

  border-radius: 12px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  background: rgba(255,255,255,0.06);

  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.player-selection img:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

/* モード選択 */
.mode-selection {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 18px;
}

.mode-selection button {
  padding: 10px 20px;
  font-size: 15px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #6fd3ff, #3fa9f5);
  color: #003;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.mode-selection button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* 難易度選択 */
.difficulty-group {
  margin-top: 4px;
  padding-top: 4px;
}

.difficulty-selection {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.difficulty-selection button {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ffd86f, #ff9740);
  color: #333;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.difficulty-selection button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.error-message {
  margin-top: 12px;
  color: #ff7676;
  font-size: 14px;
}

/* ========== ゲーム画面 ========== */

.game-page {
  width: 100%;
  max-width: 960px;
  margin: 24px auto;
  padding: 16px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#back-to-title,
#return-title,
#retry-same {
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

#back-to-title:hover,
#return-title:hover,
#retry-same:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.status-info {
  font-size: 14px;
  text-shadow: 0 0 4px #000;
}

/* バトルフィールド */
.battle-field {
  position: relative;
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: flex-end;
}

.actor {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes spawnZoomIn {
  0%   { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1);    opacity: 1; }
}

@keyframes playerAttackRight {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(14px); }
  100% { transform: translateX(0); }
}

@keyframes monsterAttackLeft {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(-14px); }
  100% { transform: translateX(0); }
}

@keyframes hitShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* ===== バトル演出（移動・被弾）クラス ===== */
.game-page .actor img{
  will-change: transform;
}

.game-page .actor img.anim-spawn-zoom{
  animation: spawnZoomIn 260ms ease-out;
}

.game-page .actor img.anim-attack-right{
  animation: playerAttackRight 180ms ease-out;
}

.game-page .actor img.anim-attack-left{
  animation: monsterAttackLeft 180ms ease-out;
}

.game-page .actor img.anim-hit-shake{
  animation: hitShake 220ms ease-out;
}


/* 選択画面は触らず、ゲーム中だけキャラを大きく＆見切れ防止 */
.game-page .player-side img,
.game-page .monster-side img {
  width: 100%;
  max-width: 260px;   /* ←迫力（基本） */
  max-height: 40vh;   /* ←見切れ防止（重要） */
  height: auto;

  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  transition: opacity 0.25s ease;
}

/* 敵は少し大きめにして迫力 */
.game-page .monster-side img {
  max-width: 320px;
}

/* 敵が倒れたときの演出 */
.monster-dead {
  opacity: 0;
  transform: scale(0.6);
}

/* HPバー */
.hp-bar-wrapper {
  width: 100%;
  max-width: 220px;
  height: 14px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.7);
}

.hp-bar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5cff8d, #2bd1ff);
  transition: width 0.2s ease-out;
}

/* 問題と入力 */
.question-section {
  grid-column: 1 / -1;
  margin-top: 12px;
  padding: 12px 16px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  text-align: center;
}

.kana-hint {
  margin-top: 6px;
  font-size: 14px;
  font-weight: bold;
  color: #b8ffb8;
  text-shadow: 0 0 6px #000;
}

.enter-hint {
  margin-top: 10px;
  font-size: 14px; 
  opacity: 1; 
  color: #ffffff;
  text-shadow: 0 0 6px #000;
}

#question-text {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.6;
  min-height: 2.4em;
  text-shadow: 0 0 4px #000;
}

/* ルビ（1行表示・上側） */
#question-text ruby.q-ruby { ruby-position: over; font-size: 1em; }
#question-text ruby.q-ruby rt { font-size: 0.55em; color: #ffeb85; }

#answer-input {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 18px;
  text-align: left;
  overflow-x: auto;
  white-space: nowrap;
}

/* 攻撃エフェクト */
.hit-effect {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 120px;
  height: auto;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.hit-effect.show {
  opacity: 1;
  transform: translate(-50%, -10%);
}

/* 敵撃破メッセージ */
.defeat-message {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  font-weight: bold;
  color: #ffea55;
  text-shadow: 0 0 6px #000, 0 0 12px #000;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.defeat-message.show {
  opacity: 1;
  transform: translate(-50%, -10%);
}

/* 結果オーバーレイ */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.result-inner {
  max-width: 480px;
  width: 90%;
  padding: 24px 24px 20px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.8);
  text-align: center;
}

.result-inner h1 {
  margin: 0 0 16px;
  font-size: 28px;
  text-shadow: 0 0 6px #000, 0 0 12px #000;
}

.result-stats p { margin: 4px 0; font-size: 16px; }

.result-buttons {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* スマホ用 */
@media (max-width: 768px) {
  .top-page-inner { padding: 20px 16px 24px; }
  .title { font-size: 26px; }
  .player-selection img { width: 140px; }
  .battle-field { grid-template-columns: 1fr; }
  .question-section { margin-top: 16px; }
  #question-text { font-size: 20px; }
  #answer-input { font-size: 16px; }
}
.bg-layer{
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: opacity 700ms ease;
  will-change: opacity;
}

.bg-layer.is-active{
  opacity: 1;
}

/* ===== コンボ演出（表示のみ） ===== */
.combo-popup{
  position: absolute;
  left: 50%;
  top: 8%;
  transform: translateX(-50%);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 0 8px #000, 0 0 16px #000;
  opacity: 0;
  pointer-events: none;
}

.combo-popup.show{
  animation: comboPop 650ms ease-out;
}

@keyframes comboPop{
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(0.9); }
  20%  { opacity: 1; transform: translate(-50%, 0px) scale(1.05); }
  70%  { opacity: 1; transform: translate(-50%, -6px) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -16px) scale(0.98); }
}

/* ===== Perfect演出（表示のみ） ===== */
.perfect-popup{
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 1px;

  /* PERFECT専用カラー */
  color: #00e5ff;
  text-shadow:
    0 0 4px rgba(0, 229, 255, 0.6),
    0 0 10px rgba(0, 170, 255, 0.5);

  opacity: 0;
  pointer-events: none;
}

.perfect-popup.show{
  animation: perfectPop 900ms ease-out;
}

@keyframes perfectPop{
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(0.95); }
  15%  { opacity: 1; transform: translate(-50%, 0px) scale(1.05); }
  70%  { opacity: 1; transform: translate(-50%, -6px) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -18px) scale(0.98); }
}

#result-comment{
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.95;
}

/* ===== ランク色分け ===== */
#result-rank.rank-S { color: #ffd86f; text-shadow: 0 0 10px rgba(255, 216, 111, 0.6), 0 0 18px rgba(255, 216, 111, 0.35); }
#result-rank.rank-A { color: #6fd3ff; text-shadow: 0 0 10px rgba(111, 211, 255, 0.55); }
#result-rank.rank-B { color: #5cff8d; text-shadow: 0 0 10px rgba(92, 255, 141, 0.55); }
#result-rank.rank-C { color: #ffffff; opacity: 0.9; }

/* ===== Sランク特別演出 ===== */
.result-inner.rank-S{
  animation: rankSGlow 900ms ease-out;
  box-shadow: 0 0 0 rgba(0,0,0,0.8), 0 0 28px rgba(255, 216, 111, 0.35);
}

@keyframes rankSGlow{
  0%   { transform: scale(0.98); box-shadow: 0 0 0 rgba(0,0,0,0.8), 0 0 0 rgba(255, 216, 111, 0.0); }
  35%  { transform: scale(1.02); box-shadow: 0 0 0 rgba(0,0,0,0.8), 0 0 34px rgba(255, 216, 111, 0.55); }
  100% { transform: scale(1.00); box-shadow: 0 0 0 rgba(0,0,0,0.8), 0 0 22px rgba(255, 216, 111, 0.35); }
}

/* ===== 紙吹雪（Sランクのみ） ===== */
.confetti-layer{
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.confetti{
  position: absolute;
  top: -10vh;
  width: 10px;
  height: 14px;
  opacity: 0.95;
  animation: confettiFall 1100ms linear forwards, confettiSpin 600ms linear infinite;
}

@keyframes confettiFall{
  to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); }
}

@keyframes confettiSpin{
  to { rotate: 360deg; }
}

/* ===== 章クリア演出 ===== */
.chapter-clear-overlay{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 9998;
}

.chapter-clear-inner{
  text-align: center;
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
  animation: chapterClearPop 1200ms ease-out forwards;
}

.chapter-clear-title{
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffd86f;
  text-shadow: 0 0 12px rgba(255,216,111,0.55);
}

.chapter-clear-sub{
  margin-top: 6px;
  font-size: 18px;
  opacity: 0.95;
}

@keyframes chapterClearPop{
  0%   { transform: scale(0.92); opacity: 0; }
  15%  { transform: scale(1.02); opacity: 1; }
  70%  { transform: scale(1.00); opacity: 1; }
  100% { transform: scale(0.98); opacity: 0; }
}

/* ===== 必殺技ゲージ ===== */
.skill-ui{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}

.skill-label{
  font-weight: 800;
  opacity: 0.95;
}

.skill-gauge{
  width: 140px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

.skill-gauge-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: #00e5ff;
  box-shadow: 0 0 10px rgba(0,229,255,0.35);
  transition: width 160ms ease-out;
}

.skill-btn{
  padding: 6px 10px;
  border-radius: 10px;
  border: none;
  font-weight: 800;
  cursor: pointer;
  opacity: 0.95;
}

.skill-btn:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== 宝箱・ごほうび演出 ===== */
.treasure-overlay{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 9997; /* 章クリアより一段下でOK */
}

.treasure-inner{
  text-align: center;
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
  animation: treasurePop 1000ms ease-out forwards;
}

.treasure-chest{
  font-size: 56px;
  filter: drop-shadow(0 0 12px rgba(255,216,111,0.35));
}

.treasure-text{
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
}

@keyframes treasurePop{
  0%   { transform: scale(0.90); opacity: 0; }
  18%  { transform: scale(1.05); opacity: 1; }
  75%  { transform: scale(1.00); opacity: 1; }
  100% { transform: scale(0.98); opacity: 0; }
}

.sound-toggle {
  margin-left: 8px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
}
/* 隠しキャラ（未解放） */
.player-selection img.locked{
  filter: grayscale(1) brightness(0.2);
  opacity: 0.8;
  pointer-events: auto;
  position: relative;
}

.player-selection img.locked::after{
  content: "???";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: 800;
  font-size: 18px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
}
.new-popup{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.new-popup.hidden{ display: none; }

.new-popup-inner{
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 18px 22px;
  border-radius: 14px;
  text-align: center;
  min-width: 260px;
  animation: newPopIn 240ms ease-out;
}

.new-badge{
  display: inline-block;
  font-weight: 900;
  font-size: 18px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #ff2d55;
  margin-bottom: 10px;
}

.new-popup-text{
  font-size: 15px;
  line-height: 1.5;
}

@keyframes newPopIn{
  from{ transform: translateY(10px) scale(0.98); opacity: 0; }
  to{ transform: translateY(0) scale(1); opacity: 1; }
}

/* ================= フッター（共通リンク・バナー） ================= */

.link-section{
  width: min(980px, calc(100% - 24px));
  margin: 18px auto 10px;
  padding: 0;
}
.link-section p{
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 14px 40px rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
  text-align: center;
}

footer{
  width: min(980px, calc(100% - 24px));
  margin: 0 auto 22px;
  padding: 18px 18px 20px;
  border-radius: 18px;

  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 50px rgba(0,0,0,0.60);

  color: rgba(255,255,255,0.92);
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

footer a,
.link-section a{
  color: #8bd7ff;
  font-weight: 400;
  text-decoration: underline;
}
footer a:visited,
.link-section a:visited{
  color: #8bd7ff;
}

footer p{
  margin: 8px 0;
  line-height: 1.9;
  font-size: 14px;
}

.footer-banners{
  gap: 40px;
  margin: 10px auto 12px;
}
.footer-banners img{
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.65));
}

@media (max-width: 600px){
  footer, .link-section{ width: calc(100% - 16px); }
  footer p{ font-size: 13px; }
}

/* ===== フッター内リンク色を完全固定 ===== */

footer a:link,
footer a:visited,
footer a:hover,
footer a:active,
.link-section a:link,
.link-section a:visited,
.link-section a:hover,
.link-section a:active{
  color: #9fe3ff;
  font-weight: 800;
  text-decoration: underline;
}

/* hoverだけ少し強調 */
footer a:hover,
.link-section a:hover{
  color: #ffffff;
  text-shadow: 0 0 6px rgba(159,227,255,0.8);
}

.footer-banners a{
  text-decoration: none;
}

.footer-banners a img{
  display: block;
}

.footer-banners{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;

  font-size: 0;
  line-height: 0;
}

.footer-banners a{
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
}

.footer-banners img{
  display: block;
}

.sound-credit {
  font-size: 12px;
  color: #aaa;
  margin: 6px 0;
}
.sound-credit a {
  color: #aaa;
  text-decoration: underline;
}
/* =========================================
   タイプクエスト用ヘッダー（崩れにくい修正版）
   ※ body / bg-layer は触らない
========================================= */
:root{
  --tq-header-h: 64px;
}

/* ヘッダー本体：stickyで自然に上部固定 */
.site-header.tq-header{
  position: sticky;
  top: 0;
  z-index: 3000;

  width: 100%;
  min-height: var(--tq-header-h);

  background: rgba(8, 18, 34, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border-bottom: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* body が flex + align-items:center のため、内側を幅固定 */
.tq-header-inner{
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 10px 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tq-logo{
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-shadow: 0 0 6px rgba(0,0,0,0.45);
  white-space: nowrap;
  flex: 0 0 auto;
}

.tq-logo:hover{ opacity: .9; }

.tq-nav{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.tq-nav a{
  color: #f3f7ff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  text-shadow: 0 0 6px rgba(0,0,0,0.4);
  transition: background .2s ease, transform .15s ease;
}

.tq-nav a:hover{
  background: rgba(255,255,255,0.10);
  transform: translateY(-1px);
}

.tq-nav a.is-current{
  background: linear-gradient(135deg, rgba(111,211,255,.28), rgba(63,169,245,.28));
  box-shadow: inset 0 0 0 1px rgba(111,211,255,.35);
}

/* トップ画面の高さ調整（stickyヘッダー分だけ引く） */
.top-page{
  min-height: calc(100vh - var(--tq-header-h));
  height: auto; /* 元の100vh固定で詰まるのを防ぐ */
}

/* ゲーム画面の上が少し詰まる場合だけ */
.game-page{
  margin-top: 12px;
}

/* ヘッダーがあるとき、トップ画面の中身が少し下に寄りすぎる場合は微調整 */
.top-page-inner{
  margin-top: 0;
}

/* スマホ */
@media (max-width: 900px){
  :root{ --tq-header-h: 58px; }

  .tq-header-inner{
    padding: 8px 12px;
    gap: 8px;
  }

  .tq-logo{
    font-size: 14px;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tq-nav{
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .tq-nav a{
    font-size: 12px;
    padding: 7px 10px;
    white-space: nowrap;
  }
}
