@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg-soft: #f3f8ff;
  --bg-mid: #dbeafb;
  --bg-strong: #c2dbf4;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #d2dfeb;
  --line-strong: #b4c8da;
  --ink: #1d2733;
  --muted: #5a6b7b;
  --brand: #0f8b8d;
  --brand-strong: #0b6e70;
  --brand-soft: #d8f1ef;
  --danger: #b02b2b;
  --success: #1f7a54;
  --shadow-soft: 0 16px 38px rgba(16, 41, 58, 0.09);
  --shadow-card: 0 10px 24px rgba(18, 41, 58, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(72rem 36rem at 0% -15%, rgba(255, 255, 255, 0.92), transparent 60%),
    radial-gradient(56rem 32rem at 100% -8%, rgba(213, 236, 255, 0.75), transparent 52%),
    linear-gradient(165deg, var(--bg-soft), var(--bg-mid) 58%, var(--bg-strong));
}

.hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 139, 141, 0.18);
  border-radius: 24px;
  padding: clamp(1.25rem, 2.2vw, 2rem);
  background:
    radial-gradient(34rem 20rem at 100% 0%, rgba(15, 139, 141, 0.18), transparent 55%),
    linear-gradient(135deg, #ffffff, #f2fbfb 58%, #ebf5ff);
  box-shadow: var(--shadow-soft);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -64px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 139, 141, 0.18), rgba(15, 139, 141, 0));
  pointer-events: none;
}

.hero-eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--brand-strong);
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  font-weight: 800;
  line-height: 1.08;
}

.hero-copy {
  max-width: 65ch;
  color: var(--muted);
}

.card-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.15rem;
  box-shadow: var(--shadow-card);
}

.section-title {
  margin: 0 0 0.85rem;
  font-size: 1.22rem;
  font-weight: 800;
}

.subsection-title {
  font-size: 1rem;
  font-weight: 700;
}

.form-label {
  color: #394959;
  font-weight: 600;
}

.form-control,
.form-select {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  min-height: 44px;
}

.form-control:focus,
.form-select:focus {
  border-color: #50a8aa;
  box-shadow: 0 0 0 0.2rem rgba(15, 139, 141, 0.14);
}

.btn-brand {
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 12px 24px rgba(15, 139, 141, 0.28);
}

.btn-brand:hover,
.btn-brand:focus-visible {
  color: #ffffff;
  background: linear-gradient(135deg, #138f91, #0b696b);
}

.btn-outline-brand {
  border-radius: 12px;
  font-weight: 700;
  color: var(--brand-strong);
  border-color: #6ca8aa;
}

.btn-outline-brand:hover,
.btn-outline-brand:focus-visible {
  color: #063f40;
  background: #dff3f3;
  border-color: #5b9a9d;
}

.icon-info {
  width: 20px;
  height: 20px;
  border: 1px solid #89a8bf;
  border-radius: 50%;
  background: #f3f8ff;
  color: #345f84;
  font-size: 0.7rem;
  line-height: 1;
  font-weight: 700;
}

.icon-info:hover,
.icon-info:focus-visible {
  background: #e0efff;
  border-color: #6f95b1;
}

.sponsor-block {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.sponsor-block .form-check {
  padding-left: 0;
}

.sponsor-block .form-check-input {
  float: none;
  margin-left: 0;
  cursor: pointer;
}

.sponsor-block .form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

.sponsor-block .form-check-input:focus {
  border-color: #50a8aa;
  box-shadow: 0 0 0 0.2rem rgba(15, 139, 141, 0.14);
}

.sponsor-block .form-check-label {
  font-weight: 700;
  cursor: pointer;
}

.sponsor-hint {
  max-width: 70ch;
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.sponsor-preview-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sponsor-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 60mm;
  max-width: 100%;
  min-height: 18mm;
  padding: 0.35rem;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
}

.sponsor-image {
  max-width: 100%;
  max-height: 18mm;
  object-fit: contain;
}

.sponsor-text-line {
  margin: 0;
  font-size: 0.85rem;
  text-align: center;
}

.popover.sponsor-popover {
  max-width: 300px;
}

.popover.sponsor-popover .popover-body {
  padding: 0.85rem 0.9rem;
}

.loadable-section {
  position: relative;
}

.section-loading {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  color: var(--muted);
  font-weight: 600;
}

.section-loading .spinner-border {
  width: 2rem;
  height: 2rem;
  color: var(--brand);
}

.selection-block {
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.selection-accordion .accordion-item {
  border-radius: 16px;
}

.selection-accordion .accordion-button {
  flex-wrap: wrap;
  gap: 0.15rem 0.6rem;
  padding-right: 3rem;
}

.selection-summary {
  font-weight: 600;
  color: var(--brand-strong);
}

.selection-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.9rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.selection-divider::before,
.selection-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.autocomplete {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 268px;
  margin: 0;
  padding: 0.25rem;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.autocomplete-item {
  padding: 0.5rem 0.65rem;
  border-radius: 9px;
  cursor: pointer;
  line-height: 1.25;
}

.autocomplete-item.is-active,
.autocomplete-item:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.autocomplete-empty {
  padding: 0.5rem 0.65rem;
  color: var(--muted);
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

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

.team-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.team-card:hover {
  transform: translateY(-1px);
  border-color: #8fb6d5;
}

.team-card.is-selected {
  border-color: #58a8aa;
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.16);
  background: #f0fbfa;
}

.team-card .form-check-input {
  margin: 0;
}

.team-logo {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d8e4ef;
  padding: 3px;
  flex: 0 0 auto;
}

.team-name {
  font-weight: 600;
  color: #2a3946;
  line-height: 1.2;
}

.team-empty {
  margin: 0;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: #fbfdff;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-button {
  border: 1px solid #a7bfd2;
  border-radius: 999px;
  background: #f6fbff;
  color: #385067;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.26rem 0.7rem;
}

.chip-button:hover,
.chip-button:focus-visible {
  border-color: #7ea3c0;
  background: #e9f4ff;
}

.accordion-item {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.accordion-button {
  font-weight: 700;
  color: #2c3c48;
  background: #f7fbff;
}

.accordion-button:not(.collapsed) {
  color: #0a5f61;
  background: #e9f7f6;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}

.locker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.locker-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
  padding: 0.85rem;
}

.locker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.locker-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
}

.locker-reserved {
  border-radius: 999px;
  background: var(--brand-soft);
  color: #0a5657;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 0.22rem 0.58rem;
}

.locker-team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.locker-team-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #deebf5;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.42rem 0.5rem;
}

.locker-team-item .team-logo {
  width: 34px;
  height: 34px;
}

.locker-team-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2d3c49;
}

.locker-team-time {
  color: #4f6275;
  font-size: 0.78rem;
  font-weight: 600;
}

.locker-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

textarea.form-control {
  min-height: 280px;
  resize: vertical;
  font-family: "Consolas", "Courier New", monospace;
  border-radius: 14px;
}

.status-line {
  margin: 0;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #2f4659;
}

.status-line.is-error {
  color: var(--danger);
}

.status-line.is-success {
  color: var(--success);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

@media (max-width: 767px) {
  .card-shell {
    padding: 0.95rem;
  }

  .team-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-brand,
  .btn-outline-brand {
    width: 100%;
  }

  .locker-team-item {
    grid-template-columns: 32px 1fr;
    row-gap: 2px;
  }

  .locker-team-time {
    grid-column: 1 / -1;
    margin-left: 40px;
  }
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.language-control {
  min-width: 180px;
  max-width: 220px;
}

.language-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-strong);
}

.locker-team-list {
  min-height: 58px;
}

.locker-team-list.is-empty {
  border: 1px dashed #c6d7e6;
  border-radius: 10px;
  padding: 0.45rem;
  background: #fafdff;
}

.locker-team-list.is-empty::before {
  content: attr(data-empty-text);
  display: block;
  color: #617387;
  font-size: 0.84rem;
  font-weight: 600;
}

.locker-team-item {
  cursor: grab;
}

.locker-team-item:active {
  cursor: grabbing;
}

.locker-team-item.is-reserved {
  background: #f8fcff;
  border-style: dashed;
}

.locker-team-item.is-reserved .locker-team-time {
  color: #446684;
}

.locker-reserved-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid #d2e2f0;
  background: #ffffff;
  color: #3e6e92;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.locker-item-ghost {
  opacity: 0.45;
}

.locker-item-chosen {
  box-shadow: 0 8px 16px rgba(15, 58, 92, 0.2);
}

.locker-item-drag {
  transform: rotate(1deg);
}

@media (max-width: 767px) {
  .hero-top {
    flex-direction: column;
    align-items: stretch;
  }

  .language-control {
    max-width: 100%;
    width: 100%;
  }

  .locker-reserved-icon {
    width: 32px;
    height: 32px;
  }
}

/* Fine tuning: smaller language selector + reserved item wrapping */
.language-control {
  min-width: 120px;
  max-width: 150px;
}

.language-control .form-select {
  min-height: 34px;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
  font-size: 0.82rem;
  border-radius: 10px;
}

.language-label {
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
}

.locker-team-item {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.locker-team-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.locker-team-time {
  white-space: nowrap;
}

.locker-team-item.is-reserved {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
}

.locker-team-item.is-reserved .locker-team-name {
  line-height: 1.2;
}

.locker-team-item.is-reserved .locker-team-time {
  grid-column: 2;
  justify-self: start;
  white-space: normal;
  margin-top: 2px;
}

@media (max-width: 767px) {
  .language-control {
    width: min(180px, 100%);
  }

  .locker-team-item.is-reserved {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .locker-team-item.is-reserved .locker-team-time {
    grid-column: 2;
    margin-left: 0;
  }
}
