:root { --ground:#F3F4EE; --card:#FFFFFF; --ink:#14201A; --muted:#55625A; --green:#1F4D3A; --green2:#2F6650; --ball:#DDF247; --line:#C9CEC3; --bad:#A8400C; }
* { box-sizing: border-box; }
body { margin:0; background:var(--ground); color:var(--ink); font-family:Inter,system-ui,sans-serif; font-size:16px; line-height:1.45; }
a { color:var(--green); }
h1,h2,.brand,.name,strong,.score { font-family:'Space Grotesk',Inter,sans-serif; }
h1 { font-size:32px; letter-spacing:-0.5px; margin:0 0 4px; }
h2 { font-size:20px; margin:28px 0 10px; }
main { max-width:560px; margin:0 auto; padding:20px 20px 64px; }
.top { max-width:560px; margin:0 auto; padding:14px 20px 0; display:flex; justify-content:space-between; align-items:center; }
.top nav { display:flex; gap:4px; }
.top a { min-height:44px; display:inline-flex; align-items:center; padding:0 8px; text-decoration:none; font-weight:600; font-size:14px; }
.brand { font-size:16px; color:var(--ink); padding-left:0; }
.muted { color:var(--muted); margin:0; }
.small { font-size:13px; margin:2px 0 0; }
.search { margin:18px 0; display:flex; flex-direction:column; gap:6px; }
.search label { font-size:13px; font-weight:600; color:var(--muted); }
.row { display:flex; gap:8px; }
input[type=search] { flex:1; min-width:0; height:48px; border-radius:12px; border:1px solid var(--line); background:var(--card); padding:0 14px; font:inherit; color:var(--ink); }
button { font:inherit; height:48px; padding:0 18px; border-radius:12px; border:none; background:var(--green); color:#fff; font-weight:600; cursor:pointer; }
button.ghost { height:44px; background:transparent; color:var(--green); border:1.5px solid var(--green); font-size:14px; white-space:nowrap; }
button.ghost.light { color:#fff; border-color:#fff; margin-top:14px; }
:focus-visible { outline:3px solid var(--green); outline-offset:2px; }
.hero :focus-visible { outline-color:#fff; }
.cards { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.card { background:var(--card); border-radius:16px; padding:14px 16px; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.card.stack { flex-direction:column; align-items:stretch; gap:4px; }
.name { font-size:18px; font-weight:700; color:var(--ink); text-decoration:none; }
a.name:hover { text-decoration:underline; }
.pill { background:#E4E7DE; font-size:13px; font-weight:600; padding:6px 10px; border-radius:8px; white-space:nowrap; }
.pill.up { background:var(--ball); }
.meta { display:flex; justify-content:space-between; gap:12px; font-size:13px; color:var(--muted); }
.line { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.score { font-size:17px; font-weight:700; white-space:nowrap; }
.result { font-weight:600; white-space:nowrap; }
.result.won { color:var(--green); }
.result.lost { color:var(--bad); }
.panel { background:var(--card); border-radius:16px; padding:18px; }
.panel h2 { margin-top:0; }
.hero { background:var(--green); color:#fff; border-radius:20px; padding:20px; }
.tiles { display:flex; gap:10px; margin:14px 0 10px; }
.tile { flex:1; background:var(--green2); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:2px; font-size:12px; font-weight:600; }
.tile strong { font-size:24px; }
.tile.accent { background:var(--ball); color:var(--ink); }

/* journal */
h3 { font-size:13px; color:var(--muted); margin:0 0 6px; }
.top nav a { color:var(--green); }
.foot { max-width:560px; margin:0 auto; padding:0 20px 40px; display:flex; flex-wrap:wrap; gap:6px 16px; align-items:center; font-size:13px; color:var(--muted); }
.foot a, button.link { min-height:44px; display:inline-flex; align-items:center; }
button.link { background:none; border:none; padding:0; height:auto; min-height:44px; color:var(--green); font-weight:500; font-size:13px; text-decoration:underline; }
button.link.danger { color:var(--bad); font-size:15px; margin-top:8px; }
.btn { display:inline-flex; align-items:center; justify-content:center; height:48px; padding:0 18px; border-radius:12px; background:var(--green); color:#fff; font-weight:600; text-decoration:none; white-space:nowrap; }
.btn.ghost { height:44px; background:transparent; color:var(--green); border:1.5px solid var(--green); font-size:14px; }
.actions { display:flex; gap:10px; margin:16px 0 0; }
.actions .btn { flex:1; }
.head { display:flex; justify-content:space-between; align-items:baseline; }
.head a { min-height:44px; display:inline-flex; align-items:center; font-weight:600; font-size:14px; }
.two { display:flex; gap:12px; }
.two > div { flex:1; min-width:0; }
.panel ul, ul.plain { margin:0; padding-left:18px; }
.panel p { margin:0 0 8px; }
.bar { height:6px; border-radius:3px; background:#E4E7DE; }
.bar div { height:6px; border-radius:3px; }
.bar .good { background:var(--green); } .bar .bad { background:var(--bad); }
.note { margin:4px 0; }
.chips { list-style:none; margin:4px 0; padding:0; display:flex; flex-wrap:wrap; gap:6px; }
.chips li { font-size:13px; padding:5px 10px; border-radius:8px; }
.chips .good { background:#DCE9E2; color:#173B2C; } .chips .bad { background:#F6DCCB; color:#7A2E06; }
.error { background:#F6DCCB; color:#7A2E06; padding:12px 14px; border-radius:12px; }
.form { display:flex; flex-direction:column; gap:6px; margin:18px 0; }
.form label, legend { font-size:13px; font-weight:600; color:var(--muted); margin-top:10px; padding:0; }
.form label .muted { font-weight:400; display:inline; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=date], .form select, .form textarea, .rename input { width:100%; min-height:48px; border-radius:12px; border:1px solid var(--line); background:var(--card); padding:10px 14px; font:inherit; color:var(--ink); }
.form textarea { line-height:1.45; resize:vertical; }
.form button[type=submit] { margin-top:18px; height:56px; border-radius:16px; background:var(--ink); }
fieldset { border:none; margin:0; padding:0; }
.seg { display:flex; gap:8px; margin-top:6px; }
.seg label { flex:1; margin:0; position:relative; }
.seg input { position:absolute; opacity:0; inset:0; width:100%; height:100%; margin:0; cursor:pointer; }
.seg span { display:flex; align-items:center; justify-content:center; height:44px; border-radius:12px; border:1px solid var(--line); background:var(--card); color:var(--ink); font-size:14px; font-weight:500; }
.seg input:checked + span { background:var(--green); border-color:var(--green); color:#fff; font-weight:600; }
.seg .bad input:checked + span { background:var(--bad); border-color:var(--bad); }
.seg input:focus-visible + span { outline:3px solid var(--green); outline-offset:2px; }
.tactic { background:var(--card); border-radius:16px; padding:12px 14px; margin-top:8px; }
.tactic legend { float:left; width:100%; margin:0 0 2px; color:var(--ink); font-size:15px; font-weight:500; }
.newtactic { display:flex; gap:8px; margin-top:6px; }
.newtactic input { flex:1; min-width:0; }
.newtactic select { width:auto; flex:none; }
.rename { display:flex; gap:8px; margin-bottom:8px; }
.rename input { flex:1; min-width:0; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.eyebrow { font-size:13px; font-weight:600; margin:0 0 6px; }
.hero .eyebrow, a.onhero { color:var(--ball); }
/* game plan: dark, for reading courtside */
body.dark { background:var(--ink); color:#fff; }
body.dark a, body.dark .top nav a { color:var(--ball); }
body.dark .brand { color:#fff; }
body.dark .muted, body.dark .foot { color:#C5CDC7; }
body.dark .eyebrow { color:var(--ball); }
body.dark h1 { font-size:34px; line-height:1.1; margin-bottom:8px; }
body.dark h2 { font-size:13px; font-family:Inter,sans-serif; color:#C5CDC7; margin:24px 0 10px; }
body.dark .panel { background:#24362D; margin-top:24px; }
body.dark .panel h2 { margin-top:0; }
body.dark button.link { color:var(--ball); }
body.dark :focus-visible { outline-color:#fff; }
.steps, .avoid { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.steps li { background:#24362D; border-radius:16px; padding:14px 16px; display:flex; gap:14px; align-items:center; }
.steps li:first-child { background:var(--ball); color:var(--ink); }
.steps .n { font-family:'Space Grotesk',sans-serif; font-size:28px; font-weight:700; color:var(--ball); }
.steps li:first-child .n { color:var(--ink); }
.steps div, .avoid li { display:flex; flex-direction:column; gap:2px; }
.steps span:not(.n), .avoid span { font-size:13px; }
.avoid li { border:1.5px solid #F2A277; border-radius:16px; padding:14px 16px; }
body.dark ul.plain { font-size:15px; display:flex; flex-direction:column; gap:4px; }
.tactic .seg { clear:both; padding-top:6px; }

/* navigation v2: bottom tabs, account, back links */
body.has-tabs main { padding-bottom: 120px; }
.top { padding-top: 10px; min-height: 54px; }
.avatar { width: 44px; height: 44px; min-height: 44px; border-radius: 22px; background: #E4E7DE; color: var(--ink) !important; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; text-decoration: none; padding: 0 !important; }
a.back { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--green); padding: 0; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid #DDE0D7; display: flex; gap: 4px; padding: 8px max(10px, calc(50vw - 270px)) calc(10px + env(safe-area-inset-bottom)); }
.tab { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 14px; font-size: 12px; font-weight: 500; color: var(--muted) !important; text-decoration: none; }
.tab.on { background: var(--green); color: #fff !important; font-weight: 700; }
.tab.log { flex: 1.1; background: var(--ball); color: var(--ink) !important; font-weight: 700; }
.tab.log.on { outline: 3px solid var(--ink); outline-offset: -3px; }
.switch { display: flex; gap: 4px; background: #E4E7DE; border-radius: 14px; padding: 4px; margin: 14px 0; }
.switch a { flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.switch a.on { background: var(--ink); color: #fff; font-weight: 600; }
.tile.wide { flex: 1.3; }
.tile strong.small { font-size: 16px; line-height: 1.3; }
.tile.accent span, .tile span { font-weight: 600; }
.btn.white { background: #fff; color: var(--ink); width: 100%; }
.btn.wide, button.wide { width: 100%; }
.card > div { min-width: 0; }
.card p { margin: 2px 0 0; }
.menu { margin: 18px 0; }
.menu li { list-style: none; }
.menu a.card, a.card.choice, a.card.pick { text-decoration: none; color: var(--ink); }
.menu a.card { flex-direction: column; align-items: flex-start; gap: 2px; }
a.card.choice { flex: 1; flex-direction: column; align-items: flex-start; gap: 4px; border: 1.5px solid var(--green); }
a.card.pick svg { color: var(--green); flex: none; }
a.card.pick div { display: flex; flex-direction: column; gap: 2px; }
.tag { font-size: 12px; font-weight: 600; color: var(--muted); }
.panel.quiet { background: #E4E7DE; margin: 12px 0; }
.panel.quiet p { margin: 0; }
.panel .name { display: block; font-size: 22px; }
.weeknav { display: flex; justify-content: space-between; margin-top: 10px; }
.weeknav a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; font-size: 14px; text-decoration: none; }
.week { display: flex; gap: 6px; margin-bottom: 8px; }
.week a { flex: 1; height: 66px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.week a span { font-size: 11px; font-weight: 500; }
.week a strong { font-size: 17px; }
.week a i { width: 6px; height: 6px; border-radius: 3px; }
.week a i.dot { background: var(--green); }
.week a.today { border: 2px solid var(--green); }
.week a.on { background: var(--green); border-color: var(--green); color: #fff; }
.week a.on i.dot { background: var(--ball); }
.dayhead { margin: 18px 0 8px; font-size: 13px; color: var(--muted); scroll-margin-top: 12px; }
.dayhead.sel { color: var(--ink); }
.card.event { align-items: center; }
.card.event .time { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 17px; width: 52px; flex: none; }
.card.event > div { flex: 1; }
input[type=time] { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 10px 14px; font: inherit; color: var(--ink); }
body.dark .avatar { background: #24362D; color: #fff !important; }
body.dark a.back { color: var(--ball); }

/* green top bar */
.top { max-width: none; background: var(--green); padding: 10px max(20px, calc(50vw - 260px)); min-height: 64px; }
.top .brand { color: #fff; font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.top a.back, body.dark .top a.back { color: #fff; font-size: 16px; }
.top .avatar, body.dark .top .avatar { background: var(--ball); color: var(--ink) !important; }
.top :focus-visible { outline-color: #fff; }
body.dark .top { background: var(--green); }

.two.start { margin: 16px 0 6px; }
.btn.big { flex: 1; height: 64px; border-radius: 16px; font-family: 'Space Grotesk', sans-serif; font-size: 20px; }
.or { margin: 18px 0 0; font-size: 14px; }

/* score grid, laid out like the league site's score entry */
table.sgrid { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 16px; margin-top: 12px; }
table.sgrid th, table.sgrid td { padding: 10px 6px; text-align: center; }
table.sgrid thead th { font-size: 14px; font-weight: 600; color: var(--muted); padding-top: 14px; }
table.sgrid tbody tr { border-top: 1px solid #E4E7DE; }
table.sgrid tbody th { text-align: left; padding-left: 16px; font-size: 16px; font-weight: 600; line-height: 1.25; }
table.sgrid tbody th span { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
table.sgrid td:last-child { padding-right: 12px; }
table.sgrid input { width: 52px; height: 52px; min-height: 52px; padding: 0; text-align: center; border-radius: 10px; border: 1.5px solid var(--line); font: inherit; font-size: 20px; font-weight: 600; color: var(--ink); background: #fff; }
table.sgrid td:last-child input { background: #F3F4EE; }
table.sgrid { table-layout: fixed; }
table.sgrid thead td { width: auto; }
table.sgrid thead th { width: 62px; }
table.sgrid tbody th { overflow-wrap: anywhere; }
.form table.sgrid input[type=text] { width: 50px; height: 52px; min-height: 52px; padding: 0; border-radius: 10px; border: 1.5px solid var(--line); font-size: 20px; font-weight: 600; }
.form table.sgrid td:last-child input[type=text] { background: #F3F4EE; }

/* iPhone: date and time fields otherwise keep their own width and spill over their neighbour */
.form input[type=date], .form input[type=time], input[type=time] {
  -webkit-appearance: none; appearance: none; display: block; box-sizing: border-box;
  width: 100%; min-width: 0; max-width: 100%; height: 48px; min-height: 48px; line-height: 26px;
}
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
.two { gap: 12px; }
.two > div { flex: 1 1 0; min-width: 0; overflow: hidden; }
.form .two > div { padding: 0 1px 2px; }

/* whole card opens the opponent; other controls in the card stay tappable */
.card { position: relative; }
.card a.name::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.card a:not(.name), .card button, .card form { position: relative; z-index: 1; }
a.tile { color: #fff; text-decoration: none; }
/* group results */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.versus a { color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.25; min-height: 44px; display: flex; align-items: center; }
.versus a:last-child { justify-content: flex-end; text-align: right; }
.versus a.win { font-weight: 700; }
.versus .score { font-size: 16px; }
.card.mine { border: 1.5px solid var(--green); }

/* tactics library and opponent traits */
.checks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.checks legend { margin-bottom: 6px; }
.checks legend .muted { display: block; font-weight: 400; }
.checks label { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 15px; font-weight: 500; color: var(--ink); }
.checks input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.chips .plain { background: #E4E7DE; color: var(--ink); }
details.lib { background: #E9ECE3; border-radius: 16px; margin-top: 8px; padding: 0 10px; }
details.lib[open] { padding-bottom: 10px; }
details.lib summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px; font-weight: 600; font-size: 15px; cursor: pointer; list-style: none; }
details.lib summary::-webkit-details-marker { display: none; }
details.lib summary::after { content: "+"; font-size: 22px; font-weight: 500; color: var(--green); }
details.lib[open] summary::after { content: "\2212"; }
.libhead { margin: 18px 0 0; }
.tactic legend .why { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.avoid.try li { border-color: var(--ball); }
