:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #f1eee7;
  background: #0d1117;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy: #f1eee7;
  --blue: #c1a878;
  --teal: #c1a878;
  --ink-muted: #b8b7b2;
  --line: rgb(193 188 174 / 22%);
  --surface: #161c24;
  --surface-raised: #1d242d;
  --surface-sunken: #10151c;
  --focus: #d2bc90;
  --shadow: 0 10px 26px rgb(3 9 22 / 20%);
}

* { box-sizing: border-box; }

body {
  min-width: 0;
  margin: 0;
  line-height: 1.55;
  background: radial-gradient(ellipse at 85% 0, rgb(193 168 120 / 7%), transparent 35rem);
}

a { color: var(--blue); }
html { scroll-padding-top: 110px; }
section[id] { scroll-margin-top: 1rem; }
.skip-link { position: fixed; top: 0.75rem; left: 1rem; z-index: 30; padding: 0.65rem 1rem; border-radius: 8px; background: var(--blue); color: #0d1117; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 clamp(1rem, 5vw, 4.5rem);
  background: #10151c;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 12px;
  background: rgb(193 168 120 / 10%);
  color: var(--blue);
  font-weight: 800;
  letter-spacing: -0.08em;
}

.brand strong,
.brand small { display: block; line-height: 1.2; }
.brand small { margin-top: 0.2rem; color: var(--blue); font-size: 0.66rem; letter-spacing: 0.14em; }

.portal-nav {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 3vw, 2rem);
}

.portal-nav a { padding: 0.6rem 0.8rem; border-radius: 8px; color: var(--ink-muted); font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.portal-nav a:hover { background: rgb(193 168 120 / 10%); color: var(--blue); }

main {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 3.5rem) 0 1.5rem;
}

.hero h1 {
  max-width: 760px;
  margin: 0.25rem 0 0.8rem;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.hero-copy > p:last-child { max-width: 650px; margin: 0; color: var(--ink-muted); font-size: 1rem; }
.hero-note { display: grid; gap: 0.6rem; padding: 1.1rem 1.3rem; border-left: 2px solid var(--blue); background: linear-gradient(90deg, rgb(193 168 120 / 8%), transparent); }
.hero-note-label { color: var(--blue); font-size: 0.65rem; font-weight: 750; letter-spacing: 0.12em; }
.hero-note strong { font-size: 1.08rem; line-height: 1.45; }
.hero-note > span:last-child { color: var(--ink-muted); font-size: 0.82rem; }
.eyebrow { margin: 0 0 0.3rem; color: var(--teal); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.13em; }

.panel {
  margin: 1.25rem 0;
  padding: clamp(1.15rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
h2 { margin: 0; color: var(--navy); font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.2; }
h3 { margin: 0 0 0.25rem; color: var(--navy); font-size: 1.08rem; }
h4 { margin: 0 0 0.5rem; }
.muted { color: var(--ink-muted); }
.panel > .muted { margin: 0.75rem 0 0; max-width: 78ch; }

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.35rem;
}

.form-panel,
.profile-form {
  display: grid;
  gap: 0.65rem;
}

.form-panel {
  align-content: start;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-sunken);
}

label { color: var(--navy); font-size: 0.85rem; font-weight: 650; }
input,
textarea,
select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #70736f;
  border-radius: 9px;
  background: var(--surface-sunken);
  color: var(--navy);
  font: inherit;
}
input::placeholder,
textarea::placeholder { color: #9a9993; opacity: 1; }
textarea { resize: vertical; }
input:disabled,
textarea:disabled,
select:disabled { opacity: 0.65; cursor: not-allowed; }

input[aria-invalid="true"],
textarea[aria-invalid="true"] { border-color: #edaaa2; }
.field-hint { color: var(--ink-muted); font-size: 0.82rem; }
.field-error { min-height: 0; color: #edaaa2; font-size: 0.82rem; }
.field-error:empty { display: none; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled { cursor: wait; opacity: 0.65; }
.button-primary { background: var(--blue); color: #0d1117; }
.button-primary:hover:not(:disabled) { background: #d2bc90; }
.button-quiet { border-color: var(--line); background: transparent; color: var(--navy); }
.button-quiet:hover:not(:disabled) { border-color: var(--blue); background: rgb(193 168 120 / 8%); }

.notice {
  padding: 0.9rem 1rem;
  border: 1px solid #466a57;
  border-radius: 10px;
  background: #172c23;
  color: #b0dec0;
  white-space: pre-wrap;
}

.notice[data-kind="error"] { border-color: #87544f; background: #352220; color: #f1b6ae; }
.events-panel { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.event-detail { margin: 0.75rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-sunken); }
.events-panel > summary,
.team-panel > summary { padding: 0.25rem 0; color: var(--blue); font-weight: 750; cursor: pointer; }
.event-detail > summary { color: var(--navy); font-weight: 650; cursor: pointer; overflow-wrap: anywhere; }
.event-detail[open] > summary { padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.event-detail > p { margin: 0.65rem 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.event-detail > .button { margin-top: 1rem; border-color: var(--blue); background: transparent; color: var(--blue); }
.event-detail > .button:hover:not(:disabled) { background: rgb(193 168 120 / 10%); }
.events-panel > details:not(.event-detail) { margin-top: 1rem; }
summary { cursor: pointer; }
summary::marker { color: var(--blue); }
.event-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.event-form textarea { min-height: 7rem; }
.organization-list { display: grid; gap: 1rem; margin-top: 1.25rem; }
.dashboard-intro { margin: 1.5rem 0 1rem; color: var(--ink-muted); font-size: 0.9rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 1rem; }
.dashboard-grid > .dashboard-section,
.dashboard-tool-tile,
.dashboard-load-error { min-width: 0; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-sunken); }
.dashboard-grid > .dashboard-section > summary,
.dashboard-tool-tile { display: grid; width: 100%; min-height: 205px; align-content: start; gap: 0.65rem; padding: 1.25rem; color: var(--navy); font: inherit; text-align: left; cursor: pointer; list-style: none; }
.dashboard-section > summary::-webkit-details-marker { display: none; }
.dashboard-section > summary:hover,
.dashboard-tool-tile:hover:not(:disabled) { background: rgb(193 168 120 / 7%); border-radius: 12px; }
.dashboard-tile-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgb(193 168 120 / 30%); border-radius: 10px; background: rgb(193 168 120 / 10%); color: var(--blue); font-size: 0.8rem; font-weight: 750; }
.dashboard-tile-title { color: var(--navy); font-size: 1.05rem; font-weight: 750; overflow-wrap: anywhere; }
.dashboard-tile-description { color: var(--ink-muted); font-size: 0.85rem; font-weight: 400; line-height: 1.5; }
.dashboard-tile-action { color: var(--blue); font-size: 0.8rem; font-weight: 650; }
.dashboard-section[open] { grid-column: 1 / -1; padding: 0 1.25rem 1.25rem; border-color: var(--blue); }
.dashboard-grid > .dashboard-section[open] > summary { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; min-height: 0; margin-inline: -1.25rem; width: calc(100% + 2.5rem); border-bottom: 1px solid var(--line); }
.dashboard-section[open] > summary .dashboard-tile-description { grid-column: 2; grid-row: 2; }
.dashboard-section[open] > summary .dashboard-tile-action { grid-column: 3; grid-row: 1; font-size: 0; }
.dashboard-section[open] > summary .dashboard-tile-action::after { content: "Schließen"; font-size: 0.8rem; }
.dashboard-section[open] > summary .dashboard-tile-icon { grid-row: 1 / 3; }
.dashboard-tool-tile:disabled { opacity: 0.6; cursor: not-allowed; }
.dashboard-load-error { padding: 1.25rem; border-color: #87544f; color: #f1b6ae; overflow-wrap: anywhere; }
.profile-section-title { margin: 1.25rem 0 0.25rem; font-size: 1rem; }
.commerce-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block: 1rem; }
.commerce-status { padding: 0.8rem; border-left: 3px solid var(--blue); background: var(--surface); overflow-wrap: anywhere; }
.commerce-record { min-width: 0; margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow-wrap: anywhere; }
.commerce-record[hidden] { display: none; }
.commerce-record h4 { margin: 0 0 0.5rem; }
.commerce-address { white-space: pre-line; }
.tournament-fields[hidden] { display: none; }
.event-checkin { margin-block: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.checkin-video { width: 100%; max-height: 360px; background: #000; border-radius: 10px; }
.checkin-video[hidden] { display: none; }
.checkin-qr { display: block; max-width: 100%; height: auto; background: #fff; }
.checkin-code-form { display: grid; gap: 0.75rem; margin-block: 1rem; }
.checkin-code-form label { display: grid; gap: 0.35rem; }
.checkin-participants li { margin-block: 0.75rem; overflow-wrap: anywhere; }
.checkin-participants button { margin-left: 0.5rem; }
.tournament-management { margin-block: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.tournament-rules { white-space: pre-wrap; overflow-wrap: anywhere; }
.tournament-player-form { display: grid; gap: 0.75rem; margin-block: 1rem; }
.tournament-player-form label, .tournament-match label { display: grid; gap: 0.35rem; }
.tournament-match { padding: 1rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.tournament-match button { margin-top: 0.75rem; }
.tournament-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-block: 1rem; }
.tournament-table th, .tournament-table td { text-align: left; padding: 0.35rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.commerce-shipping-form { display: grid; gap: 0.75rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.commerce-shipping-form label { display: grid; gap: 0.35rem; }
.profile-section-hint { margin: 0 0 1rem; color: var(--ink-muted); font-size: 0.85rem; }
.profile-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 1rem 0 1.5rem; }
.profile-facts > div { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.profile-facts dt { color: var(--blue); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.03em; }
.profile-facts dd { margin: 0.5rem 0 0; color: var(--navy); font-size: 1rem; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.profile-facts .profile-fact-empty { border-style: dashed; }
.profile-facts .profile-fact-empty dd { color: var(--ink-muted); font-weight: 400; font-size: 0.9rem; }
.event-participants { margin-top: 1rem; }
.event-calendar { margin: 1.25rem 0; min-width: 0; }
.calendar-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.calendar-toolbar h4 { margin: 0; font-size: 1.1rem; }
.calendar-controls { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.calendar-controls .button { min-height: 36px; padding: 0.4rem 0.6rem; font-size: 0.8rem; }
.calendar-legend { color: var(--ink-muted); font-size: 0.8rem; }
.calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); border-radius: 10px; overflow: hidden; }
.calendar-weekday { padding: 0.5rem; background: var(--surface-sunken); color: var(--ink-muted); text-align: center; font-size: 0.8rem; }
.calendar-day,
.calendar-empty { min-width: 0; min-height: 100px; padding: 0.4rem; background: var(--surface-sunken); }
.calendar-empty { background: var(--surface); }
.calendar-day-number { display: block; margin-bottom: 0.35rem; font-size: 0.8rem; }
.calendar-today { box-shadow: inset 0 0 0 2px var(--blue); }
.calendar-event { display: block; width: 100%; margin-top: 0.3rem; padding: 0.35rem; border: 1px solid var(--blue); border-radius: 5px; background: #30291e; color: #ebcf91; font: inherit; font-size: 0.75rem; line-height: 1.35; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.calendar-event-published { border-color: #466a57; background: #203b2e; color: #b0dec0; }
.calendar-event:hover { filter: brightness(1.2); }
.shop-logo-panel { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: start; gap: 0.75rem 1.25rem; margin-block: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.shop-logo-panel > h4 { grid-column: 1 / -1; margin: 0; font-size: 1rem; }
.shop-logo-panel > [role="status"] { grid-column: 2; grid-row: 2; margin: 0; font-size: 0.9rem; }
.shop-logo-preview { display: block; grid-column: 1; grid-row: 2 / 4; width: 160px; max-width: 100%; height: 110px; object-fit: contain; background: white; border-radius: 8px; padding: 0.5rem; }
.logo-upload-hint { grid-column: 2; grid-row: 3; margin: 0; color: var(--ink-muted); font-size: 0.8rem; line-height: 1.6; }
.shop-logo-preview[hidden] { display: none; }
.shop-logo-form { display: flex; grid-column: 1 / -1; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.shop-logo-form label { order: -1; flex-basis: 100%; }
.shop-logo-form input { width: 100%; }
.calendar-day { position: relative; }
.calendar-create { display: block; width: 100%; min-height: 60px; padding: 0.3rem; border: 1px dashed var(--line); border-radius: 5px; background: transparent; color: var(--blue); font: inherit; font-size: 0.75rem; cursor: pointer; }
.calendar-create::before { content: ""; position: absolute; inset: 0; }
.calendar-create:hover { background: rgb(193 168 120 / 10%); border-color: var(--blue); }
.event-list-heading { margin-top: 1.5rem; }
@media (max-width: 600px) {
  .shop-logo-panel { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
  .shop-logo-panel > [role="status"],
  .shop-logo-preview,
  .logo-upload-hint { grid-column: 1; grid-row: auto; }
  .calendar-days { gap: 0; }
  .calendar-day,
  .calendar-empty { min-height: 65px; padding: 0.2rem; border: 1px solid var(--line); }
  .calendar-weekday { padding: 0.25rem 0; font-size: 0.7rem; }
  .calendar-event { font-size: 0.65rem; padding: 0.2rem; }
  .calendar-create { min-height: 36px; padding: 0.1rem; font-size: 0.6rem; }
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid > .dashboard-section > summary,
  .dashboard-tool-tile { min-height: 0; padding: 1rem; }
  .dashboard-section[open] { padding-inline: 1rem; }
  .dashboard-grid > .dashboard-section[open] > summary { margin-inline: -1rem; width: calc(100% + 2rem); }
  .dashboard-section[open] > summary .dashboard-tile-action { grid-column: 2; grid-row: 3; }
  .profile-facts { grid-template-columns: 1fr; }
}

.organization-card {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
}

.organization-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.organization-top > div { min-width: 0; overflow-wrap: anywhere; }
.organization-top h3 { margin-bottom: 0.2rem; font-size: 1.18rem; }
.organization-legal { margin: 0; color: var(--ink-muted); }
.status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
}
.status-pending { background: #3b321f; color: #ebcf91; }
.status-approved { background: #203b2e; color: #b0dec0; }
.status-rejected { background: #422b29; color: #f1b6ae; }

.organization-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin: 0.9rem 0 0;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.review-note {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--focus);
  border-radius: 0 8px 8px 0;
  background: #30291e;
}

.review-note p { margin: 0; }
.review-note p + p { margin-top: 0.25rem; }
.profile-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.profile-form > h4,
.profile-form > p { margin: 0; }
.event-form > .muted { font-size: 0.85rem; max-width: 85ch; }
.profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem 1rem; }
.field { display: grid; align-content: start; gap: 0.35rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.profile-form > .button { justify-self: start; margin-top: 0.25rem; }
.create-details { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.create-details summary { width: fit-content; color: var(--blue); font-weight: 700; cursor: pointer; }
.create-details[open] .profile-form { border-top: 0; padding-top: 0.5rem; }
.dev-mailbox-details { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.dev-mailbox-details > summary { width: fit-content; color: var(--blue); font-weight: 700; cursor: pointer; }
.dev-mailbox-details > p { margin: 0.6rem 0 0; }
.mailbox-messages { display: grid; gap: 0.65rem; margin-top: 1rem; }
.mailbox-message { padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-sunken); }
.mailbox-message h4 { margin: 0; color: var(--navy); }
.mailbox-message p { margin: 0.35rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mailbox-message a { overflow-wrap: anywhere; font-weight: 650; }
.password-reset-request-details { margin-top: 1rem; }
.password-reset-request-details > summary { width: fit-content; color: var(--blue); font-weight: 700; cursor: pointer; }
.password-reset-request-form,
.password-reset-form { max-width: 520px; margin-top: 0.75rem; }
.empty-state { margin: 0; padding: 1rem; border: 1px dashed var(--line); border-radius: 10px; color: var(--ink-muted); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.admin-actions .button { min-width: 120px; }
.rejection-form { display: grid; gap: 0.55rem; margin-top: 1rem; }
.rejection-form textarea { width: 100%; padding: 0.65rem 0.75rem; border-radius: 9px; font: inherit; resize: vertical; }
.rejection-form .admin-actions { margin-top: 0; }
.cancel-rejection { border-color: var(--line); color: var(--navy); }
.button-approve { background: #b0dec0; color: #10151c; }
.button-reject { border-color: #87544f; background: transparent; color: #f1b6ae; }
.decision-meta { margin: 0.9rem 0 0; color: var(--ink-muted); font-size: 0.85rem; }
.decision-history { margin-top: 0.65rem; color: var(--ink-muted); font-size: 0.88rem; }
.decision-history summary { width: fit-content; color: var(--blue); font-weight: 650; cursor: pointer; }
.decision-history ul { display: grid; gap: 0.35rem; padding-left: 1.25rem; }
.admin-user-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.admin-user-section h3 { margin: 0; color: var(--navy); font-size: 1.15rem; }
.admin-user-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.admin-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-sunken);
}
.admin-user-identity { min-width: 0; }
.admin-user-identity h4 { margin: 0; color: var(--navy); font-size: 1rem; }
.admin-user-identity > p { margin: 0.15rem 0 0; overflow-wrap: anywhere; }
.admin-user-meta { color: var(--ink-muted); font-size: 0.84rem; }
.admin-revoke-confirmation { min-width: min(100%, 340px); }
.admin-revoke-confirmation > p { margin: 0 0 0.65rem; color: #f1b6ae; font-size: 0.9rem; }
.admin-revoke-confirmation .button { margin: 0.15rem; }

.team-panel {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.team-panel > summary { width: fit-content; color: var(--blue); font-weight: 750; cursor: pointer; }
.team-list { display: grid; gap: 0.65rem; margin: 0.9rem 0; padding: 0; list-style: none; }
.member-row,
.invitation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-sunken);
}
.member-identity { display: grid; min-width: 0; gap: 0.12rem; }
.member-identity > * { overflow-wrap: anywhere; }
.role-badge {
  width: fit-content;
  margin-top: 0.2rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgb(193 168 120 / 12%);
  color: #d2bc90;
  font-size: 0.76rem;
  font-weight: 700;
}
.member-role-form { display: flex; align-items: center; gap: 0.45rem; }
.member-role-form select { min-width: 145px; }
.member-role-form .button,
.member-row > .button,
.invitation-row .button { min-height: 40px; }
.member-role-form .button-quiet,
.button-danger { border-color: #87544f; color: #f1b6ae; }
.invitation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.55fr) auto;
  align-items: end;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--surface-sunken);
}
.invitation-form h4 { grid-column: 1 / -1; margin: 0; color: var(--navy); }
.invitation-form label { display: grid; gap: 0.3rem; }
.invitation-form .button { min-height: 46px; }
.invitation-heading { margin: 1.2rem 0 0; color: var(--navy); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1200px, calc(100% - 3rem));
  margin: 3rem auto 0;
  padding: 1.25rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.tournament-launcher { margin-block: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.tournament-desk, .tournament-board {
  box-sizing: border-box;
  width: min(1200px, calc(100vw - 1rem));
  max-width: calc(100vw - 1rem);
  max-height: calc(100dvh - 1rem);
  padding: clamp(0.75rem, 3vw, 2rem);
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
  overflow-wrap: anywhere;
}
.tournament-desk::backdrop, .tournament-board::backdrop { background: rgb(0 0 0 / 80%); }
.tournament-desk-header, .tournament-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.tournament-desk-header { justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tournament-desk-header h2 { margin-top: 0; }
.tournament-toolbar { margin-block: 0.8rem; }
.tournament-toolbar .button[aria-pressed="true"] { border-color: var(--blue); background: rgb(193 168 120 / 15%); }
.tournament-desk-body { min-width: 0; }
.tournament-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0.8rem; margin-block: 1rem; }
.tournament-metrics > div { display: grid; gap: 0.3rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.tournament-metrics strong { font-size: 1.15rem; }
.tournament-timer, .tournament-next-action, .tournament-section { margin-block: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.tournament-clock { margin: 0.5rem 0; font-size: clamp(1.7rem, 6vw, 3rem); font-variant-numeric: tabular-nums; color: var(--blue); }
.tournament-player-list { padding: 0; list-style: none; }
.tournament-player-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; border-bottom: 1px solid var(--line); padding-block: 0.65rem; }
.tournament-player-list li > span { flex: 1 1 180px; }
.tournament-entry-form, .tournament-cut-selection { display: grid; gap: 0.75rem; margin-block: 1rem; }
.tournament-entry-form .field { display: grid; gap: 0.4rem; }
.tournament-desk input[type="checkbox"], .tournament-board input[type="checkbox"] { width: auto; min-height: auto; margin: 0.5rem; }
.tournament-cut-selection .field { display: flex; flex-wrap: wrap; align-items: center; }
.tournament-table-scroll { max-width: 100%; overflow-x: auto; }
.tournament-table { width: 100%; border-collapse: collapse; }
.tournament-table caption { text-align: left; padding-block: 0.75rem; }
.tournament-table th, .tournament-table td { text-align: left; padding: 0.65rem; border-bottom: 1px solid var(--line); }
.tournament-match { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.tournament-match .field { display: grid; gap: 0.4rem; }
.tournament-match select { max-width: 100%; }
.tournament-board-match { font-size: 1.25rem; padding: 0.65rem; border-bottom: 1px solid var(--line); }
body:has(.tournament-board[open]) { overflow: hidden; }
@media print {
  body:has(.tournament-board[open]) > * { display: none !important; }
  body:has(.tournament-board[open]) > main { display: block !important; width: 100%; margin: 0; }
  body:has(.tournament-board[open]) main * { visibility: hidden; }
  body:has(.tournament-board[open]) main *:not(:has(.tournament-board[open])):not(.tournament-board[open]):not(.tournament-board[open] *) { display: none !important; }
  body:has(.tournament-board[open]) main :has(.tournament-board[open]) { margin: 0 !important; padding: 0 !important; border: 0 !important; }
  .tournament-board[open], .tournament-board[open] * { visibility: visible !important; }
  .tournament-board[open] { position: absolute; inset: 0; width: 100%; max-width: none; max-height: none; overflow: visible; border: 0; color: #000; background: #fff; }
  .tournament-board .no-print { display: none !important; }
  .tournament-board .muted, .tournament-board .tournament-clock { color: #333; }
}

.hidden { display: none !important; }

@media (max-width: 720px) {
  .site-header { min-height: 68px; flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.7rem 1rem; }
  html { scroll-padding-top: 150px; }
  .portal-nav { order: 3; flex: 0 0 100%; width: 100%; justify-content: flex-start; overflow-x: auto; padding: 0.45rem 0 0.15rem; }
  .site-header > .button { margin-left: auto; }
  .hero { padding-top: 2.5rem; }
  .hero { grid-template-columns: 1fr; gap: 1.25rem; }
  .hero-note { display: none; }
  .account-grid { grid-template-columns: 1fr; }
  .member-row { flex-wrap: wrap; }
  .invitation-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .invitation-form > .button { grid-column: 1 / -1; }
  .status { white-space: normal; }
}

@media (max-width: 520px) {
  main { width: min(calc(100% - 1rem), 1120px); }
  .panel { padding: 1rem; border-radius: 14px; }
  .brand { white-space: normal; }
  .site-header { gap: 0.5rem; }
  .site-header > .button { padding-inline: 0.65rem; }
  .portal-nav { gap: 0.25rem; }
  .portal-nav a { padding-inline: 0.5rem; }
  .hero { padding-top: 1.75rem; }
  .profile-fields { grid-template-columns: 1fr; }
  .invitation-form { grid-template-columns: 1fr; }
  .invitation-form h4 { grid-column: auto; }
  .member-row,
  .invitation-row { align-items: stretch; flex-direction: column; }
  .member-role-form { align-items: stretch; flex-direction: column; }
  .member-role-form select { min-width: 0; }
  .field-wide { grid-column: auto; }
  .organization-top { flex-direction: column; }
  .admin-user-card { align-items: stretch; flex-direction: column; }
  .admin-actions { display: grid; grid-template-columns: 1fr; }
  .admin-actions .button { width: 100%; }
  footer { width: calc(100% - 1rem); flex-direction: column; gap: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
