/* Shared styles for the betting games: ladder, roulette, and the lunch generator. Skin tokens only. */
.pick-card { max-width: 760px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.pick-card + .pick-card { margin-top: 16px; }
.pick-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.pick-sub { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 12px; }
.pick-label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.pick-label span { font-weight: 400; color: var(--muted); }
.pick-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.pick-card .error { margin-top: 10px; }
.chips-box { min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--subtle); }
.chips-box:focus-within { outline: 2px solid var(--focus); outline-offset: -1px; background: var(--bg); }
.pick-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.pick-check input { accent-color: var(--accent); margin: 0; }

/* page-level buttons, so the games look right in every skin */
.pick-card .btn:disabled, .pick-stage .btn:disabled { opacity: .5; cursor: default; }

/* ---------- ladder ---------- */
.ladder { --cols: 4; margin-top: 4px; }
.ladder-row { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.ladder-name {
  margin: 0 3px; padding: 7px 4px; border-radius: 6px; border: 2px solid var(--c); background: var(--bg); color: var(--fg);
  font: 600 13px/1.2 var(--font); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.ladder-name:hover { background: color-mix(in srgb, var(--c) 10%, var(--bg)); }
.ladder-name.active { background: color-mix(in srgb, var(--c) 18%, var(--bg)); }
.ladder-name.winner { background: var(--c); color: #fff; }
.ladder.auto .ladder-name { cursor: default; pointer-events: none; }
.ladder-svg { display: block; width: 100%; height: 340px; }
.ladder-poles line, .ladder-rungs line { stroke: var(--muted); stroke-width: 3; stroke-linecap: round; opacity: .55; }
.ladder-paths polyline { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.ladder-result {
  margin: 0 3px; padding: 7px 4px; border-radius: 6px; text-align: center; font-size: 13px; font-weight: 600;
  border: 1px dashed var(--line); color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ladder-result .ladder-a { display: none; }
.ladder-result.revealed { border: 2px solid var(--c); color: var(--fg); animation: pop .3s ease-out; }
.ladder-result.revealed .ladder-a { display: inline; }
.ladder-result.revealed .ladder-q { display: none; }
.ladder-result.winner { background: var(--c); color: #fff; }
@keyframes pop { 50% { transform: scale(1.08); } }
@media (max-width: 600px) { .ladder-svg { height: 280px; } .ladder-name, .ladder-result { font-size: 12px; margin: 0 1px; } }

/* ---------- roulette ---------- */
.roulette { display: grid; place-items: center; }
.roulette-svg { width: min(100%, 380px); height: auto; overflow: visible; }
.roulette-wheel { transform-origin: 0 0; }
.roulette-wheel path { stroke: var(--bg); stroke-width: .012; }
.roulette-wheel text { dominant-baseline: middle; text-anchor: middle; font-weight: 700; font-family: var(--font); pointer-events: none; }
.roulette-wheel .slice.win path { filter: brightness(1.12); stroke: var(--fg); stroke-width: .03; }
.roulette-hub { fill: var(--bg); stroke: var(--line); stroke-width: .02; }
.roulette-pointer { fill: var(--fg); stroke: var(--bg); stroke-width: .015; }

/* ---------- results + history ---------- */
.pick-stage { margin-top: 16px; }
.pick-result {
  margin-top: 16px; padding: 18px; border-radius: 8px; text-align: center; background: color-mix(in srgb, var(--accent) 9%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); animation: pop .35s ease-out;
}
.pick-result-label { font-size: 13px; color: var(--muted); }
.pick-result-value { font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.pick-result .pick-actions { justify-content: center; }
.pick-history { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.pick-history li { padding: 2px 10px; border-radius: 999px; background: var(--subtle); border: 1px solid var(--line); color: var(--muted); }
.pick-history li b { color: var(--fg); }

/* ---------- lunch ---------- */
.menu-groups { display: grid; gap: 10px; }
.menu-group h3 { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.menu-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.menu-chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 999px; padding: 3px 11px;
  font: 13px/1.5 var(--font); cursor: pointer;
}
.menu-chip:hover { border-color: var(--accent); }
.menu-chip.custom { border-style: dashed; }
.menu-chip[aria-pressed="true"] { color: var(--muted); text-decoration: line-through; background: var(--subtle); opacity: .7; }
.menu-count { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.method-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; border: 0; padding: 0; margin: 0; }
.method-pick label { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--bg); }
.method-pick label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.method-pick input { margin: 3px 0 0; accent-color: var(--accent); }
.method-pick .m-emoji { font-size: 20px; line-height: 1.2; }
.method-pick b { display: block; font-size: 14px; }
.method-pick small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.candidates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.candidates span { padding: 2px 10px; border-radius: 999px; background: var(--subtle); border: 1px solid var(--line); font-size: 12.5px; }

/* Figma: cards are white frames on the dark canvas */
[data-skin="figma"] .page-main { padding: 48px 40px; }
[data-skin="figma"] .pick-card {
  position: relative; border: 0; border-radius: 0; color: #1e1e1e;
  --bg: #fff; --fg: #1e1e1e; --muted: #6b6b6b; --line: #e6e6e6; --subtle: #f5f5f5;
}
[data-skin="figma"] .pick-card::before { content: attr(data-frame); position: absolute; left: 0; bottom: 100%; padding-bottom: 6px; font-size: 11px; color: #b3b3b3; }
[data-skin="figma"] .pick-card + .pick-card { margin-top: 40px; }
[data-skin="figma"] .field-value, [data-skin="figma"] .pick-links { padding: 2px 16px; color: #e6e6e6; }
@media (max-width: 800px) { [data-skin="figma"] .page-main { padding: 36px 16px; } }

/* rail: links to the other games */
.pick-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.pick-links a { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 6px; }
.pick-links a:hover { background: var(--subtle); }
.pick-links a[aria-current="page"] { font-weight: 600; color: var(--accent); }

/* lunch: nearby restaurants under the result */
.near { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.near[hidden] { display: none; }
.near-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.near-head h3 { font-size: 14px; font-weight: 600; }
.near-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; counter-reset: near; }
.near-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 6px; padding: 6px 4px; border-radius: 6px; counter-increment: near; }
.near-list li::before { content: counter(near); grid-row: 1 / 3; font-size: 12px; color: var(--muted); text-align: right; padding-top: 2px; }
.near-list li:hover { background: var(--subtle); }
.near-list li[hidden] { display: none; }
#nearMore { margin-top: 6px; }
.near-map { height: 280px; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.near-map[hidden] { display: none; }
.nm-pin {
  position: relative; display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 7px; border-radius: 50%;
  background: #e5484d; color: #fff; font: 700 11px/1 var(--font); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); cursor: pointer;
  border: 2px solid #fff; box-sizing: border-box;
}
.nm-pin::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -4px; border: 4px solid transparent; border-top: 5px solid #fff; }
.nm-pin.on { background: #0969da; transform: scale(1.25); transform-origin: 50% 100%; z-index: 5; }
.nm-me { display: block; width: 14px; height: 14px; border-radius: 50%; background: #0969da; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(9, 105, 218, .35), 0 1px 3px rgba(0, 0, 0, .3); }
@media (max-width: 600px) { .near-map { height: 220px; } }
/* room for sticky tool headers (Jira, Notion) when the result scrolls to the top */
#result { scroll-margin-top: 72px; }
#nearTitle:focus { outline: none; }
#nearTitle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.near-list a b { font-weight: 600; }
.near-list a:hover b { color: var(--accent); text-decoration: underline; }
.near-meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 13px; }
.near-links a { color: var(--accent); }
.near-links a:hover { text-decoration: underline; }

/* the draw popup */
.pick-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 16px 20px 20px; overflow: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
}
.pick-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.pick-dialog[open] { animation: menu-in .16s ease-out; }
.pd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pd-head h2 { font-size: 17px; font-weight: 600; }
.pick-dialog .candidates { margin-top: 6px; }
.pick-dialog .pick-stage { margin-top: 12px; }
.pd-result { margin-top: 14px; padding: 18px; border-radius: 10px; text-align: center; background: color-mix(in srgb, var(--accent) 9%, var(--bg)); animation: pop .35s ease-out; }
.pd-result[hidden] { display: none; }
.pick-dialog [hidden] { display: none !important; } /* the folded board and candidates */
.pick-dialog .near { border-top: 0; margin-top: 12px; padding-top: 0; }
.pd-result .pick-result-value { font-size: 34px; }
.pd-result .pick-actions { justify-content: center; }
[data-skin="jira"] .pick-dialog { border-radius: 3px; border: 0; box-shadow: 0 8px 12px rgba(9, 30, 66, .15), 0 0 1px rgba(9, 30, 66, .31); }
[data-skin="jira"] .pd-result { border-radius: 3px; background: #dcfff1; }
[data-mode="dark"][data-skin="jira"] .pd-result { background: #1c3329; }
[data-skin="notion"] .pick-dialog { border: 0; border-radius: 6px; box-shadow: rgba(15, 15, 15, .05) 0 0 0 1px, rgba(15, 15, 15, .1) 0 5px 10px, rgba(15, 15, 15, .2) 0 15px 40px; }
[data-skin="notion"] .pd-result { border-radius: 4px; background: #e7f3f8; }
[data-mode="dark"][data-skin="notion"] .pd-result { background: #1f282d; }
[data-skin="figma"] .pick-dialog { --bg: #fff; --fg: #1e1e1e; --muted: #6b6b6b; --line: #e6e6e6; --subtle: #f5f5f5; border-radius: 13px; }
@media (max-width: 600px) {
  .pick-dialog { padding: 14px; margin: auto 12px 12px; width: auto; max-width: none; }
  .pd-result .pick-result-value { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .pick-dialog[open], .pd-result { animation: none; } }
/* a page card moved into the popup drops its own frame; the popup is the frame now */
.pick-dialog .pick-card { border: 0; padding: 0; margin: 0; background: none; box-shadow: none; max-width: none; }
.pick-dialog .pick-card::before { content: none; }
.pick-dialog.wide { width: min(820px, calc(100vw - 32px)); }
#ladderDone { margin-top: 14px; }
#doneValue { font-size: 22px; line-height: 1.5; }

