/* กินอะไรดี wheel + group vote + สีมงคลวันนี้ (2026-10-11, features Phase 2).
   Builds on /malitools/bills/calc.css (cards, fields, buttons) and ui-kit tokens. */
.fd-page { --app: #ff9a1f; --app-2: #ff4b2b; --app-ink: #2b1a12; --app-soft: #ffe8cf; }
html[data-theme="dark"] .fd-page { --app-soft: #3a2a17; }
.fd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border: 2px solid var(--edge, #2b1a12) !important; border-radius: 14px; background: var(--surface); color: var(--text);
  font: 800 15px/1.2 var(--font-body); cursor: pointer; box-shadow: 0 3px 0 var(--ink-sh, var(--ink, #2b1a12)) !important; text-decoration: none; }
.fd-btn img { width: 20px; height: 20px; }
.fd-btn.primary { background: var(--accent, #ff4b2b); color: #fff; }
.fd-btn.line { background: #06c755; color: #fff; }
.fd-btn:active { transform: translateY(3px); box-shadow: none !important; }
.fd-btn[disabled] { opacity: .5; pointer-events: none; }
.fd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fd-actions .fd-btn { flex: 1 1 140px; }

/* chips */
.fd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border: 2px solid var(--edge, #2b1a12);
  border-radius: 999px; background: var(--surface); color: var(--text); font: 800 14px/1 var(--font-body); cursor: pointer; box-shadow: none; }
.fd-chip img { width: 18px; height: 18px; }
.fd-chip[aria-pressed="true"] { background: var(--app); color: var(--app-ink); }
.fd-chip:focus-visible { outline: 3px solid color-mix(in srgb, var(--app) 55%, transparent); outline-offset: 2px; }
.fd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--bg); font-size: 12.5px; font-weight: 800; }
.fd-tag img { width: 16px; height: 16px; }

/* the wheel */
.fd-wheel-box { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 6px auto 4px; }
.fd-wheel { width: 100%; height: 100%; display: block; transform: rotate(0deg); transition: transform 1.7s cubic-bezier(.12,.75,.2,1); }
.fd-wheel text { font: 800 11px var(--font-body); fill: #2b1a12; }
.fd-pointer { position: absolute; top: -6px; left: 50%; width: 0; height: 0; transform: translateX(-50%);
  border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--accent, #ff4b2b);
  filter: drop-shadow(0 2px 0 var(--ink-sh, #2b1a12)); z-index: 2; }
.fd-hub { position: absolute; inset: 34%; display: grid; place-items: center; border: 3px solid #2b1a12; border-radius: 50%;
  background: #fffaf2; overflow: hidden; }
.fd-hub img { width: 92%; height: 92%; object-fit: contain; }
.fd-spin { display: flex; justify-content: center; }
.fd-spin .fd-btn { min-width: 180px; font-size: 17px; }
.fd-empty { text-align: center; margin: 0; font-weight: 700; color: var(--muted); }

/* result */
.fd-result { display: grid; gap: 12px; }
.fd-result h3 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -0.01em; line-height: 1.2; }
.fd-result p { margin: 0; }
.fd-note { font-size: 13.5px; font-weight: 700; color: var(--muted); }

/* poll builder + vote page */
.fd-cands { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fd-cands li { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border: 1.5px solid var(--line-strong);
  border-radius: 14px; background: var(--bg); font-weight: 700; }
.fd-cands li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fd-cands button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; box-shadow: none; padding: 0; font-size: 15px; }
.fd-cands button:hover { background: var(--app-soft); color: var(--text); }
.fd-add { display: flex; gap: 8px; }
.fd-add .cc-in { flex: 1; }
.fd-add .cc-in input { padding-right: 12px; }
.fd-link { display: grid; gap: 10px; padding: 14px; border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--bg); }
.fd-link code { font: 700 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.fd-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fd-opt { position: relative; width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 14px;
  border: 2px solid var(--edge, #2b1a12); border-radius: 16px; background: var(--surface); color: var(--text); text-align: left;
  font: 700 16px/1.3 var(--font-body); cursor: pointer; box-shadow: 0 3px 0 var(--ink-sh, var(--ink, #2b1a12)); overflow: hidden; }
.fd-opt:active { transform: translateY(3px); box-shadow: none; }
.fd-opt .bar { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--app-soft); z-index: 0; transition: width .3s; }
.fd-opt > *:not(.bar) { position: relative; z-index: 1; }
.fd-opt b { font-size: 16px; overflow-wrap: anywhere; }
.fd-opt em { font-style: normal; font-size: 13px; font-weight: 800; color: var(--muted); }
.fd-opt small { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.fd-opt[aria-pressed="true"] { background: var(--app); }
.fd-opt[aria-pressed="true"] .bar { background: color-mix(in srgb, #fff 35%, transparent); }
.fd-opt[disabled] { cursor: default; opacity: .7; }
.fd-win { display: grid; gap: 10px; padding: 14px 16px; border: 2px solid var(--edge, #2b1a12); border-radius: 16px; background: var(--app-soft); }
.fd-win b { font-size: 22px; font-weight: 900; }
.fd-mali { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 18px 10px; }
.fd-mali img { width: 120px; height: 120px; }
.fd-mali p { margin: 0; font-weight: 700; line-height: 1.6; max-width: 34ch; }

/* lucky colours */
.lk-date { margin: 0; font-weight: 800; }
.lk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lk-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--bg); }
.lk-list li b { display: block; font-size: 15px; }
.lk-list li small { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.lk-list li.avoid { border-style: dashed; }
.lk-sws { display: inline-flex; gap: 4px; flex: none; }
.lk-sw { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--sw); border: 2px solid #2b1a12; vertical-align: middle; }
.lk-sw.big { width: 30px; height: 30px; }
.lk-strip { display: flex; gap: 8px; overflow-x: auto; }
.lk-item { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 6px; border: 1.5px solid var(--line-strong); border-radius: 999px; white-space: nowrap; }
.lk-item small { font-size: 12px; font-weight: 800; }
.lk-item.avoid { border-style: dashed; }
.lk-week td { white-space: normal; text-align: left !important; vertical-align: top; min-width: 76px; }
/* headings line up with the swatches under them (calc.css right-aligns every th) */
.lk-week th { text-align: left !important; }
.lk-week td small { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.lk-week td .lk-sw { margin-right: 2px; }

@media (prefers-reduced-motion: reduce) {
  .fd-wheel, .fd-opt .bar { transition: none; }
}

/* the hub style.css pads every <section> 48-84px; cards must not inherit that */
.fd-page .cc-card { padding: 0 !important; }
