/* かずのたまと共通の見た目（かずのたまの style.css から、そろばん以外を写した） */
:root {
  --bg: #fff4de;
  --ink: #4a3426;
  --sub: #8a6a55;
  --board: #fffdf7;
  --red: #e8473f;
  --blue: #2f7de1;
  --green: #3aa76d;
  --yellow: #ffd24a;
  --card: #ffffff;
  --shadow: 0 6px 0 rgba(74, 52, 38, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "BIZ UDGothic", "Yu Gothic UI", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  overscroll-behavior: none;
}
#app { position: fixed; inset: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; }
button { font-family: inherit; color: inherit; border: none; cursor: pointer; touch-action: manipulation; }

/* ---- タイトル ---- */
.title-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; }
.title-mascot { width: min(30vh, 34vw); animation: bounce 1.6s ease-in-out infinite; }
.title-text { font-size: min(10vh, 11vw); font-weight: 800; letter-spacing: .08em; margin: 0; }
.title-text .r { color: var(--red); } .title-text .b { color: var(--blue); }
.menu { display: flex; gap: 3vw; flex-wrap: wrap; justify-content: center; }
.big-btn {
  font-size: min(4.6vh, 5vw); font-weight: 800; padding: 2.2vh 4vw; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow); min-width: 22vw;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(74, 52, 38, .18); }
.big-btn.primary { background: var(--red); color: #fff; }
.big-btn.blue { background: var(--blue); color: #fff; }
.big-btn.green { background: var(--green); color: #fff; }
.parent-btn {
  position: absolute; right: 2vw; bottom: 2vh; font-size: 14px; padding: 10px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .7); color: var(--sub);
}
.parent-btn .fill { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--sub); border-radius: 2px; }
.loading { position: absolute; bottom: 12vh; font-size: 18px; color: var(--sub); }

/* ---- 上の帯 ---- */
.topbar { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 1.5vh 2vw 0; }
.home-btn { font-size: 18px; padding: 10px 16px; border-radius: 14px; background: rgba(255, 255, 255, .8); box-shadow: 0 3px 0 rgba(74, 52, 38, .12); }
.dots { display: flex; gap: 8px; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: #ead9bf; }
.dot.done { background: var(--yellow); box-shadow: 0 0 0 2px #e0ac1a inset; }
.dot.miss { background: #f3c6a8; }
.dot.now { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- 問題の画面 ---- */
.lesson { justify-content: flex-start; }
.prompt-row { width: 100%; display: flex; align-items: center; gap: 2vw; padding: 1vh 4vw 0; min-height: 15vh; }
.mascot { width: min(14vh, 13vw); flex: none; transition: transform .2s; }
.mascot.jump { animation: jump .6s ease; }
.mascot.tilt { animation: tilt .8s ease; }
.bubble {
  position: relative; background: #fff; border-radius: 28px; padding: 1.6vh 2.4vw; font-size: min(4.4vh, 4.2vw);
  font-weight: 800; line-height: 1.35; box-shadow: var(--shadow); flex: 1;
}
.bubble::before { content: ""; position: absolute; left: -16px; top: 50%; margin-top: -12px; border: 12px solid transparent; border-right: 16px solid #fff; border-left: 0; }
.replay { flex: none; width: 64px; height: 64px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); font-size: 28px; }
.scene { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; min-height: 0; padding: 1vh 4vw 2vh; }

/* ---- シール ---- */
.reward { justify-content: center; gap: 3vh; }
.reward .sticker-big { width: min(40vh, 40vw); animation: spinIn 1s ease; }
.reward h2 { font-size: min(6vh, 6vw); margin: 0; }
.book { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2vw; padding: 3vh 4vw; }
.slot { width: min(22vh, 15vw); height: min(22vh, 15vw); border-radius: 24px; background: #fff; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; position: relative; }
.slot img { width: 85%; height: 85%; object-fit: contain; }
.slot.locked img { filter: brightness(0); opacity: .1; }
.slot .n { position: absolute; right: 8px; bottom: 6px; font-size: 18px; font-weight: 800; color: var(--sub); }

/* ---- おうちのかたへ ---- */
.parent { overflow-y: auto; align-items: stretch; padding: 3vh 5vw; font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif; }
.parent h2 { margin: 0 0 8px; font-size: 24px; }
.parent h3 { margin: 20px 0 4px; font-size: 18px; }
.parent p { margin: 4px 0 16px; color: var(--sub); line-height: 1.6; font-size: 15px; }
.parent table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 15px; }
.parent th, .parent td { padding: 10px 12px; border-bottom: 1px solid #f0e6d8; text-align: left; vertical-align: middle; }
.parent td.num, .parent th.num { text-align: right; font-variant-numeric: tabular-nums; }
.parent th { background: #f7efe2; font-weight: 600; white-space: nowrap; }
.parent td:first-child { white-space: nowrap; }
.hist { display: inline-flex; gap: 3px; }
.hist i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #ddd; }
.hist i.o { background: var(--green); } .hist i.x { background: #e8a07a; }
.parent .actions { margin-top: 20px; display: flex; gap: 12px; }
.parent .actions button { padding: 12px 18px; border-radius: 12px; background: #fff; box-shadow: 0 3px 0 rgba(74, 52, 38, .12); font-size: 15px; }

/* ---- 演出 ---- */
.burst { position: fixed; pointer-events: none; font-size: 54px; animation: burst 1s ease forwards; z-index: 10; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes jump { 0% { transform: translateY(0); } 40% { transform: translateY(-30px) rotate(-8deg); } 100% { transform: translateY(0); } }
@keyframes tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-12deg); } 60% { transform: rotate(10deg); } }
@keyframes pop { 0% { transform: scale(.2); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes spinIn { 0% { transform: scale(0) rotate(-180deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; } 100% { transform: translate(-50%, -160%) scale(1.4); opacity: 0; } }
@keyframes shake { 0%, 100% { translate: 0; } 20% { translate: -10px; } 40% { translate: 10px; } 60% { translate: -6px; } 80% { translate: 6px; } }
