/* まるっとスライドパズル — extra.css（担当 F）
 * アルバム／きょうの1まい／じゆうにあそぶ／せってい／あそびかた
 * クラスはすべて x- ではじめる（ほかの画面とぶつからないように）。色は base.css の変数を使う。
 */

/* ---- 共通 ------------------------------------------------------------- */
.x-screen { gap: 8px; }
.x-topbar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
.x-topbar-l { justify-self: start; }
.x-topbar-r { justify-self: end; font-size: 15px; color: var(--ink-soft); }
.x-title { margin: 0; font-size: 21px; letter-spacing: .04em; white-space: nowrap; }
.x-back { padding: 8px 16px 8px 12px; font-size: 16px; gap: 6px; }
.x-back-arrow, .x-chev {
  display: inline-block; width: 10px; height: 10px; border: solid currentColor; border-width: 0 0 3px 3px;
  transform: rotate(45deg); border-radius: 1px; margin-left: 3px;
}
.x-chev-r { transform: rotate(-135deg); margin: 0 3px 0 0; }
.x-body { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 1040px; margin: 0 auto; }
.x-body.scroll { padding: 2px 2px 16px; }
.x-lead { margin: 0; font-size: 16px; color: var(--ink-soft); font-weight: 600; }
.x-label { margin: 6px 2px 0; font-size: 15px; color: var(--ink-soft); }
.x-h2 { margin: 0 0 8px; font-size: 18px; }
.x-center { justify-content: center; }
.x-wide { width: 100%; }

/* 紙の札（まだの絵など） */
.x-paper {
  background:
    repeating-linear-gradient(0deg, rgba(138, 111, 92, .07) 0 1px, transparent 1px 22px),
    linear-gradient(160deg, #FFF9EC, #F6E4C2);
  box-shadow: inset 0 0 0 2px rgba(138, 111, 92, .18), inset 0 -10px 18px rgba(185, 131, 79, .12);
}
.x-q { font-size: 2.4em; font-weight: 900; color: rgba(138, 111, 92, .55); line-height: 1; }

/* 絵が読みこめなかったときの、やさしい色の札（だれの絵かで色をかえる） */
[data-who] { --wa: var(--fumi); --wb: var(--keika); }
[data-who="trio"] { --wa: var(--fumi); --wb: var(--miso); }
[data-who="f"] { --wa: #F7B26A; --wb: var(--fumi); }
[data-who="m"] { --wa: #8CC2E8; --wb: var(--miso); }
[data-who="k"] { --wa: #F6B3CA; --wb: var(--keika); }
[data-who="fm"] { --wa: var(--fumi); --wb: var(--miso); }
[data-who="kf"] { --wa: var(--keika); --wb: var(--fumi); }
[data-who="km"] { --wa: var(--keika); --wb: var(--miso); }
.is-broken { background: linear-gradient(135deg, var(--wa), var(--wb)) !important; }
img.is-broken { visibility: hidden; }

.x-who {
  display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 15px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(74, 52, 38, .45);
  background: linear-gradient(90deg, var(--wa), var(--wb));
}

/* ======================================================================
   アルバム
   ====================================================================== */
.x-album-head { display: flex; flex-direction: column; gap: 8px; margin: 2px 2px 14px; }
.x-bar { height: 8px; border-radius: 99px; background: rgba(138, 111, 92, .16); overflow: hidden; }
.x-bar-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--fumi), var(--keika), var(--miso)); transition: width .5s ease; }
.x-count { font-weight: 800; }

.x-album-grid {
  display: grid; gap: 12px;
  /* スマホの縦は2列（絵を大きく・題名が2行で読める幅） */
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
@media (min-width: 600px) { .x-album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .x-album-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; } }

.x-card {
  appearance: none; border: 0; padding: 6px 6px 8px; margin: 0; font: inherit; color: inherit; text-align: center;
  display: flex; flex-direction: column; gap: 6px; border-radius: 16px; background: var(--white);
  box-shadow: var(--shadow-sm), inset 0 0 0 2px rgba(74, 52, 38, .08);
  animation: x-rise .35s ease both; animation-delay: calc(var(--i, 0) * 25ms);
}
.x-card.is-owned { cursor: pointer; transition: transform .12s ease; }
.x-card.is-owned:active { transform: scale(.97); }
.x-card.is-owned:focus-visible { outline: 3px solid var(--miso); outline-offset: 2px; }
@media (hover: hover) { .x-card.is-owned:hover { transform: translateY(-3px) rotate(-.6deg); } }
.x-card-pic {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; width: 100%; border-radius: 11px; overflow: hidden; background: var(--paper-2);
}
.x-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-card.is-owned .x-card-pic:not(.is-loaded):not(.is-broken)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%) -150% 0 / 250% 100% no-repeat;
  animation: x-wait 1.6s ease-in-out infinite;
}
@keyframes x-wait { to { background-position: 250% 0; } }
img.x-fade { opacity: 0; transition-property: opacity; transition-timing-function: ease; }
img.x-fade.is-loaded { opacity: 1; }
/* 題名：2行まで折り返して全部見せる（ことばの切れ目＝空白で折る。長い語だけは途中で折る） */
.x-card-title {
  font-size: 15px; font-weight: 700; line-height: 1.35; padding: 0 2px; min-height: 2.7em;
  display: flex; align-items: center; justify-content: center;
  white-space: normal; word-break: keep-all; overflow-wrap: anywhere; line-break: strict;
}
.x-card.is-locked { background: transparent; box-shadow: none; padding: 6px 6px 8px; }
.x-card.is-locked .x-card-pic { border-radius: 11px; transform: rotate(-1.2deg); }
.x-card.is-locked:nth-child(2n) .x-card-pic { transform: rotate(1deg); }
.x-card.is-locked .x-card-title { font-size: 14px; min-height: 0; }

/* ---- 大きく見る ---- */
.x-viewer-back { padding: 10px; background: rgba(46, 31, 22, .78); }
.modal.x-viewer {
  width: auto; max-width: 100%; max-height: 100%; padding: 10px 10px 14px; border-radius: 22px;
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
}
.x-view { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.x-view-frame {
  /* 画面いっぱい近く：幅と（高さ－文字の分）の小さいほう */
  width: min(calc(100vw - 40px), calc(100dvh - 210px), 860px);
  height: min(calc(100vw - 40px), calc(100dvh - 210px), 860px);
  border-radius: 14px; overflow: hidden; background: var(--paper-2); touch-action: pan-y;
  box-shadow: inset 0 0 0 1px rgba(74, 52, 38, .1);
}
.x-view-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-view-img.from-r { animation: x-slide-r .26s ease both; }
.x-view-img.from-l { animation: x-slide-l .26s ease both; }
.x-view-cap { width: 100%; max-width: 560px; }
.x-view-titlerow { display: flex; align-items: center; gap: 8px; }
.x-view-names { flex: 1 1 auto; min-width: 0; }
.x-view-title { margin: 0; font-size: 21px; line-height: 1.35; }
.x-view-who { margin-top: 2px; }
.x-view-info { margin: 6px 0 0; font-size: 15px; line-height: 1.5; }
.x-view-btns { margin-top: 10px !important; }
.x-view-btns .btn { min-width: 120px; }
@media (min-aspect-ratio: 5/4) and (min-width: 700px) {
  /* 横長：絵を左、文字を右に */
  .x-view { flex-direction: row; align-items: center; gap: 18px; }
  .x-view-frame { width: min(calc(100dvh - 60px), calc(100vw - 380px), 860px); height: min(calc(100dvh - 60px), calc(100vw - 380px), 860px); }
  .x-view-cap { width: 300px; }
}

/* ======================================================================
   きょうの1まい
   ====================================================================== */
.x-daily-body { display: grid; gap: 14px; align-content: start; }
.x-today { display: grid; grid-template-columns: minmax(0, 44%) 1fr; gap: 14px; align-items: center; padding: 12px; }
.x-today-pic {
  position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--paper-2);
  box-shadow: inset 0 0 0 2px rgba(74, 52, 38, .08);
}
.x-today-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .6s ease; }
.x-today:not(.is-done) .x-today-img { filter: blur(14px) saturate(1.15) brightness(1.05); transform: scale(1.15); }
.x-today-veil {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 253, 248, .55), rgba(255, 244, 222, .15) 70%);
}
.x-today-q {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--white); color: var(--fumi); font-size: 32px; font-weight: 900; box-shadow: var(--shadow-sm);
  animation: x-bob 2.6s ease-in-out infinite;
}
.x-today-ask { font-size: 15px; color: var(--ink); background: rgba(255, 253, 248, .85); padding: 2px 10px; border-radius: 99px; }
.x-today-stamp { --rot: -12deg; position: absolute; right: 6%; bottom: 6%; width: 30%; height: 30%; z-index: 1; }
.x-today-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.x-today-info p { margin: 0; }
.x-today-date { font-size: 30px; font-weight: 900; line-height: 1.1; letter-spacing: .02em; }
.x-today-date small { font-size: 16px; margin: 0 2px; }
.x-today-wd { font-size: 16px; color: var(--ink-soft); }
.x-today-size { font-size: 15px; }
.x-size-chip { display: inline-block; padding: 1px 10px; border-radius: 8px; background: var(--paper-2); font-size: 16px; }
.x-today-note { font-size: 14px; line-height: 1.45; }
.x-today-title { font-size: 17px; font-weight: 800; line-height: 1.35; }
.x-today-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 16px; }
.x-today-play { margin-top: 4px; width: 100%; }
.x-today .btn-big { min-height: 56px; }

.x-cal { padding: 12px 10px 12px; }
.x-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.x-cal-title { margin: 0; font-size: 19px; }
.x-cal-nav[disabled] { opacity: .3; }
.x-cal-wk, .x-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.x-cal-wk span { text-align: center; font-size: 14px; color: var(--ink-soft); padding: 2px 0; }
.x-cal-wk .is-sun, .x-day.is-sun .x-day-n { color: #C9616F; }
.x-cal-wk .is-sat, .x-day.is-sat .x-day-n { color: #4C83B5; }
.x-day {
  position: relative; aspect-ratio: 1 / 1; min-height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: rgba(255, 244, 222, .7); border: 0; padding: 0; font: inherit; color: inherit;
}
.x-day.is-blank { background: transparent; }
.x-day-n { position: relative; z-index: 2; font-size: 16px; font-weight: 800; }
.x-day.is-future { background: transparent; }
.x-day.is-future .x-day-n { opacity: .35; }
.x-day.is-today { box-shadow: inset 0 0 0 2.5px var(--fumi); background: #FFF0D9; }
.x-day.is-stamped { cursor: pointer; background: transparent; }
.x-day.is-stamped .x-day-n { color: #fff !important; text-shadow: 0 1px 0 rgba(0, 0, 0, .18); }
.x-day .x-stamp { position: absolute; inset: 9%; }
.x-cal-foot { margin: 10px 2px 0; text-align: center; font-size: 15px; color: var(--ink-soft); }
.x-cal-foot b { color: var(--ink); font-size: 18px; margin: 0 2px; }
.x-cal-sep { margin: 0 8px; opacity: .5; }

/* ---- スタンプ（CSS で描く。色は日がわり） ----
   ふみまる：丸に 耳ふたつ ／ ミソマル：ふっくら丸に しわ1本（顔は描かない） ／ けいか：丸に ハートひとつ */
.x-stamp {
  --c: var(--fumi); --c2: rgba(243, 154, 61, .82);
  display: block; border-radius: 50%; transform: rotate(var(--rot, -10deg));
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .28), transparent 55%), var(--c2);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), 0 0 0 2px var(--c);
  pointer-events: none;
}
.x-stamp::before, .x-stamp::after { content: ""; position: absolute; }
.x-stamp.s-fumi::before, .x-stamp.s-fumi::after {
  /* ハムスターの耳 */
  width: 34%; height: 34%; top: -12%; border-radius: 50%; background: var(--c2); box-shadow: 0 0 0 2px var(--c); z-index: -1;
}
.x-stamp.s-fumi::before { left: 2%; }
.x-stamp.s-fumi::after { right: 2%; }
.x-stamp.s-fumi { isolation: isolate; }
.x-stamp.s-miso { --c: var(--miso); --c2: rgba(74, 154, 212, .82); border-radius: 46% 54% 50% 50% / 56% 50% 50% 44%; }
.x-stamp.s-miso::before {
  /* 脳のしわ（ゆるい線1本） */
  left: 24%; right: 24%; top: 16%; height: 22%; border: 2px solid rgba(255, 255, 255, .6); border-color: rgba(255, 255, 255, .6) transparent transparent transparent;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.x-stamp.s-keika { --c: var(--keika); --c2: rgba(238, 127, 164, .82); }
.x-stamp.s-keika::before {
  /* 小さなハート（右上） */
  width: 38%; height: 38%; right: -12%; top: -12%;
  background: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M12 21s-7.5-4.6-9.6-9.3C.9 8.3 3 4.5 6.6 4.5c2.1 0 3.5 1.2 5.4 3.3 1.9-2.1 3.3-3.3 5.4-3.3 3.6 0 5.7 3.8 4.2 7.2C19.5 16.4 12 21 12 21z%27 fill=%27%23EE7FA4%27 stroke=%27%23fff%27 stroke-width=%271.8%27/%3E%3C/svg%3E") center / contain no-repeat;
  transform: rotate(14deg);
}
.x-stamp.is-new { animation: x-stamp-in .62s cubic-bezier(.2, 1.5, .4, 1) both; }
.x-today-stamp.s-fumi::before, .x-today-stamp.s-fumi::after { top: -10%; }

/* ---- 過去の日を見る窓 ---- */
.x-dayview-pic { position: relative; width: min(280px, 70vw); aspect-ratio: 1 / 1; margin: 6px auto 8px; border-radius: 14px; overflow: hidden; background: var(--paper-2); }
.x-dayview-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-dayview-title { margin: 0 0 4px; font-size: 17px; font-weight: 800; line-height: 1.35; }

@media (min-width: 760px) and (min-aspect-ratio: 1/1) {
  .x-daily-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; gap: 18px; }
  .x-today { grid-template-columns: 1fr; padding: 16px; }
  .x-today-pic { width: min(100%, calc(100dvh - 330px)); margin: 0 auto; }
  .x-day { min-height: 44px; }
}

/* ======================================================================
   じゆうにあそぶ
   ====================================================================== */
.x-free-body { display: flex; flex-direction: column; overflow: hidden; }
.x-free-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.x-free-prevhost { flex: 1 1 auto; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.x-free-prev {
  position: relative; width: 200px; height: 200px; border-radius: 16px; overflow: hidden;
  background: var(--paper-2); box-shadow: 0 0 0 6px var(--wood), 0 0 0 8px var(--wood-dark), var(--shadow);
}
.x-free-img { position: absolute; inset: 0; background-size: cover; background-position: center; transition: background-image .2s ease; }
.x-free-prev.is-broken .x-free-img { display: none; }
.x-free-gridover { position: absolute; inset: 0; display: grid; pointer-events: none; }
.x-free-gridover span { box-shadow: inset 0 0 0 1px rgba(255, 253, 248, .75); }
.x-free-gridover span.is-blank {
  background: rgba(74, 52, 38, .42);
  box-shadow: inset 0 0 0 1px rgba(255, 253, 248, .75), inset 0 4px 10px rgba(0, 0, 0, .25);
}
.x-free-ctrl { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 560px; margin: 0 auto; }
.x-strip {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 4px 4px 6px; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.x-thumb {
  appearance: none; flex: 0 0 auto; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--paper-2); scroll-snap-align: center; box-shadow: inset 0 0 0 2px rgba(74, 52, 38, .1); opacity: .78;
  transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
}
.x-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-thumb.is-on { opacity: 1; box-shadow: 0 0 0 3px var(--white), 0 0 0 6px var(--fumi); transform: translateY(-1px); }
.x-thumb:focus-visible { outline: 3px solid var(--miso); outline-offset: 2px; }
.x-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 16px; background: rgba(138, 111, 92, .14); }
.x-seg-btn {
  appearance: none; border: 0; cursor: pointer; min-height: 50px; padding: 4px 6px; border-radius: 12px; background: transparent;
  font: inherit; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}
.x-seg-main { font-size: 17px; font-weight: 900; }
.x-seg-sub { font-size: 14px; font-weight: 700; opacity: .85; letter-spacing: -.01em; line-height: 1.2; }
.x-seg-btn.is-on { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--fumi); }
.x-seg-btn:focus-visible { outline: 3px solid var(--miso); outline-offset: 1px; }
.x-free-best { margin: 4px 0 2px; text-align: center; font-size: 15px; min-height: 22px; }
.x-free-best b { font-size: 18px; }
.x-free-play { width: 100%; }

.x-free-empty { margin: auto; max-width: 440px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 20px; }
.x-free-empty h2 { margin: 6px 0 0; font-size: 20px; }
.x-free-empty p { margin: 0 0 6px; line-height: 1.6; }
.x-free-empty-fig { display: flex; gap: 10px; }
.x-mini-card { width: 64px; height: 64px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 14px; transform: rotate(-4deg); }
.x-mini-card:nth-child(2) { transform: translateY(-6px) rotate(2deg); }
.x-mini-card:nth-child(3) { transform: rotate(5deg); }

@media (max-height: 700px) {
  .x-thumb { width: 50px; height: 50px; }
  .x-seg-btn { min-height: 48px; }
  .x-seg-sub { display: none; }
  .x-label { margin-top: 2px; font-size: 14px; }
  .x-free-ctrl { gap: 4px; }
}
@media (min-width: 760px) and (min-aspect-ratio: 1/1) {
  .x-free-main { flex-direction: row; align-items: center; gap: 28px; }
  .x-free-prevhost { align-self: stretch; }
  .x-free-ctrl { width: 380px; flex: 0 0 380px; }
  .x-thumb { width: 64px; height: 64px; }
  .x-strip { flex-wrap: wrap; overflow: visible; max-height: 156px; overflow-y: auto; }
}

/* ======================================================================
   せってい
   ====================================================================== */
.x-set-body { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.x-set-list { padding: 4px 16px; }
.x-set-row { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 10px 0; cursor: pointer; }
.x-set-row + .x-set-row { border-top: 2px dashed rgba(138, 111, 92, .18); }
.x-set-name { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; font-size: 18px; pointer-events: none; }
.x-set-name small { font-size: 14px; line-height: 1.45; }
.x-switch {
  appearance: none; border: 0; background: transparent; padding: 4px; margin: 0; cursor: pointer; font: inherit; color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 0 0 auto;
}
.x-switch-track {
  position: relative; width: 74px; height: 42px; border-radius: 99px; background: rgba(138, 111, 92, .3);
  box-shadow: inset 0 2px 4px rgba(74, 52, 38, .2); transition: background .18s ease;
}
.x-switch-knob {
  position: absolute; top: 4px; left: 4px; width: 34px; height: 34px; border-radius: 50%; background: var(--white);
  box-shadow: 0 2px 4px rgba(74, 52, 38, .3); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.x-switch.is-on .x-switch-track { background: var(--ok); }
.x-switch.is-on .x-switch-knob { transform: translateX(32px); }
.x-switch.is-on { color: #3E8A55; }
.x-switch-text { font-size: 14px; font-weight: 800; }
.x-switch:focus-visible .x-switch-track { outline: 3px solid var(--miso); outline-offset: 2px; }

.x-set-rec { padding: 14px 16px; }
.x-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.x-stat { background: var(--paper); border-radius: 12px; padding: 8px 10px; }
.x-stat dt { font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.x-stat dd { margin: 0; font-size: 18px; font-weight: 900; }
.x-set-btns { display: flex; flex-direction: column; gap: 12px; }
.btn.x-danger { color: #B2453B; box-shadow: var(--shadow-sm), inset 0 0 0 2px rgba(178, 69, 59, .45); }
.btn.x-danger.is-armed { background: #C8564A; color: #fff; box-shadow: 0 4px 0 #8F3027; }
.x-credit { margin: 4px 0 0; text-align: center; font-size: 14px; color: var(--ink-soft); }
.x-modal-text { margin: 0; line-height: 1.7; font-weight: 600; }
.modal.x-confirm.is-step2 { box-shadow: 0 0 0 4px rgba(200, 86, 74, .5), var(--shadow); }

/* ======================================================================
   あそびかた
   ====================================================================== */
.x-how-body { display: flex; flex-direction: column; gap: 10px; max-width: 560px; overflow: hidden; }
.x-how-view { flex: 1 1 auto; min-height: 0; overflow: hidden; touch-action: pan-y; border-radius: var(--radius); }
.x-how-track { display: flex; height: 100%; transition: transform .32s cubic-bezier(.25, .9, .3, 1); }
.x-how-page {
  flex: 0 0 100%; height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  overflow-y: auto; padding: 14px 16px; box-shadow: none; border: 2px solid rgba(138, 111, 92, .12);
}
.x-how-no { margin: 0; font-size: 14px; color: var(--ink-soft); }
.x-how-title { margin: 0; font-size: 21px; text-align: center; }
.x-how-lines { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.x-how-lines li { font-size: 16px; line-height: 1.6; font-weight: 600; padding-left: 18px; position: relative; }
.x-how-lines li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--wood-light); }
.x-chip { display: inline-block; padding: 0 10px; border-radius: 99px; background: var(--paper-2); font-size: 14px; font-weight: 800; margin-right: 2px; }
.x-chip.c-fumi { background: var(--fumi); color: #fff; }
.x-chip.c-miso { background: var(--miso); color: #fff; }
.x-chip.c-keika { background: var(--keika); color: #fff; }
.x-dots { display: flex; justify-content: center; gap: 4px; }
.x-dot { appearance: none; border: 0; background: transparent; width: 28px; height: 28px; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.x-dot::after { content: ""; width: 10px; height: 10px; border-radius: 99px; background: rgba(138, 111, 92, .3); transition: width .2s ease, background .2s ease; }
.x-dot.is-on::after { width: 24px; background: var(--fumi); }
.x-how-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

/* ---- 小さな盤の図 ---- */
.x-fig { position: relative; --s: min(60vw, 280px, calc(100dvh - 440px)); width: var(--s); height: var(--s); min-width: 132px; min-height: 132px; margin: 6px 0; flex: 0 0 auto; }
.x-mini {
  --g: 4px; position: absolute; inset: 0; border-radius: 12px; padding: 0;
  background: var(--wood-dark); box-shadow: 0 0 0 5px var(--wood), 0 0 0 7px var(--wood-dark), var(--shadow-sm);
}
.x-mt, .x-mini-hole {
  position: absolute; left: var(--g); top: var(--g);
  width: calc((100% - 4 * var(--g)) / 3); height: calc((100% - 4 * var(--g)) / 3);
  transform: translate(calc(var(--x) * (100% + var(--g))), calc(var(--y) * (100% + var(--g))));
  border-radius: 6px;
}
.x-mini-hole { background: rgba(0, 0, 0, .18); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .25); }
.x-mt {
  background-image: var(--pic, none), linear-gradient(135deg, hsl(calc(var(--hue) * 42 + 18), 80%, 78%), hsl(calc(var(--hue) * 42 + 48), 70%, 66%));
  background-size: 300% 300%, 100% 100%;
  background-position: var(--bx) var(--by), 0 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 2px 3px rgba(0, 0, 0, .25);
}
.x-mt-n {
  position: absolute; left: 3px; top: 3px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  background: rgba(255, 253, 248, .92); color: var(--ink); font-size: 14px; font-weight: 800; line-height: 20px; text-align: center;
}
.x-mt.a-right, .x-mt.a-right2 { animation: x-mv-r 3.2s ease-in-out infinite; }
.x-mt.a-hint { animation: x-hint 1.6s ease-in-out infinite; z-index: 1; }
.x-finger {
  position: absolute; z-index: 3; pointer-events: none;
  left: calc(4px + (100% - 16px) / 6 + var(--x) * (100% - 4px) / 3);
  top: calc(4px + (100% - 16px) / 6 + var(--y) * (100% - 4px) / 3);
  width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: rgba(255, 253, 248, .75); box-shadow: 0 0 0 3px var(--fumi), 0 4px 10px rgba(0, 0, 0, .25);
  opacity: 0; animation: x-tap 3.2s ease-in-out infinite;
}
.x-peek {
  position: absolute; inset: 0; border-radius: 12px; overflow: hidden; pointer-events: none;
  background-image: var(--pic, none), linear-gradient(135deg, var(--fumi), var(--keika));
  background-size: cover; opacity: 0; animation: x-peek 4.8s ease-in-out infinite; animation-delay: 1.6s;
  display: flex; align-items: flex-end; justify-content: center;
}
.x-peek-label { margin-bottom: 8px; background: var(--miso); color: #fff; font-size: 14px; padding: 1px 12px; border-radius: 99px; }
.x-fig-done .x-mini { --g: 0px; overflow: hidden; }
.x-fig-done .x-mt { border-radius: 0; box-shadow: none; }
.x-fig-done .x-mt-n { display: none; }
.x-fig-stars {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  background: var(--white); color: var(--star); padding: 2px 14px; border-radius: 99px; font-size: 18px; letter-spacing: 2px; box-shadow: var(--shadow-sm);
}

/* ---- 動き ---- */
@keyframes x-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes x-slide-r { from { opacity: .2; transform: translateX(18%); } to { opacity: 1; transform: none; } }
@keyframes x-slide-l { from { opacity: .2; transform: translateX(-18%); } to { opacity: 1; transform: none; } }
@keyframes x-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes x-stamp-in {
  0% { opacity: 0; transform: rotate(calc(var(--rot, -10deg) - 20deg)) scale(2.2); }
  60% { opacity: 1; transform: rotate(var(--rot, -10deg)) scale(.9); }
  100% { opacity: 1; transform: rotate(var(--rot, -10deg)) scale(1); }
}
@keyframes x-mv-r {
  0%, 30% { opacity: 1; transform: translate(calc(var(--x) * (100% + var(--g))), calc(var(--y) * (100% + var(--g)))); }
  42%, 84% { opacity: 1; transform: translate(calc((var(--x) + 1) * (100% + var(--g))), calc(var(--y) * (100% + var(--g)))); }
  92% { opacity: 0; transform: translate(calc((var(--x) + 1) * (100% + var(--g))), calc(var(--y) * (100% + var(--g)))); }
  93% { opacity: 0; transform: translate(calc(var(--x) * (100% + var(--g))), calc(var(--y) * (100% + var(--g)))); }
  100% { opacity: 1; transform: translate(calc(var(--x) * (100% + var(--g))), calc(var(--y) * (100% + var(--g)))); }
}
@keyframes x-tap {
  0%, 8% { opacity: 0; transform: scale(1.4); }
  18% { opacity: 1; transform: scale(1); }
  25% { opacity: 1; transform: scale(.78); }
  32%, 100% { opacity: 0; transform: scale(.78); }
}
@keyframes x-hint {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 0 0 0 rgba(243, 154, 61, 0); filter: brightness(1); }
  50% { box-shadow: inset 0 0 0 3px #fff, 0 0 14px 5px rgba(243, 154, 61, .95); filter: brightness(1.12); }
}
@keyframes x-peek { 0%, 55%, 100% { opacity: 0; } 65%, 90% { opacity: .96; } }

@media (prefers-reduced-motion: reduce) {
  .x-card, .x-view-img, .x-stamp.is-new, .x-today-q, .x-card-pic::after { animation: none !important; }
  img.x-fade { transition: none !important; }
  .x-mt.a-right, .x-mt.a-right2, .x-finger, .x-peek, .x-mt.a-hint { animation: none !important; }
  .x-finger { opacity: .9; }
  .x-how-track { transition: none !important; }
}

/* ---- せまい画面（幅 380px 以下）の調整 ---- */
.x-back, .x-title, .x-today-play { white-space: nowrap; }
@media (max-width: 380px) {
  .x-back { padding: 8px 12px 8px 10px; font-size: 15px; }
  .x-title { font-size: 19px; }
  .x-today { grid-template-columns: minmax(0, 40%) 1fr; gap: 12px; padding: 10px; }
  .x-today-date { font-size: 26px; }
  .x-today-wd, .x-today-date small { font-size: 14px; }
  .x-today-play { padding-left: 10px; padding-right: 10px; font-size: 16px; }
  .x-today .btn-big { font-size: 19px; }
  .x-day { min-height: 34px; }
  .x-day-n { font-size: 15px; }
}

/* あそびかた：ページの中身は上下まんなかに（はみ出すときは上から） */
.x-how-page > :first-child { margin-top: auto; }
.x-how-page > :last-child { margin-bottom: auto; }
.x-fig-done { margin-bottom: 20px; }
/* 4まいめ（コースと ★）は文が長いので、低い画面では絵を小さく（360×640 で文がかくれないように） */
.x-fig-done { --s: min(60vw, 280px, calc(100dvh - 520px)); }

/* ======================================================================
   ぼかした絵の背景の上でも読めるように（絵はあざやかなアニメ画像のため）
   パネルの外に出ている文字には、うすい紙の地を敷く
   ====================================================================== */
.x-lead, .x-label, .x-count { color: var(--ink); text-shadow: 0 0 6px #FFF4DE; }
.x-album-head {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 253, 248, .88); box-shadow: var(--shadow-sm);
}
.x-topbar-r .x-count {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  background: rgba(255, 253, 248, .9); box-shadow: var(--shadow-sm); text-shadow: none;
}
.x-card.is-locked .x-card-title {
  justify-self: center; align-self: center; padding: 1px 10px; border-radius: 99px;
  background: rgba(255, 253, 248, .88); color: var(--ink);
}
/* じゆうに：えらぶ所をまとめて 紙のパネルに */
.x-free-ctrl {
  padding: 10px 12px 12px; border-radius: var(--radius);
  background: rgba(255, 253, 248, .9); box-shadow: var(--shadow);
}
.x-free-ctrl .x-label { text-shadow: none; }
/* 「絵」の見出しに、えらんでいる絵の題名（2行まで） */
.x-pic-label { display: flex; align-items: baseline; gap: 10px; }
.x-pic-label-k { flex: 0 0 auto; }
.x-pic-name {
  flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.3;
  word-break: keep-all; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.x-seg { background: rgba(138, 111, 92, .16); }
.x-seg-btn { color: var(--ink); }
.x-seg-btn:not(.is-on) .x-seg-main { font-weight: 700; opacity: .78; }
.x-free-best .muted { color: var(--ink-soft); }
@media (max-height: 700px) {
  .x-free-ctrl { padding: 6px 10px 8px; }
  .x-free-best { margin: 2px 0 0; }
}
/* せってい：いちばん下の版の文字 */
.x-credit { justify-self: center; align-self: center; padding: 2px 12px; border-radius: 99px; background: rgba(255, 253, 248, .85); color: var(--ink); }

/* 読みこみ中：だれの絵かの、やさしい色の地（白い札のままにしない）→ 読みこめたら ふわっと（img.x-fade）
   ※ 各部品の background より後ろに置く */
.x-card.is-owned .x-card-pic, .x-thumb, .x-dayview-pic, .x-today-pic, .x-view-frame, .x-free-prev {
  background: linear-gradient(rgba(255, 253, 248, .58), rgba(255, 253, 248, .58)), linear-gradient(135deg, var(--wa), var(--wb));
}

/* 題名・ことばの途中で折らない（空白の所で折る。入りきらない長い語だけ途中で） */
.x-view-title, .x-view-info, .x-today-title, .x-dayview-title, .x-today-note, .x-set-name small {
  word-break: keep-all; overflow-wrap: anywhere; line-break: strict;
}
