/* lenz と同じ色（new_blitz/ui/theme.py）。配置は地図を大きく見せる形（上に黒いナビ、お知らせ帯、真ん中に地図、下にボタン。らりむ 11/06） */
:root {
  --bg: #0E0B16; --panel: #130F1E; --card: #1A1527; --card-hi: #221C33; --line: #2E2742;
  --text: #F3EFFF; --muted: #9C93B8; --accent: #B39BFF; --brand-from: #8B6CFF; --brand-to: #FF4D9D;
  --good: #41E089; --bad: #FF5C6C; --nav: #08060D; --stage: #1B1924; --notice: #5B3FD6;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--stage); color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; }
body { display: flex; flex-direction: column; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* 上のナビ */
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; padding: 8px 16px; background: var(--nav); border-bottom: 1px solid #000; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.brand img { width: 32px; height: 32px; }
.brand b { background: linear-gradient(90deg, var(--brand-from), var(--brand-to)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { display: flex; gap: 4px; align-self: stretch; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px; cursor: pointer; color: var(--muted); font-size: 15px; font-weight: 700; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.account { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
#who { color: var(--muted); white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 10px; background: var(--card-hi); border: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE58A, #E0A800); box-shadow: inset 0 0 0 2px #B88400; }

.btn { background: var(--card-hi); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: #120C22; border-color: var(--accent); font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.small { padding: 2px 8px; }

/* お知らせ帯 */
.notice { position: relative; background: var(--notice); color: #fff; text-align: center; padding: 9px 44px; font-weight: 600; }
.notice-x { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #fff; cursor: pointer; font-size: 16px; opacity: .85; }
.notice-x:hover { opacity: 1; }

/* 真ん中の地図 */
.stage { flex: 1; display: flex; min-height: 0; }
.map { position: relative; flex: 1; min-height: 480px; overflow: hidden; background: var(--stage); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.message { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(8, 6, 13, .85); border: 1px solid var(--line);
  padding: 6px 16px; border-radius: 999px; pointer-events: none; max-width: min(560px, 60%); text-align: center; z-index: 2; }
.message:empty { display: none; }
.legend { position: absolute; left: 14px; bottom: 14px; background: rgba(8, 6, 13, .8); border-radius: 8px; padding: 6px 10px; font-size: 12px;
  display: flex; gap: 12px; flex-wrap: wrap; pointer-events: none; z-index: 2; max-width: 40%; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

/* 地図の上に浮かぶもの */
.float { position: absolute; z-index: 3; background: rgba(26, 21, 39, .96); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
/* マイドロップス（左の一覧）。画面は 2 つ: マイドロップス（一覧＋全部のピン）と 降下計算（選んだピン＋バスの線＋右のパネル） */
.list { width: 300px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; min-height: 0; }
.list h2 { margin: 0 0 2px; font-size: 18px; }
.list > p { margin: 0 0 10px; }
.stage.t-drops #panel, .stage.t-drops #legend { display: none; }
.stage.t-calc #dropsview { display: none; }
.stage.t-map #dropsview, .stage.t-map #panel, .stage.t-map #legend { display: none; }
.pincard .cardmsg { margin: 8px 0 0; color: #CFC6EA; }
.pincard p.muted { margin: 0 0 8px; }
.pincard .wide:disabled { opacity: .45; cursor: default; }


.card h2 { margin: 0 0 10px; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

#search { width: 100%; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 8px; }
.drops { list-style: none; margin: 0; padding: 0; overflow: auto; min-height: 0; flex: 1; }
.drops li { padding: 7px 10px; border-radius: 8px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.drops li:hover { background: var(--card-hi); }
.drops li.on { background: var(--card-hi); outline: 1px solid var(--accent); }
.drops li .pin { width: 10px; height: 10px; border-radius: 50%; background: #FFD23F; flex: none; }
.drops li.on .pin { box-shadow: 0 0 0 2px #fff; }
.drops .group { color: var(--muted); font-size: 12px; padding: 8px 4px 2px; cursor: default; }
.drops .group:hover { background: none; }

#result .head { font-size: 22px; font-weight: 700; color: var(--good); margin: 0 0 2px; }
#result .parts { color: var(--muted); margin: 0 0 12px; }
#result .row { margin: 0 0 7px; }
#result .row b { margin-right: 8px; }
#result .note { color: var(--muted); margin: 0; }
#result .warn { color: #FFB020; margin: 0 0 6px; font-weight: 600; }   /* 結果の注意（高さの地図が無い・周りが変わった） */

.foot { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; padding: 6px 16px; border-top: 1px solid #000; background: var(--nav); }

/* スマホ・狭い画面: 地図の下に結果、マイドロップスは地図の上に全幅で */
@media (max-width: 900px) {
  .stage { flex-direction: column; }
  .map { flex: none; height: min(76vh, 120vw); min-height: 360px; }
  .list { width: auto; order: 2; border-right: 0; border-top: 1px solid var(--line); }
  .drops { max-height: 50vh; }
  .message { top: 10px; font-size: 12px; border-radius: 12px; max-width: 90%; }
  .legend { display: none; }
}
@media (max-width: 600px) {
  .nav { padding: 8px 16px; gap: 6px 12px; }
  .brand { font-size: 15px; }
  .brand span b { display: none; }
  .tab { padding: 6px 8px; font-size: 14px; }
  #who { display: none; }
  .account { gap: 6px; }
  .account .btn, .chip { padding: 5px 9px; font-size: 13px; }
}

/* 管理者の画面（admin.js） */
#seeas { padding: 6px 8px; color: var(--text); background: var(--card-hi); }
#seeas option { background: var(--panel); }
.adminbox { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 16px; border-radius: 12px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); }
.adminbox::backdrop { background: rgba(0, 0, 0, .6); }
.adm-head { display: flex; align-items: center; justify-content: space-between; }
.adm-head h2 { margin: 0; font-size: 17px; }
.adm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.adm-row input { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.adm-row input[type=search] { flex: 1; min-width: 160px; }
.adm-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.adm-scroll { max-height: 55vh; overflow: auto; }
table.adm { width: 100%; border-collapse: collapse; font-size: 13px; }
table.adm th { text-align: left; color: var(--muted); font-weight: 400; position: sticky; top: 0; background: var(--card); }
table.adm td, table.adm th { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.adm .num { text-align: right; white-space: nowrap; }
table.adm tr[data-uid] { cursor: pointer; }
table.adm tr[data-uid]:hover, table.adm tr.on { background: var(--card-hi); }
.adm-detail h3 { margin: 0 0 4px; font-size: 15px; }
.adm-detail h4 { margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.adm-error { color: var(--bad); }
@media (max-width: 800px) { .adm-body { grid-template-columns: 1fr; } }

/* ピンに乗せたときの小窓と、押したときのカード */
.peek, .pincard { position: absolute; z-index: 5; background: #0B0911; border: 1px solid #000; border-radius: 10px; color: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .55); }
.peek { width: 240px; padding: 10px 8px 8px; text-align: center; pointer-events: none; }
.peek h3, .pincard h3 { margin: 0; font-size: 15px; font-weight: 800; }
.peek .sub, .pincard .sub { color: #D6D0E6; margin-top: 1px; }
.peek .hint { color: #8FB0FF; font-size: 12px; margin: 4px 0 8px; }
.peek canvas { display: block; width: 224px; height: 130px; border-radius: 4px; }
.pincard { width: 280px; max-width: calc(100% - 16px); padding: 14px 14px 14px; }
.pincard h3 { font-size: 19px; padding-right: 24px; }
.pincard .sub { font-size: 15px; }
.pincard .x { position: absolute; right: 8px; top: 6px; background: none; border: 0; color: #fff; font-size: 15px; cursor: pointer; padding: 4px; }
.pincard .link { display: block; background: none; border: 0; padding: 0; margin: 4px 0 12px; color: #8FB0FF; text-decoration: underline; cursor: pointer; font-size: 14px; }
.pincard canvas { display: block; width: 100%; height: 140px; border-radius: 6px; margin-bottom: 12px; }
.pincard .wide { display: block; width: 100%; padding: 10px; border: 0; border-radius: 10px; color: #fff; font-size: 15px;
  background: linear-gradient(90deg, var(--brand-from), var(--brand-to)); }
.pincard p { margin: 0; }
@media (hover: none) { .peek, .keys { display: none; } }

/* 右のパネル（アプリの降下計算の右側と同じボタン） */
.panel { width: 340px; flex: none; background: var(--panel); border-left: 1px solid var(--line); padding: 16px; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; }
.plabel { font-weight: 800; }
.ptarget { color: var(--muted); font-size: 13px; min-height: 1.2em; }
.ptarget b { color: var(--text); }
.btn.block { display: block; width: 100%; padding: 10px; font-weight: 700; }
.calc { width: 100%; border: 0; border-radius: 12px; padding: 13px; font-size: 16px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(90deg, var(--brand-from), var(--brand-to)); }
.calc:disabled { opacity: .45; cursor: default; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid2 .btn { padding: 10px 6px; font-weight: 700; white-space: normal; }
.keys { margin: 0; color: var(--muted); font-size: 12px; }
.panel h3 { margin: 8px 0 0; font-size: 18px; }
.btn.on { border-color: var(--accent); background: #2C2245; }
.placebox label { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.placebox input, .placebox select { width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.placebox pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--panel); padding: 8px; border-radius: 8px; margin: 10px 0 8px; }
@media (max-width: 900px) {
  .panel { width: auto; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  html, body { height: auto; }
  .stage { flex: none; }
}

/* 候補 1〜4（らりむ 11/06） */
#result .alts { margin: 0 0 12px; display: grid; gap: 5px; }
#result .alts-h { color: var(--muted); font-size: 12px; margin: 0 0 2px; }
#result .alt { display: grid; grid-template-columns: 24px auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  text-align: left; padding: 6px 9px; border-radius: 8px; border: 1px solid #3A3350; background: #1E1A2A; color: inherit; cursor: pointer; font: inherit; }
#result .alt:hover { border-color: #6A5F8A; }
#result .alt.on { border-color: #FFD23F; background: #2A2438; }
#result .alt .n { grid-row: 1 / 3; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #FFD23F; color: #FFD23F;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; }
#result .alt.on .n { background: #FFD23F; color: #0E0B16; }
#result .alt .t { font-weight: 700; font-size: 15px; }
#result .alt .d { color: var(--muted); font-size: 12px; justify-self: end; }
#result .alt .m { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }

/* 1 つのピンで別々の建物（spot の members）: 色と名前（らりむ 11/11） */
.members { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin: 6px 0 2px; font-size: 12px; color: #D6D0E6; }
.members span { display: inline-flex; align-items: center; gap: 4px; }
.members i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #fff; display: inline-block; }
.pincard .members { margin: -6px 0 12px; }

/* トークンを買う（shop.js） */
.shopbox { width: min(760px, calc(100vw - 32px)); }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.pack { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px 14px; border-radius: 12px;
  background: var(--card-hi); border: 1px solid var(--line); }
.pack.tagged { border-color: var(--accent); }
.pack-tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); padding: 2px 10px; border-radius: 10px;
  font-size: 12px; font-weight: 700; white-space: nowrap; color: #120C22; background: var(--accent); }
.pack-tag.best { background: linear-gradient(90deg, var(--brand-from), var(--brand-to)); color: #fff; }
.pack-label { color: var(--muted); font-size: 13px; }
.pack-tokens { font-size: 22px; font-weight: 800; }
.pack-sub { color: var(--muted); font-size: 13px; }
.pack-price { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.cur { display: inline-flex; gap: 4px; }
.cur .btn.on { border-color: var(--accent); color: var(--text); }
#tokens[style*="pointer"]:hover { border-color: var(--accent); }
.shopbox .wide { width: 100%; padding: 9px; }
.shopbox a, .foot a { color: var(--accent); }

/* 初めてログインしたときの言語の選択（app.js askLang、11/18） */
.langbox { width: min(420px, calc(100vw - 32px)); text-align: center; }
.langbox h2 { margin: 4px 0 14px; font-size: 18px; line-height: 1.5; }
.langbox h2 .muted { font-size: 14px; font-weight: 400; }
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 14px; }
.langs .btn { padding: 14px 10px; font-size: 16px; }
