@import url("../../../assets/conversion-workbench.css");

:root {
  --tool-accent: #2563eb;
  --tool-accent-strong: #1d4ed8;
  --tool-accent-soft: #eaf2ff;
}

.tool-card-soft {
  border: 1px solid var(--tool-border);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 16px 34px rgba(34, 64, 122, 0.08);
  padding: 20px;
}

.scoreboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: start;
}

.scoreboard-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid #e2ebf6;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.scoreboard-controls,
.scoreboard-stage-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.scoreboard-controls .converter-heading,
.scoreboard-stage-card .converter-heading,
.scoreboard-rounds-wrap .converter-subheading {
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.scoreboard-controls .converter-heading > span:first-child,
.scoreboard-stage-card .converter-heading > span:first-child,
.scoreboard-rounds-wrap .converter-subheading > span:first-child {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--tool-accent-soft);
  color: var(--tool-accent-strong);
  font-size: 15px;
  font-weight: 700;
}

.scoreboard-controls .converter-note,
.scoreboard-stage-card .converter-note,
.scoreboard-rounds-wrap .converter-note {
  max-width: 560px;
  line-height: 1.6;
}

.field-stack {
  display: grid;
  gap: 8px;
}

.field-stack span {
  font-size: 14px;
  color: #475569;
}

.field-wide {
  grid-column: span 2;
}

.scoreboard-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--tool-border);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 14px;
}

.scoreboard-input:focus,
.scoreboard-form .converter-select:focus {
  outline: none;
  border-color: #b7caf0;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.scoreboard-form .converter-select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border-radius: 12px;
}

.scoreboard-switches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid #e2ebf6;
  border-radius: 20px;
  background: #f8fbff;
}

.scoreboard-stage {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid #dde6f3;
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 8%, rgba(59, 130, 246, 0.32), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(56, 189, 248, 0.18), transparent 24%),
    linear-gradient(145deg, #0f172a 0%, #16233d 46%, #1f2937 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 40px rgba(15, 23, 42, 0.28),
    0 24px 54px rgba(15, 23, 42, 0.18);
}

.scoreboard-stage::before,
.scoreboard-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.scoreboard-stage::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.36), transparent 82%);
  opacity: 0.16;
}

.scoreboard-stage::after {
  inset: auto -12% -26% auto;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 68%);
}

.scoreboard-controls .converter-toggle {
  min-height: 54px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
}

.scoreboard-controls .converter-toggle span {
  line-height: 1.5;
}

.scoreboard-controls .converter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2px;
}

.scoreboard-controls .converter-actions button {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 600;
}

.scoreboard-controls .converter-status {
  margin-top: 2px;
  padding-left: 2px;
}

.scoreboard-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.scoreboard-header > div:first-child {
  display: grid;
  gap: 14px;
}

.scoreboard-chip,
.scoreboard-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.scoreboard-chip {
  width: fit-content;
  padding: 0 16px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(37, 99, 235, 0.16);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.28);
}

.scoreboard-chip,
.scoreboard-chip * {
  color: #ffffff !important;
}

.scoreboard-header h2 {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  padding: 16px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.94) 100%);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  color: #132238;
  font-size: clamp(28px, 4.6vw, 52px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.scoreboard-step-badge {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.28);
}

.scoreboard-step-badge,
.scoreboard-step-badge * {
  color: #ffffff !important;
}

.scoreboard-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-top: 30px;
}

.score-team {
  position: relative;
  display: grid;
  gap: 20px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(51, 65, 85, 0.9) 0%, rgba(30, 41, 59, 0.84) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -12px 22px rgba(15, 23, 42, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.score-team.is-leading {
  border-color: rgba(96, 165, 250, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 20px 46px rgba(37, 99, 235, 0.2),
    0 0 0 1px rgba(96, 165, 250, 0.18);
  transform: translateY(-2px);
}

.score-team__head {
  display: grid;
  gap: 6px;
  text-align: center;
}

.team-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(191, 219, 254, 0.78);
  text-transform: uppercase;
}

.score-team__head strong {
  color: #f8fbff;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

.score-value {
  min-height: 228px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(100, 116, 139, 0.72) 0%, rgba(71, 85, 105, 0.82) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 28px rgba(15, 23, 42, 0.12);
  color: #fff;
  font-size: clamp(84px, 11vw, 144px);
  line-height: 1;
  font-weight: 800;
  text-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.score-value:hover {
  transform: translateY(-2px);
  border-color: rgba(147, 197, 253, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 18px 40px rgba(15, 23, 42, 0.2);
}

.scoreboard-stage[data-led="on"] .score-value {
  font-family: "Consolas", "Courier New", monospace;
  letter-spacing: 0.08em;
  color: #e8f0ff;
  text-shadow: 0 0 14px rgba(96, 165, 250, 0.36);
}

.score-minus {
  justify-self: center;
  min-width: 124px;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.42);
  color: #dbeafe;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.scoreboard-versus {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 168px;
  border-radius: 32px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    radial-gradient(circle at 50% 22%, rgba(96, 165, 250, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(51, 65, 85, 0.76) 0%, rgba(30, 41, 59, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: clamp(46px, 5vw, 74px);
  font-weight: 700;
  color: rgba(226, 232, 240, 0.82);
  letter-spacing: 0.06em;
}

.scoreboard-versus::before,
.scoreboard-versus::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.48), rgba(148, 163, 184, 0));
  transform: translateX(-50%);
}

.scoreboard-versus::before {
  top: -38px;
  height: 28px;
}

.scoreboard-versus::after {
  bottom: -38px;
  height: 28px;
}

.scoreboard-rounds-wrap {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.scoreboard-rounds-wrap .converter-subheading > span:first-child {
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.scoreboard-rounds-wrap .converter-note {
  color: rgba(191, 219, 254, 0.58);
}

.scoreboard-rounds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.scoreboard-rounds.is-empty {
  display: none;
}

.mini-round-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.mini-round-card span,
.mini-round-card small {
  color: rgba(226, 232, 240, 0.72);
  font-size: 12px;
}

.mini-round-card strong {
  font-size: 22px;
  font-weight: 700;
  color: #f8fbff;
}

.scoreboard-meta {
  margin-top: 0;
}

.scoreboard-meta .converter-stat {
  background: #fff;
}

:fullscreen.scoreboard-stage {
  min-height: 100vh;
  padding: 28px;
  border-radius: 0;
  overflow: auto;
}

:fullscreen.scoreboard-stage .scoreboard-rounds {
  padding-bottom: 12px;
}

:fullscreen.scoreboard-stage .scoreboard-header {
  position: sticky;
  top: 0;
  padding-bottom: 16px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.82) 72%, rgba(15, 23, 42, 0) 100%);
  backdrop-filter: blur(4px);
}

:fullscreen.scoreboard-stage .scoreboard-main {
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .scoreboard-grid {
    grid-template-columns: 1fr;
  }

  .scoreboard-switches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scoreboard-main {
    grid-template-columns: 1fr;
  }

  .scoreboard-versus {
    min-height: 84px;
  }

  :fullscreen.scoreboard-stage .scoreboard-rounds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .scoreboard-form,
  .scoreboard-switches,
  .scoreboard-controls .converter-actions,
  .scoreboard-rounds,
  .converter-meta.scoreboard-meta {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: span 1;
  }

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

  .scoreboard-controls,
  .scoreboard-stage-card,
  .scoreboard-stage {
    padding: 20px;
  }

  .score-value {
    min-height: 132px;
    font-size: 68px;
  }

  :fullscreen.scoreboard-stage {
    padding: 18px;
  }

  :fullscreen.scoreboard-stage .scoreboard-rounds {
    grid-template-columns: 1fr;
  }
}
