/* 街の店長さん — 全齡向 Q 版店鋪學習遊戲 */

:root {
    --shop-bg: #fdf6ec;
    --shop-accent: #8d6e63;
    --shop-floor: #d7ccc8;
    --shop-wall: #fff8e1;
    --coral: #ff6f61;
    --mint: #7ec8a3;
    --cream: #fff8f0;
    --brown: #4e342e;
    --brown-light: #6d4c41;
    --shadow: 0 4px 20px rgba(78, 52, 46, 0.12);
    --radius: 16px;
    --font: 'Hiragino Sans', 'Yu Gothic UI', 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }
body {
    background: var(--cream);
    font-family: var(--font);
    color: var(--brown);
    user-select: none;
    overflow: hidden;
}

.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    overflow-y: auto;
}
.screen.hidden { display: none; }

/* ── Title ── */
#start-screen {
    justify-content: center;
    background: linear-gradient(165deg, #ffe8d6 0%, #fff8f0 45%, #e8f5e9 100%);
    padding: 24px;
}
.title-deco {
    font-size: 56px;
    filter: drop-shadow(0 4px 0 rgba(255,111,97,0.3));
    animation: bob 2.5s ease-in-out infinite;
}
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.game-title {
    font-size: clamp(30px, 8vw, 46px);
    font-weight: 800;
    letter-spacing: 0.05em;
    margin: 8px 0 4px;
}
.game-subtitle { font-size: 16px; color: var(--brown-light); margin-bottom: 20px; }

.money-pill {
    background: #fff;
    border: 2px solid #ffcc80;
    border-radius: 999px;
    padding: 8px 20px;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.money-pill.small { padding: 5px 14px; margin: 8px 0; font-size: 14px; }
.money-pill span { color: #ff6f00; }

.panel {
    background: rgba(255,255,255,0.85);
    border: 2px solid #e0d5cc;
    border-radius: var(--radius);
    padding: 18px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}
.panel-label { font-size: 13px; font-weight: 700; color: var(--brown-light); margin-bottom: 10px; }

.level-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.level-btn {
    flex: 1; min-width: 90px; padding: 10px 12px;
    border: 2px solid #bcaaa4; border-radius: 12px;
    background: #fff; font-size: 14px; cursor: pointer;
    transition: all 0.15s; font-family: inherit;
}
.level-btn:hover { border-color: var(--coral); }
.level-btn.active { background: var(--coral); border-color: var(--coral); color: #fff; font-weight: 700; }

.setting-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 12px; font-size: 14px;
}
.setting-row select { padding: 6px 10px; border-radius: 8px; border: 2px solid #e0d5cc; font-family: inherit; }

.customer-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.customer-chip {
    font-size: 11px; background: #fff3e0; border: 1px solid #ffcc80;
    border-radius: 999px; padding: 4px 10px; color: var(--brown-light);
}

.btn-primary {
    background: linear-gradient(135deg, #ff8a65, #ff6f61);
    border: none; border-radius: 999px; padding: 15px 44px;
    font-size: 19px; font-weight: 800; color: #fff; cursor: pointer;
    box-shadow: 0 6px 0 #e64a19, 0 8px 24px rgba(255,111,97,0.35);
    transition: transform 0.1s; font-family: inherit; letter-spacing: 0.06em;
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #e64a19; }

.btn-secondary {
    background: #fff; border: 2px solid var(--shop-accent);
    border-radius: 999px; padding: 10px 22px; font-size: 14px;
    cursor: pointer; font-family: inherit; color: var(--brown);
}
.btn-secondary:hover { background: #fff8e1; }

.btn-icon {
    background: #fff; border: 2px solid #d7ccc8; border-radius: 10px;
    padding: 6px 10px; font-size: 13px; cursor: pointer; font-family: inherit;
    color: var(--brown); font-weight: 700;
}
.btn-icon:hover { border-color: var(--coral); }

.instructions { max-width: 420px; text-align: center; font-size: 13px; line-height: 1.9; color: var(--brown-light); margin-top: 16px; opacity: 0.9; }

/* ── Map ── */
#map-screen { background: linear-gradient(180deg, #b3e5fc 0%, #e1f5fe 40%, #fff8e1 100%); padding: 20px; }
.map-header { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.map-title { font-size: 24px; font-weight: 800; }
#shop-map { display: flex; flex-direction: column; gap: 20px; max-width: 640px; width: 100%; }
.map-section { width: 100%; }
.map-section-title {
    font-size: 16px; font-weight: 800; color: var(--brown);
    margin: 0 0 10px 2px; padding-bottom: 6px;
    border-bottom: 3px solid rgba(141,110,99,0.22);
}
.map-section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }

.shop-card {
    background: #fff; border: 3px solid #e0e0e0; border-radius: var(--radius);
    padding: 16px 12px; text-align: center; cursor: pointer;
    transition: all 0.2s; font-family: inherit; color: inherit; box-shadow: var(--shadow);
}
.shop-card.unlocked { border-color: var(--mint); background: linear-gradient(180deg, #fff, #f1f8e9); }
.shop-card.unlocked:hover { transform: translateY(-4px); }
.shop-card.can-unlock { border-color: #ffb74d; background: linear-gradient(180deg, #fff8e1, #fff); animation: pulse 1.5s ease infinite; }
@keyframes pulse { 0%,100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 4px rgba(255,183,77,0.4); } }
.shop-card.locked { opacity: 0.65; cursor: default; }
.shop-card-icon { font-size: 36px; margin-bottom: 6px; }
.shop-card-name { font-size: 16px; font-weight: 800; }
.shop-card-sub { font-size: 12px; color: var(--brown-light); margin-bottom: 8px; }
.shop-card-badge { font-size: 11px; background: var(--mint); color: #fff; border-radius: 999px; padding: 3px 10px; display: inline-block; font-weight: 700; }
.shop-card-stars { font-size: 13px; color: #ffb300; letter-spacing: 1px; margin-top: 4px; }
.shop-card-mastery { font-size: 10px; color: #ef6c00; font-weight: 800; margin-top: 4px; }
.shop-card-cost { font-size: 11px; color: #f57c00; font-weight: 700; }
.shop-card-lock { font-size: 11px; color: #9e9e9e; }

/* ── 単語図鑑 ── */
#dex-screen { background: linear-gradient(180deg, #ede7f6 0%, #f3e5f5 40%, #fff8e1 100%); padding: 20px; }
#dex-content { display: flex; flex-direction: column; gap: 18px; max-width: 640px; width: 100%; }
.dex-section { width: 100%; }
.dex-section-title {
    font-size: 15px; font-weight: 800; color: var(--brown);
    margin: 0 0 10px 2px; padding-bottom: 6px; border-bottom: 3px solid rgba(141,110,99,0.22);
}
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.dex-card {
    background: #fff; border: 2px solid #e0d5cc; border-radius: 12px;
    padding: 8px 4px; text-align: center; box-shadow: 0 2px 6px rgba(78,52,46,0.1);
}
.dex-card.unknown { background: #f2eee9; border-style: dashed; opacity: 0.7; }
.dex-card.mastered { border-color: #ffb300; background: linear-gradient(180deg, #fff, #fff8e1); }
.dex-icon { font-size: 30px; line-height: 1.1; }
.dex-jp { font-size: 13px; font-weight: 800; margin-top: 2px; }
.dex-zh { font-size: 10px; color: var(--brown-light); }
.dex-stars { font-size: 10px; color: #ffb300; letter-spacing: 0.5px; margin-top: 2px; }

/* 開封演出 */
.unbox-pop {
    position: fixed; inset: 0; z-index: 320; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
}
.unbox-card {
    background: #fff; border: 3px solid #ffb300; border-radius: 18px;
    padding: 18px 26px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    animation: unboxPop 1.5s ease forwards;
}
.unbox-icon { font-size: 52px; line-height: 1; }
.unbox-jp { font-size: 20px; font-weight: 800; margin-top: 6px; }
.unbox-zh { font-size: 13px; color: var(--brown-light); }
.unbox-tag { font-size: 12px; font-weight: 800; color: #e65100; margin-top: 6px; }
@keyframes unboxPop {
    0% { transform: scale(0.3) rotate(-12deg); opacity: 0; }
    18% { transform: scale(1.12) rotate(4deg); opacity: 1; }
    32% { transform: scale(1) rotate(0); }
    80% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.9) translateY(-12px); opacity: 0; }
}

/* ── Game ── */
#game-screen { background: var(--shop-bg); justify-content: flex-start; }

#top-bar {
    width: 100%; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: space-between; align-items: center;
    background: var(--shop-wall); border-bottom: 3px solid var(--shop-floor);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); z-index: 5;
}
.top-left, .top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-stat { font-size: 14px; font-weight: 700; }
.top-stat span { color: #ff6f00; }
#session-earn { font-size: 12px; color: #43a047; font-weight: 700; }
.listening-badge { font-size: 11px; background: #e3f2fd; color: #1565c0; padding: 3px 8px; border-radius: 999px; font-weight: 700; }
#review-stars { color: #ffb300; letter-spacing: 1px; }

/* ミッションバー */
.quest-bar {
    width: 100%; max-width: 720px; margin: 0 auto; box-sizing: border-box;
    padding: 5px 14px; font-size: 12px; font-weight: 700; color: #6a4a00;
    background: linear-gradient(90deg, #fff3d6, #fff8e8);
    border-bottom: 2px solid #ffd98a; display: flex; align-items: center; gap: 8px;
}
.quest-bar.hidden { display: none; }
.quest-bar.done { background: linear-gradient(90deg, #d7f5dc, #eafaec); border-bottom-color: #8ed99a; color: #1b5e20; }
.quest-prog { margin-left: auto; background: #fff; border: 1.5px solid #ffcc80; border-radius: 999px; padding: 1px 9px; font-weight: 800; color: #e65100; }

/* ランチラッシュ橫幅 */
.rush-banner {
    width: 100%; max-width: 720px; margin: 0 auto; box-sizing: border-box;
    padding: 6px 14px; font-size: 13px; font-weight: 800; text-align: center; color: #fff;
    background: linear-gradient(90deg, #ff7043, #ff5252, #ff7043);
    background-size: 200% 100%; animation: rushPulse 1.1s ease-in-out infinite;
}
.rush-banner.hidden { display: none; }
@keyframes rushPulse { 0%,100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

#shop-stage {
    flex: 1; width: 100%; max-width: 720px; min-height: 0;
    display: flex; flex-direction: column;
}

/* 1. 貨架 */
#shelf-zone {
    background: linear-gradient(180deg, var(--shop-wall), var(--shop-bg));
    padding: 8px 10px 12px; border-bottom: 6px solid var(--shop-accent);
    box-shadow: inset 0 -10px 0 -6px rgba(0,0,0,0.08);
}
.shelf-label { font-size: 12px; font-weight: 700; color: var(--brown-light); margin: 2px 0 6px 4px; }
#menu-area {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
}
.shelf-item { position: relative; display: flex; flex-direction: column; gap: 4px; }
.shelf-add {
    position: relative;
    aspect-ratio: 1 / 1; width: 100%;
    background: #fff; border: 2px solid #e0d5cc; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; cursor: pointer; transition: all 0.12s; font-family: inherit;
    box-shadow: 0 3px 0 rgba(141,110,99,0.25);
}
.shelf-add:hover:not(:disabled) { border-color: var(--coral); transform: translateY(-2px); }
.shelf-add:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 rgba(141,110,99,0.25); }
.shelf-item.selected .shelf-add { border-color: #43a047; background: #f1f8e9; }
.shelf-item.out .shelf-add { opacity: 0.4; filter: grayscale(0.6); }
.shelf-add:disabled { cursor: not-allowed; }
.shelf-price { display: flex; align-items: center; justify-content: center; gap: 2px; }
.shelf-price-step {
    width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #e0d5cc; background: #fff;
    font-size: 12px; font-weight: 800; cursor: pointer; font-family: inherit; line-height: 1;
    color: var(--brown); display: flex; align-items: center; justify-content: center; flex: none;
}
.shelf-price-step:hover { border-color: var(--coral); }
.shelf-price-val { font-size: 11px; font-weight: 800; color: #ff6f00; min-width: 42px; text-align: center; }
.shelf-icon { font-size: clamp(24px, 6.5vw, 36px); line-height: 1; }
.shelf-stock { font-size: 10px; color: var(--brown-light); font-weight: 700; }
.shelf-qty {
    position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px;
    padding: 0 5px; border-radius: 999px; background: var(--coral); color: #fff;
    font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 1b. 注文トレイ */
#tray-zone {
    background: var(--shop-wall); border-bottom: 3px solid var(--shop-floor);
    padding: 6px 10px 8px;
}
.tray-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tray-label { font-size: 12px; font-weight: 700; color: var(--brown-light); }
.tray-actions { display: flex; gap: 8px; }
.btn-tray-clear {
    background: #fff; border: 2px solid #d7ccc8; border-radius: 999px;
    padding: 5px 14px; font-size: 13px; font-weight: 700; color: var(--brown-light);
    cursor: pointer; font-family: inherit;
}
.btn-tray-submit {
    background: linear-gradient(135deg, #66bb6a, #43a047); border: none; border-radius: 999px;
    padding: 6px 22px; font-size: 15px; font-weight: 800; color: #fff; cursor: pointer;
    font-family: inherit; box-shadow: 0 3px 0 #2e7d32;
}
.btn-tray-submit:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #2e7d32; }
.btn-tray-submit:disabled, .btn-tray-clear:disabled { opacity: 0.45; cursor: not-allowed; }
#tray-items {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    min-height: 40px; margin-top: 6px;
}
.tray-empty { font-size: 12px; color: #b0a69c; padding: 8px 4px; }
.tray-chip {
    display: flex; align-items: center; gap: 4px;
    background: #fff; border: 2px solid #ffcc80; border-radius: 999px; padding: 3px 6px;
    box-shadow: 0 2px 0 rgba(141,110,99,0.2);
}
.tray-chip-icon { font-size: 22px; line-height: 1; }
.tray-chip-qty { font-size: 14px; font-weight: 800; color: #e65100; min-width: 24px; text-align: center; }
.tray-inc, .tray-dec {
    width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
    font-size: 16px; font-weight: 800; font-family: inherit; line-height: 1;
    background: #fff3e0; color: #e65100; display: flex; align-items: center; justify-content: center;
}
.tray-inc:hover, .tray-dec:hover { background: #ffe0b2; }

/* 2~4. 場景 */
#scene-area {
    position: relative; width: 100%; flex: 1; min-height: 200px;
    overflow: hidden;
}
#scene-canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

/* 5. 對話框 */
#dialogue-zone { padding: 8px 12px 14px; }
.speech-bubble {
    background: #fff; border: 3px solid var(--shop-accent); border-radius: 20px;
    padding: 12px 18px; text-align: center; box-shadow: var(--shadow);
    position: relative; max-width: 520px; margin: 0 auto;
}
.speech-bubble::before {
    content: ''; position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    border-left: 12px solid transparent; border-right: 12px solid transparent;
    border-bottom: 14px solid var(--shop-accent);
}
.speech-voice-tag { font-size: 11px; color: #fff; background: var(--shop-accent); border-radius: 999px; padding: 2px 10px; display: inline-block; margin-bottom: 6px; }
.speech-text { font-size: clamp(18px, 4.5vw, 26px); font-weight: 800; line-height: 1.4; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; min-height: 32px; }
.speech-hint { font-size: 12px; color: var(--brown-light); margin-top: 6px; }
.speech-text ruby { ruby-align: center; }
.speech-text rt { font-size: 0.42em; color: var(--brown-light); font-weight: 700; letter-spacing: 0.02em; }
.speech-text .masked { color: var(--shop-accent); letter-spacing: 0.08em; }
.speech-line.complaint { color: #e53935; }
.speech-hint .expected { color: #2e7d32; font-weight: 700; }
.speaker-btn { background: #fff3e0; border: 2px solid #ffcc80; border-radius: 50%; width: 38px; height: 38px; font-size: 18px; cursor: pointer; vertical-align: middle; transition: transform 0.15s; }
.speaker-btn:hover { transform: scale(1.1); }

/* ── End ── */
#end-screen { justify-content: center; background: linear-gradient(180deg, #ffe0b2, #fff8e1); padding: 24px; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0; max-width: 400px; width: 100%; }
.result-box { background: #fff; border: 2px solid #e0d5cc; border-radius: 14px; padding: 14px; text-align: center; }
.result-box.wide { grid-column: 1 / -1; }
.result-value { font-size: 28px; font-weight: 800; color: #ff6f00; }
.result-label { font-size: 12px; color: var(--brown-light); margin-top: 4px; }
.final-message { font-size: 17px; margin: 12px 0; text-align: center; }
.session-stars { text-align: center; margin: 6px 0 2px; }
.session-stars .star-row { font-size: 40px; color: #ffb300; letter-spacing: 4px; line-height: 1; }
.session-stars .star-record { font-size: 14px; font-weight: 800; color: #e65100; margin-top: 4px; }
.session-stars .star-best { font-size: 13px; font-weight: 700; color: var(--brown-light); margin-top: 4px; }
.session-stars .star-goals { font-size: 11px; color: var(--brown-light); margin-top: 4px; opacity: 0.85; }
.end-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* 学習まとめ */
.learn-summary { max-width: 400px; width: 100%; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ls-line { background: #fff; border: 2px solid #e0d5cc; border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--brown); }
.ls-line b { color: #ef6c00; }
.ls-levelup { background: linear-gradient(90deg, #fff3d6, #ffe9b8); border-color: #ffcc66; }
.ls-new { background: #eafaec; border-color: #a5d6a7; }
.ls-quest { background: #e3f2fd; border-color: #90caf9; }
.next-goal { max-width: 400px; width: 100%; margin-bottom: 18px; }
.next-goal.hidden { display: none; }
.next-goal-label { font-size: 13px; font-weight: 700; color: var(--brown-light); margin-bottom: 6px; text-align: center; }
.next-goal-label b { color: #ef6c00; }
.next-goal-bar { height: 12px; background: #eee1d6; border-radius: 999px; overflow: hidden; border: 1px solid #e0d5cc; }
.next-goal-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ffb74d, #ff9800); transition: width 0.5s ease; }

/* ── 開店前備貨（prep-screen）── */
#prep-screen { background: linear-gradient(180deg, #fff3e0 0%, #fff8e1 50%, #fdf6ec 100%); padding: 0 20px 100px; }
/* 上部（戻る・店名・所持金・注意書き・人気タグ）は開店ボタンと同様に画面上部へ固定し、リストのスクロールに追従させない */
.prep-top-fixed {
    position: sticky; top: 0; z-index: 30;
    width: 100%; max-width: 640px;
    background: linear-gradient(180deg, #fff3e0 0%, #fff3e0 85%, rgba(255,243,224,0) 100%);
    padding: 20px 0 12px;
}
.prep-header { width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.prep-title { flex: 1; font-size: 20px; font-weight: 800; }
.prep-sub { width: 100%; font-size: 12px; color: var(--brown-light); margin: 6px 0 12px; text-align: center; }
.prep-hot-tip {
    width: 100%; background: linear-gradient(90deg, #ffe0b2, #fff3d6);
    border: 2px solid #ffb74d; border-radius: 12px; padding: 8px 14px;
    font-size: 13px; font-weight: 700; color: #e65100; text-align: center;
}
.prep-hot-tip.hidden { display: none; }
.prep-list { max-width: 640px; width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.prep-price-hint { font-size: 11px; color: #b0a69c; margin-top: 2px; }
.hot-tag { font-size: 10px; background: #ff9800; color: #fff; border-radius: 999px; padding: 1px 8px; font-weight: 800; }
.sale-tag { font-size: 10px; background: #26a69a; color: #fff; border-radius: 999px; padding: 1px 8px; font-weight: 800; }
.sale-note { color: #00897b; font-weight: 800; }
#prep-start-btn {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 20;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.restock-row {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 2px solid #e0d5cc; border-radius: 12px;
    padding: 10px 12px; margin-bottom: 8px;
}
.restock-row.new { border-style: dashed; border-color: #ffb74d; background: #fffdf8; }
.restock-row.hot { border-color: #ff9800; background: #fff8e1; box-shadow: 0 0 0 2px rgba(255,152,0,0.2); }
.restock-row.locked { opacity: 0.72; background: #f5f2ef; border-style: dashed; border-color: #cfc4bc; }
.prep-lock-hint { font-size: 12px; font-weight: 700; color: #9e8f82; }
.prep-lock-hint b { color: #e65100; }
.restock-icon { font-size: 30px; }
.restock-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.restock-name { font-weight: 800; font-size: 15px; }
.restock-name small { font-size: 11px; color: var(--brown-light); font-weight: 600; }
.restock-meta { font-size: 11px; color: var(--brown-light); }
.restock-meta .rs-stock { color: #e65100; }
.qty-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.qty-label { font-size: 12px; font-weight: 700; color: var(--brown-light); }
.qty-step {
    width: 24px; height: 24px; border-radius: 50%; border: 2px solid #e0d5cc; background: #fff;
    font-size: 14px; font-weight: 800; cursor: pointer; font-family: inherit; line-height: 1;
    color: var(--brown); display: flex; align-items: center; justify-content: center;
}
.qty-step:hover { border-color: var(--coral); }
.qty-val { font-size: 14px; font-weight: 800; color: var(--brown); min-width: 32px; text-align: center; }
.restock-buy {
    align-self: center;
    background: linear-gradient(135deg, #ffb74d, #ff9800); border: none;
    border-radius: 12px; padding: 8px 12px; font-size: 12px; font-weight: 800; line-height: 1.25;
    color: #fff; cursor: pointer; font-family: inherit; white-space: nowrap; text-align: center;
}
.restock-buy:hover { filter: brightness(1.05); }
.restock-buy.disabled { background: #cfc4bc; cursor: not-allowed; pointer-events: none; }

/* ── 店舗改装モーダル ── */
.upgrade-modal {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(40,26,20,0.55); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.upgrade-modal.hidden { display: none; }
.upgrade-box {
    background: #fff; border: 3px solid var(--shop-accent); border-radius: 20px;
    padding: 18px; max-width: 420px; width: 100%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35); animation: haggleIn 0.2s ease;
    display: flex; flex-direction: column; align-items: center;
}
.upgrade-head { width: 100%; display: flex; align-items: center; justify-content: space-between; font-size: 18px; font-weight: 800; }
.upgrade-list { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.upgrade-row {
    display: flex; align-items: center; gap: 10px;
    background: #fffdf8; border: 2px solid #e0d5cc; border-radius: 12px; padding: 10px 12px;
}
.upgrade-icon { font-size: 28px; }
.upgrade-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upgrade-name { font-weight: 800; font-size: 15px; }
.upgrade-name small { font-size: 11px; color: var(--brown-light); font-weight: 600; }
.upgrade-desc { font-size: 11px; color: var(--brown-light); }
.upgrade-lv { font-size: 12px; font-weight: 700; color: #ff8f00; letter-spacing: 1px; }
.upgrade-buy {
    align-self: center; background: linear-gradient(135deg, #7e57c2, #5e35b1); border: none;
    border-radius: 12px; padding: 8px 14px; font-size: 13px; font-weight: 800;
    color: #fff; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.upgrade-buy:hover { filter: brightness(1.08); }
.upgrade-buy.disabled { background: #cfc4bc; cursor: not-allowed; pointer-events: none; }

/* ── 価格交渉モーダル ── */
.haggle-modal {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(40,26,20,0.55); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.haggle-modal.hidden { display: none; }
.haggle-box {
    background: #fff; border: 3px solid var(--shop-accent); border-radius: 20px;
    padding: 20px 18px; max-width: 380px; width: 100%; text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35); animation: haggleIn 0.2s ease;
}
@keyframes haggleIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.haggle-face { font-size: 44px; line-height: 1; }
.haggle-text { font-size: 20px; font-weight: 800; margin: 8px 0 4px; line-height: 1.4; }
.haggle-text .hg-jp { color: var(--brown); }
.haggle-replay {
    background: #fff3e0; border: 2px solid #ffcc80; border-radius: 999px;
    padding: 5px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
    font-family: inherit; color: #e65100; margin-bottom: 12px;
}
.haggle-options { display: flex; flex-direction: column; gap: 8px; }
.haggle-opt {
    display: flex; flex-direction: column; gap: 1px; align-items: center;
    border: 2px solid #e0d5cc; border-radius: 12px; padding: 9px; cursor: pointer;
    font-family: inherit; background: #fff; transition: all 0.12s;
}
.haggle-opt:hover { transform: translateY(-2px); }
.haggle-opt .hg-label { font-size: 17px; font-weight: 800; color: var(--brown); }
.haggle-opt .hg-sub { font-size: 11px; color: var(--brown-light); }
.haggle-opt.accept { border-color: #66bb6a; background: #f1f8e9; }
.haggle-opt.counter { border-color: #ffb74d; background: #fff8e1; }
.haggle-opt.refuse { border-color: #ef9a9a; background: #fff5f5; }

/* ── FX ── */
#feedback { position: fixed; top: 40%; left: 50%; transform: translate(-50%,-50%); font-size: 36px; font-weight: 800; pointer-events: none; z-index: 250; opacity: 0; transition: opacity 0.2s; }
#feedback.show { opacity: 1; }
.combo-popup { position: fixed; top: 36%; left: 50%; transform: translate(-50%,-50%); font-size: 40px; font-weight: 800; color: #ff6f00; pointer-events: none; z-index: 250; animation: comboAnim 0.9s ease forwards; }
@keyframes comboAnim { 0% { opacity: 1; transform: translate(-50%,-50%) scale(0.5);} 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.15);} 100% { opacity: 0; transform: translate(-50%,-70%) scale(1);} }
.coin { position: fixed; font-size: 18px; font-weight: 800; color: #ff6f00; pointer-events: none; z-index: 150; animation: coinFly 1s ease forwards; }
@keyframes coinFly { 0% { opacity: 1; transform: translate(-50%,0);} 100% { opacity: 0; transform: translate(-50%,-50px);} }
.delivery-fly { position: fixed; font-size: 30px; z-index: 220; pointer-events: none; transform: translate(-50%,-50%); transition: left 0.5s ease, top 0.5s ease, transform 0.5s ease, opacity 0.5s; }
