/* 뭐먹을까 — roulette.css (v1.2.0) · 다크 테마 (딸깍 미니앱 통일) */
:root {
  /* 색 토큰은 shared/theme.css 가 공급(라이트 기본+다크 선택). 비색상 토큰만 유지 */
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
  line-height: 1.6; font-size: 15px;
}

/* topbar */
.topbar { display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border-bottom: 1px solid var(--border); padding: 10px 18px; position: sticky; top: 0; z-index: 20; }
.tb-left { display: flex; align-items: center; gap: 12px; }
.home-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text3); text-decoration: none; font-size: 13px; }
.home-link:hover { color: var(--accent); }
.sep { width: 1px; height: 20px; background: var(--border); }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--text); }
.logo svg { color: var(--accent); }
.tb-right { display: flex; align-items: center; gap: 6px; }
.tbtn { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer;
  color: var(--text2); padding: 5px 9px; border-radius: 7px; font-size: 12px; text-decoration: none; white-space: nowrap; font-family: inherit; }
.tbtn:hover { background: var(--bg); color: var(--accent); }

/* layout */
.wrap { max-width: 1020px; margin: 0 auto; padding: 22px 18px 60px; }
.intro { color: var(--text2); font-size: 14px; margin-bottom: 20px; line-height: 1.7; }
.intro b { color: var(--text); }
.loc-line { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--border2);
  color: var(--text2); font-size: 12.5px; font-family: inherit; cursor: pointer; padding: 3px 10px; border-radius: 999px; margin-left: 4px; }
.loc-line:hover { border-color: var(--accent); color: var(--text); }
.loc-edit { color: var(--accent2); font-size: 11.5px; }

.lr-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
@media (max-width: 760px) { .lr-grid { grid-template-columns: 1fr; } }

/* 룰렛 카드 */
.wheel-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 20px; display: flex; flex-direction: column; align-items: center; }
.wheel-head { width: 100%; display: flex; justify-content: center; min-height: 22px; margin-bottom: 6px; }
.pool-info { font-size: 12.5px; color: var(--text3); }
.pool-info b { color: var(--accent2); font-weight: 600; }

.wheel-stage { position: relative; width: 100%; max-width: 360px; }
#svg { width: 100%; height: auto; display: block; }
#wheel { transform-box: fill-box; transform-origin: center; transition: transform 4.2s cubic-bezier(.17,.67,.16,.99); }
.wheel-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--text3); font-size: 13.5px; padding: 40px; line-height: 1.7; }

.spin-btn { margin-top: 14px; width: 100%; max-width: 320px; font-size: 17px; font-weight: 700; color: #fff;
  background: var(--accent); border: none; border-radius: 12px; padding: 14px; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, transform .06s; }
.spin-btn:hover { background: var(--accent2); }
.spin-btn:active { transform: scale(.98); }
.spin-btn:disabled { opacity: .55; cursor: not-allowed; }
.spin-ico { font-size: 18px; }

.result { margin-top: 14px; width: 100%; max-width: 360px; min-height: 70px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; justify-content: center; text-align: center; }
.result-empty { color: var(--text3); font-size: 14px; }
.res-name { font-size: 21px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.res-meta { font-size: 13px; color: var(--text2); line-height: 1.7; }
.res-meta .dot { color: var(--text3); margin: 0 6px; }
.res-cuisine { display: inline-block; background: var(--accent-dim); color: var(--accent2); font-size: 12px;
  font-weight: 600; padding: 2px 9px; border-radius: 999px; margin-bottom: 8px; }
.res-links { margin-top: 11px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.res-links a, .res-links button { font-size: 12.5px; font-family: inherit; cursor: pointer; text-decoration: none;
  border-radius: 8px; padding: 7px 12px; border: 1px solid var(--border2); background: var(--panel2); color: var(--text2); }
.res-links a:hover, .res-links button:hover { color: var(--text); border-color: var(--accent); }
.res-links .lk-map { background: var(--accent-dim); color: var(--accent2); border-color: transparent; }
.res-links .lk-excl { color: var(--text3); }
.res-links .lk-excl:hover { color: var(--danger); border-color: var(--danger); }

.disclaimer { margin-top: 14px; font-size: 11px; color: var(--text3); text-align: center; line-height: 1.6; max-width: 400px; }
.disclaimer b { color: var(--text2); }

/* 옵션 사이드 */
.lr-side { display: flex; flex-direction: column; gap: 14px; }
.side-block { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; }
.side-h { font-size: 12px; font-weight: 700; color: var(--text3); letter-spacing: .02em; margin-bottom: 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; cursor: pointer; font-family: inherit;
  border: 1px solid var(--border2); background: var(--bg); color: var(--text2); }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.chip .cnt { opacity: .7; font-size: 11px; margin-left: 3px; }

.seg { display: flex; background: var(--bg); border: 1px solid var(--border2); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; background: none; border: none; color: var(--text2); padding: 7px 4px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }

.list-open-btn { width: 100%; font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  background: var(--accent-dim); color: var(--accent2); border: 1px solid var(--accent); border-radius: 9px; padding: 10px; }
.list-open-btn:hover { background: var(--accent); color: #fff; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text2); cursor: pointer; }
.chk input { accent-color: var(--accent); }
.muted { color: var(--text3); font-size: 12px; }
.excl-summary { display: block; width: 100%; text-align: left; margin-top: 10px; font-size: 12.5px; font-family: inherit;
  background: var(--bg); color: var(--text2); border: 1px solid var(--border2); border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.excl-summary:hover { border-color: var(--danger); color: var(--text); }
.side-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.mini-btn { font-size: 12px; font-family: inherit; cursor: pointer; background: var(--panel2); color: var(--text3);
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; }
.mini-btn:hover { color: var(--text); border-color: var(--accent); }

/* 모달 공통 */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--border2); border-radius: 14px; width: 100%; max-width: 440px; max-height: 88vh; overflow: auto; display: flex; flex-direction: column; }
.modal-lg { max-width: 520px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.modal-title { font-size: 16px; font-weight: 700; }
.lm-count { font-size: 12px; font-weight: 400; color: var(--text3); }
.modal-head .x { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 16px 18px; }
.modal-desc { font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 16px; }
.modal-desc b { color: var(--accent2); }
.m-field { margin-bottom: 18px; }
.m-field > label { display: block; font-size: 12px; font-weight: 700; color: var(--text3); margin-bottom: 8px; }
.loc-list { display: flex; flex-direction: column; gap: 7px; }
.loc-item { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border2); border-radius: 9px; padding: 10px 12px; cursor: pointer; }
.loc-item.on { border-color: var(--accent); background: var(--accent-dim); }
.loc-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border2); flex: none; position: relative; }
.loc-item.on .loc-radio { border-color: var(--accent); }
.loc-item.on .loc-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.loc-info { flex: 1; min-width: 0; }
.loc-name { font-size: 14px; font-weight: 600; color: var(--text); }
.loc-name .tag { font-size: 10.5px; font-weight: 600; color: var(--text3); background: var(--panel2); border-radius: 5px; padding: 1px 5px; margin-left: 6px; }
.loc-addr { display: block; font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-del { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 15px; flex: none; }
.loc-del:hover { color: var(--danger); }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; height: 38px; background: var(--bg); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); padding: 0 11px; font-size: 14px; font-family: inherit; }
.add-row input:focus { outline: none; border-color: var(--accent); }
.m-btn { font-size: 13px; font-family: inherit; cursor: pointer; border-radius: 8px; padding: 9px 14px; border: 1px solid var(--border2); background: var(--panel2); color: var(--text2); white-space: nowrap; }
.m-btn:hover { color: var(--text); border-color: var(--accent); }
.m-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.m-btn.primary:hover { background: var(--accent2); }
.m-btn.ghost { background: none; }
.m-btn.full { width: 100%; margin-top: 8px; }
.m-btn:disabled { opacity: .5; cursor: not-allowed; }
.add-msg { margin-top: 9px; font-size: 12.5px; line-height: 1.5; }
.add-msg.err { color: var(--danger); }
.add-msg.ok { color: var(--success); }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; position: sticky; bottom: 0; background: var(--panel); }
.modal-foot:has(.primary:only-child) { justify-content: flex-end; }

/* 전체 목록 모달 */
.list-search { width: 100%; height: 36px; background: var(--bg); border: 1px solid var(--border2); border-radius: 8px; color: var(--text);
  padding: 0 11px; font-size: 14px; font-family: inherit; margin: 4px 0 10px; }
.list-search:focus { outline: none; border-color: var(--accent); }
.list-wrap { display: flex; flex-direction: column; gap: 5px; max-height: 42vh; overflow: auto; }
.lrow { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; }
.lrow.ex { opacity: .5; }
.lr-main { flex: 1; min-width: 0; }
.lr-name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.lr-badge { font-size: 11px; }
.lr-sub { display: block; font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.lr-act { flex: none; font-size: 12px; font-family: inherit; cursor: pointer; border-radius: 7px; padding: 5px 11px; border: 1px solid var(--border2); background: var(--panel2); color: var(--text2); }
.lr-act.excl:hover { color: var(--danger); border-color: var(--danger); }
.lr-act.restore { color: var(--accent2); border-color: transparent; background: var(--accent-dim); }
.lr-act.restore:hover { background: var(--accent); color: #fff; }
.lr-act.del:hover { color: var(--danger); border-color: var(--danger); }
.list-empty { text-align: center; color: var(--text3); font-size: 13px; padding: 24px; }
.excl-extra { margin-top: 12px; }
.excl-extra-h { font-size: 11.5px; font-weight: 700; color: var(--text3); margin: 6px 0 6px; }
.excl-extra .lrow { margin-bottom: 5px; }

/* 내 목록 편집 */
.custom-text { width: 100%; background: var(--bg); border: 1px solid var(--border2); border-radius: 9px; color: var(--text);
  padding: 11px 13px; font-size: 14px; font-family: inherit; line-height: 1.7; resize: vertical; min-height: 200px; }
.custom-text:focus { outline: none; border-color: var(--accent); }
.custom-count { margin-top: 8px; font-size: 12.5px; color: var(--text3); text-align: right; }
