/* ============================================================
 * レストラン オープン！（Restaurant Open!）
 * iPad 横（1180×820・1024×700）が 基本。画面は ばめんごとに 1まい（.screen）で、たてに スクロール。
 * くるくる レストラン・ねだん マスターと 同じ 色あい。
 * ============================================================ */

:root {
    --ink: #4A2E1F;
    --ink-soft: #7A5A47;
    --red: #D9534A;
    --red-dark: #A93A32;
    --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, select { 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: column;
    width: 100%;
    height: 100%;
}

/* === 上の 帯（左は 🏠） === */
.topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 68px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 8px calc(140px + env(safe-area-inset-left, 0px));
    border-bottom: 4px solid var(--red);
    background: #fff;
}
.top-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-pill {
    flex: 0 0 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 2px 12px;
    border-radius: 999px;
    border: 3px solid var(--sun);
    font-size: 18px;
    white-space: nowrap;
}
.top-back {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 2px 14px;
    border-radius: 12px;
    border: 3px solid var(--ink);
    background: #fff;
    color: var(--ink-soft);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

/* === ばめん === */
.screens {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}
.screen {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px calc(16px + env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
}
.scr-title {
    margin: 0 0 10px;
    font-size: 24px;
}
.card {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 20px;
    background: #fff;
    border: 3px solid var(--line);
}
.card-title {
    margin: 0 0 8px;
    font-size: 18px;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.note {
    margin: 8px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-soft);
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.msg {
    margin: 8px 0 0;
    min-height: 1.4em;
    text-align: center;
    font-size: 18px;
    line-height: 1.45;
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.msg.is-ng { color: var(--ng-dark); }
.msg.is-ok { color: var(--ok-dark); }
.count-pill {
    display: inline-block;
    min-width: 2em;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--panel-bg);
    border: 2px solid var(--line);
    font-size: 15px;
    text-align: center;
}
.foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}
.big-btn {
    min-height: 62px;
    padding: 6px 30px;
    border-radius: 18px;
    border: 4px solid var(--red-dark);
    background: var(--red);
    box-shadow: 0 6px 0 var(--red-dark);
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--red-dark); }
.big-btn.is-off { opacity: 0.4; pointer-events: none; }
.sub-btn {
    min-height: 50px;
    padding: 4px 18px;
    border-radius: 14px;
    border: 3px solid var(--blue);
    background: #fff;
    color: var(--blue-dark);
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}
.sub-btn:active { transform: translateY(3px); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 50px;
    padding: 4px 10px;
    border-radius: 14px;
    border: 3px solid var(--line);
    background: #fff;
    box-shadow: 0 4px 0 var(--line);
    font-size: 17px;
    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; }

/* === はじめ === */
.role-head { display: flex; align-items: center; gap: 14px; }
.role-img { width: 72px; height: 72px; object-fit: contain; flex: 0 0 auto; }
.role-title-box { flex: 1 1 auto; min-width: 0; }
.role-title { margin: 0; font-size: 32px; line-height: 1.15; word-break: keep-all; overflow-wrap: anywhere; }
.role-sub { margin: 2px 0 0; font-size: 16px; color: var(--red); }
.lang-slot { flex: 0 0 auto; align-self: flex-start; max-width: 100%; }
.lead { margin: 10px 0; font-size: 18px; line-height: 1.5; color: var(--ink-soft); word-break: keep-all; overflow-wrap: anywhere; }
.role-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}
.role-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 190px;
    padding: 14px;
    border-radius: 24px;
    border: 4px solid var(--line);
    background: #fff;
    box-shadow: 0 7px 0 var(--line);
    cursor: pointer;
    text-align: center;
}
.role-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--line); }
.role-shop { border-color: var(--red); box-shadow: 0 7px 0 var(--red-dark); }
.role-cust { border-color: var(--blue); box-shadow: 0 7px 0 var(--blue-dark); }
.role-ico { font-size: 64px; line-height: 1.1; }
.role-name { font-size: 26px; font-weight: 900; }
.role-desc { font-size: 15px; color: var(--ink-soft); line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.money-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 8px 14px;
    border-radius: 18px;
    background: #fff;
    border: 3px solid var(--line);
}
.money-label { flex: 0 0 auto; font-size: 17px; }
.money-row .seg { flex: 1 1 auto; }

/* === おみせを つくる === */
.name-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sel {
    flex: 0 1 260px;
    min-width: 0;
    min-height: 52px;
    padding: 4px 12px;
    border-radius: 14px;
    border: 3px solid var(--line);
    background: #fff;
    font-size: 19px;
    font-weight: 800;
}
.seg-type { flex: 1 1 380px; }
.name-preview { margin: 10px 0 0; font-size: 26px; color: var(--red-dark); text-align: center; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tab {
    min-height: 44px;
    padding: 2px 14px;
    border-radius: 999px;
    border: 3px solid var(--tab-edge, var(--line));
    background: var(--tab-bg, #fff);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}
.tab.on { outline: 4px solid var(--red); outline-offset: 1px; }
.pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    gap: 8px;
}
.pick-small { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.pick {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 132px;
    padding: 6px 4px 8px;
    border-radius: 16px;
    border: 3px solid var(--line);
    background: #fff;
    cursor: pointer;
    text-align: center;
}
.pick img { width: 72px; height: 72px; object-fit: contain; pointer-events: none; }
.pick-en { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.pick-price {
    padding: 0 8px;
    border-radius: 999px;
    background: var(--pc, var(--red));
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
}
.pick.on { border-color: var(--ok); background: #EAF8EF; box-shadow: 0 0 0 3px rgba(47, 168, 102, 0.3); }
.pick.on::after {
    content: '✔';
    position: absolute;
    top: 4px;
    right: 8px;
    color: var(--ok-dark);
    font-size: 18px;
}
.pick-qty {
    position: absolute;
    top: 4px;
    left: 6px;
    min-width: 26px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 15px;
}
.set-preview { margin: 8px 0 0; font-size: 18px; text-align: center; white-space: pre-line; }
.set-preview.is-ng { color: var(--ng-dark); }

/* === おみせが ひらいて いる === */
.open-grid {
    display: grid;
    grid-template-columns: minmax(280px, 38%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
.open-left { display: flex; flex-direction: column; align-items: center; text-align: center; }
.open-welcome { margin: 0; font-size: 15px; color: var(--ink-soft); word-break: keep-all; overflow-wrap: anywhere; }
.open-name { margin: 6px 0 8px; font-size: 28px; color: var(--red-dark); line-height: 1.2; }
.qr {
    width: 260px;
    height: 260px;
    max-width: 100%;
    background: #fff;
    border: 8px solid #fff;
    border-radius: 12px;
    box-shadow: 0 0 0 3px var(--line);
    image-rendering: pixelated;
}
.aikotoba { margin: 10px 0; font-size: 18px; }
.aikotoba b { font-size: 32px; letter-spacing: 0.14em; color: var(--blue-dark); }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 12px; }
.board-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #FFFBF4;
    border: 2px solid var(--line);
}
.board-item img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.board-words { display: flex; flex-direction: column; min-width: 0; }
.board-en { font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; }
.board-yen { font-size: 14px; color: var(--red-dark); }
.board-set { grid-column: 1 / -1; background: #FFF6D6; border-color: #E8C55A; }
.phrases { display: flex; flex-direction: column; gap: 6px; }
.phrase {
    min-height: 46px;
    padding: 4px 14px;
    border-radius: 12px;
    border: 2px solid var(--blue);
    background: #F3F9FF;
    font-size: 18px;
    text-align: left;
    cursor: pointer;
}
.phrase small { display: block; font-size: 13px; color: var(--ink-soft); }

/* === おきゃく === */
.wallet-card { display: flex; align-items: center; gap: 14px; }
.wallet-ico { font-size: 46px; }
.wallet-label { margin: 0; font-size: 15px; color: var(--ink-soft); }
.wallet-yen { margin: 0; font-size: 34px; }
.enter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.enter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 140px;
    padding: 10px;
    border-radius: 22px;
    border: 4px solid var(--blue);
    background: #fff;
    box-shadow: 0 6px 0 var(--blue-dark);
    font-size: 19px;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.enter-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--blue-dark); }
.enter-ico { font-size: 46px; }

.scan-box {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    background: #222;
}
.scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
    position: absolute;
    inset: 16%;
    border: 5px solid rgba(255, 211, 77, 0.95);
    border-radius: 18px;
    pointer-events: none;
}

.code-wrap { display: flex; flex-direction: column; align-items: center; }
.lcd {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
    min-width: 240px;
    margin: 0 auto 10px;
    padding: 6px 18px;
    border-radius: 14px;
    background: #23372B;
    border: 5px solid #5B6B60;
    color: #9CF2B4;
}
.lcd-num { font-size: 50px; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.lcd-yen { font-size: 22px; }
.tenkey {
    display: grid;
    grid-template-columns: repeat(3, 84px);
    grid-auto-rows: 64px;
    gap: 10px;
    justify-content: center;
}
.key {
    border-radius: 16px;
    border: 3px solid var(--line);
    background: #fff;
    box-shadow: 0 5px 0 var(--line);
    font-size: 30px;
    font-weight: 900;
    cursor: pointer;
}
.key:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.key-ok { background: var(--ok); border-color: var(--ok-dark); box-shadow: 0 5px 0 var(--ok-dark); color: #fff; }
.key-del { color: var(--ink-soft); }

.order-head { text-align: center; margin-bottom: 8px; }
.order-welcome { margin: 0; font-size: 16px; color: var(--ink-soft); }
.order-shop { margin: 0; font-size: 30px; color: var(--red-dark); }
.order-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 36%);
    gap: 12px;
    align-items: start;
}
.set-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 16px;
    border: 3px solid #E8C55A;
    background: #FFF6D6;
    cursor: pointer;
    width: 100%;
    text-align: left;
}
.set-imgs { display: flex; }
.set-imgs img { width: 52px; height: 52px; object-fit: contain; margin-right: -10px; }
.set-words { flex: 1 1 auto; min-width: 0; padding-left: 14px; }
.set-name { display: block; font-size: 20px; }
.set-yen { display: block; font-size: 15px; color: var(--red-dark); }
.tray-list { display: flex; flex-direction: column; gap: 6px; }
.tray-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #FFFBF4;
    border: 2px solid var(--line);
}
.tray-row img { width: 38px; height: 38px; object-fit: contain; }
.tray-name { flex: 1 1 auto; min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.tray-x {
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    border: 2px solid var(--line);
    background: #fff;
    font-size: 18px;
    cursor: pointer;
}
.say-box {
    margin: 10px 0;
    padding: 8px 10px;
    border-radius: 14px;
    background: #F3F9FF;
    border: 2px dashed var(--blue);
    text-align: center;
}
.say-label { margin: 0; font-size: 14px; color: var(--ink-soft); }
.say-text { margin: 4px 0 8px; font-size: 20px; line-height: 1.35; min-height: 1.35em; }
.order-tray .big-btn { width: 100%; }

.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 40%); gap: 12px; align-items: start; }
.pay-left, .pay-right { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pay-step { margin: 4px 0 8px; font-size: 18px; word-break: keep-all; overflow-wrap: anywhere; }
.pay-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 10px; }
.pay-item { display: flex; flex-direction: column; align-items: center; width: 104px; }
.pay-item img { width: 80px; height: 80px; object-fit: contain; }
.pay-item span { font-size: 14px; text-align: center; line-height: 1.2; }
.reveal-btn {
    min-height: 56px;
    padding: 4px 16px;
    border-radius: 14px;
    border: 3px dashed var(--ink-soft);
    background: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}
.pay-total { margin: 8px 0; font-size: 34px; color: var(--red-dark); }

.done-card { text-align: center; max-width: 760px; margin: 0 auto; }
.done-thanks { margin: 0; font-size: 22px; color: var(--ok-dark); }
.done-title { margin: 4px 0 10px; font-size: 28px; }
.done-zukan, .done-wallet { margin: 6px 0; font-size: 19px; }

.zukan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.z-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 14px;
    background: #fff;
    border: 3px solid var(--line);
    text-align: center;
    min-height: 118px;
    cursor: pointer;
}
.z-item img { width: 64px; height: 64px; object-fit: contain; pointer-events: none; }
.z-item span { font-size: 13px; line-height: 1.2; overflow-wrap: anywhere; }
.z-item.is-locked img { filter: brightness(0) opacity(0.15); }
.z-item.is-locked span { color: #BBB; }
.special {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 20px;
    background: #FFF6D6;
    border: 3px solid #E8C55A;
}
.special-img { width: 96px; height: 96px; object-fit: contain; }
.special-title { margin: 0; font-size: 22px; }
.special-text { margin: 4px 0 0; font-size: 16px; color: var(--ink-soft); }

.overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 16px 16px calc(140px + env(safe-area-inset-left, 0px));
    background: rgba(74, 46, 31, 0.5);
    overflow-y: auto;
}
.complete-box {
    max-width: 560px;
    padding: 18px 22px;
    border-radius: 26px;
    background: #fff;
    border: 5px solid #E8C55A;
    text-align: center;
}
.complete-img { width: 200px; height: 200px; object-fit: contain; }
.complete-title { margin: 6px 0; font-size: 28px; }
.complete-text { margin: 0 0 14px; font-size: 18px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }

/* === 🎁 ご当地メニュー（E1-8） === */
.gotochi-pick { margin-top: 8px; }
.gotochi-pick:empty { display: none; }
.g-title { margin: 4px 0 6px; font-size: 16px; font-weight: 900; color: #8A5A00; }
.g-note {
    margin: 6px 0 0;
    padding: 6px 10px;
    border-radius: 12px;
    border: 2px dashed #E8B530;
    background: #FFFBEA;
    color: #7A5600;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.pick.is-g { background: linear-gradient(180deg, #FFF8DD 0%, #FFFFFF 70%); }
.g-zukan-head { margin-top: 18px; padding-top: 12px; border-top: 3px dashed #E8B530; }
.g-zukan-title { margin: 0; font-size: 18px; font-weight: 900; color: #8A5A00; }
.g-zukan-lead { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: #7A5600; word-break: keep-all; overflow-wrap: anywhere; }
.z-pref { font-size: 11px; font-weight: 900; opacity: 0.8; }
/* 🔑 くるくるの あいことば（E1-10） */
.g-code-box {
    margin-top: 10px;
    padding: 10px 14px 12px;
    border-radius: 16px;
    border: 3px solid #E8B530;
    background: #fff;
}
.g-code-title { margin: 0; font-size: 17px; font-weight: 900; color: #8A5A00; }
.g-code-note { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: #7A5600; word-break: keep-all; overflow-wrap: anywhere; }
.g-code-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.g-code-row .g-code-input { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 24px; }
.g-code-row .g-code-go { flex: 0 0 auto; margin: 0; }
.g-code-own { margin: 6px 0 0; font-size: 14px; font-weight: 900; color: #8A5A00; }
.g-code-link { margin-top: 8px; }
/* ご当地ずかん：もっている（⭐）・たべた（🍽）を カラーで（E1-10） */
.g-zukan-count { margin: 4px 0 0; font-size: 15px; font-weight: 900; color: var(--ink); }
.z-gitem.is-own { border-color: #E8B530; background: linear-gradient(180deg, #FFF8DD 0%, #FFFFFF 75%); }
.z-gtags { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: 2px; }
.z-gitem .z-gtag { padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 900; line-height: 1.6; white-space: nowrap; max-width: 100%; overflow: hidden; }
.z-gitem .z-gtag-own { background: #FFE9A6; color: #6B5200; }
.z-gitem .z-gtag-eat { background: #DDEFE3; color: #1F7D4A; }
.z-gitem .z-gnew { position: absolute; top: 4px; left: 6px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; }
.g-new-title { margin: 8px 0 4px; font-size: 15px; font-weight: 900; color: #8A5A00; }
.g-new-list { display: flex; flex-wrap: wrap; gap: 10px; }
.g-new-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 128px;
    padding: 8px 6px;
    border-radius: 16px;
    border: 3px solid #E8B530;
    background: linear-gradient(180deg, #FFF8DD 0%, #FFFFFF 75%);
    box-shadow: 0 0 0 3px rgba(255, 211, 77, 0.45);
    cursor: pointer;
    animation: gNewPop 0.5s ease-out;
}
.g-new-item img { width: 88px; height: 88px; object-fit: contain; pointer-events: none; }
.g-new-pref { font-size: 12px; font-weight: 900; color: var(--ink-soft); }
.g-new-en { font-size: 15px; font-weight: 900; color: var(--ink); text-align: center; overflow-wrap: anywhere; }
.g-new-mark { position: absolute; top: 4px; left: 6px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; }
@keyframes gNewPop {
    0% { transform: scale(0.6); opacity: 0; }
    70% { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .g-new-item { animation: none; } }
.g-code-jump { display: block; margin: 0 0 8px; }
@media (max-width: 600px) and (orientation: portrait) {
    .g-code-row { flex-direction: column; align-items: stretch; }
    .g-code-row .g-code-input { font-size: 22px; }
}

/* === せまい はば === */
@media (max-width: 900px) {
    .open-grid, .order-grid, .pay-grid { grid-template-columns: minmax(0, 1fr); }
    .enter-grid { grid-template-columns: minmax(0, 1fr); }
    .enter-btn { min-height: 84px; flex-direction: row; }
    .enter-ico { font-size: 34px; }
}

/* === スマホの たて === */
@media (max-width: 600px) and (orientation: portrait) {
    .topbar { padding-left: calc(132px + env(safe-area-inset-left, 0px)); flex-wrap: wrap; gap: 6px; }
    .top-title { flex: 1 1 100%; order: 5; font-size: 16px; }
    .top-pill { font-size: 15px; min-height: 34px; padding: 1px 8px; }
    .top-back { min-height: 40px; margin-left: auto; }
    .screen { padding: 10px 10px calc(16px + env(safe-area-inset-bottom, 0px)); }
    .role-head { flex-wrap: wrap; }
    .lang-slot { flex: 1 1 100%; }
    .role-img { width: 52px; height: 52px; }
    .role-title { font-size: 24px; }
    .role-grid { grid-template-columns: minmax(0, 1fr); }
    .role-btn { min-height: 120px; }
    .role-ico { font-size: 44px; }
    .money-row { flex-wrap: wrap; }
    .pick-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .tenkey { grid-template-columns: repeat(3, minmax(0, 88px)); grid-auto-rows: 56px; }
    .lcd { min-width: 0; width: 100%; }
    .overlay { padding: 70px 10px 10px; }
}

/* === スマホの よこ・高さの ひくい 画面（いちばん さいごに 書く。rules md 2-9） === */
@media (max-height: 560px) and (orientation: landscape) {
    .topbar { min-height: 52px; padding-top: calc(4px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; }
    .top-title { font-size: 16px; }
    .top-pill { min-height: 32px; font-size: 15px; }
    .top-back { min-height: 40px; }
    .screen { padding: 8px 10px calc(12px + env(safe-area-inset-bottom, 0px)) calc(10px + env(safe-area-inset-left, 0px)); }
    .role-img { width: 44px; height: 44px; }
    .role-title { font-size: 22px; }
    .lead { font-size: 15px; margin: 6px 0; }
    .role-btn { min-height: 110px; padding: 8px; }
    .role-ico { font-size: 36px; }
    .role-name { font-size: 20px; }
    .enter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .enter-btn { min-height: 76px; flex-direction: column; font-size: 15px; }
    .enter-ico { font-size: 28px; }
    .open-grid, .order-grid, .pay-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .qr { width: 200px; height: 200px; }
    .tenkey { grid-template-columns: repeat(3, 64px); grid-auto-rows: 44px; gap: 6px; }
    .key { font-size: 22px; }
    .lcd-num { font-size: 32px; }
    .big-btn { min-height: 50px; font-size: 18px; }
    .overlay { padding: 8px 8px 8px calc(140px + env(safe-area-inset-left, 0px)); align-items: flex-start; }
    .complete-img { width: 110px; height: 110px; }
}

/* ============================================================
 * v2（E1・11/1 相棒の イメージ）：レジ・おさいふ・つぎへ／おわる・けっか・あいことば
 * ============================================================ */
.top-sub { border-color: var(--ok); }
.resume-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    min-height: 54px;
    border-radius: 16px;
    border: 3px dashed var(--ok);
    background: #EAF8EF;
    color: var(--ok-dark);
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}
.role-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.sub-end { border-color: var(--ink-soft); color: var(--ink); }

/* おかね（お札・硬貨） */
.money-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 6px 0; }
.money {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    cursor: pointer;
    border: 3px solid rgba(0, 0, 0, 0.18);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
    color: #3A2A10;
    padding: 0;
}
.money:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }
.money.m-1000 { width: 112px; height: 60px; border-radius: 8px; background: linear-gradient(135deg, #CFE8D2, #9FCBA6); font-size: 22px; }
.money.m-500 { width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFF1B8, #E2B64A); font-size: 20px; }
.money.m-100 { width: 62px; height: 62px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFFFFF, #BFC6CC); font-size: 19px; }
.money.m-50 { width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFFFFF, #C9CED3); font-size: 17px; }
.money.m-10 { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #F6C79A, #B9733E); font-size: 17px; color: #fff; }
.money.m-50::after {
    content: '';
    position: absolute;
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.15);
    top: 6px;
}
.money .m-n {
    position: absolute;
    right: -10px;
    top: -10px;
    min-width: 30px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 15px;
    line-height: 1.6;
}
.money.is-zero { opacity: 0.3; pointer-events: none; }
.wallet-view { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; padding: 6px 0; }
.wallet-sum { margin: 6px 0 0; text-align: center; font-size: 22px; }
.give-box {
    min-height: 84px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 8px;
    border-radius: 16px;
    border: 3px dashed var(--line);
    background: #FFFBF4;
}
.enter-main { border-color: var(--red); box-shadow: 0 6px 0 var(--red-dark); }

/* レジ */
.reg-grid { display: grid; grid-template-columns: minmax(320px, 44%) minmax(0, 1fr); gap: 12px; align-items: start; }
.reg-list { display: flex; flex-direction: column; gap: 6px; }
.reg-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #FFFBF4;
    border: 2px solid var(--line);
    font-size: 18px;
}
.reg-row img { width: 36px; height: 36px; object-fit: contain; }
.reg-row .r-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.reg-row .r-yen { flex: 0 0 auto; color: var(--red-dark); }
.reg-total-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    font-size: 18px;
}
.reg-total { font-size: 34px; color: var(--red-dark); }
.reg-recv-total { font-size: 26px; color: var(--blue-dark); }
.reg-change { font-size: 30px; color: var(--ok-dark); }
.reg-recv { margin-top: 10px; padding-top: 8px; border-top: 3px dashed var(--line); }
.reg-label { margin: 4px 0; font-size: 16px; text-align: center; color: var(--ink-soft); }
.say-mini {
    min-width: 46px;
    min-height: 46px;
    border-radius: 12px;
    border: 3px solid var(--blue);
    background: #fff;
    font-size: 20px;
    cursor: pointer;
}
.reg-left .big-btn { width: 100%; margin-top: 8px; }
.pick .pick-x { position: absolute; top: 4px; left: 6px; min-width: 26px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 15px; }

/* やりとりの おわり */
.after-card { max-width: 820px; margin: 0 auto; text-align: center; }
.done-line { margin: 6px 0; font-size: 20px; line-height: 1.45; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.after-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.huge-btn {
    min-height: 92px;
    padding: 8px 18px;
    border-radius: 22px;
    border: 4px solid var(--ok-dark);
    background: var(--ok);
    box-shadow: 0 7px 0 var(--ok-dark);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    cursor: pointer;
}
.huge-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ok-dark); }
.huge-end { background: #fff; color: var(--ink); border-color: var(--ink-soft); box-shadow: 0 7px 0 var(--ink-soft); }
.btn-swap { background: var(--blue); border-color: var(--blue-dark); box-shadow: 0 7px 0 var(--blue-dark); }

/* けっか */
.sold-list { display: flex; flex-direction: column; gap: 6px; }
.sold-row { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 12px; background: #FFFBF4; border: 2px solid var(--line); font-size: 18px; }
.sold-row img { width: 40px; height: 40px; object-fit: contain; }
.sold-row .s-name { flex: 1 1 auto; min-width: 0; }
.sold-total { margin: 10px 0 0; font-size: 26px; text-align: right; color: var(--red-dark); }
.code-card { text-align: center; background: #FFF8DB; border-color: #E8C55A; }
.code-label { margin: 0; font-size: 17px; color: #6B5200; }
.big-code { margin: 6px 0 0; font-size: 40px; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; font-family: 'M PLUS Rounded 1c', 'Courier New', monospace; overflow-wrap: anywhere; }
.z-item { position: relative; }
.z-item .z-x { position: absolute; top: 4px; right: 6px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 14px; }
.z-item.is-new { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 211, 77, 0.6); }
.z-sec { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; }
.z-cat { padding: 2px 14px; border-radius: 999px; color: #fff; font-size: 17px; }
.z-num { font-size: 15px; color: var(--ink-soft); }
.restore-input {
    display: block;
    width: 100%;
    max-width: 520px;
    margin: 10px auto;
    min-height: 60px;
    padding: 4px 14px;
    border-radius: 14px;
    border: 3px solid var(--line);
    font-family: var(--font);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
    -webkit-user-select: text;
    user-select: text;
}

@media (max-width: 900px) {
    .reg-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) and (orientation: portrait) {
    .after-btns { grid-template-columns: minmax(0, 1fr); }
    .huge-btn { min-height: 70px; font-size: 22px; }
    .big-code { font-size: 26px; }
    .money.m-1000 { width: 92px; height: 50px; font-size: 18px; }
}
@media (max-height: 560px) and (orientation: landscape) {
    .reg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .huge-btn { min-height: 60px; font-size: 20px; }
    .reg-total { font-size: 26px; }
    .big-code { font-size: 26px; }
    .money.m-1000 { width: 86px; height: 46px; font-size: 17px; }
    .money.m-500 { width: 54px; height: 54px; }
    .money.m-100 { width: 50px; height: 50px; }
    .money.m-50, .money.m-10 { width: 46px; height: 46px; font-size: 15px; }
}

/* ============================================================
 * E1-11（2026/11/20）：🧭 ナビ・🌟 レアジェムえもん・⭐ ランチセットを えらぶ
 * ============================================================ */
.nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px calc(12px + env(safe-area-inset-right, 0px)) 8px calc(12px + env(safe-area-inset-left, 0px));
    background: #FFFBEA;
    border-bottom: 4px solid var(--sun);
}
.nav.is-shop { border-bottom-color: var(--red); background: #FFF4EE; }
.nav.is-cust { border-bottom-color: var(--blue); background: #EEF6FF; }
.nav-who {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--sun);
    font-size: 30px;
}
.nav.is-shop .nav-who { border-color: var(--red); }
.nav.is-cust .nav-who { border-color: var(--blue); }
.nav-body { flex: 1 1 auto; min-width: 0; }
.nav-steps { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 3px; }
.nav-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px 1px 2px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid var(--line);
    font-size: 13px;
    color: #A08878;
    white-space: nowrap;
}
.nav-chip b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--line);
    color: #fff;
    font-size: 13px;
}
.nav-chip.done { color: var(--ok-dark); border-color: #BFE6CF; }
.nav-chip.done b { background: var(--ok); }
.nav-chip.on { color: #fff; border-color: transparent; background: var(--red); }
.nav.is-cust .nav-chip.on { background: var(--blue); }
.nav-chip.on b { background: #fff; color: var(--red); }
.nav.is-cust .nav-chip.on b { color: var(--blue); }
.nav-text { margin: 0; font-size: 21px; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.nav-sub { margin: 2px 0 0; font-size: 15px; line-height: 1.35; color: var(--ink-soft); white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.nav-btns { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
.nav-say, .nav-btn {
    min-height: 52px;
    border-radius: 14px;
    font-family: var(--font);
    font-weight: 900;
    cursor: pointer;
}
.nav-say { min-width: 56px; padding: 0 10px; font-size: 24px; background: #fff; border: 3px solid var(--sun); box-shadow: 0 4px 0 #D9A92A; }
.nav-btn { padding: 0 16px; font-size: 19px; color: #fff; background: var(--ok); border: 3px solid var(--ok-dark); box-shadow: 0 4px 0 var(--ok-dark); white-space: nowrap; }
.nav-say:active, .nav-btn:active { transform: translateY(3px); box-shadow: none; }

/* する ところが ゆっくり ひかる */
.nav-focus {
    outline: 4px solid var(--sun);
    outline-offset: 3px;
    border-radius: 16px;
    animation: navGlow 1.4s ease-in-out infinite;
}
@keyframes navGlow {
    0%, 100% { outline-color: rgba(255, 196, 0, 0.95); box-shadow: 0 0 0 0 rgba(255, 196, 0, 0.0); }
    50% { outline-color: rgba(255, 196, 0, 0.35); box-shadow: 0 0 18px 4px rgba(255, 196, 0, 0.55); }
}

/* まんなかの おしらせ（canbat の .toast と 同じ 形） */
.nav-pop {
    position: fixed;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    z-index: 8500;
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    max-width: min(640px, 90vw);
    padding: 14px 24px;
    border-radius: 22px;
    border: 4px solid var(--red);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    font-weight: 900;
}
.nav-pop.is-cust { border-color: var(--blue); }
.nav-pop-num {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 30px;
}
.nav-pop.is-cust .nav-pop-num { background: var(--blue); }
.nav-pop-text { flex: 1 1 auto; min-width: 0; font-size: 22px; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }

/* ⭐ ランチセット */
.set-card { position: relative; }
.set-bonus { display: block; margin-top: 2px; font-size: 13px; color: var(--ok-dark); }
.set-ask-ico { font-size: 40px; line-height: 1; }
.set-card .set-x { position: absolute; top: 6px; right: 8px; min-width: 26px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 15px; text-align: center; }
.set-edit { display: block; margin: -4px 0 10px; }
.order-bonus {
    margin: 0 0 10px;
    padding: 6px 12px;
    border-radius: 12px;
    background: #FFF6D6;
    border: 2px dashed #E8C55A;
    font-size: 15px;
    line-height: 1.4;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.set-box { max-width: 820px; width: 100%; text-align: center; }
.set-box-title { margin: 0 0 4px; font-size: 24px; }
.set-box-note { margin: 0 0 8px; font-size: 16px; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.set-pick-tray {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 60px;
    margin: 8px 0 4px;
    padding: 4px 10px;
    border-radius: 14px;
    background: #FFF6D6;
    border: 3px solid #E8C55A;
}
.set-pick-tray img { width: 48px; height: 48px; object-fit: contain; }
.set-pick-name { margin-left: 8px; font-size: 18px; }
.set-pick-grid { max-height: 40dvh; overflow-y: auto; padding: 4px; text-align: left; }
.set-box-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }

/* 🌟 レアジェムえもん */
.rare-wrap {
    margin: 0 0 14px;
    padding: 10px 12px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, #FFF8DC, #FDEBFF);
    border: 3px solid #E8C55A;
}
.rare-wrap.is-shop { background: linear-gradient(135deg, #FFF1EC, #FFF8DC); border-color: #E89A8A; }
.rare-title { margin: 0; font-size: 22px; }
.rare-lead { margin: 2px 0 8px; font-size: 14px; color: var(--ink-soft); word-break: keep-all; overflow-wrap: anywhere; }
.rare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rare-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 6px;
    border-radius: 16px;
    background: #fff;
    border: 3px solid var(--line);
}
.rare-item.is-done { border-color: #E8C55A; box-shadow: 0 0 0 3px rgba(232, 197, 90, 0.35); }
.rare-pic { position: relative; width: 76px; height: 76px; }
.rare-pic img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.rare-item.is-locked .rare-pic img { filter: brightness(0) opacity(0.18) !important; }
.rare-badge {
    position: absolute;
    right: -6px;
    bottom: -4px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #E8C55A;
    font-size: 18px;
}
.rare-pic-big { width: 170px; height: 170px; margin: 0 auto; }
.rare-pic-big .rare-badge { width: 54px; height: 54px; font-size: 32px; right: -4px; bottom: 0; }
.rare-name { margin-top: 4px; font-size: 14px; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.rare-item.is-locked .rare-name { color: #9C8878; }
.rare-cond { margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--ink-soft); word-break: keep-all; overflow-wrap: anywhere; }
.rare-bar { display: block; width: 90%; height: 8px; margin-top: 5px; border-radius: 99px; background: #F1E4D2; overflow: hidden; }
.rare-bar i { display: block; height: 100%; background: linear-gradient(90deg, #FFC93C, #FF8A3C); }
.rare-num { margin-top: 2px; font-size: 13px; color: var(--red-dark); }
.rare-ov-lead { margin: 0 0 4px; font-size: 22px; color: var(--red-dark); }

@media (prefers-reduced-motion: reduce) {
    .nav-focus { animation: none; }
}
@media (max-width: 900px) {
    .nav-chip-label { display: none; }
    .nav-chip { padding: 1px 2px; }
    .nav-text { font-size: 18px; }
}
@media (max-width: 600px) and (orientation: portrait) {
    .nav { flex-wrap: wrap; gap: 6px 8px; padding: 6px 8px; }
    .nav-who { width: 40px; height: 40px; font-size: 22px; }
    .nav-body { flex: 1 1 0; }
    .nav-text { font-size: 16px; }
    .nav-sub { font-size: 13px; }
    .nav-btns { flex-direction: column; gap: 6px; }
    .nav-say, .nav-btn { min-height: 44px; }
    .nav-btn { font-size: 16px; }
    .nav-pop-text { font-size: 18px; }
    .rare-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .rare-pic-big { width: 120px; height: 120px; }
    .complete-title { font-size: 22px; }
    .set-pick-grid { max-height: 36dvh; }
}
/* スマホの よこ・高さの ひくい 画面（いちばん さいごに 書く。rules md 2-9） */
@media (max-height: 560px) and (orientation: landscape) {
    .nav { padding-top: 4px; padding-bottom: 4px; gap: 8px; }
    .nav-steps { display: none; }
    .nav-who { width: 36px; height: 36px; font-size: 20px; }
    .nav-text { font-size: 15px; }
    .nav-sub { font-size: 12px; }
    .nav-say, .nav-btn { min-height: 40px; }
    .nav-say { font-size: 18px; min-width: 44px; }
    .nav-btn { font-size: 15px; padding: 0 10px; }
    .nav-pop { top: 50%; padding: 8px 14px; }
    .nav-pop-num { width: 40px; height: 40px; font-size: 22px; }
    .nav-pop-text { font-size: 17px; }
    .rare-pic-big { width: 90px; height: 90px; }
    .set-pick-grid { max-height: 30dvh; }
}
