/* サッカー英語ミッション: iPad 横長。芝生の地・スコアボードの上帯・本のページのような色枠 */
:root {
  --ink: #1d2025; --grass: #2f9e4f; --grass2: #38ab59; --night: #123d22;
  --blue: #2f6fd6; --green: #1f9a46; --yellow: #f5c400; --red: #d33a32;
  --paper: #ffffff; --line: #e3e0d6;
  --en: "Andika", "Century Gothic", "Avenir Next", sans-serif;
  --jp: "Noto Sans JP", "Hiragino Sans", sans-serif;
  --num: "Inter", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--jp); color: var(--ink); overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--grass) 0 120px, var(--grass2) 120px 240px);
  display: flex; flex-direction: column; -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.ic { width: 1.15em; height: 1.15em; flex: none; }
[hidden] { display: none !important; }

/* 上帯(スコアボード) */
.board {
  flex: none; height: 72px; display: flex; align-items: center; gap: 14px; padding: 0 18px;
  padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right));
  background: var(--night); color: #fff; border-bottom: 4px solid #fff;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 18px; white-space: nowrap; }
.ball-ico { width: 34px; height: 34px; }
.tabs { display: flex; gap: 6px; margin: 0 auto; }
.tabs button {
  display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 8px;
  font-weight: 700; font-size: 17px; color: #cfe8d6; white-space: nowrap;
}
.tabs button svg { width: 22px; height: 22px; }
.tabs button.on { background: #fff; color: var(--night); }
.score { display: flex; align-items: center; gap: 8px; background: #000; border: 2px solid #3c4a40; border-radius: 6px; padding: 4px 12px; }
.score .lbl { font-size: 12px; font-weight: 700; color: #9fb6a6; }
.score .num { font-family: var(--num); font-weight: 900; font-size: 30px; color: #ffd84a; min-width: 2.2em; text-align: right; letter-spacing: .04em; }
.score.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.18); } }
.gear { width: 44px; height: 44px; color: #9fb6a6; display: grid; place-items: center; }
.gear svg { width: 28px; height: 28px; }

main { flex: 1; min-height: 0; padding: 16px 22px 18px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }

/* 進み具合 */
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex: none; }
.steps li {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px;
  background: rgba(255,255,255,.22); color: #eaf6ee; font-weight: 700; font-size: 16px;
}
.steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.25); font-family: var(--num); font-size: 14px; }
.steps .n .ic { width: 16px; height: 16px; }
.steps li.ok { background: rgba(255,255,255,.4); color: #fff; }
.steps li.now { background: #fff; color: var(--night); }
.steps li.now .n { background: var(--yellow); color: var(--ink); }

/* ボタン */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 24px; border-radius: 10px; font-weight: 900; font-size: 20px;
  color: #fff; border-bottom: 5px solid rgba(0,0,0,.22); transition: transform .08s;
}
.btn:active { transform: translateY(3px); border-bottom-width: 2px; }
.btn.big { min-height: 68px; font-size: 26px; padding: 0 34px; }
.btn.sm { min-height: 44px; font-size: 16px; padding: 0 14px; border-bottom-width: 4px; }
.btn.blue { background: var(--blue); }
.btn.blue.light { background: #6b9ae6; }
.btn.green { background: var(--green); }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.red { background: var(--red); }
.btn.ghost { background: rgba(255,255,255,.92); color: var(--ink); }
.btn.off { background: #c9ccc6; color: #fff; }
.btn.round { border-radius: 40px; }

.tag { display: inline-block; background: var(--night); color: #fff; font-weight: 700; font-size: 15px; padding: 4px 12px; border-radius: 4px; }

/* 絵 */
.art { width: 100%; height: 100%; overflow: hidden; border-radius: 8px; background: #e8f4fb; }
.art img, .art svg { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 1. たんご */
.intro { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; }
.word-card {
  background: var(--paper); border-radius: 16px; border: 6px solid var(--yellow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px;
}
.big-word { font-family: var(--en); font-weight: 700; font-size: clamp(90px, 22vh, 210px); line-height: 1; color: var(--red); }
.mean { font-size: clamp(26px, 5vh, 42px); font-weight: 900; }
.intro-art { border-radius: 16px; overflow: hidden; border: 6px solid #fff; background: #fff; }
.intro-art .art { border-radius: 0; }

/* 2. 1文ずつ */
.one {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 0.85fr 1.25fr; gap: 0;
  background: var(--paper); border: 6px solid var(--c); border-radius: 16px; overflow: hidden;
}
.one-text { padding: 26px 30px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.cnt { font-family: var(--num); font-weight: 900; color: var(--c); font-size: 22px; }
.en { font-family: var(--en); font-weight: 700; margin: 0; line-height: 1.15; }
.one .en { font-size: clamp(44px, 8.6vh, 84px); }
.hl { color: var(--red); }
.jp { margin: 0; font-weight: 700; font-size: clamp(22px, 3.6vh, 32px); color: #3b4a3f; background: #fff6cc; border-radius: 6px; padding: 8px 14px; align-self: flex-start; }
.one-art { position: relative; }
.one-art .art { border-radius: 0; background: #fff; display: flex; align-items: center; }
.one-art .art img, .intro-art .art img { object-fit: contain; height: auto; }
.intro-art .art { display: flex; align-items: center; background: #fff; }
.who { position: absolute; left: 12px; top: 12px; background: rgba(29,32,37,.82); color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px; border-radius: 4px; }

/* 3. 4文まとめ(本のページ) */
.grid4 { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(4, 1fr); gap: 10px; }
.cell { background: var(--paper); border: 4px solid var(--c); border-radius: 12px; display: grid; grid-template-columns: 1fr minmax(0, 34%); overflow: hidden; min-height: 0; }
.cell-text { padding: 6px 18px; display: flex; align-items: center; gap: 16px; min-width: 0; }
.cell .en { font-size: clamp(30px, 6.4vh, 58px); flex: 1; min-width: 0; }
.cell .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cell .jp { font-size: 18px; padding: 2px 10px; }
.cell-text .row { flex: none; flex-wrap: nowrap; }
.cell .art { border-radius: 0; background: #fff; }
.cell .art img { object-fit: contain; }
/* 4. ノート */
.note { flex: 1; min-height: 0; background: #fffdf5; border-radius: 14px; padding: 18px 34px; display: flex; flex-direction: column; justify-content: space-around; border-left: 14px solid #e2453c; }
.note-head { display: flex; align-items: center; gap: 14px; }
.note-word { font-family: var(--en); font-weight: 700; font-size: 34px; color: var(--red); }
.line { position: relative; height: clamp(64px, 12vh, 104px); border-top: 2px solid #9fb6d9; border-bottom: 2px solid #9fb6d9; display: flex; align-items: center;
  background: linear-gradient(transparent 0 32%, #c9d6ea 32% calc(32% + 1px), transparent calc(32% + 1px) 66%, #f0a3a3 66% calc(66% + 2px), transparent calc(66% + 2px)); }
.line span { font-family: var(--en); font-size: clamp(42px, 8.4vh, 76px); line-height: 1; transform: translateY(-4%); }

/* 5. ごほうび */
.reward { flex: 1; min-height: 0; position: relative; background: var(--night); border-radius: 16px; color: #fff; padding: 20px 26px; display: flex; flex-direction: column; justify-content: center; gap: 20px; overflow: hidden; }
.reward h2 { margin: 0; text-align: center; font-size: clamp(44px, 9vh, 80px); font-weight: 900; color: var(--yellow); }
.rw-row { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 14px; }
.rw-box { background: rgba(255,255,255,.1); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rw-box .lbl { font-weight: 700; color: #cfe8d6; }
.rw-pts { font-family: var(--num); font-weight: 900; font-size: 64px; color: var(--yellow); line-height: 1; }
.rw-box .sub { font-size: 14px; color: #cfe8d6; }
.rw-ball svg { width: 96px; height: 96px; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rw-cards { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mini { width: 110px; text-align: center; font-size: 13px; font-weight: 700; }
.mini .art { height: 76px; border: 3px solid #fff; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; animation: fall 2.6s ease-in forwards; }
.confetti i:nth-child(4n) { background: #ffd84a; } .confetti i:nth-child(4n+1) { background: #ff6b6b; } .confetti i:nth-child(4n+2) { background: #6bc7ff; } .confetti i:nth-child(4n+3) { background: #fff; }
.confetti i:nth-child(n) { left: calc(var(--x, 50) * 1%); }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* クリア済み */
.cleared { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.cl-head { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 14px; padding: 12px 20px; }
.cl-head h2 { margin: 4px 0 0; font-size: 38px; font-weight: 900; color: var(--green); }
.cl-head p { margin: 0; font-weight: 700; }
.cl-word span { font-family: var(--en); font-weight: 700; font-size: 72px; color: var(--red); line-height: 1; }
.cl-word { display: flex; align-items: baseline; gap: 14px; }
.cl-word small { font-size: 22px; font-weight: 900; }
.center-card { margin: auto; background: #fff; border-radius: 16px; padding: 40px; text-align: center; }

/* ならったページ */
.book, .cards { background: #fff; border-radius: 16px; padding: 18px 22px; }
.book h2, .cards h2, .st-side h2 { margin: 0 0 12px; font-size: 26px; font-weight: 900; }
h2 small { font-family: var(--num); color: #5b5f66; font-size: 18px; margin-left: 6px; }
.tiles { display: grid; grid-template-columns: repeat(11, 1fr); gap: 8px; }
.tile { aspect-ratio: 1; border-radius: 8px; background: #eaf6ee; border: 3px solid var(--green); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.tile .no { position: absolute; top: 4px; left: 6px; font-family: var(--num); font-size: 12px; font-weight: 700; color: #5b5f66; }
.tile .tw { font-family: var(--en); font-weight: 700; font-size: 26px; }
.tile.locked { background: #f1f1ee; border-color: #dcdcd6; color: #b9bbb5; }
.tile.locked .ic { width: 22px; height: 22px; }
.book-top { flex: none; }
.book-word { background: #fff; border-radius: 10px; padding: 6px 20px; font-family: var(--en); font-weight: 700; font-size: 40px; color: var(--red); }
.book-word small { font-family: var(--jp); color: var(--ink); font-size: 18px; }

/* スタジアム */
.stadium { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.9fr 1fr; gap: 14px; }
.st-pic { border-radius: 16px; overflow: hidden; border: 6px solid #fff; background: #fff; align-self: start; aspect-ratio: 800 / 440; }
.st-pic svg { width: 100%; height: 100%; display: block; }
.st-side { background: #fff; border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.shop { list-style: none; margin: 0; padding: 0; }
.shop li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); min-height: 54px; }
.shop .dn { flex: 1; font-weight: 700; font-size: 18px; }
.shop .own { color: var(--green); }
.shop .have { font-weight: 700; color: var(--green); }
.balls { margin-top: 12px; }
.balls .lbl { font-weight: 700; margin-bottom: 6px; }
.ball-row { display: flex; flex-wrap: wrap; gap: 4px; }
.ball-row svg { width: 30px; height: 30px; }

/* カード */
.card-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.pcard { background: var(--night); border-radius: 10px; padding: 6px; color: #fff; text-align: left; }
.pcard .art { height: 100px; }
.pcard .pn { padding: 6px 4px 2px; display: flex; flex-direction: column; }
.pcard .pn b { font-family: var(--en); font-size: 18px; }
.pcard .pn span { font-size: 12px; color: #cfe8d6; }
.pcard.locked { background: #cfd3cc; }
.pcard .q { display: grid; place-items: center; font-family: var(--num); font-weight: 900; font-size: 44px; color: #fff; background: #b5bab2; }

/* おうちの人 */
.pop { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 10; }
.sheet { background: #fff; border-radius: 16px; padding: 22px 26px; width: min(620px, 92vw); }
.sheet h2 { margin: 0 0 8px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.seg { display: flex; border: 2px solid var(--blue); border-radius: 8px; overflow: hidden; }
.seg button { padding: 8px 16px; font-weight: 700; }
.seg button.on { background: var(--blue); color: #fff; }
.mutedtxt { color: #5b5f66; font-size: 14px; font-weight: 500; }

.one-art { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding-right: 8px; }
.one-art .art { height: auto; }
.one-art .who { position: static; align-self: center; }
.one-text .row { flex-wrap: nowrap; gap: 10px; }
.one-text .btn { padding: 0 16px; }

/* 小さい画面(iPad mini・縦) */
@media (max-width: 1100px) {
  .brand span { display: none; }
  .tabs button { padding: 10px 12px; font-size: 16px; }
}
/* スマホ(縦長): スクロールなしで1画面。タブは下に固定、中身は残りの高さに合わせて縮む */
@media (max-width: 700px) {
  html, body { height: 100%; }
  body { height: 100dvh; overflow: hidden; }
  .board { height: 50px; gap: 8px; padding: 0 12px; border-bottom-width: 3px; }
  .brand span { display: inline; font-size: 15px; }
  .ball-ico { width: 26px; height: 26px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; margin: 0; gap: 0; background: var(--night); border-top: 3px solid #fff; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabs button { flex: 1; flex-direction: column; gap: 1px; font-size: 10px; padding: 4px 2px; border-radius: 6px; }
  .tabs button svg { width: 22px; height: 22px; }
  .score { margin-left: auto; padding: 1px 8px; }
  .score .lbl { display: none; }
  .score .num { font-size: 20px; min-width: 2em; }
  .gear { width: 34px; height: 34px; }
  .gear svg { width: 24px; height: 24px; }
  main { padding: 8px 10px calc(62px + env(safe-area-inset-bottom)); gap: 8px; overflow: hidden; }
  main > section, .grid4, .cleared { flex: 1; min-height: 0; }
  .steps { gap: 3px; }
  .steps li { padding: 3px 2px; gap: 2px; font-size: 10px; justify-content: center; white-space: nowrap; border-radius: 6px; }
  .steps .n { width: 15px; height: 15px; font-size: 9px; flex: none; }
  .steps .n .ic { width: 10px; height: 10px; }
  .btn { min-height: 44px; font-size: 15px; padding: 0 12px; white-space: nowrap; border-bottom-width: 4px; border-radius: 8px; gap: 5px; }
  .btn.big { min-height: 50px; font-size: 17px; padding: 0 14px; }
  .btn.sm { min-height: 34px; font-size: 13px; padding: 0 8px; border-bottom-width: 3px; }
  .row { gap: 6px; flex-wrap: nowrap; }
  .row.between, .row.end, .row.center { justify-content: stretch; }
  .row.between > .btn, .row.end > .btn, .row.center > .btn, .row.between > .row { flex: 1; }
  .row.between > .row > .btn { flex: 1; }
  .row.between > .btn.ghost { flex: none; }
  .row.between > .btn.ghost span { display: none; }
  .row.between > span:empty { display: none; }
  .tag { font-size: 12px; padding: 2px 8px; }
  /* たんご */
  .intro { grid-template-columns: 1fr; grid-template-rows: 1fr auto; gap: 8px; }
  .word-card { padding: 8px; border-width: 4px; gap: 4px; min-height: 0; }
  .big-word { font-size: min(96px, 15vh); }
  .mean { font-size: 22px; }
  .intro-art { border-width: 4px; max-height: 30vh; }
  .intro-art .art img { max-height: calc(30vh - 8px); }
  /* 1文ずつ */
  .one { grid-template-columns: 1fr; grid-template-rows: auto 1fr; border-width: 4px; }
  .one-text { padding: 10px 12px 6px; gap: 6px; }
  .cnt { font-size: 15px; }
  .one .en { font-size: min(36px, 5.6vh); }
  .jp { font-size: 16px; padding: 4px 10px; }
  .one-text .row { gap: 6px; }
  .one-text .btn { flex: 1; padding: 0 6px; min-height: 40px; font-size: 14px; }
  .one-art { padding: 0 6px 6px; min-height: 0; gap: 4px; }
  .one-art .art { flex: 1; min-height: 0; height: auto; display: flex; }
  .one-art .art img, .one-art .art svg { height: 100%; object-fit: contain; }
  .one-art .who { font-size: 12px; padding: 2px 8px; }
  /* 4文(本のページ) */
  .grid4 { grid-template-rows: repeat(4, 1fr); gap: 6px; }
  .cell { grid-template-columns: 1fr 36%; border-width: 3px; border-radius: 10px; }
  .cell-text { flex-direction: column; align-items: stretch; justify-content: center; padding: 4px 6px 4px 10px; gap: 4px; }
  .cell .tx { gap: 2px; }
  .cell .en { font-size: min(22px, 3.4vh); line-height: 1.1; }
  .cell .jp { font-size: 12px; padding: 1px 6px; }
  .cell-text .row { gap: 4px; }
  .cell-text .btn.sm { min-height: 30px; font-size: 12px; padding: 0 6px; flex: 1; }
  .cell .art img { object-fit: cover; }
  /* ノート */
  .note { padding: 8px 12px; border-left-width: 6px; gap: 0; justify-content: space-between; }
  .note-head { gap: 8px; }
  .note-word { font-size: 20px; }
  .line { flex: 1; height: auto; min-height: 0; max-height: 70px; padding: 0; }
  .line span { font-size: min(24px, 3.6vh); line-height: 1.2; }
  /* ごほうび */
  .reward { padding: 10px; gap: 8px; border-radius: 12px; }
  .reward h2 { font-size: 30px; }
  .rw-row { grid-template-columns: 1fr 1fr; gap: 6px; }
  .rw-row .rw-box:last-child { grid-column: 1 / -1; }
  .rw-box { padding: 8px; gap: 4px; }
  .rw-box .lbl { font-size: 12px; }
  .rw-pts { font-size: 36px; }
  .rw-box .sub { font-size: 10px; }
  .rw-ball svg { width: 52px; height: 52px; }
  .mini { width: 72px; font-size: 10px; }
  .mini .art { height: 48px; }
  /* クリア済み */
  .cleared { gap: 6px; }
  .cl-head { flex-direction: row; align-items: center; padding: 6px 12px; border-radius: 10px; }
  .cl-head .tag { display: none; }
  .cl-head h2 { font-size: 22px; margin: 0; }
  .cl-head p { font-size: 11px; }
  .cl-word { gap: 6px; }
  .cl-word span { font-size: 32px; }
  .cl-word small { font-size: 13px; }
  /* ならったページ */
  .book, .cards { padding: 8px 10px; border-radius: 12px; overflow: hidden; }
  .book h2, .cards h2 { font-size: 17px; margin: 0 0 6px; }
  h2 small { font-size: 13px; }
  .tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .tile { min-width: 0; border-width: 2px; border-radius: 6px; }
  .tile .no { font-size: 8px; top: 1px; left: 3px; }
  .tile .tw { font-size: 14px; }
  .tile.locked .ic { width: 14px; height: 14px; }
  .book-top { flex: none; }
  .book-word { font-size: 24px; padding: 2px 12px; }
  .book-word small { font-size: 12px; }
  /* カード */
  .card-grid { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .pcard { padding: 3px; border-radius: 6px; }
  .pcard .art { height: auto; aspect-ratio: 4 / 3; border-radius: 4px; }
  .pcard .pn { padding: 2px 1px 0; }
  .pcard .pn b { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pcard .pn span { display: none; }
  .pcard .q { font-size: 22px; }
  /* スタジアム */
  .stadium { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 8px; }
  .st-pic { border-width: 4px; border-radius: 12px; }
  .st-side { padding: 8px 10px; border-radius: 12px; min-height: 0; overflow: hidden; }
  .st-side h2 { display: none; }
  .shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .shop li { flex-direction: column; justify-content: center; gap: 3px; padding: 5px 2px; border: 1px solid var(--line); border-radius: 6px; min-height: 0; text-align: center; }
  .shop .dn { flex: none; font-size: 11px; }
  .shop .own { display: none; }
  .shop .have { font-size: 11px; }
  .shop .btn.sm { min-height: 26px; font-size: 11px; padding: 0 6px; }
  .balls { margin-top: 6px; }
  .balls .lbl { font-size: 12px; margin-bottom: 3px; }
  .ball-row svg { width: 18px; height: 18px; }
}
