/* わんこコレクション：見た目
   - 絵は #stage（ドット絵のキャンバス）に描き、文字とボタンはその上に重ねる
   - --gy（地面の高さ）は game.js が入れる */
:root {
  --ink: #2a1a14;
  --win: #1d2547;
  --gold: #ffd76a;
  --link: #9fd8ff;
  --fire: #e8622c;
  --gy: 50vh;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: #1b2340;
  color: var(--ink);
  font-family: "DotGothic16", "Hiragino Maru Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 18px;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app {
  position: relative;
  width: 100%; max-width: 480px;
  height: 100vh; height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #8fd3ff;
  touch-action: none;
}
#stage { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.screen { position: absolute; inset: 0; }

/* ---------- ボタン ---------- */
.pxbtn {
  font: inherit; color: var(--ink); background: #fff;
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 14px; min-height: 48px; cursor: pointer; border-radius: 0;
}
.pxbtn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.pxbtn:focus-visible { outline: 3px solid var(--fire); outline-offset: 2px; }
.pxbtn:disabled { background: #d9d4cb; color: #7a7068; cursor: default; }
.pxbtn.small { font-size: 15px; padding: 4px 10px; min-height: 36px; box-shadow: 3px 3px 0 var(--ink); }
.pxbtn.big { font-size: 26px; background: var(--gold); min-height: 64px; }
.pxbtn small { display: block; font-size: 13px; }

/* ---------- 上の帯 ---------- */
.topbar {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 0;
}
.coins, .hearts {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 3px solid var(--ink); padding: 2px 10px; min-height: 36px; font-size: 20px;
}
.coin { width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 3px solid var(--ink); display: inline-block; }
.hearts { color: #d8453b; letter-spacing: 2px; }
.hearts .off { color: #cfc8bd; }

/* ---------- ホーム ---------- */
.title { position: absolute; left: 0; right: 0; top: calc(58px + env(safe-area-inset-top)); text-align: center; }
.title .en { margin: 0; font-family: "Press Start 2P", monospace; font-size: 12px; letter-spacing: .2em; }
.title h1 {
  margin: 6px 0 0; font-weight: 400; font-size: clamp(34px, 11vw, 48px); line-height: 1.15; color: #fff;
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
               3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink), 5px 6px 0 var(--ink);
}
.menu {
  position: absolute; left: 0; right: 0; top: calc(var(--gy) + 26px); bottom: 0;
  display: flex; flex-direction: column; gap: 14px;
  padding: 0 28px calc(12px + env(safe-area-inset-bottom));
}
.pxbtn.big small { font-size: 14px; }
.pxbtn.gold { background: var(--gold); }
.tb-right { display: flex; gap: 6px; }
#home .topbar .pxbtn.small { font-size: 14px; padding: 4px 7px; white-space: nowrap; }
#home .topbar .coins { padding: 2px 8px; }
.title .lead {
  margin: 8px 12px 0; font-size: 16px; color: #fff;
  text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink);
}
/* ホームのいちばん下：きろくの ほぞんについて */
.savenote {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: auto 0 0; padding-top: 2px;
  font-size: 13px; color: #fff; text-shadow: 2px 2px 0 var(--ink);
}
.savenote .sitelink { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.title .en a { color: inherit; text-decoration: none; }
.savenote a:not(.pxbtn) { color: #fff; }
.savenote .pxbtn { font-size: 13px; min-height: 30px; padding: 2px 10px; text-shadow: none; }
.win { max-height: 100%; overflow-y: auto; touch-action: pan-y; }
.win .notes { margin: 4px 0 0; padding: 0; list-style: none; text-align: left; font-size: 15px; line-height: 1.6; }
.win .notes li { margin: 0 0 10px; padding-left: 1.3em; text-indent: -1.3em; word-break: keep-all; overflow-wrap: anywhere; }
.win .notes li::before { content: "🐾 "; }
.win .notes b { font-weight: 400; color: var(--gold); }
/* ミニゲームをえらぶ窓：押したくなる 大きなボタン */
.win .games { display: flex; flex-direction: column; gap: 14px; margin: 12px 0 4px; }
.win .gamecard {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 74px; padding: 8px 12px; text-align: left;
  border-width: 4px; box-shadow: 5px 5px 0 #000; animation: cardbob 1.6s ease-in-out infinite;
}
.win .gamecard.ball { background: #ffd76a; }
.win .gamecard.run { background: #a6e58f; animation-delay: .2s; }
.win .gamecard.pet { background: #ffb8d0; animation-delay: .4s; }
.win .gamecard.challenge { background: #b8c8ff; animation-delay: .6s; }
.win .gamecard:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 #000; animation: none; }
.win .gamecard .gc-ico {
  flex: none; width: 66px; height: 50px; display: flex; align-items: center; justify-content: center; gap: 3px;
  background: #fff; border: 3px solid var(--ink); border-radius: 4px;
}
.win .gamecard canvas { image-rendering: pixelated; flex: none; }
.win .gamecard .heart { color: #e0507a; font-size: 24px; line-height: 1; }
.win .gamecard .gc-name { flex: 1; min-width: 0; font-size: 21px; line-height: 1.2; white-space: nowrap; }
.win .gamecard .gc-name small { display: block; margin-top: 3px; font-size: 13px; color: var(--ink); white-space: normal; word-break: keep-all; }
.win .gamecard .gc-name .gc-best { font-size: 12px; color: #6e4a1a; }
.win .gamecard.ball .gc-ico canvas { width: 18px !important; height: 18px !important; }
.win .gamecard .gc-go {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 15px; line-height: 34px; text-align: center; padding-left: 2px;
}
@media (max-width: 350px) {
  .win .gamecard { gap: 8px; padding: 8px; }
  .win .gamecard .gc-ico { width: 52px; }
  .win .gamecard .gc-ico canvas { max-width: 22px; height: auto !important; }
  .win .gamecard.ball .gc-ico { gap: 1px; }
  .win .gamecard.ball .gc-ico canvas { width: 14px !important; height: 14px !important; }
  .win .gamecard .gc-name { font-size: 18px; }
  .win .gamecard .gc-go { width: 28px; height: 28px; line-height: 28px; font-size: 13px; }
}
@keyframes cardbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .win .gamecard { animation: none; } }
/* ---------- 毎日あそぶ仕組み ---------- */
.goldtext { color: var(--gold); }
#toast {
  position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 5;
  width: max-content; max-width: 92%; padding: 8px 16px; white-space: pre-line; word-break: keep-all; text-align: center; font-size: 17px; line-height: 1.5;
  color: var(--ink); background: var(--gold); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); pointer-events: none;
}
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 10px 0; }
.streak .day { display: flex; flex-direction: column; align-items: center; padding: 4px 0; font-size: 13px; color: #d7ddf3; border: 2px solid #5a67a8; }
.streak .day b { font-weight: 400; font-size: 12px; }
.streak .day.done { background: #34406e; color: #9aa6d8; }
.streak .day.today { background: var(--gold); color: var(--ink); border-color: #fff; }
.missions { list-style: none; margin: 6px 0 10px; padding: 0; text-align: left; font-size: 15px; }
.missions li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 2px dashed #5a67a8; flex-wrap: wrap; }
.missions .mk { flex: none; width: 22px; height: 22px; border: 2px solid #fff; text-align: center; line-height: 18px; color: var(--ink); }
.missions li.ok .mk { background: var(--gold); }
.missions .mt { flex: 1; min-width: 0; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.missions .mt i { display: block; height: 6px; margin-top: 4px; background: #34406e; border: 1px solid #fff; }
.missions .mt u { display: block; height: 100%; background: var(--gold); }
.missions b { flex: none; font-weight: 400; color: var(--gold); }
.missions li.ok .mt { color: #9aa6d8; }
.missions.themes li.ok .mt { color: var(--gold); }
.missions .pxbtn { flex: none; margin-left: auto; }
/* ---------- ずかんの中 ---------- */
.book-panel h3 { margin: 18px 0 6px; padding-bottom: 2px; font-weight: 400; font-size: 20px; color: var(--gold); border-bottom: 3px solid var(--gold); }
.book-sub { margin: 0 0 8px; font-size: 14px; color: #d7ddf3; }
.pdogs { display: flex; flex-direction: column; gap: 10px; }
.pdog { display: flex; gap: 10px; padding: 8px; border: 3px solid #fff; }
.pphoto {
  flex: none; position: relative; width: 104px; height: 104px; border: 3px solid var(--ink); outline: 2px solid #fff;
  background: #34406e url("../assets/img/dogs.jpg") no-repeat; background-size: 300%;
}
.pphoto canvas { position: absolute; left: -6px; bottom: -6px; background: #fff; border: 2px solid var(--ink); image-rendering: pixelated; }
.pbody { flex: 1; min-width: 0; }
.pbody h4 { margin: 0; font-weight: 400; font-size: 22px; color: var(--gold); }
.pbody p { margin: 3px 0 0; font-size: 13px; line-height: 1.55; }
.pbody .pmeta { color: var(--link); }
.pbody .pgame { color: #ffe9a8; }
.pbody a.psticker { display: inline-block; margin-top: 8px; text-decoration: none; color: var(--ink); }
.bgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bgs .pxbtn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; min-height: 0; font-size: 14px; box-shadow: 3px 3px 0 #000; }
.bgs .pxbtn small { font-size: 11px; }
.bgs .pxbtn[aria-pressed="true"] { background: var(--gold); }
.bgs .sw { width: 44px; height: 30px; border: 2px solid var(--ink); }
@media (max-width: 350px) {
  .pxbtn.small { font-size: 13px; padding: 4px 6px; }
  .tb-right { gap: 5px; }
  .pphoto { width: 84px; height: 84px; }
}
/* さいしょの1分 */
.welcome-dogs, .welcome-gifts { display: flex; justify-content: center; gap: 10px; margin: 10px 0; }
.welcome-dogs span, .welcome-gifts span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; }
.welcome-gifts span { padding: 6px 4px; background: #fff; color: var(--ink); border: 3px solid var(--ink); font-size: 12px; }
.welcome-dogs canvas, .welcome-gifts canvas { image-rendering: pixelated; background: #fff; border: 3px solid var(--ink); }
.fast { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 14px; color: #d7ddf3; pointer-events: none; }
/* きょうの3匹（日記） */
#btn-diary { position: relative; }
#btn-diary.new::after { content: "NEW"; position: absolute; top: -10px; right: -8px; padding: 0 4px; font-size: 10px; line-height: 15px; color: #fff; background: var(--fire); border: 2px solid var(--ink); }
.win .diary { list-style: none; margin: 8px 0; padding: 0; text-align: left; }
.win .diary li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 2px dashed #5a67a8; }
.win .diary canvas { flex: none; image-rendering: pixelated; background: #fff; border: 2px solid var(--ink); }
.win .diary b { display: block; font-weight: 400; font-size: 15px; color: var(--gold); }
.win .diary span { font-size: 14px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.win .dpast { text-align: left; margin: 4px 0; font-size: 14px; color: #d7ddf3; }
.win .dpast summary { cursor: pointer; padding: 4px 0; }
.win .dsite { margin: 12px 0 2px; color: var(--gold); text-align: left; }
.win a.pxbtn { display: inline-block; text-decoration: none; color: var(--ink); }
/* あそびかたの窓 */
.win .howto { list-style: none; margin: 4px 0 0; padding: 0; text-align: left; font-size: 15px; line-height: 1.5; }
.win .howto li { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; word-break: keep-all; overflow-wrap: anywhere; }
.win .howto .hi {
  flex: none; width: 78px; min-height: 40px; padding: 3px; display: flex; flex-wrap: wrap; gap: 3px; align-items: center; justify-content: center;
  font-size: 17px; color: var(--ink); background: #bfe6ff; border: 3px solid #fff;
}
.win .howto canvas { image-rendering: pixelated; flex: none; }
/* ショーに出る犬をえらぶ */
.win .cast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.win .cast .pxbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 16px; box-shadow: 3px 3px 0 #000; }
.win .cast .pxbtn small { font-size: 13px; }
.win .cast .pxbtn[aria-pressed="true"] { background: var(--gold); }
.win .cast .pxbtn[aria-pressed="false"] { background: #b9b3aa; color: #6e665e; }
.win .cast .pxbtn[aria-pressed="false"] canvas { opacity: .45; }
.win .cast canvas { image-rendering: pixelated; }
/* ホームの4つのステップ */
.guide {
  margin: 0; padding: 6px 10px; text-align: center; font-size: 16px; line-height: 1.5; min-height: 36px;
  color: #fff; background: var(--win); border: 3px solid #fff; box-shadow: 0 0 0 3px var(--ink);
}
.pxbtn.step { display: flex; align-items: center; gap: 10px; text-align: left; font-size: 22px; min-height: 58px; padding: 6px 12px; position: relative; }
.pxbtn.step .no {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff;
  font-style: normal; font-size: 18px; line-height: 30px; text-align: center;
}
.pxbtn.step small { font-size: 13px; color: #6e5a4e; }
.pxbtn.step.dim { background: #e4dfd6; color: #7a7068; }
.pxbtn.step.dim .no { background: #9a9088; }
.pxbtn.step.now { background: var(--gold); animation: nowpulse 1.1s ease-in-out infinite; }
.pxbtn.step.now small { color: var(--ink); }
.pxbtn.step.now::after {
  content: "つぎは ここ！"; position: absolute; right: -6px; top: -14px; padding: 1px 8px;
  font-size: 13px; color: #fff; background: var(--fire); border: 3px solid var(--ink); transform: rotate(4deg);
}
@keyframes nowpulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.row2 .pxbtn.step { font-size: 18px; gap: 6px; padding: 6px 8px; }
.row2 .pxbtn.step.now::after { content: "ここ！"; }
@media (max-height: 700px) {
  .title h1 { font-size: 30px; }
  .title h1 .tall { display: none; }
  .title .lead { font-size: 14px; margin-top: 4px; }
  .menu { gap: 10px; }
  .guide { font-size: 14px; min-height: 0; padding: 4px 8px; }
  .pxbtn.step, .row2 .pxbtn.step { min-height: 48px; }
  .savenote { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .pxbtn.step.now { animation: none; } }
.pxbtn.mid { font-size: 22px; min-height: 56px; }
.pxbtn.mid small { font-size: 13px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.row3 .pxbtn { padding: 8px 2px; min-height: 60px; font-size: 17px; }
.row3 .pxbtn small { font-size: 12px; }
#timer::before { content: "⏱"; font-size: 15px; }

/* ---------- ずかん ---------- */
.book-panel {
  position: absolute; left: 0; right: 0; top: calc(56px + env(safe-area-inset-top)); bottom: 0;
  overflow-y: auto; touch-action: pan-y;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  background: var(--win); border-top: 4px solid #fff; box-shadow: 0 -4px 0 var(--ink); color: #fff;
}
.book-panel h2 { margin: 0 0 8px; font-weight: 400; font-size: 26px; color: var(--gold); text-align: center; }
.records { list-style: none; margin: 0 0 12px; padding: 8px 12px; border: 3px solid #fff; font-size: 16px; }
.records li { display: flex; justify-content: space-between; padding: 3px 0; }
.records b { font-weight: 400; color: var(--gold); }
.book-panel .grid { overflow: visible; margin-top: 10px; }
.grid .cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 118px; padding: 8px 2px 6px; font-size: 12px; text-align: center;
  color: var(--ink); background: #fff; border: 3px solid var(--ink);
}
.grid .cell.none { background: #d9d4cb; color: #7a7068; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row2 .pxbtn { padding: 8px 4px; min-height: 60px; }
.row2 .pxbtn small { font-size: 12px; }

/* ---------- ファッションショー ---------- */
.caption {
  position: absolute; left: 24px; right: 24px; top: calc(var(--gy) + 64px); margin: 0; padding: 10px 8px; text-align: center;
  color: #fff; background: var(--win); border: 3px solid #fff; box-shadow: 0 0 0 3px var(--ink);
  font-size: 20px; line-height: 1.5; min-height: 56px;
}
.win .photo { display: block; width: 100%; height: auto; border: 3px solid #fff; image-rendering: auto; }
.theme-line { margin: 0; color: var(--gold); font-size: 15px; text-align: center; }
/* きせかえ：★と「はやり」の説明、いまの星 */
.dress-info { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; font-size: 13px; line-height: 1.45; color: #fff; }
.dress-info p { margin: 0; grid-column: 1; word-break: keep-all; overflow-wrap: anywhere; }
.dress-info #dress-theme { color: var(--gold); }
.dress-info .pxbtn { grid-column: 2; grid-row: 1 / span 2; font-size: 12px; padding: 4px 6px; min-height: 0; white-space: nowrap; box-shadow: 3px 3px 0 #000; }
.dress-score {
  position: absolute; left: 50%; top: calc(54px + env(safe-area-inset-top)); transform: translateX(-50%); margin: 0; padding: 3px 12px;
  width: max-content; max-width: 94%; text-align: center; font-size: 13px; line-height: 1.4;
  color: var(--ink); background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.dress-score b { display: block; font-weight: 400; font-size: 17px; color: #b0582a; }
.grid .trend { position: absolute; top: 4px; left: 4px; padding: 0 4px; font-size: 11px; line-height: 15px; color: #fff; background: #3f8fd8; border: 2px solid var(--ink); }
.grid .tag { font-size: 11px; color: #6e5a4e; }
.caption { white-space: pre-line; }
.win .judge { list-style: none; margin: 8px 0; padding: 6px 10px; text-align: left; font-size: 14px; line-height: 1.5; border: 2px solid #5a67a8; }
.win .judge li { padding: 3px 0; }
.win .judge b { display: block; font-weight: 400; color: var(--gold); }
.win .judge span { font-size: 12px; color: #d7ddf3; }

.best { margin: 2px 0 0; text-align: center; color: #fff; text-shadow: 2px 2px 0 var(--ink); }

/* ---------- ボールとり ---------- */
.hint {
  position: absolute; left: 24px; right: 24px; top: 13%; margin: 0; padding: 10px 8px; text-align: center;
  color: #fff; background: var(--win); border: 3px solid #fff; box-shadow: 0 0 0 3px var(--ink);
  font-size: 16px; line-height: 1.7;
  pointer-events: none; transition: opacity .4s;
}
.hint.off { opacity: 0; }
.combo {
  position: absolute; left: 0; right: 0; top: calc(56px + env(safe-area-inset-top)); margin: 0; text-align: center;
  color: #fff; font-size: 20px; pointer-events: none;
  text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink);
}
.switch .pair { display: flex; align-items: center; gap: 6px; }
.switch {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}
.switch .pxbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-size: 16px; min-height: 84px; }
.switch .pxbtn small { font-size: 12px; color: #6e5a4e; }
.switch .pxbtn[aria-pressed="true"] { background: var(--gold); }

/* ---------- きせかえ ---------- */
.panel {
  position: absolute; left: 0; right: 0; top: calc(var(--gy) + 22px); bottom: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--win); border-top: 4px solid #fff; box-shadow: 0 -4px 0 var(--ink);
}
#dress-dog { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% - var(--gy) - 2px); image-rendering: pixelated; cursor: pointer; touch-action: manipulation; }
#dress-dog.spin { animation: dogspin .7s ease-in-out; }
@keyframes dogspin { 0% { transform: translateX(-50%) scaleX(1); } 25% { transform: translateX(-50%) translateY(-12px) scaleX(-1); } 50% { transform: translateX(-50%) translateY(-18px) scaleX(1); } 75% { transform: translateX(-50%) translateY(-8px) scaleX(-1); } 100% { transform: translateX(-50%) scaleX(1); } }
.prize { gap: 10px; align-items: flex-end; }
@media (prefers-reduced-motion: reduce) { #dress-dog.spin { animation: none; } }
.tabs canvas, .switch canvas, .grid canvas, .prize canvas { image-rendering: pixelated; flex: none; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tabs.slots { grid-template-columns: repeat(4, 1fr); }
.tabs .pxbtn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px; font-size: 16px; min-height: 44px; box-shadow: 3px 3px 0 #000; }
.tabs .pxbtn[aria-selected="true"] { background: var(--gold); }
.grid { flex: 1; min-height: 0; overflow-y: auto; touch-action: pan-y; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: start; padding: 2px 4px 6px 2px; }
.grid .pxbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: relative; padding: 8px 2px 6px; font-size: 12px; min-height: 136px; box-shadow: 3px 3px 0 #000; }
.grid .pxbtn[aria-pressed="true"] { background: var(--gold); }
.grid .star { position: absolute; top: 2px; right: 6px; font-size: 20px; color: var(--fire); }
.grid .lock { font-size: 40px; line-height: 76px; }
.grid .empty { grid-column: 1 / -1; color: #d7ddf3; font-size: 16px; line-height: 1.7; margin: 4px 2px; }

/* ---------- お知らせの窓 ---------- */
#modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(27, 35, 64, .6); }
.win {
  width: 100%; max-width: 340px; text-align: center;
  background: var(--win); color: #fff; border: 4px solid #fff; border-radius: 6px;
  box-shadow: 0 0 0 4px var(--ink), 8px 10px 0 4px rgba(42, 26, 20, .4);
  padding: 18px 18px 20px;
}
.win h2 { margin: 0 0 8px; font-weight: 400; font-size: 26px; color: var(--gold); }
.win p { margin: 6px 0; line-height: 1.6; }
.win .num { font-size: 40px; color: var(--gold); }
.win .prize { display: flex; justify-content: center; margin: 10px 0 4px; }
.win .prize canvas { background: #fff; border: 3px solid var(--ink); }
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) { .hint { transition: none; } }

/* 文の途中（文字のあいだ）ではなく、空白のところで折り返す */
.guide, .title .lead, .hint, .caption, .win p, .win h2 { word-break: keep-all; overflow-wrap: anywhere; }
