:root { --brand: #511F7D; --bg: #f5f3f8; --card: #fff; --text: #1c1726; --muted: #6f6880; --line: #e4e0ea; --good: #1e9b5a; --bad: #c8343b; --r: 12px; }
@media (prefers-color-scheme: dark) { :root { --bg: #131017; --card: #1e1a25; --text: #f1edf6; --muted: #a49cb2; --line: #332d3d; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
@media (prefers-color-scheme: dark) { a { color: #c9a5f0; } }
h1 { font-size: 26px; margin: 0; } h2 { font-size: 19px; margin: 0 0 8px; } h3 { font-size: 16px; margin: 0 0 10px; } h4 { margin: 12px 0 6px; }
input, select, textarea { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
input[type=checkbox] { width: auto; } input[type=color] { padding: 2px; height: 38px; }
textarea { resize: vertical; }
#app { display: grid; grid-template-columns: 240px 1fr; height: 100%; }
.splash, .auth { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; min-height: 100%; }
.splash img { width: 90px; border-radius: 20px; } .auth { justify-content: flex-start; padding-top: 6vh; }
.auth .wordmark { width: 84px; border-radius: 20px; } .auth h1 { margin: 12px 0 18px; } .auth .card { width: min(440px, 100%); }
.side { background: var(--brand); color: #fff; display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 14px; } .brand img { width: 36px; border-radius: 9px; }
.team-pick { background: rgba(255,255,255,.15); color: #fff; border: 0; margin-bottom: 8px; } .team-pick option { color: #000; }
.team-name { font-weight: 600; margin-bottom: 8px; }
.side nav a { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; padding: 7px 10px; border-radius: 8px; opacity: .88; }
.side nav a:hover { background: rgba(255,255,255,.1); } .side nav a.on { background: rgba(255,255,255,.22); opacity: 1; font-weight: 600; }
.cat { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .65; margin: 14px 10px 4px; }
.who { margin-top: auto; padding: 12px 10px 0; display: flex; flex-direction: column; font-size: 13px; } .who small { opacity: .75; }
.mobile-top { display: none; }
main { overflow-y: auto; padding: 24px 28px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .actions input[type=search] { width: 200px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; } .grid .card { margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row > .field { flex: 1; min-width: 140px; }
.between { justify-content: space-between; } .end { justify-content: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; } .field > span { font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0 12px; }
.btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.96); } .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; } .btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.good { background: var(--good); color: #fff; border-color: var(--good); }
.btn.small { padding: 4px 10px; font-size: 13px; } .btn.wide { width: 100%; margin-top: 6px; }
.danger-text { color: var(--bad) !important; } .bad-text { color: var(--bad); }
.muted { color: var(--muted); } .small { font-size: 13px; } .empty { color: var(--muted); margin: 4px 0; } .pre { white-space: pre-wrap; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 20px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); font-weight: 600; }
.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); } .pill.muted { background: var(--bg); color: var(--muted); }
@media (prefers-color-scheme: dark) { .pill { color: #d6b8f5; } }
.notice { background: color-mix(in srgb, var(--brand) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; }
.notice.bad { background: color-mix(in srgb, var(--bad) 10%, var(--card)); border-color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.stat span { font-size: 24px; grid-row: span 2; } .stat b { font-size: 22px; } .stat small { color: var(--muted); }
.item { border-top: 1px solid var(--line); padding: 12px 0; } .item:first-of-type { border-top: 0; }
.tag { display: inline-block; min-width: 28px; text-align: center; background: var(--brand); color: #fff; border-radius: 6px; font-size: 12px; font-weight: 700; padding: 2px 6px; margin-right: 8px; }
.sets { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.set { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; background: var(--bg); }
.set.logged { background: color-mix(in srgb, var(--good) 12%, var(--bg)); } .set .presc { flex: 1; min-width: 150px; }
.set.edit select { width: auto; } .num { width: 76px; } .mini { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.notes { margin-top: 6px; }
.rating { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.rating button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.rating button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.table-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; } tr.click { cursor: pointer; } tr.click:hover td { background: var(--bg); }
.indent { padding-left: 14px; }
.spark { width: 90px; height: 24px; color: var(--brand); }
.board { list-style: none; padding: 0; margin: 0; } .board li { display: flex; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.board li span:nth-child(2) { flex: 1; } .board li.me { background: color-mix(in srgb, var(--brand) 10%, transparent); border-radius: 8px; } .rank { width: 30px; text-align: center; font-weight: 700; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 4px; opacity: .55; }
.badge.got { opacity: 1; } .badge .icon { font-size: 30px; filter: grayscale(1); } .badge.got .icon { filter: none; }
.badge.got.bronze { border-color: #C07A3E; } .badge.got.silver { border-color: #8E9AAB; } .badge.got.gold { border-color: #E0A800; } .badge.got.platinum { border-color: #37B6C9; }
.badge .tier { text-transform: capitalize; color: var(--muted); } .bar { height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 4px; } .bar i { display: block; height: 100%; background: var(--brand); }
.week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; min-height: 160px; display: flex; flex-direction: column; gap: 6px; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); } .day-head { display: flex; justify-content: space-between; align-items: center; }
.asg, .ev { border-radius: 8px; padding: 6px 8px; font-size: 13px; display: flex; flex-direction: column; position: relative; }
.asg { background: color-mix(in srgb, var(--brand) 12%, transparent); } .asg small { color: var(--muted); } .asg .btn { position: absolute; top: 2px; right: 2px; padding: 0 6px; }
.ev { background: var(--bg); cursor: pointer; display: block; }
.codes { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 6px; } .codes div { display: flex; flex-direction: column; }
.code { font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: .12em; }
.req { padding: 8px 0; border-bottom: 1px solid var(--line); } .req select { width: auto; }
.with-actions .card { margin-bottom: 4px; } .with-actions { margin-bottom: 14px; }
.pick-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; margin-top: 8px; }
.pick { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 4px; font: inherit; color: inherit; cursor: pointer; } .pick:hover { background: var(--bg); }
.video { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; margin: 8px 0; background: #000; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; z-index: 10; overflow-y: auto; }
.modal { background: var(--card); border-radius: 16px; padding: 18px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal:has(.wide-modal) { width: min(980px, 100%); } .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 20; max-width: 90vw; }
.toast.good { background: var(--good); color: #fff; } .toast.bad { background: var(--bad); color: #fff; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
@media (max-width: 800px) {
  #app { display: block; }
  .side { display: none; }
  .mobile-top { display: flex; gap: 8px; align-items: center; position: sticky; top: 0; z-index: 5; background: var(--brand); padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .mobile-top img { width: 30px; border-radius: 7px; } .mobile-top select { background: rgba(255,255,255,.15); color: #fff; border: 0; } .mobile-top option { color: #000; }
  .mobile-top .team-name { color: #fff; margin: 0; white-space: nowrap; }
  main { padding: 16px 12px 60px; overflow: visible; }
  .actions input[type=search] { width: 100%; }
}
