/* ============================================================
 * くるくる レストラン（Spinning Restaurant）
 * iPad 横（1180×820・1024×700）が 基本。左に おみせ（レーン）、右に そうさパネル。
 * 形は ことばシューティング（apps/wordshot）と そろえた（パネル・四択・はじめ／おわりの 画面）。
 * おみせの 大きさ（おさら・レーンの 高さ）は main.js の layout() が --S などで 決める。
 * ============================================================ */

:root {
    --ink: #4A2E1F;
    --ink-soft: #7A5A47;
    --red: #D9534A;
    --red-dark: #A93A32;
    --wood: #E3B07A;
    --wood-dark: #B9824B;
    --cream: #FFF7E8;
    --panel: #FFFFFF;
    --panel-bg: #FFF1DD;
    --line: #EBCFA9;
    --blue: #3B86D1;
    --blue-dark: #2A69A8;
    --ok: #2FA866;
    --ok-dark: #1F7D4A;
    --ng: #E2574C;
    --ng-dark: #A9372E;
    --sun: #FFD34D;
    --font: 'M PLUS Rounded 1c', 'Gowun Dodum', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'BIZ UDPGothic', 'Meiryo', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background: var(--panel-bg);
    color: var(--ink);
    font-family: var(--font);
    font-weight: 700;
    overscroll-behavior: none;
}

button { font-family: var(--font); color: inherit; }

/* === UI要塞化（8つの 指定・rules md 2-9） === */
.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    z-index: -1 !important;
    position: absolute !important;
    max-width: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
}

/* === 全体（横長：左に おみせ・右に パネル） === */
#app {
    position: relative;
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
}
#stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    background: var(--cream);
}
#scene {
    --S: 120px;
    --laneY: 260px;
    --holdY: 400px;
    --meX: 60%;
    --rivalX: 16%;
    position: absolute;
    inset: 0;
    overflow: hidden;
    /* かべ（たてじま）とランプの あかり */
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 236, 190, 0.9) 0%, rgba(255, 236, 190, 0) 60%),
        repeating-linear-gradient(90deg, #FBEBD2 0 38px, #F7E1C2 38px 76px);
}

#loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--ink);
    background: var(--cream);
    z-index: 50;
}

/* おなかの ゲージ（左上の 🏠 を よける） */
.gauge {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: calc(140px + env(safe-area-inset-left, 0px));
    right: calc(var(--S) * 0.75 + 10px);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 3px solid var(--line);
    z-index: 5;
    pointer-events: none;
}
.gauge-label {
    flex: 0 0 auto;
    font-size: 16px;
    color: var(--ink-soft);
    white-space: nowrap;
}
.gauge-cells {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 4px;
}
.gauge-cell {
    flex: 1 1 0;
    min-width: 0;
    height: 22px;
    border-radius: 999px;
    background: #F3E3CC;
    border: 2px solid #E7CFAE;
    transition: background 0.25s, transform 0.25s;
}
.gauge-cell.on {
    background: linear-gradient(180deg, #FFB347, #F08A24);
    border-color: #C9701A;
    transform: scaleY(1.12);
}

/* ちゅうぼうの のれん（レーンの みぎはし）
 * 文字は 上の 布の 上に よこ書き。下の ほうだけ 切れめ（3まいの 布）。 */
.noren {
    position: absolute;
    right: 0;
    top: calc(var(--laneY) - var(--S) * 0.98);
    width: calc(var(--S) * 0.86);
    height: calc(var(--S) * 0.98);
    border-radius: 0 0 0 12px;
    background: #2F4A7A;
    border-top: calc(var(--S) * 0.06) solid #24395F;
    box-shadow: -4px 4px 0 rgba(0, 0, 0, 0.12);
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: calc(var(--S) * 0.1);
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}
.noren span {
    font-size: calc(var(--S) * 0.12);
    letter-spacing: 0.06em;
    white-space: nowrap;
    line-height: 1.2;
}
/* 下 半分の 切れめ 2本 */
.noren::before, .noren::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 4%;
    height: 48%;
    background: #FBEBD2;
}
.noren::before { left: 32%; }
.noren::after { left: 64%; }

/* レーン（ベルト） */
.lane {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--laneY) - var(--S) * 0.16);
    height: calc(var(--S) * 0.36);
    background: #8A8F96;
    border-top: 5px solid #B9BEC4;
    border-bottom: 6px solid #5E636A;
    z-index: 2;
    pointer-events: none;
}
.belt {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, #7B8088 0 22px, #8E949C 22px 44px);
    background-position: var(--belt, 0px) 0;
}

/* カウンター（木） */
.counter {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--laneY) + var(--S) * 0.2 + 11px);
    bottom: 0;
    background:
        linear-gradient(180deg, var(--wood) 0, var(--wood) 18px, #D49B60 18px, #D49B60 22px, transparent 22px),
        repeating-linear-gradient(0deg, #F4D7B0 0 30px, #EFCFA4 30px 60px);
    border-top: 4px solid var(--wood-dark);
    z-index: 1;
    pointer-events: none;
}

/* せき（あなた・ライバル）：かお と つみかさねた おさら を よこに、なまえは 下 */
.seat {
    position: absolute;
    top: var(--seatTop, 70%);
    display: grid;
    grid-template-areas: "face stack" "name name";
    grid-template-columns: auto auto;
    align-items: end;
    justify-items: center;
    column-gap: 6px;
    row-gap: 2px;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
}
.seat .stack { grid-area: stack; }
.seat .seat-face { grid-area: face; }
.seat .seat-name { grid-area: name; }
.seat-me { left: var(--meX); }
.seat-rival { left: var(--rivalX); }
.seat-face {
    width: calc(var(--S) * 0.62);
    height: calc(var(--S) * 0.62);
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--S) * 0.36);
    line-height: 1;
}
.seat-face-me { border-color: var(--sun); }
.seat-rival .seat-face { border-color: #9AB7D6; }
.rival-img {
    width: 92%;
    height: 92%;
    object-fit: contain;
}
.me-img {
    width: 96%;
    height: 96%;
    object-fit: contain;
}
.seat-me.is-eat .seat-face { animation: chew 0.3s ease-in-out 3; }
.seat-rival.is-chew .seat-face { animation: chew 0.3s ease-in-out 4; }
.seat-name {
    margin: 0;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    font-size: 15px;
    white-space: nowrap;
}
.seat-count {
    display: inline-block;
    min-width: 1.4em;
    text-align: center;
    color: var(--red-dark);
}

/* たべた おさらの つみかさね */
.stack {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    min-width: calc(var(--S) * 0.5);
    min-height: 4px;
}
.stack-plate {
    width: calc(var(--S) * 0.5);
    height: 9px;
    margin-top: -3px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--pc, #F4A340);
    animation: drop 0.3s ease-out;
}

/* おさら（レーンの 上・手もと） */
.plates {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}
.plate {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--S);
    height: var(--S);
    margin-left: calc(var(--S) * -0.5);
    margin-top: calc(var(--S) * -0.5);
    pointer-events: auto;
    cursor: pointer;
    will-change: transform;
}
.plate.is-busy { pointer-events: none; }
.plate .dish {
    position: absolute;
    left: 3%;
    right: 3%;
    bottom: 8%;
    height: 32%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 45%, #FFFFFF 0 55%, #F1F1F1 56% 100%);
    border: calc(var(--S) * 0.05) solid var(--pc, #F4A340);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}
.plate .food {
    position: absolute;
    left: 10%;
    bottom: 18%;
    width: 80%;
    height: 80%;
    object-fit: contain;
    pointer-events: none;
    transition: transform 0.35s ease-in, opacity 0.35s ease-in;
}
.plate.is-eaten .food { transform: scale(0.2); opacity: 0; }
.plate .tag {
    position: absolute;
    left: 50%;
    bottom: -4%;
    transform: translateX(-50%);
    padding: 0 8px;
    border-radius: 999px;
    background: var(--pc, #F4A340);
    color: #fff;
    font-size: calc(var(--S) * 0.12);
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
}
.plate.is-ng { animation: shake 0.35s; }
/* ずかんに まだ ない りょうりの しるし */
.plate .new-badge {
    position: absolute;
    top: 2%;
    right: 0;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--sun);
    border: 2px solid #D9A900;
    color: #6B5200;
    font-size: calc(var(--S) * 0.1);
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
}
.plate.is-pick .dish { box-shadow: 0 0 0 5px rgba(255, 211, 77, 0.9), 0 4px 0 rgba(0, 0, 0, 0.18); }

/* うかぶ 文字（もぐもぐ・ゲット） */
.pops {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
}
.pop {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 2px 12px;
    border-radius: 999px;
    background: #fff;
    border: 3px solid var(--ok);
    color: var(--ok-dark);
    font-size: 20px;
    white-space: nowrap;
    animation: popUp 1.1s ease-out forwards;
}
.pop.is-rival { border-color: #9AB7D6; color: var(--blue-dark); }

/* === そうさパネル === */
#panel {
    flex: 0 0 36%;
    min-width: 300px;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
    background: var(--panel-bg);
    border-left: 4px solid var(--red);
    z-index: 10;
    overflow: hidden;
}

.hud {
    display: flex;
    gap: 8px;
    justify-content: center;
    pointer-events: none;
}
.hud-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 4px 14px;
    border-radius: 999px;
    background: #fff;
    border: 3px solid var(--sun);
    font-size: 20px;
    color: var(--ink);
    white-space: nowrap;
}
.hud-rival { border-color: #9AB7D6; }
.hud-icon { font-size: 18px; display: inline-flex; align-items: center; }
.hud-icon img { width: 26px; height: 26px; object-fit: contain; }

.card {
    position: relative;
    min-height: 168px;
    padding: 12px 14px 12px;
    border-radius: 20px;
    background: var(--panel);
    border: 3px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}
.card.is-locked { border-color: var(--red); box-shadow: 0 0 0 4px rgba(217, 83, 74, 0.16); }
.card.is-ok { border-color: var(--ok); box-shadow: 0 0 0 4px rgba(47, 168, 102, 0.2); }
.card-msg {
    margin: 0;
    word-break: keep-all;
    overflow-wrap: anywhere;
    font-size: 19px;
    line-height: 1.5;
    color: var(--ink-soft);
    white-space: pre-line;
}
.card-food { display: flex; justify-content: center; }
.card-img {
    width: 96px;
    height: 96px;
    object-fit: contain;
}
.card-word {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    color: var(--ink);
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.card-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.say-btn, .hint-btn {
    min-height: 46px;
    padding: 4px 16px;
    border-radius: 999px;
    border: 3px solid var(--blue);
    background: #fff;
    color: var(--blue-dark);
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}
.say-btn.is-big {
    min-height: 64px;
    padding: 6px 26px;
    font-size: 22px;
    background: var(--blue);
    color: #fff;
    border-color: var(--blue-dark);
    box-shadow: 0 5px 0 var(--blue-dark);
}
.hint-btn { border-color: var(--sun); color: #8A6A00; }
.say-btn:active, .hint-btn:active { transform: translateY(2px); }
.timer {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #F2E4D2;
    overflow: hidden;
}
.timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #F08A24, #FFC24D);
    transform-origin: left center;
}

/* 4つの こたえ */
.choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.choice {
    min-height: 60px;
    padding: 6px 14px;
    border-radius: 16px;
    border: 3px solid var(--line);
    background: #fff;
    box-shadow: 0 5px 0 var(--line);
    color: var(--ink);
    font-size: 25px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.08s;
}
.choice:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.choice.is-wait {
    opacity: 0.35;
    pointer-events: none;
    color: var(--ink-soft);
}
.choice.is-off { pointer-events: none; }
.choice.is-ok {
    background: var(--ok);
    border-color: var(--ok-dark);
    box-shadow: 0 5px 0 var(--ok-dark);
    color: #fff;
}
.choice.is-ng {
    background: var(--ng);
    border-color: var(--ng-dark);
    box-shadow: 0 5px 0 var(--ng-dark);
    color: #fff;
    animation: shake 0.35s;
}
.choice.is-dim { opacity: 0.45; }

.feedback {
    margin: 0;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: keep-all;
    overflow-wrap: anywhere;
    font-size: 19px;
    line-height: 1.35;
    color: var(--ink);
}
.feedback .fb-line { display: block; }
.feedback .fb-big { font-size: 1.15em; }
.feedback .fb-small { font-size: 0.85em; opacity: 0.9; }
.feedback.is-ok { color: var(--ok-dark); }
.feedback.is-ng { color: var(--ng-dark); }

.panel-foot {
    display: flex;
    justify-content: flex-end;
}
.quit-btn {
    min-height: 50px;
    min-width: 96px;
    padding: 4px 14px;
    white-space: nowrap;
    border-radius: 12px;
    border: 3px solid var(--line);
    background: #fff;
    color: var(--ink-soft);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}
.quit-btn.is-confirm { background: var(--ng); border-color: var(--ng-dark); color: #fff; font-size: 14px; }

/* === 重ねる 画面（はじめ・おわり） === */
.overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 左は 🏠 もどる（140px）を よける */
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px)) calc(140px + env(safe-area-inset-left, 0px));
    background: rgba(74, 46, 31, 0.45);
    overflow-y: auto;
}
.start-box, .result-box {
    width: 100%;
    max-width: 800px;
    max-height: 100%;
    overflow-y: auto;
    border-radius: 26px;
    background: #fff;
    border: 5px solid var(--red);
    padding: 16px 22px 18px;
    box-shadow: 0 14px 0 rgba(74, 46, 31, 0.25);
}
.start-head {
    display: flex;
    align-items: center;
    gap: 14px;
}
.start-gem {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex: 0 0 auto;
}
.start-title-box { flex: 1 1 auto; min-width: 0; }
.start-title {
    margin: 0;
    font-size: 32px;
    line-height: 1.15;
    color: var(--ink);
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.start-sub {
    margin: 2px 0 0;
    font-size: 16px;
    color: var(--red);
    letter-spacing: 0.04em;
}
.start-lead {
    word-break: keep-all;
    overflow-wrap: anywhere;
    margin: 8px 0 6px;
    font-size: 18px;
    line-height: 1.5;
    color: var(--ink-soft);
}
.lang-slot {
    flex: 0 0 auto;
    align-self: flex-start;
    max-width: 100%;
}

.opt-row {
    margin: 8px 0 0;
    padding: 8px 14px 10px;
    border-radius: 18px;
    background: var(--panel-bg);
}
.opt-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}
.opt-title {
    margin: 0 0 6px;
    font-size: 17px;
    color: var(--ink);
}
.seg {
    display: flex;
    gap: 8px;
}
.seg-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px;
    padding: 4px 8px;
    border-radius: 14px;
    border: 3px solid var(--line);
    background: #fff;
    box-shadow: 0 4px 0 var(--line);
    color: var(--ink);
    font-size: 19px;
    font-weight: 800;
    cursor: pointer;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.seg-btn.on {
    background: var(--red);
    border-color: var(--red-dark);
    box-shadow: 0 4px 0 var(--red-dark);
    color: #fff;
}
.opt-note {
    word-break: keep-all;
    overflow-wrap: anywhere;
    margin: 6px 0 0;
    min-height: 1.4em;
    font-size: 15px;
    color: var(--ink-soft);
}
.opt-note-wide { margin: 4px 6px 0; }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    min-height: 48px;
    padding: 4px 14px;
    border-radius: 999px;
    border: 3px solid var(--chip-edge, var(--line));
    background: var(--chip-bg, #fff);
    color: var(--ink);
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.chip .chip-n {
    font-size: 13px;
    color: var(--ink-soft);
}
.chip.on {
    outline: 4px solid var(--red);
    outline-offset: 2px;
}

.medal-note {
    margin: 10px 4px 0;
    padding: 8px 12px;
    border-radius: 14px;
    background: #FFF8DB;
    border: 2px dashed #E8C55A;
    font-size: 15px;
    line-height: 1.5;
    color: #6B5200;
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.start-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.voice-btn {
    min-height: 50px;
    padding: 4px 16px;
    border-radius: 14px;
    border: 3px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}
.voice-btn.is-off { color: var(--ink-soft); background: #F4F4F4; }
.sound-note {
    flex: 1 1 auto;
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
}
.start-btn {
    min-height: 64px;
    padding: 6px 34px;
    border-radius: 18px;
    border: 4px solid var(--red-dark);
    background: var(--red);
    box-shadow: 0 6px 0 var(--red-dark);
    color: #fff;
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
}
.start-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--red-dark); }
.zukan-btn {
    min-height: 50px;
    padding: 4px 14px;
    border-radius: 14px;
    border: 3px solid #E8C55A;
    background: #FFF8DB;
    color: #6B5200;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.opt-pair .seg-btn { font-size: 16px; padding: 4px 4px; }
.result-zukan { margin: 4px 0 0; font-size: 17px; color: #8A6A00; }
.res-zukan { background: #FFF8DB; border-color: #E8C55A; box-shadow: 0 4px 0 #E8C55A; }

/* === りょうり ずかん（apps/position の ずかんと おなじ 形） === */
.zukan-page {
    position: absolute;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    background: #FFFBF4;
}
.zukan-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 8px calc(140px + env(safe-area-inset-left, 0px));
    border-bottom: 3px solid var(--line);
    background: #fff;
}
.zukan-back {
    min-height: 46px;
    padding: 2px 14px;
    border-radius: 12px;
    border: 3px solid var(--ink);
    background: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.zukan-title { margin: 0; font-size: 22px; letter-spacing: 0.06em; }
.zukan-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px calc(18px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) calc(18px + env(safe-area-inset-left, 0px));
}
.zukan-total { margin: 0; font-size: 20px; }
.zukan-lead { margin: 4px 0 10px; font-size: 15px; color: var(--ink-soft); word-break: keep-all; overflow-wrap: anywhere; }
.zk-sec { margin: 12px 0 6px; display: flex; align-items: center; gap: 10px; }
.zk-cat {
    padding: 2px 14px;
    border-radius: 999px;
    color: #fff;
    font-size: 17px;
}
.zk-num { font-size: 16px; color: var(--ink-soft); }
.zk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
    gap: 10px;
}
.zk-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 150px;
    padding: 8px 6px;
    border-radius: 16px;
    border: 3px solid var(--line);
    background: #fff;
    text-align: center;
    cursor: pointer;
}
.zk-card img { width: 84px; height: 84px; object-fit: contain; pointer-events: none; }
.zk-en { font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.zk-ja { font-size: 13px; color: var(--ink-soft); line-height: 1.2; }
.zk-card.is-locked { cursor: default; background: #F7F1E8; }
.zk-card.is-locked img { filter: brightness(0) opacity(0.12); }
.zk-card.is-locked .zk-en { color: #BBB; font-size: 22px; }
.zk-card.is-new { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 211, 77, 0.6); }
.zk-card .zk-new { font-size: 12px; color: #A07800; }

.novoice-note {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--ng-dark);
}

.result-head {
    display: flex;
    align-items: center;
    gap: 14px;
}
.result-gem {
    width: 84px;
    height: 84px;
    object-fit: contain;
    flex: 0 0 auto;
}
.result-title {
    margin: 0;
    font-size: 30px;
}
.result-score, .result-rival {
    margin: 4px 0 0;
    font-size: 18px;
    color: var(--ink-soft);
    white-space: pre-line;
}
.result-rival { color: var(--blue-dark); }
.result-medal {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 0;
    padding: 8px 12px;
    border-radius: 16px;
    background: #FFF8DB;
}
.result-medal-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}
.result-medal-name {
    margin: 0;
    font-size: 22px;
}
.result-medal-why {
    margin: 2px 0 0;
    font-size: 15px;
    color: var(--ink-soft);
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.result-nomedal {
    margin: 10px 0 0;
    font-size: 16px;
    color: var(--ink-soft);
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.weak-title {
    margin: 12px 0 6px;
    font-size: 18px;
}
.weak-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
}
.weak-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    padding: 4px 10px;
    border-radius: 14px;
    border: 3px solid var(--line);
    background: #fff;
    cursor: pointer;
    text-align: left;
}
.weak-item img { width: 48px; height: 48px; object-fit: contain; flex: 0 0 auto; }
.weak-words { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.weak-en { font-size: 19px; color: var(--ink); }
.weak-ja { font-size: 14px; color: var(--ink-soft); }
.weak-say { font-size: 20px; }
.weak-none {
    margin: 4px 0 0;
    font-size: 16px;
    color: var(--ok-dark);
}
.result-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.res-btn {
    flex: 1 1 180px;
    min-height: 56px;
    padding: 4px 12px;
    border-radius: 14px;
    border: 3px solid var(--line);
    background: #fff;
    box-shadow: 0 4px 0 var(--line);
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}
.res-retry { background: var(--red); border-color: var(--red-dark); box-shadow: 0 4px 0 var(--red-dark); color: #fff; }
.res-cert { background: var(--sun); border-color: #D9A900; box-shadow: 0 4px 0 #D9A900; }

/* === うごき === */
@keyframes shake {
    0%, 100% { translate: 0 0; }
    25% { translate: -6px 0; }
    75% { translate: 6px 0; }
}
@keyframes chew {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08, 0.92); }
}
@keyframes drop {
    from { transform: translateY(-14px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes popUp {
    0% { opacity: 0; translate: 0 10px; }
    15% { opacity: 1; translate: 0 0; }
    80% { opacity: 1; translate: 0 -24px; }
    100% { opacity: 0; translate: 0 -34px; }
}
@media (prefers-reduced-motion: reduce) {
    .pop, .stack-plate, .seat-rival.is-chew .seat-face, .plate.is-ng, .choice.is-ng { animation: none; }
}

/* === こたえの 🔊（えらぶ まえに きける。E1-7） === */
.choice-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
}
.choice-row .choice {
    flex: 1 1 auto;
    min-width: 0;
}
.choice-say {
    flex: 0 0 auto;
    width: 60px;
    min-height: 60px;
    padding: 0;
    border-radius: 16px;
    border: 3px solid var(--blue-dark);
    background: var(--blue);
    box-shadow: 0 5px 0 var(--blue-dark);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.choice-say:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--blue-dark); }
.choice-row.is-saying .choice:not(.is-ok):not(.is-ng) {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(59, 134, 209, 0.25), 0 5px 0 var(--blue-dark);
}

/* はじめの 画面：🃏 カードの まいすう・めくりかた・こえの はやさを 1だんに */
.opt-trio {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.1fr);
    gap: 8px;
}
.opt-trio .seg-btn { font-size: 16px; padding: 4px 2px; white-space: nowrap; }

/* === 🃏 カードで れんしゅう（E1-7） === */
.fc-page {
    position: absolute;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    background: #FFFBF4;
}
.fc-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-right, 0px)) 8px calc(140px + env(safe-area-inset-left, 0px));
    border-bottom: 3px solid var(--line);
    background: #fff;
}
.fc-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fc-progress {
    flex: 0 0 auto;
    padding: 4px 14px;
    border-radius: 999px;
    border: 3px solid var(--ok);
    background: #fff;
    color: var(--ok-dark);
    font-size: 18px;
    white-space: nowrap;
}
.fc-main {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px calc(18px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(18px + env(safe-area-inset-left, 0px));
}
.fc-guide {
    flex: 0 0 auto;
    margin: 0;
    min-height: 1.4em;
    font-size: 21px;
    line-height: 1.4;
    text-align: center;
    color: var(--ink-soft);
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.fc-card {
    --fc-edge: #F4A340;
    --fc-tile: #FFE8CC;
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: min(100%, 880px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 18px;
    border-radius: 30px;
    border: 7px solid var(--fc-edge);
    background: #fff;
    box-shadow: 0 10px 0 rgba(74, 46, 31, 0.18);
    overflow: hidden;
    cursor: pointer;
    outline: none;
}
.fc-card:focus-visible { box-shadow: 0 0 0 5px rgba(59, 134, 209, 0.45), 0 10px 0 rgba(74, 46, 31, 0.18); }
.fc-card.is-back { background: linear-gradient(180deg, #fff 0%, #fff 55%, var(--fc-tile) 100%); }
/* ③ の おもて：もじだけ（ノートの 線） */
.fc-card.is-read {
    background:
        repeating-linear-gradient(180deg, transparent 0 46px, rgba(59, 134, 209, 0.12) 46px 48px),
        #fff;
}
.fc-card.is-flip { animation: fcFlip 0.36s ease-in-out; }
.fc-img {
    flex: 0 0 auto;
    max-width: 90%;
    object-fit: contain;
    pointer-events: none;
}
.fc-ask {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 6px dashed var(--fc-edge);
    background: var(--fc-tile);
    color: var(--fc-edge);
    pointer-events: none;
}
.fc-ask span { font-size: 4em; line-height: 1; }
.fc-word {
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    font-size: 96px;
    line-height: 1.1;
    text-align: center;
    color: var(--ink);
    letter-spacing: 0.02em;
    word-break: normal;
    overflow-wrap: normal;
    pointer-events: none;
}
/* はじめの もじに 色（アルファベットで まなんだ ことと つなぐ） */
.fc-first { color: var(--red); }
.fc-native {
    flex: 0 0 auto;
    margin: 0;
    font-size: 20px;
    color: var(--ink-soft);
    pointer-events: none;
}
.fc-ctrl {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: min(100%, 880px);
}
.fc-btn {
    flex: 0 1 auto;
    min-width: 150px;
    min-height: 64px;
    padding: 6px 22px;
    border-radius: 18px;
    border: 4px solid var(--line);
    background: #fff;
    box-shadow: 0 6px 0 var(--line);
    color: var(--ink);
    font-size: 23px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}
.fc-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.fc-say { border-color: var(--blue); color: var(--blue-dark); box-shadow: 0 6px 0 var(--blue); }
.fc-flip, .fc-next { background: var(--red); border-color: var(--red-dark); box-shadow: 0 6px 0 var(--red-dark); color: #fff; min-width: 200px; }
.fc-ok { background: var(--ok); border-color: var(--ok-dark); box-shadow: 0 6px 0 var(--ok-dark); color: #fff; min-width: 190px; }
.fc-again { background: #FFF1C9; border-color: #E8B530; box-shadow: 0 6px 0 #E8B530; color: #7A5600; }
.fc-pause { color: var(--ink-soft); }
.fc-pause.is-paused { background: var(--red); border-color: var(--red-dark); box-shadow: 0 6px 0 var(--red-dark); color: #fff; }

.fc-done {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px calc(14px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px));
}
.fc-done-box {
    width: 100%;
    max-width: 800px;
    margin: auto;
    border-radius: 26px;
    background: #fff;
    border: 5px solid var(--red);
    padding: 16px 22px 18px;
    box-shadow: 0 14px 0 rgba(74, 46, 31, 0.25);
}
.fc-next-step {
    margin: 10px 0 0;
    padding: 8px 12px;
    border-radius: 14px;
    background: #EAF3FC;
    border: 2px dashed #8DB8E4;
    color: var(--blue-dark);
    font-size: 17px;
    line-height: 1.5;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.res-up { background: #EAF3FC; border-color: var(--blue); box-shadow: 0 4px 0 var(--blue); color: var(--blue-dark); }
.fc-done .res-btn { flex-basis: 220px; word-break: keep-all; overflow-wrap: anywhere; }

@keyframes fcFlip {
    0% { transform: scaleX(1); }
    47% { transform: scaleX(0.03); }
    53% { transform: scaleX(0.03); }
    100% { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
    .fc-card.is-flip { animation: none; }
}

/* === 🎁 ご当地メニュー（E1-8） === */
.gotochi-box {
    margin-top: 10px;
    padding: 10px 14px 12px;
    border-radius: 18px;
    border: 4px solid #E8B530;
    background: linear-gradient(180deg, #FFF8DD 0%, #FFFFFF 100%);
}
.gotochi-box.is-hint {
    padding: 6px 12px;
    border-width: 2px;
    border-style: dashed;
    background: #FFFBEA;
}
.gotochi-title {
    margin: 0;
    font-size: 21px;
    font-weight: 900;
    color: #8A5A00;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.gotochi-regions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.gotochi-region {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 60px;
    padding: 4px 6px;
    border-radius: 14px;
    border: 3px solid var(--rg);
    background: var(--rg-tile);
    box-shadow: 0 4px 0 var(--rg);
    color: var(--ink);
    cursor: pointer;
}
.gotochi-region:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rg); }
.gotochi-region.is-off { opacity: 0.4; cursor: default; box-shadow: none; }
.gr-name { font-size: 16px; font-weight: 900; line-height: 1.25; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.gr-left { font-size: 13px; color: var(--ink-soft); }
.gotochi-get {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}
.gotochi-img {
    flex: 0 0 auto;
    width: 112px;
    height: 112px;
    object-fit: contain;
    animation: gotochiPop 0.6s ease-out;
}
.gotochi-words { flex: 1 1 auto; min-width: 0; }
.gotochi-pref { margin: 0; font-size: 16px; font-weight: 900; color: var(--ink-soft); }
.gotochi-en { margin: 2px 0 0; font-size: 32px; font-weight: 900; line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
.gotochi-ja { margin: 2px 0 0; font-size: 15px; color: var(--ink-soft); }
.gotochi-say {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--blue-dark);
    background: var(--blue);
    box-shadow: 0 4px 0 var(--blue-dark);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}
.gotochi-note {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: #7A5600;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.gotochi-note:empty { display: none; }
.gotochi-box.is-hint .gotochi-note { margin: 0; }
@keyframes gotochiPop {
    0% { transform: scale(0.4) rotate(-12deg); opacity: 0; }
    70% { transform: scale(1.12) rotate(4deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
    .gotochi-img { animation: none; }
}
/* ずかんの ご当地メニュー */
.zk-gotochi-head { margin-top: 22px; padding-top: 14px; border-top: 3px dashed #E8B530; }
.zk-gotochi-title { margin: 0; font-size: 22px; color: #8A5A00; }
.zk-gotochi-lead { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.zk-pref { font-size: 12px; font-weight: 900; color: var(--ink-soft); }
.zk-gcard.is-locked img { filter: grayscale(1); opacity: 0.45; }
/* 🔑 あいことば（E1-10） */
.zk-code-btn {
    margin-top: 10px;
    min-height: 50px;
    padding: 4px 18px;
    border-radius: 14px;
    border: 3px solid #D9A900;
    background: var(--sun);
    box-shadow: 0 4px 0 #D9A900;
    color: #4A3A00;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}
.zk-code-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #D9A900; }
.zk-code-box {
    margin-top: 10px;
    padding: 10px 14px 12px;
    border-radius: 16px;
    border: 3px solid #E8B530;
    background: #fff;
    text-align: center;
}
.zk-code-title { margin: 0; font-size: 16px; font-weight: 900; color: #8A5A00; }
.zk-code {
    margin: 6px 0 4px;
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    -webkit-user-select: text;
    user-select: text;
}
.zk-code-jump { margin: 2px 0 6px; min-height: 46px; font-size: 16px; }
.zk-code-note { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); text-align: left; word-break: keep-all; overflow-wrap: anywhere; }
.gotochi-note { white-space: pre-line; }

/* === iPad 横（高さ 820 まで。ブラウザの 帯が ある 700 前後も） === */
@media (max-height: 860px) {
    .start-box, .result-box { padding: 12px 18px 14px; }
    .start-gem { width: 60px; height: 60px; }
    .start-title { font-size: 28px; }
    .start-lead { margin: 4px 0 2px; font-size: 16px; }
    .opt-row { margin-top: 4px; padding: 4px 12px 5px; }
    .opt-title { margin-bottom: 2px; font-size: 15px; }
    .seg-btn { min-height: 44px; font-size: 17px; }
    .chip { min-height: 40px; font-size: 15px; padding: 2px 10px; gap: 4px; }
    .chip .chip-n { font-size: 12px; }
    .opt-note { margin-top: 3px; font-size: 13px; min-height: 0; }
    .medal-note { margin-top: 5px; padding: 3px 10px; font-size: 14px; line-height: 1.45; }
    .start-foot { margin-top: 6px; }
    .start-btn { min-height: 58px; font-size: 24px; }
    .card { min-height: 150px; }
    .choice { min-height: 56px; font-size: 23px; }
    .choice-say { width: 56px; min-height: 56px; font-size: 22px; }
    .choices { gap: 8px; }
}

/* === せまい はば（iPad の たて など） === */
@media (max-width: 900px) {
    #panel { flex-basis: 40%; min-width: 280px; }
    .choice { font-size: 22px; }
}

/* === スマホの たて：上に おみせ・下に パネル === */
@media (max-width: 600px) and (orientation: portrait) {
    #app { flex-direction: column; }
    #stage { flex: 0 0 46%; min-height: 0; }
    #panel {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        min-height: 0;
        justify-content: flex-start;
        gap: 8px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        border-left: none;
        border-top: 4px solid var(--red);
        overflow-y: auto;
    }
    .hud { order: 0; }
    .card { min-height: 0; padding: 8px 10px; flex: 0 0 auto; }
    .card-img { width: 64px; height: 64px; }
    .card-msg { font-size: 16px; }
    .card-word { font-size: 24px; }
    .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 0 0 auto; }
    .choice { min-height: 52px; font-size: 19px; padding: 4px 8px; }
    .feedback { min-height: 48px; font-size: 16px; flex: 0 0 auto; }
    .gauge { left: calc(132px + env(safe-area-inset-left, 0px)); right: 8px; padding: 2px 8px; min-height: 44px; }
    .gauge-label { display: none; }
    .seat-name { font-size: 13px; }
    .overlay { padding: calc(64px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px)) 8px; align-items: flex-start; }
    .start-box, .result-box { padding: 10px 12px 12px; border-width: 4px; }
    .start-head { flex-wrap: wrap; }
    .lang-slot { flex: 1 1 100%; }
    .start-gem { width: 52px; height: 52px; }
    .start-title { font-size: 24px; }
    .opt-pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .opt-trio { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .seg-btn { font-size: 16px; min-height: 46px; }
    .start-btn { flex: 1 1 100%; }
    .weak-list { grid-template-columns: minmax(0, 1fr); }
    .zukan-bar { padding-left: calc(132px + env(safe-area-inset-left, 0px)); }
    .zukan-title { font-size: 17px; }
    .zk-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .zk-card img { width: 64px; height: 64px; }
    .zk-card { min-height: 120px; }
    /* 👀 の 💡・🔊 は カードの 右下に（こたえを 下に おしださない。E1-7） */
    .card.is-see .card-btns { position: absolute; right: 8px; bottom: 8px; }
    .card.is-see .say-btn, .card.is-see .hint-btn { min-height: 40px; font-size: 14px; padding: 2px 10px; }
    /* こたえの 🔊（E1-7） */
    .choice-row { gap: 4px; }
    .choice-say { width: 40px; min-height: 52px; font-size: 18px; border-radius: 12px; box-shadow: 0 3px 0 var(--blue-dark); }
    /* 🔑 あいことば（E1-10） */
    .zk-code { font-size: 28px; letter-spacing: 0.06em; }
    /* 🎁 ご当地（E1-8） */
    .gotochi-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gotochi-img { width: 84px; height: 84px; }
    .gotochi-en { font-size: 24px; }
    .gotochi-say { width: 48px; height: 48px; font-size: 20px; }
    /* 🃏 カード（E1-7） */
    .fc-bar { padding-left: calc(132px + env(safe-area-inset-left, 0px)); min-height: 60px; gap: 8px; }
    .fc-title { font-size: 17px; }
    .fc-progress { font-size: 15px; padding: 2px 10px; }
    .fc-main { gap: 8px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
    .fc-guide { font-size: 16px; }
    .fc-card { border-width: 5px; border-radius: 22px; padding: 10px; }
    .fc-native { font-size: 16px; }
    .fc-ctrl { gap: 8px; }
    .fc-btn { flex: 1 1 40%; min-width: 0; min-height: 54px; padding: 4px 8px; font-size: 18px; }
    .fc-done-box { padding: 10px 12px 12px; border-width: 4px; }
}

/* === スマホの よこ・高さの ひくい 画面（いちばん さいごに 書く。rules md 2-9） === */
@media (max-height: 560px) and (orientation: landscape) {
    #panel {
        flex: 0 0 42%;
        min-width: 250px;
        max-width: 380px;
        justify-content: flex-start;
        gap: 6px;
        padding: calc(8px + env(safe-area-inset-top, 0px)) calc(10px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) 10px;
        overflow-y: auto;
    }
    .hud-pill { min-height: 32px; font-size: 16px; padding: 2px 10px; }
    .card { min-height: 0; padding: 6px 8px; gap: 4px; flex: 0 0 auto; }
    .card-msg { font-size: 15px; line-height: 1.35; }
    .card-img { width: 52px; height: 52px; }
    .card-word { font-size: 22px; }
    .say-btn, .hint-btn { min-height: 40px; font-size: 15px; padding: 2px 12px; }
    .say-btn.is-big { min-height: 48px; font-size: 18px; }
    .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 0 0 auto; }
    .choice { min-height: 46px; font-size: 18px; padding: 2px 6px; box-shadow: 0 3px 0 var(--line); }
    .feedback { min-height: 40px; font-size: 15px; flex: 0 0 auto; }
    .quit-btn { min-height: 42px; }
    .gauge { min-height: 40px; padding: 2px 8px; }
    .gauge-cell { height: 16px; }
    .gauge-label { display: none; }
    .seat-name { font-size: 12px; padding: 0 6px; }
    .overlay { padding: calc(6px + env(safe-area-inset-top, 0px)) 8px calc(6px + env(safe-area-inset-bottom, 0px)) calc(140px + env(safe-area-inset-left, 0px)); align-items: flex-start; }
    .start-box, .result-box { padding: 8px 14px 10px; border-width: 4px; }
    .start-gem, .result-gem { width: 44px; height: 44px; }
    .start-title { font-size: 22px; }
    .start-sub { font-size: 13px; }
    .start-lead { font-size: 14px; margin: 4px 0 2px; }
    .opt-row { margin-top: 4px; padding: 4px 10px 6px; }
    .opt-title { font-size: 14px; margin-bottom: 3px; }
    .seg-btn { min-height: 42px; font-size: 15px; }
    .chip { min-height: 40px; font-size: 14px; padding: 2px 10px; }
    .opt-note { font-size: 13px; }
    .medal-note { font-size: 13px; padding: 4px 8px; }
    .start-foot { margin-top: 6px; gap: 8px; }
    .voice-btn { min-height: 44px; font-size: 14px; }
    .start-btn { min-height: 50px; font-size: 20px; padding: 4px 22px; }
    .result-title { font-size: 22px; }
    .result-score, .result-rival { font-size: 15px; }
    .res-btn { min-height: 46px; font-size: 15px; flex-basis: 150px; }
    .zukan-btn { min-height: 44px; font-size: 14px; }
    .zukan-bar { min-height: 52px; padding-top: calc(4px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; }
    .zk-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .zk-card img { width: 56px; height: 56px; }
    .zk-card { min-height: 108px; }
    /* 👀 の 💡・🔊 は カードの 右下に（こたえを 下に おしださない。E1-7） */
    .card.is-see .card-btns { position: absolute; right: 8px; bottom: 8px; }
    .card.is-see .say-btn, .card.is-see .hint-btn { min-height: 40px; font-size: 14px; padding: 2px 10px; }
    /* こたえの 🔊（E1-7） */
    .choice-row { gap: 4px; }
    .choice-say { width: 40px; min-height: 46px; font-size: 18px; border-radius: 12px; box-shadow: 0 3px 0 var(--blue-dark); }
    /* はじめの 画面の 3つならびは よこの スマホでは 2れつ（こえの はやさは 下の だん いっぱい） */
    .opt-trio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; }
    .opt-trio .opt-row:last-child { grid-column: 1 / -1; }
    .opt-trio .seg-btn { font-size: 15px; }
    /* 🎁 ご当地（E1-8） */
    .gotochi-box { margin-top: 6px; padding: 6px 10px 8px; }
    .gotochi-title { font-size: 17px; }
    .gotochi-region { min-height: 48px; }
    .gr-name { font-size: 14px; }
    .gotochi-img { width: 72px; height: 72px; }
    .gotochi-en { font-size: 22px; }
    .gotochi-say { width: 46px; height: 46px; font-size: 18px; }
    /* 🃏 カード（E1-7）：カード 左・ボタン 右（rules md 2-9） */
    .fc-bar { min-height: 50px; padding-top: calc(4px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; }
    .fc-title { font-size: 17px; }
    .fc-progress { font-size: 15px; padding: 2px 10px; }
    .fc-main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(150px, 30%);
        grid-template-rows: auto minmax(0, 1fr);
        align-items: stretch;
        gap: 6px 10px;
        padding: 6px calc(10px + env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) calc(10px + env(safe-area-inset-left, 0px));
    }
    .fc-guide { grid-column: 1; grid-row: 1; font-size: 15px; }
    .fc-card { grid-column: 1; grid-row: 2; width: 100%; border-width: 5px; border-radius: 20px; padding: 6px 10px; gap: 2px; box-shadow: 0 6px 0 rgba(74, 46, 31, 0.18); }
    .fc-native { font-size: 15px; }
    .fc-ctrl {
        grid-column: 2;
        grid-row: 1 / span 2;
        width: auto;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 8px;
        overflow-y: auto;
        padding-bottom: 6px;
    }
    .fc-btn { min-width: 0; min-height: 48px; padding: 2px 8px; font-size: 17px; }
    .fc-done { padding-top: 6px; }
    .fc-done-box { padding: 8px 14px 10px; border-width: 4px; }
    .fc-next-step { font-size: 14px; padding: 4px 8px; }
}
