:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #071225;
  --muted: #64748b;
  --line: #dbe3ef;
  --line-strong: #c7d2e3;
  --surface: #ffffff;
  --soft: #f3f6fa;
  --navy: #071225;
  --green: #16a36b;
  --green-dark: #0f7a51;
  --red: #df3f45;
  --gold: #c78a10;
  --blue: #2671c9;
  --teal: #128c8c;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  background: #f5f7fb;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(245, 247, 251, 0.92)),
    #f5f7fb;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 0.78rem 0.85rem;
}

textarea {
  min-height: 190px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 107, 0.14);
}

.app {
  min-height: 100vh;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(410px, 520px);
  background: #eef3f8;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 18, 37, 0.82), rgba(7, 18, 37, 0.2));
}

.stadium-scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 18, 37, 0.18), rgba(7, 18, 37, 0.78)),
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.92) 0 2px, transparent 3px 100%),
    repeating-linear-gradient(90deg, transparent 0 84px, rgba(255, 255, 255, 0.1) 84px 86px),
    linear-gradient(90deg, #0d6b43, #1b965e 42%, #0f6d48);
}

.stadium-scene::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 10%;
  height: 44%;
  border: 4px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  transform: perspective(620px) rotateX(68deg);
}

.scene-net {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 18%;
  height: 25%;
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-bottom: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.34) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.26) 0 1px, transparent 1px 28px);
}

.scene-ball {
  position: absolute;
  left: 16%;
  bottom: 14%;
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 52% 42%, #111 0 13%, transparent 14%),
    conic-gradient(from 18deg, #f7f7f7 0 20%, #111 20% 25%, #f7f7f7 25% 45%, #1d4ed8 45% 50%, #f7f7f7 50% 70%, #df3f45 70% 75%, #f7f7f7 75%);
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.35);
}

.auth-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: #fff;
}

.brand-lockup,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup span,
.brand span,
.eyebrow {
  display: block;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-lockup strong,
.brand strong {
  display: block;
  font-size: 1.1rem;
  line-height: 1;
}

.brand-mark,
.brand-lockup > svg {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
}

.auth-kpis {
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.auth-kpis .stat {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  backdrop-filter: blur(10px);
}

.auth-kpis .stat span {
  color: rgba(255, 255, 255, 0.75);
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-header h1,
.page-title h1,
.create-form h1,
.settings-layout h1,
.rules-layout h1 {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  letter-spacing: 0;
}

.auth-header p,
.invite-note,
.muted-copy,
.privacy-note,
.league-card p,
.hero-panel p,
.notice-inline {
  color: var(--muted);
  line-height: 1.55;
}

.invite-note {
  border: 1px solid #bde3cd;
  border-radius: 8px;
  background: #f0fbf5;
  padding: 10px;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin: 22px 0;
  padding: 4px;
  border-radius: 8px;
  background: var(--soft);
}

.segmented button,
.table-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0.65rem 0.8rem;
  font-weight: 800;
}

.segmented button.active,
.table-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.08);
}

.input-icon {
  position: relative;
}

.input-icon svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.input-icon input {
  padding-left: 38px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 0 0 16px;
}

.field > span,
.choice-group legend {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.field small {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 850;
  min-height: 42px;
  padding: 0.68rem 1rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:not(:disabled):hover,
.icon-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 9px 18px rgba(7, 18, 37, 0.16);
}

.button-primary:hover {
  background: #101d33;
}

.button-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.button-danger {
  background: var(--red);
  color: #fff;
}

.button-sm {
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  font-size: 0.86rem;
}

.full-width {
  width: 100%;
  margin-top: 10px;
}

.privacy-note {
  margin: 14px 0 0;
  font-size: 0.86rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  padding: 12px 24px;
}

.brand {
  border: 0;
  background: transparent;
  text-align: left;
  min-width: max-content;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav-tabs button {
  min-width: max-content;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  padding: 0.62rem 0.78rem;
  font-weight: 800;
}

.nav-tabs button.active {
  background: var(--navy);
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions select {
  min-width: 180px;
  padding: 0.6rem 0.75rem;
}

.user-pill {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: #334155;
  padding: 0.55rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.icon-button-ghost {
  background: #fff;
}

.page,
.draft-page {
  width: min(1500px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0;
}

.no-top {
  padding-top: 0;
}

.page-title {
  margin-bottom: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 430px);
  gap: 18px;
  align-items: start;
}

.league-list {
  display: grid;
  gap: 14px;
}

.league-card,
.panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.league-card {
  padding: 18px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.league-card:hover,
.league-card.selected {
  border-color: var(--green);
}

.league-card-header,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.league-card-header > *,
.panel-header > * {
  min-width: 0;
}

.league-card h2,
.panel h2,
.status-card strong {
  margin: 0.25rem 0;
  font-size: 1.22rem;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.33rem 0.58rem;
  background: #eef4ff;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: capitalize;
}

.status-drafting,
.status-accepted {
  background: #e6f8ef;
  color: var(--green-dark);
}

.status-lobby,
.status-pending {
  background: #fff6dc;
  color: #9a6505;
}

.status-complete,
.status-rejected {
  background: #f1f5f9;
  color: #475569;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
  margin: 16px 0;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal), var(--blue));
}

.card-stats,
.squad-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.18rem;
}

.invite-row,
.inline-actions,
.bid-row,
.trade-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.invite-row {
  margin: 16px 0;
}

.invite-row input {
  font-size: 0.9rem;
}

.dashboard-side {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 18px;
}

.hero-panel {
  overflow: hidden;
  padding: 0;
}

.stadium-card-visual {
  position: relative;
  height: 190px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.95) 0 3px, transparent 4px 100%),
    repeating-linear-gradient(90deg, transparent 0 62px, rgba(255, 255, 255, 0.14) 62px 64px),
    linear-gradient(180deg, #071225 0 35%, #0f5136 36% 100%);
}

.stadium-card-visual::before {
  content: "";
  position: absolute;
  left: 11%;
  right: 11%;
  bottom: -36%;
  height: 80%;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  transform: perspective(520px) rotateX(68deg);
}

.stadium-card-visual span {
  position: absolute;
  bottom: 24px;
  width: 48px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.stadium-card-visual span:nth-child(1) {
  left: 18%;
}

.stadium-card-visual span:nth-child(2) {
  left: 44%;
  background: #fcd116;
}

.stadium-card-visual span:nth-child(3) {
  left: 68%;
  background: #dbeafe;
}

.hero-panel > div {
  padding: 18px;
}

.checklist,
.feature-list ul {
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.checklist li,
.feature-list li {
  position: relative;
  padding-left: 24px;
  color: #334155;
}

.checklist li::before,
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
}

.checklist li.done::before,
.feature-list li::before {
  background: var(--green);
  border-color: var(--green);
}

.standings-list,
.activity-list,
.trade-list,
.squad-list,
.queue-list {
  display: grid;
  gap: 8px;
}

.standing-row,
.activity-item,
.trade-item,
.squad-row,
.queue-item {
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

.standing-row {
  grid-template-columns: 32px 1fr auto;
}

.standing-row strong {
  color: var(--green-dark);
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  padding: 28px;
}

.empty-state h1,
.empty-state h2 {
  margin: 0;
}

.empty-state p {
  max-width: 520px;
  color: var(--muted);
}

.create-layout,
.settings-layout,
.rules-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.create-form h1 {
  margin-bottom: 22px;
}

.choice-group {
  border: 0;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  gap: 10px;
}

.choice-group legend {
  margin-bottom: 9px;
}

.choice-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-weight: 700;
}

.choice-group input,
.mock-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

.help-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 5px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.76rem;
  cursor: help;
}

.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: min(280px, 70vw);
  transform: translateX(-50%) translateY(3px);
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  padding: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: var(--shadow);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.form-grid,
.scoring-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mock-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 6px 0 18px;
  background: #fbfdff;
}

.mock-card small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.create-aside,
.draft-side {
  display: grid;
  gap: 14px;
}

.public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.public-card {
  display: grid;
  gap: 16px;
}

.public-card.muted {
  background: #f9fbfd;
}

.draft-page {
  width: min(1800px, calc(100% - 24px));
}

.draft-topbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.invite-banner {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) minmax(260px, 520px) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #bcd5ff;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f3f8ff;
  padding: 12px 14px;
}

.invite-banner input,
.invite-row input {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invite-banner span,
.status-card span,
.status-card small {
  display: block;
  color: var(--muted);
}

.draft-hint {
  margin: 0 16px 12px;
  border: 1px solid #bde3cd;
  border-radius: 8px;
  background: #f0fbf5;
  color: #0f5136;
  padding: 10px 12px;
  font-weight: 800;
}

.control-actions {
  margin-top: 14px;
}

.room-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.room-toolbar h1 {
  margin: 0.1rem 0 0;
}

.team-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  min-height: 98px;
}

.status-card.large {
  min-width: 290px;
}

.status-card.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.draft-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  gap: 12px;
  align-items: start;
}

.player-board {
  overflow: hidden;
  padding: 0;
}

.player-board > .panel-header {
  padding: 16px 16px 10px;
}

.table-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--soft);
  max-width: 100%;
  overflow-x: auto;
}

.table-tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 140px 120px 190px 130px;
  gap: 8px;
  padding: 0 16px 14px;
}

.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-box input {
  padding-left: 38px;
}

.players-table {
  max-height: calc(100vh - 340px);
  min-height: 520px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 70px 82px 82px 80px minmax(115px, 0.65fr) 138px;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  min-width: 960px;
}

.snake-columns .table-head,
.snake-columns .table-row {
  grid-template-columns: minmax(260px, 1.6fr) 70px repeat(11, 70px) minmax(120px, 0.7fr) 132px;
  min-width: 1320px;
}

.auction-columns .table-head,
.auction-columns .table-row {
  grid-template-columns: minmax(260px, 1.6fr) 70px repeat(11, 70px) 72px minmax(120px, 0.7fr) 132px;
  min-width: 1390px;
}

.stats-columns .table-head,
.stats-columns .table-row {
  grid-template-columns: minmax(260px, 1.6fr) 70px repeat(11, 70px) minmax(140px, 0.8fr);
  min-width: 1220px;
}

.table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
}

.table-row {
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}

.table-row:hover {
  background: #fbfdff;
}

.table-row.owned {
  color: #64748b;
  background: #f8fafc;
}

.player-cell,
.auction-player,
.squad-row,
.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-cell strong,
.squad-row strong,
.queue-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.player-cell small,
.squad-row small,
.queue-item small {
  display: block;
  color: var(--muted);
}

.kit {
  --kit-primary: #1f2937;
  --kit-secondary: #e5e7eb;
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px 8px 10px 10px;
  background:
    linear-gradient(90deg, transparent 0 30%, var(--kit-secondary) 30% 42%, transparent 42%),
    linear-gradient(135deg, var(--kit-primary), var(--kit-primary));
  color: var(--kit-text);
  font-size: 0.58rem;
  font-weight: 950;
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.3),
    0 -1px 2px rgba(0, 0, 0, 0.2);
}

.kit span {
  position: relative;
  z-index: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #071225;
  padding: 1px 4px;
  text-shadow: none;
}

.kit::before,
.kit::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 10px;
  height: 13px;
  border-radius: 4px;
  background: var(--kit-primary);
}

.kit::before {
  left: -5px;
}

.kit::after {
  right: -5px;
}

.kit-sm {
  width: 25px;
  height: 25px;
  font-size: 0.48rem;
}

.kit-lg {
  width: 48px;
  height: 48px;
  font-size: 0.72rem;
}

.pos {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  border-radius: 999px;
  padding: 0.28rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 900;
}

.pos-GK {
  background: #f0e7ff;
  color: #7c3aed;
}

.pos-DEF {
  background: #e7f0ff;
  color: #1d4ed8;
}

.pos-MID {
  background: #e7f8ef;
  color: #047857;
}

.pos-FWD {
  background: #ffe8e8;
  color: #be123c;
}

.row-actions,
.queue-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.auction-panel,
.team-panel {
  position: relative;
}

.auction-player {
  margin: 14px 0;
}

.auction-player h3 {
  margin: 0;
}

.bid-row {
  margin-top: 12px;
}

.bid-row input {
  max-width: 90px;
}

.queue-list {
  max-height: 370px;
  overflow: auto;
}

.queue-item {
  grid-template-columns: auto auto 1fr auto;
}

.queue-index {
  color: var(--muted);
  font-weight: 900;
}

.squad-counts {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 12px;
}

.pitch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, minmax(58px, 1fr));
  gap: 8px;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid #87c9a0;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 50%, transparent 50%),
    repeating-linear-gradient(90deg, #1d8b56 0 74px, #208f5a 74px 148px);
  padding: 12px;
}

.pitch::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  pointer-events: none;
}

.pitch > span {
  z-index: 1;
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: #fff;
  font-weight: 850;
}

.pitch-player {
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(7, 18, 37, 0.45);
  color: #fff;
  min-width: 0;
  padding: 5px;
}

.pitch-player b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.pitch-GK {
  grid-column: 2 / 4;
  grid-row: 4;
}

.pitch-DEF {
  grid-row: 3;
}

.pitch-MID {
  grid-row: 2;
}

.pitch-FWD {
  grid-row: 1;
}

.squad-list {
  margin-top: 12px;
  max-height: 310px;
  overflow: auto;
}

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

.draft-board {
  display: grid;
  gap: 12px;
  padding: 16px;
  max-height: calc(100vh - 340px);
  overflow: auto;
}

.round-row {
  display: grid;
  gap: 8px;
}

.round-row h3 {
  margin: 0;
  font-size: 0.94rem;
}

.round-picks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(145px, 1fr);
  gap: 8px;
  overflow-x: auto;
}

.pick-tile {
  min-height: 90px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

.pick-tile.filled {
  border-style: solid;
  border-color: #badbcb;
  background: #f2fbf6;
}

.pick-tile small,
.pick-tile span {
  display: block;
  color: var(--muted);
}

.pick-tile strong {
  display: block;
  margin: 6px 0 2px;
}

.activity-list {
  padding: 16px;
  max-height: 620px;
  overflow: auto;
}

.activity-item {
  grid-template-columns: auto 1fr auto;
}

.activity-item small {
  color: var(--muted);
}

.trade-panel {
  margin-bottom: 28px;
}

.stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}

.stats-layout .page-title,
.stats-layout .stats-board {
  grid-column: 1 / -1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.stats-board {
  padding: 0;
  overflow: hidden;
}

.stats-board > .panel-header {
  padding: 16px;
}

.trade-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  margin-top: 12px;
}

.trade-list {
  margin-top: 12px;
}

.trade-item {
  grid-template-columns: 1fr auto auto;
}

.trade-item p {
  margin: 0;
}

.rules-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.rules-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.rules-list h2 {
  margin: 0 0 4px;
}

.rules-list p {
  margin: 0;
  color: var(--muted);
}

.rules-scoring {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.rules-scoring div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.rules-scoring span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.rules-scoring strong {
  display: block;
  margin-top: 6px;
  font-size: 1.3rem;
}

.import-panel textarea {
  margin: 10px 0;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.notice-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(520px, calc(100vw - 36px));
  border: 1px solid #bde3cd;
  border-radius: 8px;
  background: #f0fbf5;
  color: #0f5136;
  box-shadow: var(--shadow);
  padding: 10px 12px;
}

.notice-toast button {
  border: 0;
  background: transparent;
  color: #0f5136;
  font-weight: 850;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .room-toolbar,
  .invite-row,
  .inline-actions {
    flex-wrap: wrap;
  }

  .dashboard-grid,
  .create-layout,
  .settings-layout,
  .rules-layout,
  .stats-layout,
  .draft-content {
    grid-template-columns: 1fr;
  }

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

  .players-table {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 260px;
  }

  .auth-overlay {
    padding: 24px;
  }

  .auth-kpis {
    display: none;
  }

  .auth-panel {
    padding: 18px;
  }

  .page,
  .draft-page {
    width: min(100% - 20px, 1500px);
    padding: 18px 0;
  }

  .nav-tabs button span,
  .user-pill {
    display: none;
  }

  .header-actions select {
    min-width: 100%;
  }

  .invite-banner {
    grid-template-columns: 1fr;
  }

  .card-stats,
  .squad-counts,
  .summary-grid,
  .form-grid,
  .scoring-grid,
  .filters,
  .trade-form {
    grid-template-columns: 1fr;
  }

  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .pitch {
    min-height: 290px;
  }

  .queue-item,
  .trade-item {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
