/* ゲームイメージ3（UI コンポーネントデザインシート）の配色 */
:root {
  --navy: #1a1740;
  --purple: #6b3cc6;
  --orange: #ff8a2e;
  --cream: #fff7ea;
  --yellow: #ffd166;
  --lavender: #e8d9ff;
  --ink: #2a1f4a;
  --round: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  --body: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--body);
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  /* 下のシートを画面の下端までつなげる */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 段階ごとに出す部品は hidden で出し入れする（src/client/ui.ts の setStep） */
[hidden] {
  display: none !important;
}

/* ---- ステージ ---- */

.stage-wrap {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  container-type: inline-size;
}

#stage {
  display: block;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* 吊り下げ看板 */
.sign {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(78%, 360px);
  aspect-ratio: 1200 / 460;
  display: grid;
  place-content: center;
  padding-top: 7%;
  text-align: center;
  background: url("/ui/header-sign.png") center / contain no-repeat;
  pointer-events: none;
}

.sign-title {
  margin: 0;
  font-family: var(--round);
  font-weight: 900;
  font-size: clamp(22px, 7vw, 30px);
  line-height: 1.1;
  color: var(--cream);
  text-shadow: 0 2px 0 #3a2160, 0 0 12px rgba(255, 209, 102, 0.45);
}

.sign-sub {
  margin: 4px 0 0;
  font-size: clamp(11px, 3.1vw, 13px);
  font-weight: 700;
  color: var(--lavender);
}

/* ステージの下に重ねるボタン列 */
.stage-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  pointer-events: none;
}

.stage-actions .btn {
  min-width: 0;
  padding: 0 10px;
  font-size: 13px;
}

.stage-actions .btn-primary {
  font-size: 15px;
}

.stage-actions .btn {
  pointer-events: auto;
}

/* ステージが狭いとき（背の低いスマホで「隠れ方をえらぶ」を開いたときなど）は、ボタンを小さくして 1 行に収める */
@container (max-width: 340px) {
  .stage-actions {
    gap: 4px;
    padding: 0 6px;
  }

  .stage-actions .btn {
    min-height: 42px;
    padding: 0 8px;
    font-size: 12px;
  }

  .stage-actions .btn-primary {
    font-size: 13px;
  }

  .stage-actions .btn-icon {
    display: none;
  }
}

/* ---- ボタン ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font: inherit;
  font-family: var(--round);
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s, opacity 0.15s;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-primary {
  flex: 1.4;
  min-height: 54px;
  font-size: 17px;
  color: #fff;
  background: linear-gradient(180deg, #ffb35c 0%, var(--orange) 55%, #f06e1c 100%);
  border-color: #ffd9a8;
  box-shadow: 0 4px 0 #b84d10, 0 8px 18px rgba(255, 138, 46, 0.45);
  text-shadow: 0 1px 0 rgba(150, 60, 0, 0.6);
}

.btn-dark {
  flex: 1;
  color: var(--cream);
  background: rgba(42, 31, 74, 0.92);
}

.btn-purple {
  flex: 1;
  color: #fff;
  background: linear-gradient(180deg, #8c5fe0 0%, var(--purple) 100%);
  border-color: #c9b2ff;
}

.btn-purple[aria-pressed="true"] {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.45), 0 0 18px rgba(155, 110, 255, 0.7);
}

.btn-icon {
  width: 22px;
  height: 22px;
}

.btn-wide {
  flex: 1;
}

.link-btn {
  min-height: 36px;
  padding: 0 6px;
  border: none;
  background: none;
  color: var(--purple);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* ---- 下のパネル（クリーム色） ---- */

.bottom {
  position: relative;
  z-index: 1;
  /* 下からせり上がるシート。中身が少なくても画面の下端まで伸ばす */
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: -18px auto 0;
  transition: width 0.28s ease;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.3);
}

.place-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 「ここに置く」は親指で押しやすいよう、シートの下寄りに置く */
.place-bar .btn-wide {
  flex: none;
  width: 100%;
  margin-top: auto;
  min-height: 56px;
  font-size: 18px;
}

.place-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  padding: 4px;
  border-radius: 50%;
  background: var(--lavender);
  border: 3px solid var(--orange);
}

.place-text {
  margin: 0;
  font-family: var(--round);
  font-weight: 900;
  font-size: 14px;
  line-height: 1.35;
}

.pose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pose-head-pad {
  width: 48px;
}

.pose-title {
  margin: 0;
  font-family: var(--round);
  font-weight: 900;
  font-size: 16px;
  color: var(--ink);
}

.pose-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pose-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 6px 2px 8px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #f3ebff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s;
}

.pose-card:active {
  transform: scale(0.96);
}

.pose-card img {
  width: 100%;
  height: 58px;
  object-fit: contain;
}

.pose-card[aria-pressed="true"] {
  border-color: var(--orange);
  background: #fff1dd;
  box-shadow: 0 0 0 3px rgba(255, 138, 46, 0.2);
}

.pose-card.is-off {
  opacity: 0.4;
}

.pose-name {
  font-family: var(--round);
  font-weight: 900;
  font-size: 14px;
}

.pose-sub {
  font-size: 10px;
  color: #6c5f86;
  white-space: nowrap;
}

/* ---- 一言 ---- */

.toast {
  position: absolute;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(26, 23, 64, 0.92);
  border: 1px solid rgba(255, 209, 102, 0.6);
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.toast.is-visible {
  opacity: 1;
}

/* ---- ちょっと飾る？ ---- */

.acc-head {
  margin: 12px 0 6px;
  text-align: center;
}

.acc-title {
  margin: 0;
  font-family: var(--round);
  font-weight: 900;
  font-size: 14px;
  color: var(--ink);
}

.acc-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.acc-chip {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: #f3ebff;
  cursor: pointer;
  touch-action: manipulation;
}

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

.acc-none {
  font-family: var(--round);
  font-weight: 900;
  font-size: 12px;
  color: #6c5f86;
}

.acc-chip[aria-pressed="true"] {
  border-color: var(--orange);
  background: #fff1dd;
}

.acc-chip.is-off {
  opacity: 0.35;
}

/* ---- 共通のパネル・ボタン ---- */

.btn-cream {
  flex: 1;
  color: var(--ink);
  background: #fff;
  border-color: #f0d9b5;
}

.btn-big {
  min-width: 200px;
  min-height: 60px;
  font-size: 20px;
}

a.btn {
  text-decoration: none;
}

.stack {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.stack .btn {
  width: 100%;
}

.panel-title {
  margin: 0;
  text-align: center;
  font-family: var(--round);
  font-weight: 900;
  font-size: 22px;
  color: var(--ink);
}

.panel-sub {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  color: #6c5f86;
}

.url-box,
.comment-box {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 2px dashed #e3cfa9;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-all;
}

/* ---- ステージに重ねる部品（探す側） ---- */

.chip {
  position: absolute;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 209, 102, 0.75);
  background: rgba(26, 23, 64, 0.88);
  color: var(--cream);
  font-family: var(--round);
  font-weight: 900;
  font-size: 14px;
  white-space: nowrap;
  pointer-events: none;
}

.timer {
  /* 吊り下げ看板のすぐ下（看板の幅は min(78%, 360px)、高さは幅の 460/1200） */
  top: calc(min(78cqw, 360px) * 0.383 + 4px);
  left: 50%;
  transform: translateX(-50%);
}

.timer b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.timer.is-low {
  border-color: var(--orange);
  color: var(--yellow);
}

.play-hint {
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background: rgba(20, 16, 50, 0.72);
  text-align: center;
}

.overlay-lead {
  margin: 0;
  font-family: var(--round);
  font-weight: 900;
  font-size: 24px;
  line-height: 1.5;
  color: var(--cream);
  text-shadow: 0 2px 0 #3a2160;
}

.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  /* ステージはぼかしと明るさで暗くしているので、幕は薄くする */
  background: rgba(20, 16, 50, 0.15);
  font-family: var(--round);
  font-weight: 900;
  font-size: 96px;
  color: var(--yellow);
  text-shadow: 0 4px 0 #b84d10, 0 0 24px rgba(255, 209, 102, 0.7);
  pointer-events: none;
}

.countdown.is-start {
  font-size: 64px;
  color: #fff;
}

.banner {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 10px 26px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffb35c, var(--orange));
  border: 3px solid #fff1d6;
  color: #fff;
  font-family: var(--round);
  font-weight: 900;
  font-size: 32px;
  text-shadow: 0 2px 0 #b84d10;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.6, 1);
}

.banner.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.banner.is-purple {
  background: linear-gradient(180deg, #8c5fe0, var(--purple));
  text-shadow: 0 2px 0 #3a2160;
}

/* 外れのタップ：小さく「ちがう！」（大きな赤い × は出さない） */
.miss {
  position: absolute;
  transform: translate(-50%, -120%);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(26, 23, 64, 0.85);
  color: var(--cream);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  animation: miss 0.7s ease-out forwards;
}

@keyframes miss {
  from {
    opacity: 1;
    transform: translate(-50%, -120%);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -220%);
  }
}

/* ---- 結果 ---- */

.result-headline {
  margin: 0;
  text-align: center;
  font-family: var(--round);
  font-weight: 900;
  font-size: 30px;
  color: var(--orange);
}

.result-score {
  margin: 2px 0 0;
  text-align: center;
  font-family: var(--round);
  font-weight: 900;
  font-size: 20px;
  color: var(--ink);
}

.result-title {
  width: fit-content;
  margin: 8px auto 0;
  padding: 6px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8c5fe0, var(--purple));
  color: #fff;
  font-family: var(--round);
  font-weight: 900;
  font-size: 18px;
}

.play-stats {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: #6c5f86;
}

/* ---- 名前入力シート ---- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(10, 8, 30, 0.6);
}

.sheet {
  width: min(100%, 520px);
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--cream);
  color: var(--ink);
}

.field {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.field-label {
  font-size: 13px;
  font-weight: 700;
}

.field-label em {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
  font-style: normal;
  font-size: 11px;
}

.field-label em.opt {
  background: #c9bde0;
}

.field input {
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid #e8dcc6;
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.field-help {
  font-size: 12px;
  line-height: 1.6;
  color: #6c5f86;
}

.field-help.is-small {
  font-size: 11px;
  color: #8a7fa0;
}

.field input:focus {
  outline: none;
  border-color: var(--orange);
}

.sheet-error {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: #d0451b;
  font-size: 13px;
  font-weight: 700;
}

.overlay .btn {
  flex: none;
}

/* シートの中身：表示中のパネルがシートの高さいっぱいを使う（中身は上から、決定ボタンは下寄り） */
.bottom > [data-show] {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.28s ease;
}

.bottom > .place-bar {
  gap: 14px;
}

/* 段階が変わったとき、同じシートの中身が入れ替わったように見せる */
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ステージの大きさが段階で変わるとき、シートが伸び縮みして見えるよう、なめらかに変える */
.stage-wrap,
#stage {
  transition: width 0.28s ease, height 0.28s ease;
}

/*
 * 探す側：案内とカウントダウンのあいだは、ぬいも含めたステージを霧の中のようにぼかす（ジュリ回答）。
 * 夜のテラスだとは分かるが、ぬいの輪郭や位置は分からない強さ。START で 0.3 秒かけて解く
 */
#stage {
  transition: width 0.28s ease, height 0.28s ease, filter 0.3s ease;
}

/* 読み込み中からぼかしておく（案内に移るときにぼかしがかかる途中で、ぬいがはっきり見えてしまわないように） */
body[data-step="loading"] #stage,
body[data-step="intro"] #stage,
body[data-step="countdown"] #stage {
  filter: blur(14px) brightness(0.75);
}

@media (prefers-reduced-motion: reduce) {
  .bottom,
  .bottom > [data-show],
  .stage-wrap,
  #stage {
    transition: none;
    animation: none;
  }
}

/* 案内中はステージをぼかして暗くしているので、幕は薄くする（夜のテラスだと分かる程度に） */
body[data-step="intro"] .overlay {
  background: rgba(20, 16, 50, 0.25);
}

/* ---- 入口 ---- */

/* 入口の看板は小さめ（§19「上：小さなロゴ」。ロープの見本のぬいにかからないように） */
body[data-mode="entry"] .sign {
  width: min(70%, 320px);
}

body[data-mode="entry"] .sign-title {
  font-size: clamp(18px, 5.6vw, 26px);
  white-space: nowrap;
}

/*
 * 入口は、ステージの絵を画面の下端まで敷いた 1 枚のビジュアルにする（ジュリ指示）。
 * 絵は画面の高さに合わせて左右を切る（src/client/ui.ts の fitCover）。文字と CTA は絵の上に重ねる
 */
body[data-mode="entry"] .app {
  position: relative;
}

body[data-mode="entry"] .stage-wrap {
  margin: 0;
}

body[data-mode="entry"] #stage {
  position: absolute;
  top: 0;
}

body[data-mode="entry"] .bottom {
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 0;
  padding-top: 120px;
  border-radius: 0;
  box-shadow: none;
  /* 下ほど濃い夜空色。絵は隠しきらず、文字と CTA のまわりだけ暗くする */
  background: linear-gradient(
    to top,
    rgba(26, 23, 64, 0.92) 0%,
    rgba(26, 23, 64, 0.78) 32%,
    rgba(26, 23, 64, 0.4) 62%,
    rgba(26, 23, 64, 0) 100%
  );
  pointer-events: none;
}

body[data-mode="entry"] .bottom a {
  pointer-events: auto;
}

.entry-panel {
  gap: 10px;
  animation: none;
}

.entry-lead {
  margin: 0 0 8px;
  text-align: center;
  font-family: var(--round);
  font-weight: 900;
  font-size: 16px;
  line-height: 1.8;
  color: var(--cream);
  text-shadow: 0 2px 6px rgba(10, 8, 30, 0.9), 0 0 2px rgba(10, 8, 30, 0.9);
}

.btn-cta {
  flex: none;
  width: 100%;
  min-height: 60px;
  font-size: 20px;
}

.entry-note {
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--lavender);
  text-shadow: 0 1px 4px rgba(10, 8, 30, 0.9);
}

.entry-event-link {
  align-self: center;
  margin-top: 2px;
  font-size: 12px;
  color: var(--lavender);
  opacity: 0.85;
  text-shadow: 0 1px 4px rgba(10, 8, 30, 0.9);
}

/*
 * 読み込み中（JS が動く前）は、段階ごとの部品と下のシートを出さない。
 * 出したままだと、幅の決まっていないシートが細長い白い棒に見える
 */
body[data-step="loading"] [data-show],
body[data-step="loading"] .bottom {
  display: none;
}

/* ---- お菓子 ---- */

/* 作った本人向け：届いたお菓子の数（少し特別に） */
.owner-treats {
  margin: 0;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--lavender);
  text-align: center;
  color: var(--ink);
}

.owner-treats-count {
  margin: 0;
  font-family: var(--round);
  font-weight: 900;
  font-size: 17px;
}

.owner-treats-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #6c5f86;
}

.play-panel .owner-treats {
  margin-top: 10px;
}

/* 渡したお菓子：ボタンからぬいへ飛ぶ */
.flying-candy {
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
}

/* 「○○さんにお菓子を渡した！」は名前が長いと 1 行に収まらないので折り返す */
#treat-btn {
  white-space: normal;
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: 1.4;
}

/*
 * PC・タブレットなど画面幅がスマホより広いとき：縦 1 列（最大 520px）を中央に置き、
 * 左右はステージの絵を拡大・強くぼかして敷き、夜空色を重ねる（ジュリ回答）。左右は飾りで、操作の対象にしない
 */
@media (min-width: 521px) {
  /* body の地の色があると、下に敷いた背景（z-index: -1）が隠れるので、地の色は html だけに持たせる */
  body {
    background: transparent;
  }

  body::before,
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
  }

  body::before {
    background: url("/stage/stage-bg.webp") center / cover no-repeat;
    filter: blur(28px) saturate(1.1);
    transform: scale(1.15);
  }

  body::after {
    background: rgba(26, 23, 64, 0.62);
  }

  /* 本体（ステージと下のシート）を、ぼかした背景から少し浮かせる */
  .stage-wrap,
  .bottom {
    box-shadow: 0 0 36px rgba(0, 0, 0, 0.45);
  }
}

/*
 * スマホの探す画面（ジュリ回答）：案内〜カウントダウン〜プレイ中は白いシートを出さず、ステージが主役。
 * ステージの下は、PC の左右と同じ「ぼかしたステージの絵＋夜空色」でつなぐ。結果画面で白いシートが下からせり上がる
 */
body[data-mode="play"] {
  background: transparent;
}

body[data-mode="play"]::before,
body[data-mode="play"]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body[data-mode="play"]::before {
  background: url("/stage/stage-bg.webp") center / cover no-repeat;
  filter: blur(28px) saturate(1.1);
  transform: scale(1.15);
}

body[data-mode="play"]::after {
  background: rgba(26, 23, 64, 0.62);
}

/*
 * 案内〜プレイ中は、シートをステージの下端に重ねる（ステージは描き足した床まで画面の下端まで伸ばす。ジュリ回答）。
 * src/client/ui.ts の fitStage は、position: absolute のときシートの高さを 0 として扱う
 */
body[data-mode="play"] .app {
  position: relative;
}

body[data-mode="play"]:not([data-step="result"]):not([data-step="exhibit"]) .bottom {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  margin: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

/* 案内中だけ、最下部を少し暗くして挑戦人数を読めるようにする */
body[data-mode="play"][data-step="intro"] .bottom {
  padding-top: 56px;
  background: linear-gradient(to top, rgba(26, 23, 64, 0.78), rgba(26, 23, 64, 0));
}

/* 案内中の 1 行：小さく、主張させない */
body[data-mode="play"] .play-panel {
  padding-top: 18px;
}

body[data-mode="play"] .play-stats {
  font-size: 12px;
  color: var(--lavender);
  opacity: 0.8;
}

/* 作った本人向け：カードにせず、挑戦人数の近くに少しだけ目立たせて */
.play-panel .owner-treats {
  margin-top: 6px;
  padding: 0;
  background: none;
}

.play-panel .owner-treats-count {
  font-size: 14px;
  color: var(--yellow);
}

.play-panel .owner-treats-sub {
  display: none;
}

/* 結果：白いシートが下からすっとせり上がる */
body[data-mode="play"][data-step="result"] .bottom,
body[data-mode="play"][data-step="exhibit"] .bottom {
  animation: sheet-up 0.3s ease-out;
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-mode="play"][data-step="result"] .bottom {
    animation: none;
  }
}

/* ---- 期間（追加設計 §5） ---- */

.btn-cta.is-disabled {
  cursor: default;
  filter: grayscale(0.6) brightness(0.8);
  pointer-events: none;
}

.btn-sub-cta {
  flex: none;
  width: 100%;
}

/* ---- 運営者（追加設計 §6〜§11）：広告感を弱く、結果体験より目立たせない ---- */

.entry-presents {
  margin: 4px 0 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
  color: var(--lavender);
  opacity: 0.75;
  text-shadow: 0 1px 4px rgba(10, 8, 30, 0.9);
}

.cm {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed #e3cfa9;
}

.cm-head {
  margin: 0 0 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #8a7fa0;
}

.cm-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #efe3cc;
}

.op-avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--lavender);
}

.op-avatar-initial {
  display: grid;
  place-items: center;
  font-family: var(--round);
  font-weight: 900;
  font-size: 20px;
  color: var(--purple);
}

.cm-body p {
  margin: 0;
}

.cm-name {
  font-family: var(--round);
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
}

.cm-role {
  font-size: 11px;
  color: #8a7fa0;
}

.cm-copy {
  margin-top: 4px !important;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.cm-cta,
.cm-featured {
  display: inline-block;
  margin-top: 6px;
  margin-right: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
}

.cm-featured {
  font-weight: 400;
  color: #6c5f86;
}

.operator-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.op-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #efe3cc;
  color: var(--ink);
  text-decoration: none;
  pointer-events: auto;
}

.op-row .op-avatar {
  width: 40px;
  height: 40px;
}

.op-row-text {
  display: grid;
  font-size: 13px;
}

.op-row-text small {
  color: #6c5f86;
  font-size: 11px;
}

.exhibit-panel .panel-title {
  font-size: 18px;
}

.nowrap {
  white-space: nowrap;
}

/* ---- 作者クレジット（入口・展示モードの最下部。目立たせない） ---- */

.app-credit {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--lavender);
  opacity: 0.7;
}

.app-credit a {
  color: inherit;
  pointer-events: auto;
}

/* 展示モード・完成画面は白いシートの上なので、文字色を合わせる */
.done-panel .app-credit,
.exhibit-panel .app-credit {
  margin-top: 16px;
  color: #8a7fa0;
  opacity: 1;
}

.entry-panel .app-credit {
  text-shadow: 0 1px 4px rgba(10, 8, 30, 0.9);
}

/*
 * 探す側のタイマーは、看板のすぐ下ではなく画面の下（描き足した床の上）に出す。
 * 看板の下には「ぶらーん」のぬいがぶら下がるので、そこを隠さない。下の床には隠れられないので、何も隠さない
 */
body[data-mode="play"] .timer {
  top: auto;
  bottom: 72px;
}


/* 入口の運営者クレジットの名前（各 note へのリンク）：周りの文字と同じ色で、下線だけ付ける */
.entry-presents a {
  color: inherit;
  pointer-events: auto;
}
