:root { color-scheme: light; font-family: system-ui, sans-serif; color: #102644; background: #f1f5fc; --accent: #0756c7; --accent-text: #fff; }
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 860px; padding: 1rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); margin: auto; }
h1, h2, h3 { margin-top: 0; }
.panel { min-width: 0; overflow-wrap: anywhere; background: white; padding: 1.25rem; border: 1px solid #d7e2f2; border-radius: 12px; margin-bottom: 1rem; }
body.dashboard-body { background: #f1f5fc; color: #102644; }
body.dashboard-body main { max-width: 560px; padding-top: .75rem; }
body.dashboard-body .panel { border-color: #dce6f4; border-radius: 14px; box-shadow: 0 2px 8px #08234d0d; }
body.dashboard-body .panel.club { background: linear-gradient(120deg, #061d57, #0756c7); color: white; border: 0; padding: .8rem 1rem; }
body.dashboard-body .club h1 { font-size: 1.2rem; }
body.dashboard-body .club .badge { width: 48px; height: 48px; }
body.dashboard-body .panel.dashboard-welcome { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; background: linear-gradient(120deg, #061d57, #0756c7); border: 0; color: white; }
body.welcome-body, [data-theme="dark"] body.dashboard-body.welcome-body { background: #f1f5fc; color: #102644; }
body.welcome-body main { max-width: none; padding: 0; }
.welcome-screen { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: max(2rem, env(safe-area-inset-top)) 1.5rem max(2rem, env(safe-area-inset-bottom)); text-align: center; }
.welcome-content { width: min(100%, 340px); }
.welcome-icon { display: block; width: 112px; height: 112px; margin: 0 auto 1rem; }
.welcome-content h1 { margin: 0; font-size: 1.75rem; line-height: 1.2; color: #102644; }
.welcome-tagline { margin: .4rem 0 0; color: #0756c7; font-weight: 700; letter-spacing: .04em; }
button.welcome-start { width: 100%; margin-top: 3rem; padding: .9rem 1rem; border-radius: 12px; background: #2175f5; color: white; font-weight: 700; }
.welcome-signin { margin: 1.5rem 0 0; color: #4a607d; font-size: .9rem; }
.welcome-signin button { padding: .5rem .15rem; background: transparent; color: #0756c7; font-weight: 700; }
.dashboard-welcome .badge { width: 48px; height: 48px; }
.dashboard-welcome h1, .dashboard-welcome h2 { font-size: 1.2rem; margin-bottom: .3rem; }
.dashboard-welcome h1:last-child { margin-bottom: 0; }
.dashboard-welcome p { margin: 0; color: #dceaff; }
.brand-heading { display: flex; align-items: center; gap: .75rem; padding: .5rem .25rem 1rem; }
.brand-heading img { flex: 0 0 52px; }
.brand-heading strong, .brand-heading span { display: block; }
.brand-heading strong { color: #071d3f; font-size: 1.25rem; }
.brand-heading span { color: #0756c7; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-shortcuts { display: grid; gap: .55rem; margin: .75rem 0 1rem; }
.dashboard-card { display: flex; align-items: center; gap: .85rem; width: 100%; min-height: 4.25rem; padding: .7rem .8rem; border: 1px solid #dce6f4; border-radius: 12px; background: white; color: #102644; text-align: left; box-shadow: 0 2px 6px #08234d0d; }
.dashboard-dropdown > summary { list-style: none; cursor: pointer; }
.dashboard-dropdown > summary::-webkit-details-marker { display: none; }
.dashboard-dropdown[open] > summary .dashboard-card-arrow { transform: rotate(90deg); }
.dashboard-dropdown-content { padding-top: .55rem; }
.dashboard-dropdown-content > .panel { margin-bottom: 0; }
.connected-club { display: flex; align-items: center; gap: .75rem; }
.connected-club .badge { width: 40px; height: 40px; }
.dashboard-card:hover { background: #f8fbff; border-color: #a6c5f3; }
.dashboard-card:focus-visible { outline: 3px solid #0756c7; outline-offset: 2px; }
.dashboard-card-icon { display: grid; flex: 0 0 2.45rem; width: 2.45rem; height: 2.45rem; place-items: center; border-radius: 50%; background: #e4efff; color: #0756c7; font-size: 1.25rem; }
.dashboard-card-copy { display: grid; flex: 1; gap: .15rem; }
.dashboard-card-copy .muted { font-size: .85rem; font-weight: 400; }
.dashboard-card-arrow { color: #0756c7; font-size: 1.5rem; line-height: 1; }
#dashboard-fixtures { scroll-margin-top: .75rem; }
.dashboard-fixture { margin-top: .65rem; padding: .85rem; border: 1px solid #dce6f4; border-radius: 11px; background: #f8fbff; }
body.dashboard-body .fixture-card { position: relative; padding: 1rem; margin-bottom: .65rem; }
.fixture-card > strong { display: block; padding-right: 2.5rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.fixture-card > p { margin: .35rem 0 0; overflow-wrap: anywhere; }
.fixture-card-actions { margin-top: .85rem; }
.fixture-card-actions button { padding: .55rem .7rem; }
.fixture-card-editor:not(:empty) { margin-top: 1rem; }
.fixture-card-delete { position: absolute; top: .5rem; right: .5rem; width: 2.5rem; height: 2.5rem; padding: 0; background: transparent; color: #4a607d; font-size: 1.5rem; line-height: 1; }
.fixture-card-delete:hover { background: #e7effb; }
.team-selection-card > strong { padding-right: 0; }
.team-selection-card > button { margin-top: .75rem; }
.club { border-top: 6px solid var(--club-colour, #0756c7); display: flex; align-items: center; gap: 1rem; }
.club h1 { margin: 0; }
.badge { width: 80px; height: 80px; object-fit: contain; }
.muted { color: #4a607d; }
.stack { display: grid; gap: .75rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
label { display: grid; gap: .3rem; font-weight: 600; }
input, select, button { font: inherit; }
input, select { width: 100%; min-width: 0; padding: .65rem; border: 1px solid #9bacc4; border-radius: 6px; background: white; color: #102644; }
input[type="color"] { height: 3rem; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; }
button { padding: .65rem 1rem; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-text); cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
button.secondary { background: #e7effb; color: #14365e; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; }
.item { padding: .75rem 0; border-top: 1px solid #d7e2f2; }
.panel > .item:first-child { padding-top: 0; border-top: 0; }
.item p { margin: .25rem 0; }
.notice { padding: .75rem; border-radius: 6px; background: #fee8e6; color: #7d2720; margin-bottom: 1rem; }
.notice.success { background: #dff3e6; color: #185e37; }
.calendar-heading { display: grid; grid-template-columns: 2.5rem 1fr 2.5rem; align-items: center; gap: .5rem; margin-bottom: 1rem; text-align: center; }
.calendar-heading button { width: 2.5rem; height: 2.5rem; padding: 0; font-size: 1.5rem; line-height: 1; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; text-align: center; }
.calendar-grid strong { padding: .35rem 0; font-size: .8rem; }
.calendar-grid button { min-height: 2.5rem; padding: .5rem .1rem; overflow-wrap: anywhere; border: 2px solid transparent; }
.calendar-grid button.calendar-has-fixtures { border-color: #0756c7; }
.calendar-grid button[aria-pressed="true"] { outline: 2px solid #102644; outline-offset: 1px; }
.calendar-hint { margin: .75rem 0 0; font-size: .85rem; }
.calendar-results { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #d7e2f2; }
.calendar-results h3 { margin: 0 0 .75rem; font-size: 1rem; }
.calendar-results > p { margin: 0; }
.calendar-fixture { padding: .75rem; border: 1px solid #dce6f4; border-radius: 11px; background: #f8fbff; }
.calendar-fixture + .calendar-fixture { margin-top: .5rem; }
.calendar-fixture p { margin: .3rem 0 .65rem; }
.team-board { margin: 1rem 0; padding: 1rem; border: 1px solid #d7e2f2; border-radius: 8px; background: #f6f9fe; }
.team-layout { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 3fr); gap: .75rem; align-items: start; }
.team-layout.team-readonly { grid-template-columns: 1fr; }
.team-pool, .team-rink { padding: .75rem; border: 1px solid #cbd9ed; border-radius: 8px; background: white; }
.team-pool { min-height: 100px; }
.team-rinks { display: grid; gap: .75rem; min-width: 0; }
.team-positions { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .5rem; }
.team-slot { min-width: 0; padding: .6rem; border: 1px dashed #9bacc4; border-radius: 6px; }
.team-player { display: block; width: 100%; text-align: left; padding: .6rem; margin-top: .4rem; background: var(--accent); color: var(--accent-text); border-radius: 6px; cursor: grab; touch-action: none; user-select: none; overflow-wrap: anywhere; }
.team-player[aria-pressed="true"] { outline: 3px solid #14365e; outline-offset: 2px; }
.team-place { margin-top: .5rem; }
.team-drop-active { outline: 3px solid var(--accent); }
.team-drag-ghost { position: fixed; z-index: 20; pointer-events: none; max-width: 200px; padding: .6rem; background: var(--accent); color: var(--accent-text); border-radius: 6px; overflow-wrap: anywhere; box-shadow: 0 3px 12px #0004; }
.team-actions { align-items: center; margin: 1rem 0; }
.share-dialog { width: min(90vw, 420px); max-height: 85vh; border: 1px solid #d7e2f2; border-radius: 12px; padding: 1.25rem; color: #102644; }
.share-dialog::backdrop { background: #0009; }
.share-options { display: grid; gap: .5rem; }
.share-error { color: #7d2720; }
#navigation { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: white; border-top: 1px solid #d7e2f2; padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom)); }
#navigation[hidden] { display: none; }
#navigation .nav-button { flex: 1; max-width: 180px; background: transparent; color: #14365e; padding: .7rem .25rem; }
#navigation .nav-button[aria-current="page"] { color: var(--accent); font-weight: 700; box-shadow: inset 0 -3px var(--accent); }
#app > button.secondary { margin-bottom: 1rem; }
@media (max-width: 480px) {
  .team-layout { grid-template-columns: 1fr; }
  .team-positions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
a { color: #0756c7; overflow-wrap: anywhere; }

:root[data-theme="dark"] { color-scheme: dark; color: #edf4ff; background: #001245; }
[data-theme="dark"] body.dashboard-body { background: #001245; color: #edf4ff; }
[data-theme="dark"] .panel, [data-theme="dark"] body.dashboard-body .panel {
  background: #0c2244; border-color: #28466d; color: #edf4ff;
}
[data-theme="dark"] body.dashboard-body .panel.club { background: linear-gradient(120deg, #071b40, #0648a8); }
[data-theme="dark"] body.dashboard-body .panel.dashboard-welcome { background: linear-gradient(120deg, #071b40, #0648a8); color: white; }
[data-theme="dark"] .brand-heading strong { color: #f3f7ff; }
[data-theme="dark"] .brand-heading span { color: #8ebeff; }
[data-theme="dark"] .dashboard-card { background: #102b50; border-color: #28466d; color: #edf4ff; box-shadow: none; }
[data-theme="dark"] .dashboard-card:hover { background: #193b68; border-color: #6899d4; }
[data-theme="dark"] .dashboard-card:focus-visible { outline-color: #8ebeff; }
[data-theme="dark"] .dashboard-card-icon { background: #1c4a83; color: #d6e8ff; }
[data-theme="dark"] .dashboard-card-arrow, [data-theme="dark"] a { color: #a4caff; }
[data-theme="dark"] .muted { color: #c0d0e6; }
[data-theme="dark"] .dashboard-fixture, [data-theme="dark"] .calendar-fixture, [data-theme="dark"] .team-board { background: #091b37; border-color: #28466d; }
[data-theme="dark"] .calendar-results { border-top-color: #28466d; }
[data-theme="dark"] .fixture-card-delete { color: #c0d0e6; }
[data-theme="dark"] .fixture-card-delete:hover { background: #25466f; }
[data-theme="dark"] input, [data-theme="dark"] select { background: #091b37; color: #edf4ff; border-color: #7790ae; }
[data-theme="dark"] button.secondary { background: #25466f; color: #f1f6ff; }
[data-theme="dark"] .item { border-top-color: #28466d; }
[data-theme="dark"] .calendar-grid button.calendar-has-fixtures { border-color: #8ebeff; }
[data-theme="dark"] .calendar-grid button[aria-pressed="true"], [data-theme="dark"] .team-player[aria-pressed="true"] { outline-color: #d6e8ff; }
[data-theme="dark"] .team-pool, [data-theme="dark"] .team-rink, [data-theme="dark"] .share-dialog {
  background: #102b50; border-color: #52739b; color: #edf4ff;
}
[data-theme="dark"] .team-slot { border-color: #7790ae; }
[data-theme="dark"] .share-error { color: #ffb4ad; }
[data-theme="dark"] #navigation { background: #091b37; border-top-color: #28466d; }
[data-theme="dark"] #navigation .nav-button { color: #d8e6fb; }
[data-theme="dark"] #navigation .nav-button[aria-current="page"] { color: #a4caff; box-shadow: inset 0 -3px #8ebeff; }
