/* look & feel modelled on prdgy.tech: warm paper, near-black ink, pills, hairlines */
:root {
  --bg: #f4f2f1;
  --paper: #ffffff;
  --well: #e9e7e5;
  --ink: #0f0f11;
  --ink-2: #55555b;
  --ink-3: #8b8a8f;
  --line: #e3e1de;
  --brand: #0f0f11;
  --on-brand: #ffffff;
  --profit: #1f8a5b;
  --mid: #b7791f;
  --low: #8b8a8f;
  --hot: #e5484d;
  --focus: #0f0f11;
  --shadow: 0 1px 2px rgba(15, 15, 17, .04);
  --display: "Helvetica Neue", Inter, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f11; --paper: #18181b; --well: #1f1f23; --ink: #f4f2f1; --ink-2: #b4b2b0; --ink-3: #7d7c80;
    --line: #2a2a2e; --brand: #f4f2f1; --on-brand: #0f0f11; --profit: #3ecf8e; --mid: #f0b44c; --low: #7d7c80; --hot: #ff6369;
    --focus: #f4f2f1; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f11; --paper: #18181b; --well: #1f1f23; --ink: #f4f2f1; --ink-2: #b4b2b0; --ink-3: #7d7c80;
  --line: #2a2a2e; --brand: #f4f2f1; --on-brand: #0f0f11; --profit: #3ecf8e; --mid: #f0b44c; --low: #7d7c80; --hot: #ff6369;
  --focus: #f4f2f1; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 Inter, -apple-system, "Helvetica Neue", "Segoe UI", sans-serif; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* header */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { flex: none; white-space: nowrap; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.brand i { font-style: normal; color: var(--ink-3); }
.brand svg { width: 22px; height: 22px; }
.status { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; padding: 6px 12px; background: var(--well); border-radius: 999px; }
.status span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.status.ok .dot { background: var(--profit); box-shadow: 0 0 0 4px color-mix(in srgb, var(--profit) 20%, transparent); }
.status.err .dot { background: var(--hot); }
.status.paused .dot { background: var(--mid); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.stake { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.money { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); padding: 0 14px 0 0; }
.money input { width: 84px; border: 0; background: transparent; padding: 8px 4px 8px 14px; font-weight: 600; text-align: right; }
.money input:focus { outline: none; }
.money:focus-within { border-color: var(--ink); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--well); cursor: pointer; color: var(--ink); transition: background .2s; }
.icon-btn:hover { background: var(--line); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[hidden] { display: none; }
.icon-btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
#soundBtn[aria-pressed="false"] .wave { opacity: .25; }
#themeBtn .moon, :root[data-theme="dark"] #themeBtn .sun { display: none; }
:root[data-theme="dark"] #themeBtn .moon { display: inline; }

/* prematch / live switch */
.mode { flex: none; display: flex; gap: 2px; padding: 3px; background: var(--well); border-radius: 999px; }
.mode button { display: flex; align-items: center; gap: 7px; border: 0; background: none; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); transition: background .2s, color .2s; }
.mode button:hover { color: var(--ink); }
.mode button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hot); }
.mode [aria-pressed="true"] .live-dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.meta .susp { color: var(--mid); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.field[hidden] { display: none; }

/* filters */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 14px; padding: 22px 28px 10px; }
.filters input[type=search] {
  flex: 1 1 260px; min-width: 200px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
}
.filters input[type=search]:focus { outline: none; border-color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.field select, .bk-picker summary {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); cursor: pointer;
}
.bk-picker { position: relative; }
.bk-picker summary { list-style: none; }
.bk-picker summary::-webkit-details-marker { display: none; }
.bk-picker summary b { font-weight: 600; color: var(--ink); }
.bk-panel {
  position: absolute; z-index: 6; top: calc(100% + 8px); left: 0; width: 300px; max-height: 360px; overflow: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 40px -24px rgba(15, 15, 17, .35); padding: 12px;
}
.bk-tools { display: flex; gap: 12px; margin-bottom: 6px; }
.bk-tools button, .link-btn { border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); cursor: pointer; font-size: 13px; padding: 4px 0; }
.bk-tools button:hover, .link-btn:hover { text-decoration-color: currentColor; }
.bk-panel label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.bk-panel label:hover { background: var(--bg); }
.bk-panel label small { margin-left: auto; color: var(--ink-3); }
.bk-panel input { accent-color: var(--ink); }

/* sport tabs: segmented pill bar like the prdgy.tech nav */
.sports { display: flex; gap: 2px; margin: 4px 28px 18px; padding: 4px; width: fit-content; max-width: calc(100% - 56px); background: var(--well); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.sports button {
  flex: none; border: 0; background: none; border-radius: 999px; padding: 7px 15px; cursor: pointer; font-size: 14px; color: var(--ink-2); transition: background .2s, color .2s;
}
.sports button:hover { color: var(--ink); }
.sports button small { color: var(--ink-3); margin-left: 4px; }
.sports button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.sports button[aria-pressed="true"] small { color: inherit; opacity: .6; }

/* BetBurger saved filters */
.bbf { padding: 8px 28px 8px; }
.bbf-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.bbf-head h2 { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.bbf-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.bbf-list button {
  flex: none; text-align: left; min-width: 180px; border: 1px solid var(--line); background: var(--paper);
  border-radius: 16px; padding: 11px 16px 11px 40px; cursor: pointer; position: relative; transition: border-color .2s;
}
.bbf-list button:hover { border-color: var(--ink-3); }
.bbf-list button::before {
  content: ""; position: absolute; left: 14px; top: 14px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink-3);
}
.bbf-list button[aria-pressed="true"] { border-color: var(--ink); }
.bbf-list button[aria-pressed="true"]::before {
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5 5.5-6' fill='none' stroke='white' stroke-width='2.2'/%3E%3C/svg%3E") center / 11px no-repeat;
  border-color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bbf-list button[aria-pressed="true"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5 5.5-6' fill='none' stroke='%230f0f11' stroke-width='2.2'/%3E%3C/svg%3E"); }
}
:root[data-theme="dark"] .bbf-list button[aria-pressed="true"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5 5.5-6' fill='none' stroke='%230f0f11' stroke-width='2.2'/%3E%3C/svg%3E"); }
.bbf-list b { display: block; font-size: 14px; font-weight: 600; }
.bbf-list small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.bbf-empty { margin: 0; font-size: 13px; color: var(--ink-3); }

/* list: each surebet is a betting slip with a profit stub on the left */
main { padding: 0 28px 72px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.slip {
  display: grid; grid-template-columns: 128px 1fr; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow);
  cursor: pointer; overflow: hidden; border: 1px solid var(--line); transition: border-color .2s, transform .2s;
}
.slip:hover { border-color: var(--ink-3); }
.slip.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { border-color: var(--profit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--profit) 22%, transparent); } }
.stub {
  --c: var(--low);
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px;
  padding: 16px 18px; background: color-mix(in srgb, var(--c) 7%, var(--paper)); color: var(--c); border-right: 1px solid var(--line);
}
.stub.t-mid { --c: var(--mid); }
.stub.t-high { --c: var(--profit); }
.stub.t-hot { --c: var(--hot); }
.stub .pct { font-family: var(--display); font-size: 32px; font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.stub .gain { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.body { padding: 14px 22px; min-width: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.meta .sport { color: var(--ink); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.meta .soon { color: #fff; background: var(--hot); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; }
.meta button { margin-left: auto; border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 0 2px; font-size: 12.5px; }
.meta button:hover { color: var(--hot); }
.legs { display: grid; gap: 6px; }
.leg {
  display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr) minmax(120px, 190px) 70px 84px; align-items: center; gap: 14px;
}
.leg + .leg { border-top: 1px solid var(--line); padding-top: 6px; }
.bk { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk a { color: inherit; text-decoration: none; }
.bk a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ev { min-width: 0; }
.ev .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.ev .lg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--ink-3); }
.mk { font-weight: 500; color: var(--ink); font-size: 14px; }
.mk small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11.5px; }
.odd { font-family: var(--display); font-size: 20px; font-weight: 500; letter-spacing: -.02em; text-align: right; }
.st { text-align: right; font-weight: 500; color: var(--ink-2); }
.empty { text-align: center; color: var(--ink-2); padding: 60px 0; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(15, 15, 17, .4); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 9; }
.drawer {
  position: fixed; z-index: 10; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--paper); overflow-y: auto;
  transform: translateX(100%); visibility: hidden; transition: transform .5s cubic-bezier(.16,1,.3,1), visibility .5s; box-shadow: -20px 0 40px -30px rgba(0, 0, 0, .6);
}
body.open .drawer { transform: none; visibility: visible; }
body.open .scrim { opacity: 1; pointer-events: auto; }
.drawer-inner { padding: 28px 32px 44px; }
.close { position: absolute; top: 16px; right: 16px; }
.d-meta { margin: 0 40px 8px 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.drawer h2 { margin: 0; font-family: var(--display); font-size: 32px; font-weight: 500; line-height: 1.08; letter-spacing: -.03em; max-width: 22ch; }
.d-league { margin: 4px 0 20px; color: var(--ink-2); }
.calc { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; }
.calc-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 10px; }
.calc h3, .other-h { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.calc .stake.big { margin-bottom: 12px; }
.calc .money { background: var(--paper); }
.calc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.calc-table th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 4px 6px; }
.calc-table td { padding: 8px 6px; border-top: 1px solid var(--line); }
.calc-table th:nth-child(n+3), .calc-table td:nth-child(n+3) { text-align: right; }
.calc-table input { width: 72px; text-align: right; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; background: var(--paper); font-weight: 600; }
.calc-table .ret.pos { color: var(--profit); font-weight: 700; }
.calc-table .ret.neg { color: var(--hot); font-weight: 700; }
.calc-sum { margin: 14px 0 0; font-size: 16px; }
.calc-sum b { color: var(--profit); font-family: var(--display); font-size: 30px; font-weight: 400; letter-spacing: -.03em; }
.calc-note { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }
.other-h { margin-top: 26px; }
.other { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.other li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--bg); border: 1px solid transparent; cursor: pointer; font-size: 13.5px; }
.other li:hover { border-color: var(--line); }
.other li.current { border-color: var(--ink); }
.other .p { font-weight: 600; color: var(--profit); }
.other .l { color: var(--ink-2); }

@media (max-width: 900px) {
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .top-actions { width: 100%; margin: 0; }
  .top-actions .stake { margin-right: auto; }
  .filters, .bbf { padding-left: 16px; padding-right: 16px; }
  .sports { margin-left: 16px; margin-right: 16px; max-width: calc(100% - 32px); }
  main { padding: 0 16px 40px; }
  .slip { grid-template-columns: 1fr; }
  .stub { flex-direction: row; align-items: baseline; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stub .pct { font-size: 26px; }
  .leg { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .leg .bk { grid-column: 1; grid-row: 1; }
  .leg .odd { grid-column: 2; grid-row: 1; }
  .leg .mk { grid-column: 1; grid-row: 2; }
  .leg .st { grid-column: 2; grid-row: 2; }
  .leg .ev { grid-column: 1 / -1; grid-row: 3; }
  .body { padding: 10px 16px; }
  .drawer-inner { padding: 20px 16px 32px; }
}

@media (max-width: 600px) {
  .calc { padding: 14px; }
  .calc-table thead { display: none; }
  .calc-table tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 10px 0; border-top: 1px solid var(--line);
  }
  .calc-table td { border: 0; padding: 0; text-align: left !important; overflow-wrap: anywhere; }
  .calc-table td:nth-child(1) { grid-column: 1 / 3; }
  .calc-table td:nth-child(2) { text-align: right !important; font-weight: 500; }
  .calc-table td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); }
  .calc-table input { width: 100%; text-align: left; }
  .drawer h2 { font-size: 21px; }
  .other li { grid-template-columns: 58px 1fr; }
}
