@charset "UTF-8";

@import url('https://fonts.googleapis.com/css2?family=Darumadrop+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@100;300;400;500;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@300;400;500;700;900&display=swap');

:root {
  --w: 960px;
  /* Colors */
  --color-primary: rgba(76, 175, 80);
  --color-primary-border: rgba(76, 175, 80, 0.6);
  --color-danger: rgba(244, 63, 94, 0.18);
  --color-danger-border: rgba(244, 63, 94, 0.35);
  --color-info: rgba(99, 102, 241, 0.25);
  --color-info-border: rgba(99, 102, 241, 0.45);
  --color-gold: rgba(255, 193, 7, 0.3);
  --color-gold-border: rgba(255, 193, 7, 0.5);
  --color-warning: #ffeb3b;
  --color-error: #fb7185;
  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 30px;
}

body {
  margin: 0;
  letter-spacing: 0.1em;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #111;
  color: #eee;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.wrap {
  background-image: url(/file/cooperation/kodomo_portal/image/map_outer_frame.png);
  min-width: 100vw;
  max-height: 100dvh;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  position: relative;
}

/* ====== 手描きマップ全体（背景にUI込み） ====== */
.map {
  position: relative;
  width: unset;
  max-width: 80dvw;
  height: 100dvh;
  max-height: 100vh;
  aspect-ratio: 1536 / 1024; /* ← 画像と合わせる */
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background-image: url('/file/cooperation/kodomo_portal/image/map_island.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  margin: 0 auto;
  box-sizing: border-box;
}

.map-goal {
  position: absolute;
  right: 12%;
  top: 47%;
  transform: translateY(-50%);
  max-width: 12vw;
}

.map-goal img {
  width: 100%;
  height: auto;
  display: block;
}

.map-houijishaku {
  position: absolute;
  right: 2%;
  top: 8%;
  max-width: 15vw;
  max-height: 30vh;
}

.map-houijishaku img {
  width: 60%;
  height: auto;
  display: block;
}

.map .map_title {
  background-image: url(/file/cooperation/kodomo_portal/image/map_title.png);
  width: 40vw;
  height: 9vh;
  background-repeat: no-repeat;
  margin: 16px auto;
  background-size: contain;
  text-align: center;
  background-position: center center;
  padding: 4vh 0 0;
}

/* 道（クリーム色の線） */
svg.paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.path {
  fill: none;
  stroke: rgba(140, 85, 50, 0.92);
  stroke-width: 6px;
  stroke-linecap: round;
  stroke-dasharray: 6 13;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  opacity: 0.95;
}
.path.locked {
  stroke: rgba(120, 120, 120, 1);
}

/* ステージ画像レイヤー */
#stage-images-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* ノードラベルコンテナ（最前面） */
#node-labels-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}
.stage-image {
  position: absolute;
  pointer-events: none;
  opacity: 0.9;
}
.stage-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ステージタイトル画像 */
.stage-title {
  position: absolute;
  pointer-events: none;
  opacity: 0.9;
  height: auto;
  aspect-ratio: auto;
}
.stage-title img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ステージタイトルテキスト */
.stage-title-text {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  font-size: 1.3vw;
  color: #5a351e;
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}
.stage-title.cleared .stage-title-text::after {
  content: '';
  position: absolute;
  top: 0;
  right: -2vw;
  width: 2vw;
  height: 2vw;
  background: url('/file/cooperation/kodomo_portal/image/clear.png') no-repeat center;
  background-size: contain;
  pointer-events: none;
}

/* ノード（木札っぽい四角） */
#nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: auto;
}
.node-wrapper {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
}
.node {
  position: relative;
  width: 32px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0;
  background: #ca151d;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.95);
  opacity: 0.98;
  outline: 3px solid #ca151d;
  outline-offset: 0px;
}
.node-label {
  position: absolute;
  white-space: nowrap;
  font-weight: bold;
  font-size: 1.3vw;
  color: #5a351e;
  /* -webkit-text-stroke-width: 1px; */
  /* -webkit-text-stroke-color: #ffffff; */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 6;
  transform: translate(-50%, -100%);
  margin-top: -6px;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}
.node-label .circled {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 1.35em;
  height: 1.35em;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #ca151d;
  margin-top: -0.1em;
  margin-right: 0.25em;
  vertical-align: middle;
  line-height: 1;
  text-shadow: none;
}
.node-label .circled .num {
  color: #ffffff;
  font-weight: 700;
}
.node.locked {
  background: rgba(120, 120, 120, 1);
  border-color: rgba(80, 80, 80, 1);
  opacity: 1;
  outline: none;
}
.node.castle {
  background: rgba(232, 88, 62, 0.95);
  border-color: rgba(168, 52, 34, 0.8);
}

/* カーソル（小さめ・かわいい） */
.cursor {
  position: absolute;
  transform: translate(-50%, -50%);
  height: 140px;
  aspect-ratio: 3 / 4;
  z-index: 6;
  pointer-events: none;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.4));
}
.cursor .bubble {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  transition: transform 260ms ease, opacity 260ms ease;
  overflow: hidden;
  position: relative;
}
.cursor .bubble img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.bubble-equipped-items {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  border-radius: 12px;
  overflow: hidden;
}
.bubble-equipped-items img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.cursor.entering .bubble {
  transform: scale(0.7);
  opacity: 0.1;
}
.cursor.exiting .bubble {
  transform: scale(1.1);
  opacity: 1;
}

@keyframes bob {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}
.cursor.walking .bubble {
  animation: bob 240ms ease-in-out infinite;
}
/* 左下：アバター表示枠 */
.avatar-box {
  position: absolute;
  left: 0;
  bottom: 1vh;
  width: 21vw;
  height: 33vh;
  min-height: 22vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 20;
  overflow: hidden;
}

.avatar-frame {
  position: absolute;
  /* top: 0; */
  /* left: 0; */
  width: 20vw;
  height: 100%;
  object-fit: contain;
}

.avatar-title {
  position: relative;
  z-index: 1;
  width: 65%;
  object-fit: contain;
}

.avatar-title-container {
  position: relative;
  width: 20vw;
  display: flex;
  align-items: center;
  justify-content: center;
  /* margin-top: -2em; */
}

.avatar-title-text {
  position: absolute;
  z-index: 2;
  color: #5a351e;
  font-weight: bold;
  font-size: 1.25em;
  padding-bottom: 0em;
  /* text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); */
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}
#avatar-box-modal .avatar-title-text {
  /* position: absolute; */
  /* z-index: 2; */
  /* color: #5a351e; */
  /* font-weight: 900; */
  font-size: 2em;
  padding-bottom: 0.5em;
  /* text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); */
  /* text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff; */
}
@keyframes flipAndWalk {
  0% {
    transform: translate(-50%, -50%) scaleX(1) translateY(0);
  }
  25% {
    transform: translate(-50%, -50%) scaleX(1) translateY(-12px);
  }
  50% {
    transform: translate(-50%, -50%) scaleX(-1) translateY(0);
  }
  75% {
    transform: translate(-50%, -50%) scaleX(-1) translateY(-12px);
  }
  100% {
    transform: translate(-50%, -50%) scaleX(1) translateY(0);
  }
}

@keyframes slideUpCompanion {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 100px)) scaleX(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1);
  }
}

.avatar-img-container {
  position: relative;
  z-index: 1;
  width: 11vw;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.equipped-items {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.equipped-items img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 下部：5つのコントロールボタン */
.bottom-controls {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 0px;
  z-index: 20;
  align-items: flex-end;
}

.bottom-controls-column {
  display: flex;
  flex-direction: row;
  gap: 0px;
  width: 20vh;
}

.control-btn {
  width: 20vw;
  height: 9vh;
  /* border-radius: 8px; */
  border: none;
  background: url(/file/cooperation/kodomo_portal/image/map_button.png) center / contain no-repeat;
  background-size: 19vw 8vh;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.1s ease;
  /* backdrop-filter: blur(6px); */
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.control-btn#btn-record {
  letter-spacing: 0.3em;
}
.control-btn#btn-treasure {
  letter-spacing: 0.2em;
}

.control-btn .icon {
  width: 4vw;
  /* height: 2.2vw; */
  display: block;
  line-height: 1;
}

.control-btn .label {
  font-size: 1.5vw;
  width: 9em;
  color: #ffffff;
  font-weight: bold;
  line-height: 1;
  text-align: center;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
}

.control-btn.btn-settings-only {
  width: 7em;
  gap: 0;
  background: none;
  background: url(/file/cooperation/kodomo_portal/image/map_button_option.png) center / contain no-repeat;
  background-size: 8vh;
}

.control-btn.btn-howto {
  width: 7em;
  gap: 0;
  background: url(/file/cooperation/kodomo_portal/image/map_button_howto.png) center / contain no-repeat;
  background-size: 9vh;
}

.control-btn.btn-settings-only .icon {
  font-size: 20px;
  width: 7em;
}

.control-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ===== Typing modal（ゲーム画面は全画面表示） ===== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: stretch;
  justify-items: stretch;
  background-image: url(/file/cooperation/kodomo_portal/image/map_outer_frame.png);
  padding: 0;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 9999;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.modal.open {
  display: grid;
  opacity: 1;
}

/* タイトル画面：背景に地図を半透明表示 */
#titleModal {
  background: rgba(0, 0, 0, 0.4);
}
#titleModal.open {
  background: rgba(0, 0, 0, 0.4);
}
body:has(.modal.open) .wrap {
  display: none;
}

/* お宝詳細モーダルは最前面に表示 */
#treasureDetailModal {
  z-index: 10001;
}
#treasureDetailModal.open {
  display: grid;
  opacity: 1;
}

/* あそびかたメニューモーダルは最前面に表示 */
#howToPlayMenuModal {
  z-index: 10001;
}
#howToPlayMenuModal.open {
  display: grid;
  opacity: 1;
}

/* ボタン説明モーダルは最前面に表示 */
#buttonExplanationModal {
  z-index: 10001;
}
#buttonExplanationModal.open {
  display: grid;
  opacity: 1;
}

/* あそびかたモーダルは最前面に表示 */
#howToPlayModal {
  z-index: 10001;
}
#howToPlayModal.open {
  display: grid;
  opacity: 1;
}

.transition {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
  z-index: 9998;
}
.transition.on {
  opacity: 1;
  pointer-events: auto;
}

/* ====== レースUI（あなたの既存CSSをそのまま入れてOK） ====== */
/* ※ 長いので、ここでは省略せず最小限にしてます。
     既存の .raceStage 以下のCSSは “そのまま” コピペしてください。 */

.raceStage {
  --bg: #0b1220;
  --card: #111a2e;
  --text: #8b4513;
  --muted: #a0522d;
  --good: #4ade80;
  --bad: #fb7185;
  box-sizing: border-box;
  width: 100%;
  /* min-height: 141%; */
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* background: rgba(11, 18, 32, 0.96); */
  background-size: cover;
  background-position: center;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--text);
  padding: 0;
  margin: 0;
  position: relative;
}
#howToPlayModal .raceStage,
#buttonExplanationModal .raceStage{
max-width: 80dvw;
margin: 0px auto;
height: 80vh;
}

.raceStage * {
  box-sizing: border-box;
  font-family: 'M PLUS Rounded 1c', sans-serif;
}
.raceStage .topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  /* background: rgba(0, 0, 0, 0.2); */
  height: 4vh;
}

#modal .raceStage .topbar,
#treasureModal .raceStage .topbar,
#treasureDetailModal .raceStage .topbar,
#scoreHistoryModal .raceStage .topbar,
#settingsModal .raceStage .topbar,
#howToPlayMenuModal .raceStage .topbar,
#howToPlayModal .raceStage .topbar,
#buttonExplanationModal .raceStage .topbar {
  display: none;
}
.raceStage .raceTitle {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}
.raceStage .statusPill {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.raceStage .timeDisplay {
  position: absolute;
  top: 12px;
  right: 9em;
  font-size: 1.8em;
  font-weight: 700;
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  background: url('/file/cooperation/kodomo_portal/image/typing_bg_time_medal.png') no-repeat center/cover;
  background-size: 100% 100%;
  min-width: 50px;
  width: 8em;
  text-align: center;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
}

.raceStage .timeDisplay img {
  width: 1.5em;
  height: 1.5em;
  margin-left: -1em;
  /* object-fit: cover; */
}

.raceStage .medalDisplay {
  position: absolute;
  top: 12px;
  right: 2em;
  font-size: 1.8em;
  font-weight: 700;
  color: #fff;
  padding: 4px 12px;
  /* border-radius: 12px; */
  background: url('/file/cooperation/kodomo_portal/image/typing_bg_time_medal.png') no-repeat center/cover;
  background-size: 100% 100%;
  min-width: 60px;
  width: 6em;
  text-align: center;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 6px;
  /* margin-left: 5%; */
  /* font-size: 0em; */
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
}

.raceStage .medalDisplay img {
  /* width: 18px; */
  /* height: 18px; */
  /* object-fit: contain; */
  width: 1.5em;
  height: 1.5em;
  margin-left: -1em;
}

.raceStage .grid {
  flex: 1;
  overflow: auto;
  width: 100%;
  height: 54vh;
}
.raceStage .grid {
  overflow: hidden;
}
@media (max-width: 860px) {
  .raceStage .grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .raceStage {
    padding: 12px;
  }
}
@media (max-height: 600px) {
  .raceStage {
    background: none;
  }
}

/* 新しいレイアウト：中央寄せのメインコンテンツ */
.raceStage .card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin: 1em auto 0;
}

#modal .raceStage .card {
  background-image: url('/file/cooperation/kodomo_portal/image/typing_frame.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
#itemsModal .raceStage .card {
  margin: 0 auto;
}
#treasureModal .raceStage .card {
  height: initial;
}
#treasureDetailModal .raceStage .card {
  margin: 0 auto;
}
.raceStage .card h2 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: none;
}
.raceStage .card .body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: auto;
  /* padding: 16px; */
  justify-content: center;
  align-items: center;
  /* margin-top: 2em; */
}
#treasureDetailModal .raceStage .card .body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

.raceStage .mainContent {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  margin-top: 0em;
}
.raceStage .row {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.raceStage button {
  background: rgba(255, 255, 255, 0.08);
  /* color: #ffffff; */
  /* border: 1px solid rgba(255, 255, 255, 0.5); */
  /* padding: 12px 16px; */
  /* border-radius: 12px; */
  cursor: pointer;
  /* transition: 0.12s transform, 0.12s background; */
  font-weight: 700;
  /* min-height: 44px; */
  font-size: 1em;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.raceStage button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}
.raceStage button:active {
  transform: translateY(0px);
  opacity: 0.85;
}
.raceStage button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}
.raceStage button.primary {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.45);
}
.raceStage button.danger {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.35);
}
.raceStage .small {
  font-size: 12px;
  color: var(--muted);
}
.raceStage .bottomHud {
  display: none;
}
.raceStage .track {
  position: relative;
  width: 100%;
  height: 65%;
  border-radius: 0;
  background: transparent;
  border: none;
  overflow: hidden;
  margin-top: auto;
}

.raceStage .lanes {
  position: absolute;
  inset: 0;
  width: 200%;
  height: 100%;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0 20px, rgba(255, 255, 255, 0.06) 20px 21px, rgba(255, 255, 255, 0) 21px 40px);
  opacity: 0.9;
}
.raceStage .finish {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 100%;
  background: repeating-linear-gradient(90deg, #fff 0 10px, #000 10px 20px);
  opacity: 0.45;
  z-index: 5;
  display: none;
}
.raceStage .runner-container {
  position: absolute;
  left: 50%;
  bottom: -18%;
  transform: translate(-50%, -50%);
  width: 15vw;
  max-width: 300px;
  /* max-height: 50%; */
  /* height: 17em; */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: flipAndWalk 3s ease-in-out infinite;
}

.raceStage .runner-container.paused {
  animation-play-state: paused;
}

.raceStage .runner-companions {
  position: absolute;
  left: 50%;
  bottom: -18%;
  transform: translateX(-50%);
  width: 100%;
  height: 400px;
  display: flex;
  gap: 0;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 9;
}

.raceStage .runner-companion {
  position: absolute;
  bottom: 0;
  width: 15vw;
  max-width: 300px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
  transform: translate(-50%, -50%);
}

.raceStage .runner-companion.visible {
  animation: slideUpCompanion 0.6s ease-out forwards;
}

.raceStage .runner-companion.animating:not(.paused) {
  animation: flipAndWalk 3s ease-in-out infinite;
}

.raceStage .runner-companion.animating.paused {
  animation: flipAndWalk 3s ease-in-out infinite;
  animation-play-state: paused;
}

.raceStage .runner-companion img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5));
  user-select: none;
}
.raceStage .runner {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* border-radius: 50%; */
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5));
  user-select: none;
}
.raceStage .runner-equipped-items {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 11;
}
.raceStage .runner-equipped-items img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  pointer-events: none;
}
.raceStage .hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
  order: 10;
}
.raceStage .hud .kpi {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.15);
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 500px) {
  .raceStage .hud {
    grid-template-columns: 1fr 1fr;
  }
}
.raceStage .kpi .label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.raceStage .kpi .value {
  font-size: 18px;
  font-weight: 800;
  margin-top: 4px;
}
.raceStage .problem {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 14px;
  border-radius: 0;
  border: none;
  background: transparent;
  text-align: center;
  /* width: 70%; */
  /* transform: scale(0.75, 1); */
  max-width: 100%;
  box-sizing: border-box;
}
.raceStage .kana {
  font-size: 3.5dvh;
  line-height: 1.5em;
  font-weight: bold;
  letter-spacing: 0.02em;
}
.raceStage .hint {
  margin-top: 6px;
  font-size: 2.5dvh;
  color: var(--muted);
  line-height: 1em;
  order: -1;
  font-weight: bold;
}
.raceStage .romajiLine {
  margin-top: 0.4em;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 3dvh;
  transform: scale(0.85, 1);
}
.raceStage .typed {
  color: var(--good);
  font-weight: 900;
}
.raceStage .rest {
  color: rgba(232, 238, 252, 0.75);
}
.raceStage .rest.stage-clear {
  color: rgba(232, 238, 252, 0.75);
  font-weight: bold;
  color: #5a351e;
  font-weight: bold;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}
.raceStage .shake {
  animation: shake 0.14s linear 1;
}
@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-4px);
  }
  100% {
    transform: translateX(0);
  }
}

/* カウントダウンアニメーション */
@keyframes countdownScale {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}
.countdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  font-weight: 900;
  color: #fff;
  text-shadow: -2px -2px 0 rgba(0, 0, 0, 0.8), 2px -2px 0 rgba(0, 0, 0, 0.8), -2px 2px 0 rgba(0, 0, 0, 0.8), 2px 2px 0 rgba(0, 0, 0, 0.8),
    -3px 0 0 rgba(0, 0, 0, 0.8), 3px 0 0 rgba(0, 0, 0, 0.8), 0 -3px 0 rgba(0, 0, 0, 0.8), 0 3px 0 rgba(0, 0, 0, 0.8);
  z-index: 10000;
  animation: countdownScale 1s ease-out forwards;
  user-select: none;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  white-space: nowrap;
}
.raceStage .sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 12px 0;
}
.raceStage .rankList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.raceStage .rankItem {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
  align-items: center;
  min-height: 52px;
}
.raceStage .rankItem .left {
  display: flex;
  gap: 10px;
  align-items: center;
}
.raceStage .badge {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

/* かな表モーダル（レース内） */
.raceStage .modalBack {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 10001;
}
.raceStage .modal2 {
  max-width: 860px;
  width: 100%;
  max-height: 82vh;
  overflow: auto;
  background: rgba(17, 26, 46, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
}
.raceStage .modal2 header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.raceStage .modal2 header .mTitle {
  font-weight: 900;
}
.raceStage .modal2 .mBody {
  padding: 14px;
}
.raceStage .table {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
@media (max-width: 860px) {
  .raceStage .table {
    grid-template-columns: repeat(3, 1fr);
  }
}
.raceStage .cell {
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.16);
}
.raceStage .cell b {
  display: block;
}
.raceStage .foot {
  display: none;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* タブレット用隠しinput */
#imeInput {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  height: 1px;
  width: 1px;
  left: -9999px;
  bottom: 0;
}
/* ===== レスポンシブ対応 ===== */

/* 横幅が946px未満のときはゲームをプレイできないようにする */
@media (max-width: 945px) {
  .wrap {
    display: none !important;
  }

  .modal {
    display: none !important;
  }

  body::after {
    content: 'PCまたはタブレットで参加してください';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  text-align: center;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.5;

  z-index: 9999;
  }
}

/* 横幅が946px以上1023px以下のときはタブレットを横にするメッセージを表示 */
@media (min-width: 946px) and (max-width: 1023px) {
  .wrap {
    display: none !important;
  }

  .modal {
    display: none !important;
  }

  body::after {
  content: 'タブレットを横向きにしてください';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  text-align: center;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.5;

  z-index: 9999;
  }
}
@media screen and (orientation: portrait) {
  .wrap {
    display: none !important;
  }

  .modal {
    display: none !important;
  }

  body::after {
  content: 'タブレットを横向きにしてください';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  text-align: center;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.5;

  z-index: 9999;
  }
}
@media screen and (max-width: 945px) and (orientation: portrait) {
  .wrap {
    display: none !important;
  }

  .modal {
    display: none !important;
  }

  body::after {
  content: 'PCまたはタブレットで参加してください';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  text-align: center;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.5;

  z-index: 9999;
  }
}

/* ====== Utility Classes ====== */
#settingsModal .btn-primary,
#howToPlayMenuModal .btn-primary {
  background: var(--color-primary);
  border: 2px solid var(--color-primary-border);
  color: #fff;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-weight: 700;
  font-size: 1.25em;
  width: 14em;
}

.btn-danger {
  background: var(--color-danger);
  border: 2px solid var(--color-danger-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: #fff;
  padding: var(--space-lg);
  font-weight: 700;
}

.btn-info {
  background: var(--color-info);
  border: 2px solid var(--color-info-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: #fff;
  padding: var(--space-lg);
  font-weight: 700;
}

.modal-header {
  font-size: 22px;
  margin-bottom: var(--space-xl);
  color: var(--color-error);
  text-align: center;
}

.modal-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-3xl);
  text-align: center;
}

.modal-button-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

.error-message {
  font-size: 14px;
  color: var(--color-error);
  margin-bottom: var(--space-md);
  min-height: 20px;
  font-weight: 600;
}

.char-counter {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-2xl);
}

/* アバターモーダルのタブ */
.avatar-tab {
  transition: all 0.2s ease;
}

/* ===== アイテムモーダルの左右レイアウト ===== */
.items-modal-container {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 0;
}

.items-modal-left {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: url('/file/cooperation/kodomo_portal/image/items_bg_left.png') center / contain no-repeat;
  background-size: 100% 87vh;
  padding: 20px;
}

.items-modal-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: url('/file/cooperation/kodomo_portal/image/items_bg_right.png') center / contain no-repeat;
  background-size: 100% 90vh;
}

.items-modal-right .raceStage {
  background: transparent;
  width: 83%;
  height: 80vh;
  justify-content: center;
}

.avatar-box-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 90%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  margin: 10% 0 0;
}

.avatar-box-modal .avatar-frame {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}

.avatar-box-modal .avatar-title-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  margin-top: 3%;
  position: absolute;
  top: 0;
}

.avatar-box-modal .avatar-img-container {
  width: 18vw;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
}

.avatar-box-modal .avatar-img-container .equipped-items {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.avatar-box-modal .equipped-items {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
}

/* ===== モーダルボタンのスタイル ===== */
.modal-btn-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 10px;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}

.modal-bottom-controls {
  padding: unset;
  display: flex;
  position: fixed;
  bottom: 0;
  justify-content: flex-start;
  width: 100%;
  height: 20dvh;
}
#itemsModal .modal-bottom-controls {
  position: relative;
  /* height: 10vh; */
}
#itemsModal .items-modal-left .modal-bottom-controls {
  /* position: relative; */
  /* height: 20vh; */
  position: absolute;
}
#itemsModal .items-modal-right .modal-bottom-controls {
  height: 5em;
}
#howToPlayModal .modal-bottom-controls {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: flex-end;
  height: calc(20dvh - 32px);
}

#buttonExplanationModal .modal-bottom-controls {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: flex-end;
  height: calc(20dvh - 32px);
}

#treasureModal .modal-bottom-controls,
#treasureDetailModal .modal-bottom-controls {
  pointer-events: none;
}

#treasureModal .modal-bottom-controls button,
#treasureDetailModal .modal-bottom-controls button {
  pointer-events: auto;
}

.modal-bottom-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 16px;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.modal-bottom-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* 「きがえる」ボタン */
#btnItemsApply.btn-kigae {
  background: url('/file/cooperation/kodomo_portal/image/items_bg_button_kigae.png') center / contain no-repeat;
  background-size: 100% 100%;
  border: none;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  margin: 0 auto;
  font-size: 1em;
  width: 10em;
}

.btn-kigae-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2em;
  height: 3em;
}

.btn-kigae-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-kigae-label {
  display: block;
  text-align: center;
  float: none;
  /* margin: 0 auto; */
  margin-bottom: 0.25em;
  font-size: 1.5em;
}

/* 「もどる」/ 「とじる」ボタン */
#btnClose.btn-back,
#btnItemsBottomClose.btn-back,
#btnScoreHistoryBottomClose.btn-back,
#btnTreasureBottomClose.btn-back,
#btnTreasureDetailBack.btn-back,
#btnSettingsBottomClose.btn-back,
#btnHowToPlayClose.btn-back,
#btnHowToPlayMenuClose.btn-back,
#btnButtonExplanationClose.btn-back {
  background: url('/file/cooperation/kodomo_portal/image/button_back.png') center / contain no-repeat;
  background-size: 100% 100%;
  border: none;
  padding: 12px 24px;
  color: transparent;
  width: auto;
  min-width: 7em;
  min-height: 7em;
  max-height: 7em;
  margin-left: 3vw;
}
#btnHowToPlayClose.btn-back,
#btnButtonExplanationClose.btn-back {
  position: absolute;
    left: 0;
}

#titleModal #btnNewGame {
  background: rgba(76, 175, 80, 1);
  background: none;
  border: 2px solid rgba(76, 175, 80, 0.6);
  border: none;
  color: transparent;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 3em;
  width: calc(20vh * (1330 / 530));
  height: 20vh;
}
#titleModal #btnContinueGame {
  display: none;
  width: calc(20vh * (1500 / 530));
  height: 20vh;
  color: transparent;
}

#btnBackToMap {
  background: rgba(76, 175, 80, 0.3);
  border: 2px solid rgba(76, 175, 80, 0.6);
  color: #fff;
  padding: 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

#btnHowToPlayStart {
  cursor: pointer;
  height: 100%;
  width: auto;
  float: right;
  position: absolute;
  right: 3em;
  bottom: 1em;
}

#btnConfirmYes {
  background: rgba(244, 63, 94);
  border: 2px solid rgba(244, 63, 94, 0.35);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  flex: 1;
}

#btnContinueGame,
#btnConfirmYes,
#btnConfirmNo,
#btnBackToTitle {
  background: rgba(99, 102, 241, 1);
  background: none;
  border: 2px solid rgba(99, 102, 241, 0.45);
  border: none;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 3em;
  width: 4em;
}

#btnConfirmYes {
  background: rgba(244, 63, 94);
}

#btnConfirmNo {
  background: rgba(99, 102, 241, 1);
  flex: 1;
}

#btnBackToTitle {
  padding: 16px;
  font-size: 18px;
  font-weight: 900;
}

/* ===== タブのスタイル ===== */
/* タブコンテナの共通スタイル */
.tabs-container,
.tabs-category-container {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
  width: 100%;
  height: 11vh;
  margin: 0em auto 0;
}
.tabs-container {
  margin: 2em auto 0;
}
/* アイテムモーダルのメインタブ */
#itemsTabOwned,
#itemsTabShop {
  flex: 1;
  padding: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: url('/file/cooperation/kodomo_portal/image/items_tab.png') center / contain no-repeat;
  background-size: 100% 100%;
  padding-top: 1em;
}

.tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4vh;
}

.tab-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tab-label {
  display: block;
  font-size: 1.5em;
}

#itemsTabOwned.active {
  background: url('/file/cooperation/kodomo_portal/image/items_tab_selected.png') center / contain no-repeat;
  background-size: 100% 100%;
  border-bottom: none;
}

#itemsTabShop.active {
  background: url('/file/cooperation/kodomo_portal/image/items_tab_selected.png') center / contain no-repeat;
  background-size: 100% 100%;
  border-bottom: none;
}

/* カテゴリタブ */
.category-tab,
.shop-category-tab {
  flex: 1;
  padding: 0;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0;
  white-space: nowrap;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.category-tab img {
  width: 10vh;
  max-width: 8vw;
  height: 10vh;
  object-fit: cover;
}
.shop-category-tab img {
  width: 10vh;
  max-width: 8vw;
  height: 10vh;
  object-fit: cover;
}

/* タブラベル（画像に重ねる） */
.category-tab-label,
.category-tab-label {
  position: absolute;
  font-size: 1em;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  pointer-events: none;
  z-index: 2;
  bottom: 0.5em;
}

.category-tab.active,
.shop-category-tab.active {
  background: transparent;
  border: none;
  color: #fff;
  opacity: 0.8;
}

.modal-back-link {
  display: inline-flex;
  padding: 12px 20px;
  background: rgba(158, 158, 158, 1);
  border: 2px solid rgba(158, 158, 158, 0.45);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 2em;
}

/* ===== テキストスタイル ===== */
/* メダルカウンター */
#medalCounter > div:first-child {
  font-size: 24px;
}

/* 確認ダイアログ */
#confirmDialog h2 {
  font-size: 22px;
  margin-bottom: 20px;
  color: #ffffff;
  background-image: url(/file/cooperation/kodomo_portal/image/map_avatar_title.png);
  background-size: 19em 5em;
  background-repeat: no-repeat;
  background-position: center center;
  width: 100%;
  height: 2em;
  padding-top: 0.2em;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
}

#confirmDialog p {
  font-size: 1em;
  color: #ffffff;
  margin-bottom: 30px;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  font-weight: bold;
}

/* ゲームクリア画面 */
#gameClearModal h1 {
  font-size: 56px;
  margin-bottom: 20px;
  color: #ffeb3b;
}

#gameClearModal p {
  font-size: 24px;
  margin-bottom: 40px;
  color: rgba(255, 255, 255, 0.9);
}

/* お宝詳細 */
#treasureDetailEmoji {
  font-size: 64px;
  margin-bottom: 16px;
  display: flex;
  position: relative;
  gap: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  aspect-ratio: 1600 / 1195;
  width: min(100vw, calc(100vh * 1600 / 1195));
  height: auto;
  max-height: 100vh;
  padding: 5% 6% 5% 6%;
}

.treasure-detail-left-container {
    display: flex;
    align-items: center;
    position: relative;
    flex: 0 0 55%;
}
.treasure-detail-right-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0 0 0;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    min-width: 0;
    flex: 0 0 45%;
}

.treasure-detail-text-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80%;
  height: 100%;
  padding: 2.5vh;
}

.treasure-detail-name {
  /* 立体感（影を複数重ね） */
  font-weight: bold;
  font-size: 0.75em;
  letter-spacing: 0.03em;

  /* 文字をグラデーションで塗る（テキストクリップ） */
  background: linear-gradient(to bottom, #fbe78b 0%, #f7c548 32%, #e28a22 58%, #8a4309 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent; /* 背景を文字に見せるため */

  /* 立体感（影を複数重ね） */
  filter: drop-shadow(-1px -1px 0 #3a1e00) drop-shadow(-1px 0 0 #3a1e00) drop-shadow(-1px 1px 0 #3a1e00) drop-shadow(0 -1px 0 #3a1e00)
    drop-shadow(0 1px 0 #3a1e00) drop-shadow(1px -1px 0 #3a1e00) drop-shadow(1px 0 0 #3a1e00) drop-shadow(1px 1px 0 #3a1e00);
  transform: scale(0.75, 1);
  width: 133%;
}
/* iPad系だけ上書き */
@supports (-webkit-touch-callout: none) {
    .treasure-detail-name {
      -webkit-text-fill-color: #f7c548;
      background: none;
      -webkit-background-clip: initial;
      background-clip: initial;
      color: #f7c548;
    }
}

.treasure-detail-text {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  color: #36261f;
  font-size: clamp(0.31em, 0.2em + 0.5em, 0.4em);
  font-weight: bold;
  line-height: 1;
  text-align: left;
  word-wrap: break-word;
  word-break: break-word;
  /* text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f, -1px -1px 0 #36261f; */
}

#treasureDetailName {
  font-weight: 900;
  color: #ffeb3b;
  font-size: 18px;
  margin-bottom: 12px;
}

#treasureDetailDescription {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
  line-height: 1.6;
}

#treasureDetailDate {
  font-size: 12px;
  color: rgba(255, 193, 7, 0.6);
}

.treasure-detail-message {
  position: absolute;
  top: 15%;
  left: 50%;
  width: 100vw;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 1em;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 100;
  color: #5a351e;
  font-weight: bold;
  text-shadow: 3px 0 0 #fff, -3px 0 0 #fff, 0 3px 0 #fff, 0 -3px 0 #fff, 3px 3px 0 #fff, -3px 3px 0 #fff, 3px -3px 0 #fff, -3px -3px 0 #fff;
}

/* エラーメッセージ */
#playerNameErrorMessage {
  font-size: 12px;
  color: #fb7185;
  margin-top: 6px;
  font-weight: 600;
}

/* ===== レイアウト関連のスタイル ===== */
/* 非表示要素 */
#bgmPlayer,
#rankList,
#itemsTabShopContent,
#btnContinueGame {
  display: none;
}

/* タイトル画面レイアウト */
#titleModal .raceStage > div {
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}

#titleModal .raceStage > div > div:first-of-type {
  display: flex;
  flex-direction: row;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
  margin-left: 6vh;
}

/* 確認ダイアログレイアウト */
#confirmDialog {
  background: rgba(0, 0, 0, 0.4);
}
#confirmDialog.open {
  background: rgba(0, 0, 0, 0.4);
}
#confirmDialog .raceStage > div {
  padding: 30px 20px;
  text-align: center;
}
#confirmDialog .raceStage > div {
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}

#confirmDialog > div > div > div:last-of-type {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ゲームクリア画面レイアウト */
#gameClearModal .raceStage > div {
  padding: 60px 40px;
  text-align: center;
}

#gameClearModal .raceStage > div > div:last-of-type {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 50px;
}

/* お宝詳細モーダル */
#treasureDetailModal .body {
  text-align: center;
  padding: 1em;
}

#ownedItems,
#shopItems {
  overflow-y: scroll;
  width: 100%;
  height: calc(47vh - 5em);
}

/* アイテムカード（新しいレイアウト） */
.item-card {
  display: inline-block;
  width: 24%;
  max-width: 24%;
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  border-radius: 8px;
}

.item-card-bg {
  position: absolute;
  inset: 0;
  background-size: contain !important;
  background-position: center;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.item-card-locked {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5) url('/file/cooperation/kodomo_portal/image/items_locked.png') center / contain no-repeat;
  /* background: url('/file/cooperation/kodomo_portal/image/items_locked.png') center / contain no-repeat; */
  background-size: 40% 40%;
  border-radius: 1em;
  z-index: 3;
  display: none;
}

.item-card.locked .item-card-locked {
  display: block;
}

.item-card-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75em;
}
.item-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-card-name {
  position: absolute;
  top: 1.55em;
  /* bottom: 45px; */
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  font-size: 1em;
  color: #333;
  /* background: rgba(255, 255, 255, 0.8); */
  padding: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #5a351e;
  font-weight: bold;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

.raceStage button.item-card-button {
  position: absolute;
  width: 100%;
  bottom: -0.5em;
  /* left: 4px; */
  /* right: 4px; */
  /* padding: 6px; */
  /* background: rgba(0, 0, 0, 0.5); */
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1em;
  z-index: 4;
  color: #5a351e;
  font-weight: bold;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

/* メダルカウンター */
#medalCountShop {
  margin-bottom: 16px;
  font-weight: 700;
  color: rgba(255, 193, 7, 0.8);
}

/* ラベルとdivのマージン */
.settings-label {
  display: inline-block;
  margin-right: 20px;
  margin-bottom: 16px;
}

.settings-label label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25em;
  cursor: pointer;
  font-weight: bold;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

/* 設定セクション */
.settings-section {
  margin-bottom: 15px;
}

/* 設定見出し */
.settings-heading {
  font-size: 1.3em;
  margin-bottom: 8px;
  /* color: #333; */
  color: #5a351e;
  font-weight: bold;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

/* 設定フッター見出し */
.settings-footer-heading {
  margin-top: 20px;
}

/* 設定ボタン間隔 */
.btn-settings-secondary {
  margin-top: 10px;
}

/* SE（効果音）セクション */
#seSection {
  margin-bottom: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

#seSection label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
}

.icon img {
  width: 100%;
}

.bubble img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* === お宝図鑑（treasureDex）モーダル === */
#treasureList {
  width: 80vw;
  height: 90vh;
  overflow-y: auto;
  padding-right: 1em;
  display: grid;
  /* grid-template-columns: 1fr 1fr; */
  /* gap: 24px; */
}
.treasure-dex-stage-div {
  margin-bottom: 0;
}

.treasure-dex-stage-header {
  position: relative;
  font-weight: bold;
  font-size: 1em;
  color: rgb(90, 53, 30);
  /* margin-bottom: 8px; */
  border-radius: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  /* min-height: 50px; */
  display: inline-block;
}

.treasure-dex-stage-header-img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  top: 0;
  left: 0;
  z-index: 0;
}

.treasure-dex-stage-header-text {
  position: relative;
  z-index: 1;
  padding: 2em 6em 2.5em;
  font-weight: bold;
  font-size: 1.25em;
  text-shadow: rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) -1px 0px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) 0px -1px 0px,
    rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) -1px -1px 0px;
  width: 100%;
}

.treasure-dex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.treasure-dex-card {
  display: flex;
  flex-direction: column;
  padding: 2em 0;
  /* border: 2px solid rgba(255, 193, 7, 0.3); */
  border-radius: 8px;
  /* background-color: rgba(255, 193, 7, 0.1); */
  background-size: 100% 100%;
  background-position: center;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: flex-start;
}

.treasure-dex-card.locked {
  /* background-color: rgba(100, 100, 100, 0.3); */
  cursor: default;
  /* opacity: 0.6; */
}

.treasure-dex-card:not(.locked):hover {
  /* background-color: rgba(255, 193, 7, 0.2); */
  /* border-color: rgba(255, 193, 7, 0.6); */
}

/* 左右分割コンテンツ */
.treasure-dex-content {
  display: flex;
  /* gap: 12px; */
  flex: 1;
  margin-bottom: 1em;
}

.treasure-dex-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  background-image: url('/file/cooperation/kodomo_portal/image/items_bg_item.png');
  background-size: 100% 100%;
  background-position: center;
  padding: 0.75em 1em 2em;
  border-radius: 4px;
  /* width: 30%; */
  flex: 0 0 45%;
  margin-left: 3em;
}

.treasure-dex-emoji {
  font-size: 24px;
  width: 6em;
  height: 6em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.treasure-dex-emoji img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.locked .treasure-dex-emoji img {
  filter: brightness(0) contrast(1000%);
}

.treasure-dex-info {
  text-align: center;
  flex: 1;
}

.treasure-dex-name {
  font-weight: bold;
  color: #fff;
  font-size: 1em;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  color: #5a351e;
  font-weight: bold;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

.treasure-dex-locked-name {
  font-weight: bold;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1em;
  color: #5a351e;
  font-weight: bold;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

/* 右側 */
.treasure-dex-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  /* width: 70%; */
  flex: 0 0 33%;
}

.treasure-dex-status {
  font-weight: bold;
  color: #4caf50;
  font-size: 1em;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
  color: #ffeb3b;
  font-size: 1.5em;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  text-align: center;
}

.treasure-dex-condition {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
  color: #fff;
  font-size: 1em;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  /* width: 100%; */
}

.treasure-dex-condition-label {
  font-size: 1em;
  /* font-weight: bold; */
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 4px;
  color: #fff;
  font-size: 1em;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
}

/* 下側：詳細テキスト */
.treasure-dex-footer {
  /* margin-top: auto; */
  margin-bottom: 0.5em;
  text-align: center;
  min-height: 20px;
}

.treasure-dex-detail-text {
  /* font-size: 12px; */
  /* color: rgba(0, 0, 0, 0.8); */
  font-weight: bold;
  /* font-weight: bold; */
  color: #fff;
  font-size: 1em;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
}

.treasure-dex-empty {
  color: rgba(255, 255, 255, 0.5);
  padding: 20px;
  text-align: center;
}

/* === スコア履歴（scoreHistory）モーダル === */
#scoreHistoryList {
  height: 100%;
  /* overflow-y: scroll; */
  padding-right: 1em;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 80vw;
}

.score-history-best {
  margin: 0;
  padding: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* min-height: 100px; */
  width: 100%;
  height: 11em;
  flex-shrink: 0;
}

.score-history-cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  auto-rows: 1fr;
  /* max-width: 80vh; */
}

.score-history-best-title {
  font-size: 2.5em;
  font-weight: bold;
  color: #ffeb3b;
  margin-top: 0.3em;
  text-align: center;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgb(90, 53, 30);
  font-weight: bold;
  text-shadow: rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) -1px 0px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) 0px -1px 0px,
    rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) -1px -1px 0px;
}

.score-history-best-title::before {
  content: '';
  width: 1.6em;
  height: 1.75em;
  background-image: url('/file/cooperation/kodomo_portal/image/map_button_icon_avatar.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.score-history-card {
  margin: 0;
  padding: 1.5em 2em 0.5em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  height: 14em;
}
.score-history-card.score-history-card-uncleared {
  filter: grayscale(100%);
  padding-top: 1.5em;
}

.score-history-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  /* margin-top: 0em; */
  width: 100%;
}

.score-history-stage-label {
  font-weight: 900;
  color: #fff;
  font-size: 1em;
  color: rgb(90, 53, 30);
  font-weight: bold;
  text-shadow: rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) -1px 0px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) 0px -1px 0px,
    rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) -1px -1px 0px;
}

.score-history-title {
  font-weight: bold;
  /* color: #ffeb3b; */
  font-size: 1.5em;
  /* text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f; */
  margin-bottom: 4px;
  text-align: center;
}

.score-history-stage-name {
  font-weight: bold;
  color: #ffeb3b;
  font-size: 1.5em;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  flex: 1;
  /* color: #ffeb3b; */
  /* font-size: 1.2em; */
  /* text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f, -1px -1px 0 #36261f; */
  /* margin-bottom: 4px; */
  margin-right: 1em;
  color: rgb(90, 53, 30);
  font-weight: bold;
  text-shadow: rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) -1px 0px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) 0px -1px 0px,
    rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) -1px -1px 0px;
}

.score-history-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
  /* font-size: 0.9em; */
  flex-shrink: 0;
}

.score-history-status-cleared {
  color: #2ecc71;
  text-shadow: rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) -1px 0px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) 0px -1px 0px,
    rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) -1px -1px 0px;
  font-weight: bold;
  color: #ffeb3b;
  font-size: 1.5em;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
}

.score-history-status-cleared::after {
  /* content: ''; */
  display: inline-block;
  width: 2em;
  height: 2em;
  margin-left: 4px;
  background-image: url('/file/cooperation/kodomo_portal/image/clear.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: middle;
}

.score-history-status-uncleared {
  color: rgba(0, 0, 0, 0.5);
  text-shadow: rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) -1px 0px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) 0px -1px 0px,
    rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) -1px -1px 0px;
  font-size: 1.5em;
}

.score-history-clear-icon {
  width: 0em;
  /* height: 20px; */
  object-fit: contain;
}

.score-history-details {
  display: flex;
  flex-direction: column;
  /* gap: 4px; */
  font-size: 1em;
  color: rgb(90, 53, 30);
  font-weight: bold;
  text-shadow: rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) -1px 0px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) 0px -1px 0px,
    rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) -1px -1px 0px;
}

.score-history-unclearned {
  color: rgba(255, 255, 255, 0.4);
  color: rgb(90, 53, 30);
  font-weight: bold;
  text-shadow: rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) -1px 0px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) 0px -1px 0px,
    rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) -1px -1px 0px;
}

.score-history-empty {
  color: rgba(255, 255, 255, 0.5);
  padding: 20px;
  text-align: center;
}
@media screen and (max-width: 1660px) {
  .score-history-card {
    padding: 1.5em 1.8em;
    min-height: 12em;
  }
  .score-history-stage-name {
    font-size: 1em;
  }
  .score-history-status-cleared {
    font-size: 1em;
    margin-left: 6vw;
  }
  .score-history-status-uncleared {
    font-size: 1em;
  }
  .score-history-details {
    font-size: 0.8em;
  }
}

/* === あそびかたモーダル === */
#howToPlayImageContainer {
  width: 100%;
  height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

#howToPlayImage {
  width: 100%;
  max-height: 100%;
  /* max-height: 50vh; */
  object-fit: contain;
}

#howToPlayText {
  width: 80%;
  line-height: 1.6;
  margin-bottom: 1em;
  text-align: center;
  font-size: 1.15em;
  color: #ffffff;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  font-weight: bold;
  color: #5a351e;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
  white-space: pre-line;
}

/* === ボタン説明モーダル === */
#buttonExplanationImageContainer {
  width: 100%;
  height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

#buttonExplanationImage {
  width: 100%;
  max-height: 100%;
  /* max-height: 50vh; */
  object-fit: contain;
}

#buttonExplanationText {
  width: 80%;
  line-height: 1.6;
  margin-bottom: 1em;
  text-align: center;
  font-size: 1.15em;
  color: #ffffff;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  font-weight: bold;
  color: #5a351e;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
  white-space: pre-line;
}

.howToPlayControls {
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 19em;
  margin: 0 auto;
  position: relative;
}

.buttonExplanationControls {
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 19em;
  margin: 0 auto;
  position: relative;
}

#howToPlayPageInfo {
  min-width: 60px;
  text-align: center;
  font-size: 1.25em;
  color: #ffffff;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  font-weight: bold;
  color: #5a351e;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

#buttonExplanationPageInfo {
  min-width: 60px;
  text-align: center;
  font-size: 1.25em;
  color: #ffffff;
  text-shadow: 1px 0 0 #36261f, -1px 0 0 #36261f, 0 1px 0 #36261f, 0 -1px 0 #36261f, 1px 1px 0 #36261f, -1px 1px 0 #36261f, 1px -1px 0 #36261f,
    -1px -1px 0 #36261f;
  font-weight: bold;
  color: #5a351e;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

#btnHowToPlayPrev {
  cursor: pointer;
  /* width: 40px; */
  height: 7em;
  position: absolute;
  left: 0;
}

#btnHowToPlayNext {
  cursor: pointer;
  /* width: 40px; */
  height: 7em;
  position: absolute;
  right: 0;
}

#btnHowToPlayPrev[disabled],
#btnHowToPlayNext[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

#btnButtonExplanationPrev {
  cursor: pointer;
  height: 7em;
  position: absolute;
  left: 0;
}

#btnButtonExplanationNext {
  cursor: pointer;
  height: 7em;
  position: absolute;
  right: 0;
}

#btnButtonExplanationPrev[disabled],
#btnButtonExplanationNext[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.raceStage button#btnHowToPlay,
.raceStage button#btnHowToPlayMenu,
.raceStage button#btnButtonExplanationMenu,
.raceStage button#btnBackToTitleFromSettings,
#btnItemsApply.btn-kigae,
#itemsTabOwned,
#itemsTabShop {
  color: #5a351e;
  font-weight: bold;
  text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
}

@media (max-width: 1280px) {
  .items-modal-left {
    width: 40%;
  }
  .treasure-dex-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .score-history-cards-container {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-height: 740px) {
  .treasure-detail-name {
    font-size: 0.55em;
  }
  .treasure-detail-text {
    font-size: 0.3em;
  }
}
@media (max-height: 580px) {
  .treasure-detail-name {
    font-size: 0.35em;
  }
  .treasure-detail-text {
    font-size: 0.25em;
  }
}
