:root {
  --ink: #17231d;
  --ink-soft: #526057;
  --paper: #f4f0e6;
  --paper-2: #ebe5d7;
  --panel: #fffdf7;
  --line: #d7d1c3;
  --green: #1f5b43;
  --green-2: #2d7859;
  --lime: #d7ec78;
  --orange: #e46f39;
  --orange-soft: #f7d2bc;
  --yellow: #f0c955;
  --red: #bd4c3a;
  --shadow: 0 18px 45px rgba(32, 39, 33, .12);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(240, 201, 85, .18), transparent 32rem),
    radial-gradient(circle at 92% 18%, rgba(31, 91, 67, .12), transparent 28rem),
    var(--paper);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  font-feature-settings: "palt";
  font-size: clamp(14px, .35vw + 12px, 16px);
  overflow: hidden;
}

h1, h2, h3, p, li, button, span, b, small { word-break: auto-phrase; line-break: strict; overflow-wrap: normal; }

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(228, 111, 57, .35); outline-offset: 2px; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.app-shell { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  min-height: 76px;
  padding: 12px clamp(18px, 3vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--ink);
  color: #fffdf7;
  border-bottom: 4px solid var(--lime);
}

.brand {
  border: 0;
  padding: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  background: none;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 9px 16px 9px 16px;
  background: var(--lime);
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
  transform: rotate(-3deg);
}

.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: clamp(14px, 1.35vw, 20px); letter-spacing: .02em; }
.brand small { color: #b8c4bb; font-size: 9px; font-weight: 800; letter-spacing: .2em; }

.top-stats { display: flex; align-items: stretch; gap: 1px; background: rgba(255,255,255,.13); }
.top-stat { min-width: 120px; padding: 7px 16px; display: grid; align-content: center; background: var(--ink); }
.top-stat span { color: #aab9ae; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.top-stat strong { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.top-stat strong small { margin-left: 3px; color: #99aa9f; font-size: 11px; }
.top-stat.accent strong { color: var(--lime); }

.game-layout {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  height: 100vh;
  padding: clamp(8px, 1.2vw, 16px);
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(520px, 1fr);
  gap: clamp(8px, 1vw, 14px);
  align-items: stretch;
}

.panel {
  min-height: 0;
  padding: clamp(16px, 1.5vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, .91);
  box-shadow: 0 5px 20px rgba(32, 39, 33, .06);
}

.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.panel-heading h1, .panel-heading h2 { margin: 2px 0 0; font-size: clamp(19px, 1.5vw, 25px); line-height: 1.2; }
.draft-panel .panel-heading h1 { font-size: 20px; white-space: nowrap; }
.draft-panel .round-chip { font-size: clamp(12px, .8vw, 14px); }
.eyebrow { color: var(--orange); font-size: 9px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.round-chip { padding: 6px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); font-size: clamp(12px, .8vw, 14px); font-weight: 800; white-space: nowrap; }
.draft-panel { height: 100%; padding: 15px; display: flex; flex-direction: column; overflow: hidden; }
.draft-panel .panel-heading { margin-bottom: 5px; align-items: center; }
.draft-panel .panel-heading h1 { margin: 0; white-space: nowrap; font-size: clamp(18px, 1.5vw, 22px); }
.draft-panel .panel-heading h1 strong { margin-left: 5px; color: var(--green); }
.mall-workspace { display: contents; }

.scenario-card {
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), #163c2e);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.scenario-icon { flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: var(--lime); font-size: 24px; }
.scenario-card .eyebrow { color: var(--lime); }
.scenario-card h2 { margin: 2px 0 3px; font-size: 16px; }
.scenario-card p { margin: 0; color: #cdd9d1; font-size: 11px; line-height: 1.5; }

.region-roulette {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 25, 19, .72);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, visibility .16s ease;
}
.region-roulette.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.roulette-machine { width: min(460px, 100%); padding: 23px; border: 2px solid var(--lime); border-radius: 22px; background: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.38), inset 0 0 0 5px rgba(255,255,255,.05); text-align: center; }
.roulette-kicker { color: var(--lime); font-size: 10px; font-weight: 900; letter-spacing: .25em; }
.roulette-window { position: relative; margin: 15px 0 12px; min-height: 96px; padding: 18px 42px; display: grid; place-items: center; overflow: hidden; border: 5px solid #a9b2a8; border-radius: 13px; background: linear-gradient(#fff, #eee9dd 48%, #fff 49%); box-shadow: inset 0 8px 16px rgba(0,0,0,.15); }
.roulette-window::before, .roulette-window::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: rgba(23,35,29,.15); }
.roulette-window::before { top: 28%; }
.roulette-window::after { bottom: 28%; }
.roulette-window i { position: absolute; top: 50%; width: 0; height: 0; border-block: 8px solid transparent; transform: translateY(-50%); }
.roulette-window i:first-child { left: 12px; border-left: 13px solid var(--orange); }
.roulette-window i:last-child { right: 12px; border-right: 13px solid var(--orange); }
.roulette-window strong { position: relative; z-index: 1; font-size: clamp(28px, 8vw, 44px); line-height: 1.2; letter-spacing: .03em; }
.region-roulette.is-spinning .roulette-window strong { animation: slotTick .11s infinite alternate; filter: blur(.45px); }
.region-roulette.is-landed .roulette-window { border-color: var(--yellow); box-shadow: 0 0 0 7px rgba(240,201,85,.16), inset 0 8px 16px rgba(0,0,0,.1); }
.region-roulette.is-landed .roulette-window strong { color: var(--green); animation: regionLand .35s ease both; }
.roulette-machine p { margin: 0; color: #b8c4bb; font-size: 10px; font-weight: 900; letter-spacing: .14em; }

.capacity-block { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.capacity-title { margin-bottom: 7px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.capacity-title b { font-size: 10px; }
.capacity-title span { color: var(--ink-soft); font-size: 8px; }
.genre-capacity { display: flex; flex-wrap: wrap; gap: 5px; }
.capacity-chip { padding: 5px 7px; display: flex; align-items: center; gap: 5px; border-radius: 8px; background: var(--paper); color: var(--ink-soft); }
.capacity-chip b { font-size: 8px; }
.capacity-chip em { color: var(--green); font-size: 9px; font-style: normal; font-weight: 900; }
.capacity-chip.is-full { background: #e2eee4; color: var(--green); }

.draft-help { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; color: var(--ink-soft); font-size: clamp(12px, .8vw, 14px); font-weight: 700; }
.text-button { padding: 0; border: 0; background: none; color: var(--green); font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.text-button:disabled { opacity: .35; cursor: default; }

.stat-guide { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #faf7ef; color: var(--ink-soft); font-size: 9px; }
.stat-guide summary { padding: 8px 10px; color: var(--green); font-size: 10px; font-weight: 900; cursor: pointer; }
.stat-guide[open] summary { border-bottom: 1px solid var(--line); }
.stat-guide-grid { padding: 9px 10px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.stat-guide-grid p { margin: 0; display: grid; gap: 1px; line-height: 1.45; }
.stat-guide-grid b { color: var(--ink); font-size: 9px; }
.stat-guide > small { display: block; padding: 3px 10px 9px; line-height: 1.5; }

.offer-list { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(62px, auto); align-content: start; gap: 7px; overflow-y: auto; scrollbar-gutter: stable; padding-right: 3px; }
.offer-card {
  position: relative;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 8px 9px 8px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  overflow: hidden;
}
.offer-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--genre-color, var(--green)); }
.offer-card:hover { transform: translateY(-2px); border-color: #a9b9ae; box-shadow: 0 7px 17px rgba(23,35,29,.09); }
.offer-card.is-selected { border-color: var(--genre-color, var(--green)); background: color-mix(in srgb, var(--genre-color, var(--green)) 7%, white); box-shadow: 0 0 0 2px color-mix(in srgb, var(--genre-color, var(--green)) 20%, transparent); }
.offer-card.is-unavailable { opacity: .35; cursor: not-allowed; }
.offer-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--genre-color, var(--green)) 48%, transparent); outline-offset: 2px; }
.offer-card.is-dragging { opacity: .58; cursor: grabbing; }
.offer-copy { min-width: 0; }
.offer-copy h3 { margin: 0 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(15px, 1vw, 18px); }
.offer-copy p { margin: 0; color: var(--ink-soft); font-size: clamp(12px, .8vw, 14px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-copy .store-reference { color: var(--ink); font-size: 9px; font-weight: 800; }
.store-reference span { margin-left: 3px; padding: 1px 4px; border-radius: 99px; background: var(--paper-2); color: var(--ink-soft); font-size: 7px; }
.store-reference span.is-local { background: var(--lime); color: var(--ink); }
.offer-copy .store-type { width: fit-content; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--genre-color) 14%, white); color: var(--genre-color); font-size: clamp(12px, .8vw, 14px); font-weight: 900; }
.offer-meta { min-width: 58px; height: 46px; display: grid; align-items: center; justify-items: end; align-self: center; }
.store-size-badge { width: clamp(46px, 3.4vw, 58px); height: 46px; display: grid; place-items: center; border: 2px solid color-mix(in srgb, var(--size-color) 72%, var(--ink)); border-radius: 10px; background: var(--size-color); line-height: 1; }
.store-size-badge b { color: var(--ink); font-size: clamp(19px, 1.5vw, 25px); }
.rarity { padding: 3px 6px; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.rarity.Epic { background: #eee2fa; color: #7b43a9; }
.rarity.Legendary { background: #fff0b6; color: #8a5c00; }
.rarity.Rare { background: #ddecf8; color: #376e98; }
.offer-meta strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.offer-meta strong em { margin-left: 1px; font-size: 7px; font-style: normal; }
.offer-meta small { color: var(--ink-soft); font-size: 8px; text-align: right; }

.mall-panel { min-height: 0; padding: 14px 16px; display: flex; flex-direction: column; overflow: hidden; }
.legend { display: flex; gap: 10px; color: var(--ink-soft); font-size: clamp(12px, .75vw, 14px); font-weight: 700; }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--green-2); }
.legend-dot.synergy { background: var(--orange); }

.mall-name-row { min-height: 43px; padding: 0 0 7px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.mall-name-row label { color: var(--ink-soft); font-size: clamp(12px, .8vw, 14px); font-weight: 800; }
.mall-name-row input { min-width: 0; flex: 1; border: 0; border-bottom: 1px dashed #a9a296; background: transparent; color: var(--ink); font-weight: 800; }
.mall-name-row > span { color: var(--ink-soft); font-size: clamp(12px, .8vw, 14px); font-weight: 800; white-space: nowrap; }

.home-button { min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--green); font-size: clamp(12px, .8vw, 14px); font-weight: 900; white-space: nowrap; cursor: pointer; }
.home-button:hover { border-color: var(--green); transform: translateY(-1px); }
.report-button { border-color: var(--green); background: var(--green); color: white; }
.report-button:hover { border-color: var(--ink); }

.mall-campus { min-height: 0; flex: 1; padding: 7px 0 5px; display: flex; flex-direction: column; }
.mall-building { position: relative; padding: 8px 9px 0; border: 3px solid #8b918b; border-radius: 10px 10px 3px 3px; background: linear-gradient(115deg, #d8ded9, #f4f6f2 35%, #ccd4ce); box-shadow: 8px 10px 0 #d9d4c9; }
.building-sign { min-height: 31px; padding: 4px 13px; display: flex; align-items: center; justify-content: center; border-radius: 5px 5px 0 0; background: var(--ink); color: white; }
.building-sign span { color: var(--lime); font-size: 7px; font-weight: 900; letter-spacing: .18em; }
.building-sign b { font-size: 15px; letter-spacing: .11em; }
.floor-board {
  position: relative;
  padding: 9px 5px 8px 0;
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: repeat(3, minmax(74px, 1fr));
  gap: 4px 8px;
  align-content: center;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.26) 0 1px, transparent 1px 12px);
}
.floor-board::after { content: ""; position: absolute; left: 24px; top: 12px; bottom: 12px; width: 2px; z-index: 0; background: #9ea69f; }
.floor-label { position: relative; z-index: 1; display: grid; place-content: center; justify-items: center; align-self: stretch; background: #dce1dc; }
.floor-label b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; }
.floor-label span { margin-top: 4px; color: var(--ink-soft); font-size: clamp(10px, .7vw, 12px); writing-mode: vertical-rl; letter-spacing: .08em; }
.floor-row { position: relative; min-width: 0; padding: 4px; display: flex; gap: 6px; border-bottom: 4px solid #8b918b; background: rgba(255,255,255,.47); }
.floor-row[data-floor="3"] { background: linear-gradient(90deg, rgba(240,201,85,.20) 0 75%, rgba(52,68,59,.08) 75%); box-shadow: inset 0 0 0 2px rgba(228,111,57,.18); }
.floor-row[data-floor="3"]::after { content: none; }
.building-entrance { width: 48%; min-height: 23px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 7px; border: 2px solid #717a73; border-bottom: 0; border-radius: 8px 8px 0 0; background: linear-gradient(90deg, #aad2d1, #e9f5f3, #aad2d1); color: #31463b; font-size: 7px; letter-spacing: .12em; }
.building-entrance i { width: 1px; height: 17px; background: rgba(49,70,59,.4); }
.outside-complex { margin: 7px 4px 0 18%; padding: 6px; display: grid; grid-template-columns: 110px minmax(150px, 1fr); gap: 6px; align-items: stretch; border: 1px solid #beb9ad; border-radius: 8px; background: #e5e2da; }
.outside-zone-head { padding: 8px 4px; display: flex; flex-direction: column; justify-content: center; border-left: 3px solid var(--orange); }
.outside-zone-head span { color: var(--orange); font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.outside-zone-head b { margin-top: 3px; font-size: 10px; }
.outside-board { min-width: 0; display: grid; }
.outside-board .mall-slot { min-height: 63px; border-style: solid; background: #fffaf0; }
.mall-slot {
  position: relative;
  min-height: 72px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px dashed #bbb4a8;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(244,240,230,.6), rgba(235,229,215,.55));
  text-align: left;
  cursor: default;
  overflow: hidden;
  transition: border-color .16s, transform .16s, background .16s;
  flex: var(--slot-weight, 1) 1 0;
  min-width: 0;
}
.mall-slot.is-fit { border: 2px solid var(--green-2); background: #f5faef; cursor: pointer; animation: softPulse 1.5s infinite; }
.mall-slot.is-fit:hover { transform: translateY(-3px); }
.mall-slot.is-drop-target { border-color: var(--orange); background: #fff5dc; box-shadow: inset 0 0 0 3px var(--orange), 0 7px 18px rgba(23,35,29,.16); transform: translateY(-3px) scale(1.015); }
.mall-slot.is-synergy { box-shadow: inset 0 0 0 2px var(--orange); }
.mall-slot.is-blocked { opacity: .38; }
.slot-trait { color: var(--ink-soft); font-size: clamp(10px, .7vw, 12px); font-weight: 800; letter-spacing: .04em; }
.slot-size { position: absolute; top: 6px; right: 7px; min-width: 30px; padding: 3px 6px; border: 1px solid color-mix(in srgb, var(--slot-size-color) 70%, var(--ink)); border-radius: 7px; background: var(--slot-size-color); color: var(--ink); font-size: clamp(11px, .75vw, 13px); font-weight: 900; text-align: center; }
.empty-slot-label { margin: auto; color: #837b70; font-size: clamp(11px, .75vw, 13px); font-weight: 800; text-align: center; }
.empty-slot-label b { display: block; margin-bottom: 4px; color: #787065; font-size: 18px; font-weight: 500; }

.tenant-slot { cursor: default; border-style: solid; border-color: color-mix(in srgb, var(--store-color) 42%, var(--line)); background: #fff; opacity: 1; }
.tenant-slot::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--store-color); }
.tenant-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tenant-head > span { min-width: 0; width: 100%; }
.tenant-head h3 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(14px, 1.15vw, 19px); line-height: 1.25; }
.tenant-head p { margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: clamp(10px, .7vw, 12px); font-weight: 700; }

.mall-footer { padding-top: 7px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; border-top: 1px solid var(--line); }
.flow-line { display: flex; align-items: center; flex: 1; color: var(--ink-soft); font-size: 8px; font-weight: 800; }
.flow-line i { height: 1px; flex: 1; margin: 0 7px; background: repeating-linear-gradient(90deg, #b5aea2 0 4px, transparent 4px 8px); }

.primary-button, .secondary-button {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: clamp(14px, .9vw, 16px);
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--lime); }
.primary-button:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--lime); }
.primary-button:disabled { opacity: .35; cursor: default; box-shadow: none; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover { border-color: var(--ink); transform: translateY(-1px); }
.primary-button.large { min-height: 52px; padding-inline: 28px; font-size: clamp(15px, 1vw, 17px); }

.best-score { color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.best-score b { margin-left: 4px; color: var(--green); font-size: 15px; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi-card { padding: 12px; display: grid; grid-template-columns: 1fr auto; align-items: end; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.kpi-card span { grid-column: 1 / -1; color: var(--ink-soft); font-size: 9px; font-weight: 800; }
.kpi-card strong { margin-top: 4px; font-size: 22px; font-variant-numeric: tabular-nums; }
.kpi-card small { padding-bottom: 3px; color: var(--ink-soft); font-size: 8px; }

.analysis-block { margin-top: 18px; }
.block-title { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.block-title h3 { margin: 0; font-size: 11px; letter-spacing: .04em; }
.block-title > span { color: var(--orange); font-size: 9px; font-weight: 900; }
.score-bars { display: grid; gap: 7px; }
.score-bar-row { display: grid; grid-template-columns: 64px 1fr 38px; gap: 7px; align-items: center; color: var(--ink-soft); font-size: 9px; }
.score-bar-row b { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { height: 7px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--green-2); transition: width .35s ease; }

.combo-list { max-height: 154px; display: grid; gap: 6px; overflow: auto; }
.combo-list.empty-state { padding: 15px 10px; border: 1px dashed var(--line); border-radius: 10px; color: #8d857a; font-size: 9px; text-align: center; }
.combo-item { padding: 7px 8px; display: grid; grid-template-columns: 19px 1fr auto; gap: 6px; align-items: center; border-radius: 9px; background: #f8f2e7; font-size: 9px; }
.combo-item i { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: var(--orange-soft); color: var(--orange); font-style: normal; font-weight: 900; }
.combo-item b { color: var(--orange); }

.local-ranking ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.local-ranking li { display: grid; grid-template-columns: 18px 1fr auto; gap: 6px; color: var(--ink-soft); font-size: 9px; }
.local-ranking li b { color: var(--ink); }
.local-ranking .empty-record { display: block; padding: 10px; text-align: center; }
.icon-button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--paper-2); cursor: pointer; }
.report-drawer:not([open]) { display: none; }
.report-drawer { min-width: 0; padding: 0; overflow: auto; }
.report-drawer > summary { display: flex; min-height: 48px; padding: 13px 18px; align-items: center; justify-content: space-between; border-radius: inherit; background: var(--ink); color: white; cursor: pointer; list-style: none; }
.report-drawer > summary::-webkit-details-marker { display: none; }
.report-drawer > summary span { font-size: 13px; font-weight: 900; }
.report-drawer > summary b { color: var(--lime); font-size: 9px; }
.report-drawer > summary b::before { content: "× "; }
.report-drawer[open] > summary { border-radius: var(--radius) var(--radius) 0 0; }
.report-drawer[open] { position: fixed; inset: 16px; z-index: 65; width: min(900px, calc(100% - 32px)); height: min-content; max-height: calc(100vh - 32px); margin: auto; overflow: auto; box-shadow: 0 0 0 100vmax rgba(17,28,22,.72), var(--shadow); }
.report-content { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.report-content > .panel-heading { margin-bottom: 0; }
.report-content > .panel-heading, .report-content > .kpi-grid { grid-column: 1 / -1; }
.report-content > .kpi-grid { grid-template-columns: repeat(4, 1fr); }
.report-content .analysis-block { margin-top: 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(17, 28, 22, .77);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
#result-modal { padding: 12px; }
.modal-card { position: relative; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid rgba(255,255,255,.6); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.start-card { padding: clamp(28px, 5vw, 58px); text-align: center; }
.start-card::before, .result-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: repeating-linear-gradient(90deg, var(--green) 0 42px, var(--lime) 42px 60px, var(--orange) 60px 78px); }
.start-kicker { color: var(--orange); font-size: 10px; font-weight: 900; letter-spacing: .22em; }
.start-logo { margin: 22px auto 15px; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 18px 30px 18px 30px; background: var(--ink); transform: rotate(-4deg); }
.start-logo span { color: var(--lime); font-size: 42px; font-weight: 900; transform: rotate(4deg); }
.start-logo span { font-size: 17px; letter-spacing: .08em; }
.start-card h2 { margin: 0; font-size: clamp(28px, 5vw, 44px); line-height: 1.3; letter-spacing: -.05em; text-wrap: balance; }
.start-card > p { max-width: 470px; margin: 18px auto 26px; color: var(--ink-soft); font-size: clamp(15px, 1vw, 17px); line-height: 1.8; text-wrap: balance; }
.start-features { margin: 22px 0; display: flex; justify-content: center; }
.start-features span { min-width: 110px; padding: 0 16px; display: grid; gap: 2px; border-right: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; }
.start-features span:last-child { border-right: 0; }
.start-features b { color: var(--green); font-size: 20px; }
.start-actions { display: flex; justify-content: center; align-items: center; gap: 12px; }
.draw-note { max-width: 430px; margin: 0 auto 20px !important; padding: 11px 14px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.draw-note b { color: var(--green); font-size: 11px; }
.draw-note span { color: var(--ink-soft); font-size: 9px; }
.start-note { display: block; margin-top: 20px; color: #7e776e; font-size: clamp(12px, .8vw, 14px); line-height: 1.7; }

.howto-card { width: min(720px, 100%); padding: clamp(28px, 5vw, 52px); }
.howto-card h2 { margin: 6px 0 22px; font-size: clamp(28px, 4vw, 40px); }
.howto-steps { margin: 0; padding: 0; display: grid; gap: 12px; list-style: none; counter-reset: howto; }
.howto-steps li { position: relative; padding: 14px 16px 14px 56px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 13px; background: white; counter-increment: howto; }
.howto-steps li::before { content: counter(howto); position: absolute; left: 15px; top: 15px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-weight: 900; }
.howto-steps b { font-size: clamp(15px, 1vw, 17px); }
.howto-steps span { color: var(--ink-soft); font-size: clamp(13px, .9vw, 15px); line-height: 1.65; }
.howto-facts { margin: 20px 0; display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.howto-facts span { padding: 12px 6px; display: grid; justify-items: center; gap: 3px; border-right: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; }
.howto-facts span:last-child { border-right: 0; }
.howto-facts b { color: var(--green); font-size: 20px; }
.howto-card > .primary-button { display: block; margin: 0 auto; }

.result-card { width: min(1240px, 100%); height: calc(100vh - 24px); max-height: none; padding: clamp(18px, 2vw, 28px); display: flex; flex-direction: column; text-align: center; }
.modal-close { position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--paper-2); cursor: pointer; }
.result-card h2 { margin: 4px 40px 8px; font-size: clamp(28px, 4vw, 48px); line-height: 1.1; }
.result-diagnosis { margin: 0 0 15px; color: var(--ink-soft); font-size: clamp(13px, .9vw, 15px); }
.result-details[hidden] { display: none; }
.result-details { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.result-detail-toggle { margin: 10px auto 0; }
.result-score-line { display: flex; align-items: center; justify-content: center; gap: 18px; }
.result-score-wrap { display: inline-grid; grid-template-columns: auto auto; align-items: end; column-gap: 5px; }
.result-score-wrap > span { grid-column: 1 / -1; color: var(--orange); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.result-score-wrap strong { font-size: clamp(46px, 9vw, 72px); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.result-score-wrap small { padding-bottom: 7px; color: var(--ink-soft); font-size: 10px; }
.result-grade { width: 54px; height: 54px; display: grid; place-items: center; border: 3px solid var(--orange); border-radius: 50%; color: var(--orange); font-size: 25px; font-weight: 900; transform: rotate(9deg); }
.result-mall-scene { min-height: 0; margin-top: 8px; padding: clamp(10px, 1.4vw, 18px); flex: 1 1 auto; display: flex; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(#dceced 0 17%, #eee9df 17% 100%); text-align: left; }
.result-scene-title { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.result-scene-title span { color: var(--orange); font-size: 7px; font-weight: 900; letter-spacing: .16em; }
.result-scene-title b { font-size: 11px; }
#result-mall-view { width: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 22%); align-items: end; gap: clamp(8px, 1.2vw, 16px); }
.result-building-view { height: 100%; min-height: 0; display: grid; grid-template-rows: auto repeat(3, minmax(0, 1fr)); border: 4px solid #7b837c; border-bottom: 7px solid #616862; background: rgba(255,255,255,.9); }
.result-roof { min-height: 46px; padding: 6px 16px; display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: white; }
.result-roof span { color: var(--lime); font-size: clamp(8px, .75vw, 11px); font-weight: 900; letter-spacing: .12em; }
.result-roof b { max-width: 70%; font-size: clamp(14px, 1.5vw, 22px); line-height: 1.25; overflow-wrap: anywhere; text-align: right; }
.result-floor { min-height: 0; display: grid; grid-template-columns: clamp(44px, 5vw, 68px) 1fr; border-top: 3px solid #8b918b; }
.result-floor > strong { display: grid; place-items: center; background: #e0e4e0; font-size: clamp(14px, 1.5vw, 22px); }
.result-floor > div { min-width: 0; padding: clamp(5px, .7vw, 10px); display: flex; flex-direction: column; }
.result-floor small { display: block; color: var(--ink-soft); font-size: clamp(8px, .7vw, 11px); font-weight: 900; letter-spacing: .08em; }
.result-tenant-row { min-height: 0; margin-top: 5px; flex: 1; display: flex; gap: clamp(4px, .5vw, 8px); }
.result-tenant { min-width: 0; padding: clamp(7px, .8vw, 12px); flex: var(--slot-weight, 1) 1 0; display: flex; flex-direction: column; justify-content: center; border-top: 6px solid var(--store-color); border-radius: 5px; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.12); }
.result-tenant b { display: block; font-size: clamp(10px, 1.15vw, 17px); line-height: 1.25; overflow-wrap: anywhere; text-align: center; }
.result-tenant.is-long b { font-size: clamp(9px, .9vw, 13px); line-height: 1.18; }
.result-tenant.is-very-long b { font-size: clamp(8px, .75vw, 11px); line-height: 1.12; }
.result-tenant span { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: clamp(8px, .75vw, 11px); }
.result-entrance { width: 45%; margin: 0 auto; padding: 3px; border: 1px solid #708a84; border-bottom: 0; background: #bee0de; color: var(--green); font-size: 5px; font-weight: 900; text-align: center; }
.result-outside-view { min-height: 42%; padding: clamp(8px, 1vw, 14px); border: 4px solid #858b84; border-top: 10px solid var(--orange); background: #f5f0e5; }
.result-outside-view > small { display: block; margin-bottom: 8px; color: var(--orange); font-size: clamp(9px, .8vw, 12px); font-weight: 900; letter-spacing: .1em; }
.result-outside-view .result-tenant { min-height: 90px; }
.result-breakdown { margin: 22px 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.result-breakdown div { padding: 9px 3px; border-radius: 8px; background: var(--paper-2); }
.result-breakdown span { display: block; color: var(--ink-soft); font-size: 7px; }
.result-breakdown b { font-size: 11px; }
.result-summary { padding: 12px 16px; display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.result-summary p { margin: 0; padding: 4px 10px; display: grid; gap: 4px; border-right: 1px solid var(--line); }
.result-summary p:last-child { border-right: 0; }
.result-summary span { color: var(--ink-soft); font-size: 12px; }
.result-summary strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-actions { margin-top: 21px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.result-primary-actions { width: min(700px, 100%); margin: 10px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.result-primary-actions button { min-width: 0; }
.result-share-wrap { position: relative; min-width: 0; }
.result-share-wrap > #share-button { width: 100%; }
.share-choice-menu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 4; width: max(100%, 210px); padding: 8px; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.share-choice-menu[hidden] { display: none; }
.share-choice-menu button { width: 100%; }
.share-choice-hint { color: var(--ink-soft); font-size: 11px; line-height: 1.45; text-align: left; }
.x-share-button { background: var(--ink); color: white; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: clamp(13px, .9vw, 15px); font-weight: 800; box-shadow: var(--shadow); transform: translate(-50%, 25px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

.drag-ghost { position: fixed; inset: 0 auto auto 0; z-index: 90; width: min(220px, 55vw); height: 52px; pointer-events: none; opacity: .94; box-shadow: 0 12px 30px rgba(23,35,29,.25); transform-origin: top left; }
.drag-ghost .offer-meta { min-width: 42px; }
.is-dragging-store, .is-dragging-store * { cursor: grabbing !important; }

.loading-card { height: 72px; border-radius: 13px; background: linear-gradient(100deg, #eee8dc 20%, #f8f5ee 40%, #eee8dc 60%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.error-card { padding: 18px; border: 1px solid #e4b7ae; border-radius: 12px; background: #fff5f2; color: var(--red); font-size: 11px; line-height: 1.6; }

@keyframes shimmer { to { background-position-x: -200%; } }
@keyframes softPulse { 50% { box-shadow: 0 0 0 4px rgba(45,120,89,.10); } }
@keyframes slotTick { from { transform: translateY(-5px); opacity: .55; } to { transform: translateY(5px); opacity: 1; } }
@keyframes regionLand { from { transform: scale(.86); } 60% { transform: scale(1.08); } to { transform: scale(1); } }

@media (max-width: 1400px) and (min-width: 1101px) {
  .game-layout { grid-template-columns: minmax(280px, 320px) minmax(480px, 1fr); }
  .panel { padding: 12px; }
  .report-content { padding: 11px; gap: 9px; }
  .kpi-card { padding: 9px; }
  .kpi-card strong { font-size: 18px; }
  .combo-list { max-height: 116px; }
}

@media (max-width: 1100px) {
  .game-layout { padding: 6px; grid-template-columns: 1fr; grid-template-rows: 44vh calc(56vh - 18px); gap: 6px; }
  .panel { min-height: auto; }
  .mall-panel { order: 1; }
  .draft-panel { min-height: 0; height: 100%; padding: 8px; order: 2; }
  .floor-board { min-height: 0; }
  .report-drawer > summary { min-height: 32px; padding: 7px 11px; }
}

@media (max-width: 620px) {
  .game-layout { padding: 3px; gap: 3px; grid-template-rows: 58vh calc(42vh - 9px); }
  .panel { border-radius: 12px; }
  h1, h2, h3, button, label, .round-chip, .store-type, .slot-trait { word-break: keep-all; overflow-wrap: normal; }
  .draft-panel { padding: 4px 5px; }
  .draft-panel .panel-heading { margin-bottom: 1px; gap: 5px; }
  .draft-panel .panel-heading h1 { font-size: clamp(14px, 3.8vw, 17px); }
  .draft-panel .round-chip { padding: 3px 6px; font-size: 10px; }
  .draft-help { min-height: 25px; padding-top: 0; gap: 4px; font-size: 10px; }
  .offer-list { grid-template-rows: none; grid-auto-rows: minmax(38px, auto); gap: 2px; padding-right: 1px; scrollbar-gutter: auto; }
  .offer-card { grid-template-columns: minmax(0, 1fr) 34px; min-height: 38px; padding: 2px 3px 2px 8px; gap: 3px; border-radius: 6px; touch-action: none; }
  .offer-card::before { width: 4px; }
  .offer-meta { min-width: 0; }
  .offer-meta { height: 32px; }
  .store-size-badge { width: 32px; height: 30px; min-height: 0; border-width: 1px; border-radius: 5px; }
  .store-size-badge b { font-size: 14px; }
  .offer-copy h3 { margin-bottom: 1px; font-size: 12px; }
  .offer-copy .store-type { padding: 1px 4px; font-size: 9px; }
  .mall-panel { padding: 5px; }
  .mall-name-row { min-height: 33px; padding-bottom: 3px; gap: 4px; }
  .mall-name-row label, .mall-name-row > span { display: none; }
  .mall-name-row input { font-size: 11px; }
  .home-button { min-height: 29px; padding: 4px 7px; font-size: 11px; }
  .mall-campus { padding: 0; }
  .mall-building { min-height: 0; flex: 1; padding: 4px 5px 0; display: flex; flex-direction: column; box-shadow: 4px 5px 0 #d9d4c9; }
  .building-sign { min-height: 22px; padding-block: 2px; }
  .building-sign b { font-size: 11px; }
  .floor-board { min-height: 0; flex: 1; padding-block: 3px; grid-template-columns: 32px 1fr; grid-template-rows: repeat(3, minmax(48px, 1fr)); gap-block: 2px; }
  .floor-board::after { left: 17px; }
  .floor-label b { width: 24px; height: 24px; font-size: 10px; }
  .floor-label span { display: none; }
  .floor-row { gap: 4px; }
  .mall-slot { min-height: 33px; padding: 3px; border-radius: 5px; }
  .slot-trait { max-width: calc(100% - 30px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; line-height: 1.2; }
  .slot-size { top: 3px; right: 3px; min-width: 24px; padding: 2px 4px; border-radius: 5px; font-size: 10px; }
  .empty-slot-label { font-size: 10px; }
  .empty-slot-label b { margin-bottom: 0; font-size: 12px; }
  .building-entrance { min-height: 15px; font-size: 9px; }
  .tenant-head { display: grid; justify-items: center; text-align: center; }
  .tenant-head h3 { width: 100%; font-size: clamp(11px, 3vw, 14px); white-space: nowrap; text-overflow: ellipsis; }
  .tenant-head p { display: none; }
  .remove-hint { display: none; }
  .legend, .flow-line { display: none; }
  .mall-footer { display: none; }
  .report-content { grid-template-columns: 1fr; }
  .report-content > .panel-heading, .report-content > .kpi-grid { grid-column: auto; }
  .report-content > .kpi-grid { grid-template-columns: 1fr 1fr; }
  .start-actions { flex-direction: column; }
  .start-actions button { width: 100%; }
  .howto-facts { grid-template-columns: 1fr 1fr; }
  .howto-facts span:nth-child(2) { border-right: 0; }
  .howto-facts span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .result-breakdown { grid-template-columns: repeat(4, 1fr); }
  #result-modal { padding: 6px; }
  .result-card { width: calc(100vw - 12px); height: calc(100vh - 12px); padding: 14px 10px 10px; border-radius: 16px; }
  .result-card h2 { margin-block: 3px 5px; font-size: clamp(24px, 8vw, 34px); }
  #result-mall-view { grid-template-columns: minmax(0, 1fr) 88px; gap: 4px; }
  .result-mall-scene { margin-top: 4px; padding: 6px; }
  .result-roof { min-height: 34px; padding-inline: 8px; }
  .result-floor { grid-template-columns: 32px 1fr; }
  .result-floor > div { padding: 4px; }
  .result-floor small { font-size: 7px; }
  .result-tenant { padding: 5px 3px; border-top-width: 4px; }
  .result-tenant b { font-size: 8px; }
  .result-tenant.is-long b { font-size: 7px; }
  .result-tenant.is-very-long b { font-size: 6px; }
  .result-tenant span { display: none; }
  .result-outside-view { padding: 5px; border-width: 3px; border-top-width: 7px; }
  .result-outside-view .result-tenant { min-height: 64px; }
  .result-primary-actions { gap: 6px; }
  .result-primary-actions { grid-template-columns: 1fr 1fr; }
  .result-primary-actions #retry-button { grid-column: 1 / -1; }
  .result-primary-actions button { min-height: 38px; padding-inline: 8px; font-size: 12px; }
  .result-detail-toggle { margin-top: 6px; min-height: 34px; padding-block: 6px; }
  .outside-complex { margin-left: 0; grid-template-columns: 78px minmax(125px, 1fr); }
  .outside-complex { min-height: 37px; margin-top: 2px; padding: 2px; }
  .outside-board .mall-slot { min-height: 34px; }
  .outside-zone-head { padding-block: 2px; }
  .outside-zone-head b { font-size: 7px; }
  .mall-footer { padding-top: 3px; }
  .mall-footer .primary-button { min-height: 28px; padding: 4px 9px; font-size: 8px; }
  .result-summary { grid-template-columns: 1fr; }
  .result-summary p { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-summary p:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
