:root {
  --ink: #151515;
  --muted: #6f737b;
  --line: #e4e4e4;
  --paper: #f7f7f5;
  --panel: #ffffff;
  --red: #e11d48;
  --blue: #7c3aed;
  --purple: #7c3aed;
  --amber: #f59e0b;
  --green: #059669;
  --soft-red: #fff1f2;
  --soft-blue: #f3e8ff;
  --soft-purple: #f3e8ff;
  --soft-amber: #fffbeb;
  --soft-green: #ecfdf5;
  --shadow: 0 12px 28px rgba(20, 20, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px clamp(14px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 245, 0.94);
  backdrop-filter: blur(14px);
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.5vw, 34px);
  width: min(1480px, 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  overflow: visible;
  padding: 0;
}

.brand-mark img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-mark span[hidden] {
  display: none;
}

.lotus-mark {
  display: grid;
  place-items: center;
  width: 150px;
  min-width: 130px;
  height: 48px;
  background: transparent;
  padding: 0;
}

.lotus-mark img {
  max-width: 100%;
  max-height: 44px;
  object-fit: contain;
}

.brand p,
.kicker,
.field-title,
label span {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.08rem, 2vw, 1.55rem);
  line-height: 1.1;
}

.sheet-link,
.sync-status,
.secondary-button,
.play-button,
.icon-action,
.add-button,
.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 13px;
  font-weight: 850;
}

.sheet-link {
  white-space: nowrap;
}

.sync-status {
  min-width: 118px;
  color: var(--muted);
  white-space: nowrap;
}

.sync-status.online {
  border-color: #a7f3d0;
  background: var(--soft-green);
  color: var(--green);
}

.sync-status.saving {
  border-color: #bfdbfe;
  background: var(--soft-blue);
  color: var(--blue);
}

.sync-status.offline {
  border-color: #fed7aa;
  background: var(--soft-amber);
  color: #b45309;
}

.sheet-link:hover,
.secondary-button:hover,
.icon-action:hover,
.add-button:hover,
.open-link:hover {
  border-color: var(--red);
  color: var(--red);
}

.app-shell {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 2.5vw, 30px) 36px;
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 14px;
  max-width: 1480px;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 900;
}

.view-tab.active {
  border-color: #ddd6fe;
  background: var(--soft-blue);
  color: var(--blue);
}

.view-panel[hidden],
[hidden] {
  display: none !important;
}

.public-bracket-page {
  background: #f5f4f7;
}

.public-bracket-shell {
  display: grid;
  gap: 14px;
}

.public-control-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin: 0 auto;
  width: min(1480px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.public-select-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.public-select-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
}

.public-team-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 auto;
  width: min(1480px, 100%);
}

.public-team-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.public-team-card-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.public-team-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.public-team-logo.fallback {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-weight: 950;
}

.public-team-card-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.public-team-card-main strong {
  font-size: 1rem;
  line-height: 1.05;
}

.public-team-card-main span,
.public-team-game span,
.public-team-game em {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.public-team-games {
  display: grid;
  gap: 6px;
}

.public-team-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border-radius: 8px;
  background: #f7f7f7;
  padding: 8px 10px;
}

.public-team-game > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.public-team-game strong {
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.15;
}

.public-team-game span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-team-game em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
  font-style: normal;
  white-space: nowrap;
}

.public-team-game.done em {
  background: var(--soft-green);
  color: var(--green);
}

.public-team-game.pending em {
  background: var(--soft-amber);
  color: #b45309;
}

.public-team-game-empty {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.public-empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 850;
}

.public-team-summary .public-empty-state {
  grid-column: 1 / -1;
}

.public-team-summary {
  grid-template-columns: 1fr;
  gap: 12px;
}

.public-team-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.public-team-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 6px 12px 6px 8px;
  font-weight: 900;
}

.public-team-button.active {
  border-color: #ddd6fe;
  background: var(--soft-blue);
  color: var(--blue);
}

.public-team-button-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.public-team-button-logo.fallback {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 950;
}

.public-team-card {
  gap: 14px;
  padding: 14px;
}

.public-team-card-head {
  grid-template-columns: 66px minmax(0, 1fr) minmax(210px, 280px);
  gap: 14px;
}

.public-team-logo {
  width: 66px;
  height: 66px;
}

.public-team-modality {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.public-team-modality span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.public-team-modality select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font-weight: 850;
}

.public-team-games {
  gap: 8px;
}

.public-team-game {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 72px;
  border: 1px solid #eeeeee;
  background: #fbfbfb;
  padding: 10px 12px;
}

.public-team-game-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.public-team-game-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.public-team-game-meta strong,
.public-team-game-meta span,
.public-team-game-meta small {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-weight: 900;
  line-height: 1;
}

.public-team-game-meta strong {
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 0.82rem;
}

.public-team-game-meta span {
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
}

.public-team-game-meta small {
  background: #f2f2f2;
  color: var(--muted);
  font-size: 0.72rem;
}

.public-team-game-versus {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.public-team-game-versus strong {
  font-size: 1rem;
  line-height: 1.15;
}

.public-team-game-versus span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: normal;
}

.public-brackets-board {
  margin-top: 0;
}

.public-bracket-card .bracket-card-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 950;
  white-space: nowrap;
}

.picker {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(260px, 1.45fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  margin-inline: auto;
  max-width: 1480px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.picker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, auto));
  gap: 8px;
}

.picker-actions .secondary-button {
  min-width: 0;
  padding-inline: 12px;
  white-space: nowrap;
}

.secondary-button.slim {
  min-height: 36px;
  padding-inline: 10px;
  font-size: 0.82rem;
}

.notification-center {
  display: grid;
  gap: 10px;
  margin: 0 auto 14px;
  max-width: 1480px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.notification-center.has-alerts {
  border-color: #ddd6fe;
  box-shadow: 0 14px 36px rgba(124, 58, 237, 0.12);
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-head p,
.notification-head h2 {
  margin: 0;
}

.notification-head p {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.notification-head h2 {
  font-size: 1rem;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-empty,
.notification-item {
  border-radius: 8px;
  background: #f8f8f8;
}

.notification-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0 12px;
}

.notification-empty svg {
  width: 18px;
  height: 18px;
}

.notification-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #ede9fe;
  background: #fbf7ff;
}

.notification-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
}

.notification-icon svg {
  width: 20px;
  height: 20px;
}

.notification-item h3,
.notification-item p {
  margin: 0;
}

.notification-item h3 {
  color: var(--blue);
  font-size: 0.95rem;
}

.notification-item p {
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

.notification-item span {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

#gamePicker.finalized-picker {
  border-color: #86efac;
  background: var(--soft-green);
  color: var(--green);
  font-weight: 850;
}

.match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.match-top {
  display: grid;
  grid-template-columns: minmax(360px, 0.72fr) minmax(620px, 1.6fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  padding: 20px clamp(16px, 3vw, 34px) 22px;
  border-bottom: 1px solid var(--line);
}

.match-top.finalized-top {
  background: linear-gradient(90deg, rgba(236, 253, 245, 0.92), #fff 42%);
  border-bottom-color: #a7f3d0;
}

.match-meta {
  display: grid;
  align-content: start;
  gap: 12px;
  max-width: 430px;
}

.meta-row {
  display: grid;
  grid-template-columns: minmax(172px, auto) minmax(118px, auto);
  gap: 22px;
  align-items: center;
  justify-content: start;
}

.time-card {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.match-date-line {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.coverage-summary {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 2px 0 2px 18px;
  min-width: 118px;
}

.coverage-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.coverage-row span {
  color: var(--muted);
}

.coverage-row strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.15;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  width: fit-content;
  border-radius: 999px;
  padding: 0 13px;
  font-weight: 900;
}

.pill.date {
  background: var(--soft-red);
  color: var(--red);
}

.pill.day {
  background: #f5f5f5;
}

.pill.venue,
.pill.modality {
  background: var(--soft-blue);
  color: var(--blue);
}

.time-card .venue {
  background: #f2f2f2;
  color: var(--muted);
}

.pill.phase {
  background: #f2f2f2;
  min-width: 180px;
  justify-content: center;
  white-space: nowrap;
}

.time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: clamp(2.15rem, 4vw, 3rem);
  font-weight: 950;
  line-height: 1;
}

.play-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding-left: 0;
}

.play-button {
  min-width: 134px;
  flex: 0 0 auto;
}

.play-button.active {
  border-color: #fecdd3;
  background: var(--soft-red);
  color: var(--red);
}

.play-button.ended {
  border-color: #ddd6fe;
  background: var(--soft-blue);
  color: var(--blue);
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 116px;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--soft-amber);
  color: #b45309;
  font-weight: 900;
  flex: 0 0 auto;
}

.status.finalized {
  background: var(--soft-green);
  color: var(--green);
}

.status.ended {
  background: var(--soft-blue);
  color: var(--blue);
}

.scoreboard {
  display: grid;
  align-items: center;
  align-self: center;
  gap: 26px;
  padding-top: 10px;
}

.match-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.score-line {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 86px 36px 86px minmax(210px, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.team {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.12rem, 1.8vw, 1.6rem);
  font-weight: 950;
  line-height: 1.04;
  max-width: 100%;
}

.team span {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: normal;
}

.team.left {
  justify-content: flex-end;
  text-align: right;
}

.team.right {
  justify-content: flex-start;
}

.team.left span {
  text-align: right;
}

.team.right span {
  text-align: left;
}

.team-logo {
  width: clamp(68px, 5.8vw, 88px);
  height: clamp(68px, 5.8vw, 88px);
  flex: 0 0 auto;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.12));
}

.score-input {
  height: 86px;
  padding: 0;
  text-align: center;
  font-size: 2rem;
  font-weight: 950;
}

.versus {
  text-align: center;
  color: var(--blue);
  font-size: 2.1rem;
  font-weight: 950;
}

.event-title {
  text-align: center;
  font-size: clamp(1.45rem, 4vw, 2.7rem);
  font-weight: 950;
}

.management {
  display: grid;
  gap: 22px;
  padding: 22px clamp(16px, 3vw, 34px) 30px;
}

.field-group {
  display: grid;
  gap: 12px;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-head h2 {
  margin: 0;
  font-size: 1.05rem;
  text-transform: uppercase;
}

.photographers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 10px;
}

.photographer-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 72px minmax(112px, auto);
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.photographer-card label span {
  font-size: 0.68rem;
  line-height: 1.05;
  white-space: normal;
}

.photographer-card input {
  min-height: 36px;
  padding: 0 9px;
}

.photo-range {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr 104px;
  gap: 8px;
}

.photo-total {
  background: #fff;
  color: var(--blue);
  font-weight: 950;
  text-align: center;
}

.remove-photo {
  position: absolute;
  top: -8px;
  right: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  border: 1px solid #fecdd3;
  border-radius: 999px;
  background: var(--soft-red);
  color: var(--red);
  padding: 0;
  box-shadow: 0 8px 18px rgba(190, 18, 60, 0.12);
}

.remove-photo svg {
  width: 16px;
  height: 16px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--ink);
  font-weight: 850;
}

.check-field input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.link-grid {
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) minmax(190px, 0.9fr) minmax(200px, 0.95fr) minmax(300px, 1.35fr) minmax(240px, 1fr);
  gap: 8px;
  align-items: stretch;
}

.link-item {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.link-item header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.link-item h3 {
  margin: 0;
  color: var(--blue);
  font-size: 0.9rem;
  line-height: 1.1;
  white-space: nowrap;
}

.link-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.link-actions.has-generator {
  grid-template-columns: 1fr auto auto;
}

.open-link,
.generate-art,
.modal-icon {
  min-width: 48px;
  padding: 0 12px;
}

.generate-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-weight: 900;
}

.generate-art:hover {
  border-color: var(--blue);
}

.generate-art.full {
  width: 100%;
}

.art-card {
  align-content: space-between;
}

.open-link.disabled {
  pointer-events: none;
  opacity: 0.42;
}

.done-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(148px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.icon-action {
  min-height: 46px;
  padding-inline: 15px;
}

.icon-action span {
  white-space: nowrap;
}

.icon-action svg,
.secondary-button svg,
.generate-art svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}

.icon-action.done {
  border-color: #a7f3d0;
  background: var(--soft-green);
  color: var(--green);
}

.bracket-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 14px;
  align-items: end;
  margin: 0 auto 14px;
  max-width: 1480px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.bracket-toolbar p,
.bracket-card-head p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.bracket-toolbar h2,
.bracket-card-head h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.1;
}

.brackets-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.bracket-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.bracket-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.bracket-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.bracket-card-actions > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.bracket-card-actions .generate-art {
  min-height: 36px;
}

.bracket-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.bracket-column {
  display: grid;
  gap: 11px;
  min-width: 0;
}

.bracket-column h3 {
  margin: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, #7c3aed, #17111f);
  color: #fff;
  padding: 9px 10px;
  font-size: 0.9rem;
  text-align: center;
}

.bracket-match,
.bracket-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bracket-match {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
}

.bracket-match.has-winner {
  border-color: #ddd6fe;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.08);
}

.bracket-match header,
.bracket-match footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.bracket-match header span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.bracket-match header strong {
  color: var(--blue);
  font-size: 0.76rem;
  line-height: 1.1;
  text-align: right;
}

.bracket-teams {
  display: grid;
  gap: 6px;
}

.bracket-team {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  border-radius: 8px;
  background: #f7f7f7;
  padding: 5px 10px 5px 5px;
}

.bracket-match.inline-score .bracket-team {
  grid-template-columns: 58px minmax(0, 1fr) 46px;
}

.bracket-team.winner {
  background: var(--soft-green);
  color: var(--green);
}

.bracket-team.waiting {
  color: var(--muted);
}

.bracket-team-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.bracket-team-logo.fallback {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 950;
}

.bracket-team strong {
  min-width: 0;
  font-size: clamp(1rem, 1.55vw, 1.35rem);
  line-height: 1.02;
}

.bracket-score {
  min-width: 34px;
  text-align: right;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 950;
}

.bracket-score-input {
  width: 42px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
  text-align: center;
}

.bracket-score-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
  outline: none;
}

.bracket-match footer span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.bracket-inline-note {
  text-align: right;
}

.bracket-empty {
  display: grid;
  place-items: center;
  min-height: 92px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 850;
  padding: 10px;
}

.upcoming-panel,
.youtube-panel,
.progress-toolbar {
  display: grid;
  gap: 14px;
  margin: 14px auto 0;
  max-width: 1480px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.upcoming-head,
.youtube-head,
.progress-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.upcoming-head p,
.youtube-head p,
.progress-toolbar p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.upcoming-head h2,
.youtube-head h2,
.progress-toolbar h2 {
  margin: 0;
  font-size: 1.1rem;
}

.upcoming-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: stretch;
  gap: 10px;
}

.upcoming-days {
  display: grid;
  gap: 18px;
}

.upcoming-day {
  display: grid;
  gap: 10px;
}

.upcoming-day-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 6px;
  border-bottom: 1px solid #eeeeee;
}

.upcoming-day-head p {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  text-transform: uppercase;
}

.upcoming-day-head h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.upcoming-day-head span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: var(--soft-purple);
  color: var(--purple);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.upcoming-batch,
.upcoming-empty,
.progress-card,
.progress-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.upcoming-batch {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  min-height: 236px;
  padding: 12px;
}

.upcoming-batch.done {
  border-color: #a7f3d0;
  background: var(--soft-green);
}

.upcoming-batch header,
.upcoming-batch footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upcoming-total,
.upcoming-batch span,
.progress-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.upcoming-total {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  padding: 0 12px;
  font-weight: 900;
}

.upcoming-batch h3,
.progress-card h3,
.progress-card p {
  margin: 0;
}

.upcoming-batch h3 {
  margin-top: 3px;
  color: var(--blue);
  font-size: 1rem;
}

.upcoming-batch-games {
  display: grid;
  align-content: start;
  gap: 6px;
}

.youtube-head {
  align-items: center;
}

.youtube-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.youtube-tools {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto minmax(170px, 1fr);
  align-items: end;
  gap: 10px;
}

.youtube-tools label,
.youtube-tools select {
  width: 100%;
}

.youtube-count {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 42px;
  color: var(--muted);
  font-weight: 850;
}

.youtube-count strong {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--soft-purple);
  color: var(--purple);
}

.youtube-hint {
  border: 1px solid #eadcff;
  border-radius: 8px;
  background: #fbf7ff;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 800;
}

.youtube-days {
  display: grid;
  gap: 18px;
}

.youtube-day {
  display: grid;
  gap: 10px;
}

.youtube-day-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 6px;
  border-bottom: 1px solid #eeeeee;
}

.youtube-day-head p {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  text-transform: uppercase;
}

.youtube-day-head h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.youtube-day-head span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--green);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.youtube-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: stretch;
  gap: 10px;
}

.youtube-game-card {
  display: grid;
  grid-template-columns: 22px 120px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
}

.youtube-game-card.selected {
  border-color: #c4b5fd;
  background: var(--soft-purple);
}

.youtube-game-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

.youtube-game-logos {
  display: grid;
  grid-template-columns: 44px 18px 44px;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.youtube-game-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.youtube-game-logos em {
  color: var(--purple);
  font-style: normal;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.youtube-game-logos strong {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1;
  text-align: center;
}

.youtube-game-logos .youtube-event-chip {
  grid-column: 1 / -1;
  color: var(--purple);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.youtube-game-info {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.youtube-game-info strong {
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.1;
}

.youtube-game-info small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-game-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  min-height: 48px;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  background: #fafafa;
  padding: 7px 9px;
  text-align: left;
}

.upcoming-game-row:hover {
  border-color: #ddd6fe;
  color: var(--blue);
}

.upcoming-game-row span {
  grid-row: span 2;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 950;
}

.upcoming-game-row strong {
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.1;
}

.upcoming-game-row small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.1;
}

.upcoming-empty,
.progress-empty {
  color: var(--muted);
  font-weight: 850;
  padding: 14px;
}

.progress-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 300px);
  margin-top: 0;
}

.progress-board {
  display: grid;
  gap: 12px;
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.progress-summary > div {
  display: grid;
  gap: 3px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.progress-summary strong {
  font-size: 1.75rem;
  line-height: 1;
}

.progress-summary span {
  color: var(--muted);
  font-weight: 850;
}

.progress-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 10px;
}

.progress-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.progress-card.finalized {
  border-color: #a7f3d0;
  background: var(--soft-green);
}

.progress-card.ended {
  border-color: #ddd6fe;
  background: #fbf7ff;
}

.progress-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.progress-card h3 {
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.98rem;
}

.progress-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.progress-meter {
  height: 8px;
  border-radius: 999px;
  background: #eeeeee;
  overflow: hidden;
}

.progress-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.progress-card.finalized .progress-meter span {
  background: var(--green);
}

.progress-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 36px));
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.story-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 15, 15, 0.62);
}

.story-modal[hidden] {
  display: none;
}

.story-dialog {
  display: grid;
  gap: 14px;
  width: min(460px, 100%);
  max-height: calc(100vh - 36px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  padding: 14px;
}

.story-modal.wide-art .story-dialog {
  width: min(980px, 100%);
}

.story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-head p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.story-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-icon {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.story-body {
  display: grid;
  place-items: center;
  min-height: 0;
  border-radius: 8px;
  background: #111;
  overflow: hidden;
}

#storyCanvas {
  display: block;
  width: min(100%, 320px);
  height: auto;
  aspect-ratio: 9 / 16;
}

.story-modal.wide-art #storyCanvas {
  width: min(100%, 860px);
  aspect-ratio: 16 / 9;
}

.story-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-share {
  border-color: #ddd6fe;
  background: var(--soft-blue);
  color: var(--blue);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 1080px) {
  .picker,
  .match-top {
    grid-template-columns: 1fr;
  }

  .picker-actions {
    grid-template-columns: 1fr 1fr;
  }

  .link-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .upcoming-list,
  .public-team-summary,
  .progress-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-control-panel {
    grid-template-columns: 1fr 1fr;
  }

  .public-control-panel .secondary-button {
    grid-column: 1 / -1;
  }

  .bracket-columns {
    grid-template-columns: 1fr;
  }

  .bracket-team {
    grid-template-columns: 52px minmax(0, 1fr) 30px;
    min-height: 60px;
  }

  .bracket-match.inline-score .bracket-team {
    grid-template-columns: 52px minmax(0, 1fr) 46px;
  }

  .bracket-team-logo {
    width: 52px;
    height: 52px;
  }

  .scoreboard {
    padding-top: 0;
  }

}

@media (max-width: 760px) {
  .topbar-content {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .sheet-link,
  .sync-status {
    flex: 1 1 160px;
  }

  .lotus-mark {
    order: 1;
    width: 128px;
    min-width: 128px;
  }

  .brand {
    order: 2;
    flex: 1 1 260px;
  }

  .sheet-link {
    order: 3;
  }

  .sync-status {
    order: 4;
  }

  .notification-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .notification-actions {
    width: 100%;
  }

  .notification-actions .secondary-button {
    flex: 1 1 130px;
  }

  .notification-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .notification-item .secondary-button {
    grid-column: 1 / -1;
  }

  .bracket-toolbar {
    grid-template-columns: 1fr;
  }

  .bracket-card-head {
    flex-direction: column;
  }

  .public-control-panel,
  .public-team-summary {
    grid-template-columns: 1fr;
  }

  .public-control-panel .secondary-button {
    grid-column: auto;
  }

  .public-team-card-head {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .public-team-modality {
    grid-column: 1 / -1;
  }

  .upcoming-head,
  .upcoming-day-head,
  .youtube-head,
  .youtube-day-head,
  .progress-toolbar {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .youtube-actions,
  .youtube-tools {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .youtube-actions {
    display: grid;
  }

  .youtube-count {
    justify-content: flex-start;
  }

  .upcoming-list,
  .youtube-game-grid,
  .progress-summary {
    grid-template-columns: 1fr;
  }

  .match-top {
    padding-top: 20px;
  }

  .meta-row {
    grid-template-columns: minmax(158px, auto) minmax(112px, auto);
    gap: 16px;
  }

  .time-card,
  .coverage-summary {
    min-height: 0;
  }

  .play-line {
    flex-wrap: wrap;
    padding-left: 0;
  }

  .score-line {
    grid-template-columns: minmax(82px, 1fr) 58px 20px 58px minmax(82px, 1fr);
    gap: 8px;
  }

  .team {
    gap: 6px;
    font-size: 0.95rem;
  }

  .team span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .team-logo {
    width: 42px;
    height: 42px;
  }

  .score-input {
    height: 58px;
    font-size: 1.5rem;
  }

  .photographers {
    grid-template-columns: 1fr;
  }

  .photographer-card {
    grid-template-columns: 1fr;
  }

  .photo-range {
    grid-template-columns: 1fr 1fr;
  }

  .photo-range label:last-child {
    grid-column: 1 / -1;
  }

  .link-actions {
    grid-template-columns: 1fr;
  }

  .link-actions.has-generator {
    grid-template-columns: 1fr;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .public-team-card-head {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .public-team-logo {
    width: 50px;
    height: 50px;
  }

  .public-team-game {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .public-team-game em {
    justify-self: start;
  }

  .match-meta,
  .play-line,
  .match-tags {
    gap: 7px;
  }

  .meta-row {
    grid-template-columns: 1fr;
  }

  .coverage-summary {
    grid-template-columns: repeat(3, max-content);
    gap: 8px 12px;
    border-left: 0;
    padding-left: 0;
  }

  .coverage-row {
    grid-template-columns: auto auto;
  }

  .pill {
    min-height: 34px;
    padding: 0 10px;
  }

  .versus {
    line-height: 1;
  }
}
