:root {
  --bg: #c9292e;
  --bg-dot: rgba(0, 0, 0, 0.18);
  --panel: #cfcfcf;
  --panel-soft: #ececec;
  --text: #101010;
  --black: #000000;
  --white: #ffffff;
  --accent: #7d446f;
  --accent-dark: #5f2f57;
  --success: #1f8e4d;
  --warning: #e7d23e;
  --shadow: 0 12px 0 rgba(0, 0, 0, 0.14);
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --container: calc(100vw - 24px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--white);
  background:
    radial-gradient(circle, var(--bg-dot) 1.3px, transparent 1.3px),
    linear-gradient(180deg, #d73238 0%, #c32228 100%);
  background-size: 14px 14px, auto;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.bg-stripe {
  position: absolute;
  top: -70px;
  width: 88px;
  border-radius: 999px;
  opacity: 0.95;
}

.stripe-a {
  left: -10px;
  height: 360px;
  transform: rotate(34deg);
  background: #0f6b60;
}

.stripe-b {
  left: 180px;
  height: 540px;
  transform: rotate(-34deg);
  background: #bfff00;
}

.stripe-c {
  left: 300px;
  height: 350px;
  width: 70px;
  transform: rotate(-18deg);
  background: #3a5dff;
}

.stripe-d {
  right: 280px;
  height: 520px;
  width: 92px;
  transform: rotate(36deg);
  background: #6200ff;
}

.stripe-e {
  right: 120px;
  height: 420px;
  width: 64px;
  transform: rotate(26deg);
  background: #ff6200;
}

.stripe-f {
  right: -6px;
  top: 120px;
  height: 250px;
  width: 44px;
  transform: rotate(54deg);
  background: #72fff0;
}

.cloud {
  position: absolute;
  bottom: -52px;
  height: 148px;
  width: 260px;
  border: 5px solid var(--black);
  border-radius: 999px;
  background: var(--white);
}

.cloud::before {
  content: "";
  position: absolute;
  bottom: 24px;
  height: 120px;
  width: 182px;
  border: 5px solid var(--black);
  border-radius: 999px;
  background: #d8d8d8;
}

.cloud-left {
  left: -30px;
}

.cloud-left::before {
  left: 42px;
}

.cloud-right {
  right: -30px;
}

.cloud-right::before {
  right: 42px;
}

.challenge-app {
  position: relative;
  z-index: 2;
  width: var(--container);
  margin: 0 auto;
  padding: 10px 0 28px;
}

.top-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 3px solid var(--white);
  border-radius: 8px;
  background: var(--white);
  color: #bf2b2b;
  text-decoration: none;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 420px);
  padding: 3px;
  border: 3px solid var(--white);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
}

.mode-button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}

.mode-button.is-active {
  background: var(--white);
  color: #bc262b;
}

.stage-title-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 8px auto 8px;
}

.pointer-badge {
  position: absolute;
  left: 130px;
  top: -18px;
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.18));
}

.stage-title {
  display: inline-flex;
  min-width: min(100%, 720px);
  justify-content: center;
  padding: 9px 18px;
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--shadow);
}

.subcopy {
  margin: 0 auto 18px;
  max-width: 900px;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
}

.guide-status {
  display: block;
  width: 100%;
  margin: 0 auto 18px;
  padding: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 800;
}

.board-panel {
  display: none;
}

.board-panel.is-active {
  display: block;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 22px;
}

.group-card {
  overflow: hidden;
  border: 2px solid var(--black);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, outline 0.18s ease;
}

.group-card__title {
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: var(--black);
  text-align: center;
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.group-card.is-current {
  transform: translateY(-1px);
  outline: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.14), var(--shadow);
}

.team-list,
.third-ranking {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-list {
  background: var(--panel);
}

.sortable-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.28);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.team-list .sortable-item:first-child,
.third-ranking .sortable-item:nth-child(-n + 2) {
  border-top: 0;
}

.team-list .sortable-item:hover,
.third-ranking .sortable-item:hover,
.team-list .sortable-item:focus-visible,
.third-ranking .sortable-item:focus-visible {
  background: rgba(255, 255, 255, 0.7);
  outline: 0;
}

.sortable-item.dragging {
  opacity: 0.45;
}

.sortable-item.drop-before {
  box-shadow: inset 0 4px 0 #111;
}

.sortable-item.drop-after {
  box-shadow: inset 0 -4px 0 #111;
}

.team-rank,
.third-rank {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.team-flag,
.third-flag {
  width: 23px;
  height: 17px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 3px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.82);
}

.team-name,
.third-name {
  font-size: 15px;
  font-weight: 600;
}

.third-place-section {
  margin: 26px auto 0;
  max-width: 1040px;
  padding: 16px 14px 0;
  border-radius: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, outline 0.18s ease;
}

.third-place-section:hover {
  cursor: pointer;
}

.third-place-section.is-current {
  transform: translateY(-2px);
  outline: 4px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.18);
}

.section-heading {
  margin-bottom: 10px;
  text-align: center;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-family: "Bebas Neue", sans-serif;
  font-size: 34px;
  letter-spacing: 0.06em;
}

.section-heading p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.third-ranking {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 2px solid var(--black);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.third-ranking .sortable-item {
  min-height: 52px;
  padding: 9px 12px;
}

.third-slot {
  position: relative;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(105, 205, 142, 0.12));
}

.third-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
}

.third-more-note {
  margin-top: 10px;
  text-align: center;
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 700;
}

.knockout-grid {
  position: relative;
  overflow: hidden;
  padding-bottom: 8px;
}

.bracket-shell {
  --board-scale: 1;
  --board-base-width: 1500px;
  --board-base-height: 580px;
  --board-height: 580px;
  --vertical-width: 112px;
  --vertical-slot-height: 48px;
  --horizontal-width: 220px;
  --horizontal-slot-width: 110px;
  --slot-height: 48px;
  position: relative;
  width: 100%;
  height: var(--board-height);
}

.bracket-board {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--board-base-width);
  height: var(--board-base-height);
  transform: translateX(-50%) scale(var(--board-scale));
  transform-origin: top center;
}

.bracket-board__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.bracket-board__lines path {
  fill: none;
  stroke: rgba(52, 10, 10, 0.72);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bracket-board__centerpiece {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
}

.bracket-champion {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 0 0 4px;
  border-radius: 0;
  background: none;
}

.bracket-champion__cup {
  font-size: 42px;
  line-height: 1;
}

.bracket-champion__label {
  margin-top: 4px;
  font-family: "Bebas Neue", sans-serif;
  font-size: 26px;
  letter-spacing: 0.06em;
  color: #ffe769;
  text-shadow:
    -1px 0 var(--black),
    0 1px var(--black),
    1px 0 var(--black),
    0 -1px var(--black);
}

.bracket-champion__prize {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 900;
  color: #ffe769;
  text-shadow:
    -1px 0 var(--black),
    0 1px var(--black),
    1px 0 var(--black),
    0 -1px var(--black);
}

.bracket-result--champion {
  margin-top: 6px;
  min-width: 124px;
}

.bracket-third-block {
  position: absolute;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
}

.bracket-third-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  color: var(--white);
  text-shadow:
    -1px 0 var(--black),
    0 1px var(--black),
    1px 0 var(--black),
    0 -1px var(--black);
}

.bracket-result--third {
  margin-top: 10px;
  min-width: 112px;
}

.bracket-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 50px;
  padding: 6px 8px;
  border: 1px solid rgba(0, 0, 0, 0.62);
  background: rgba(255, 255, 255, 0.99);
  box-shadow: none;
  color: var(--text);
}

.bracket-result__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.bracket-result__flag {
  width: 22px;
  height: 16px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 2px;
  object-fit: cover;
  background: var(--white);
}

.bracket-result__name {
  display: block;
  max-width: 102px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.bracket-match {
  position: absolute;
  border: 1px solid rgba(0, 0, 0, 0.62);
  background: rgba(255, 255, 255, 0.99);
  box-shadow: none;
  color: var(--text);
}

.bracket-match.is-playable {
  cursor: pointer;
}

.bracket-match.is-locked {
  opacity: 0.76;
}

.bracket-match--vertical {
  width: var(--vertical-width);
  display: grid;
  grid-template-rows: repeat(2, var(--vertical-slot-height));
}

.bracket-match--horizontal {
  width: var(--horizontal-width);
  display: grid;
  grid-template-columns: repeat(2, var(--horizontal-slot-width));
}

.bracket-match--final,
.bracket-match--third {
  border-width: 1px;
}

.bracket-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: var(--slot-height);
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.98);
}

.bracket-match--vertical .bracket-slot + .bracket-slot {
  border-top: 1px solid rgba(0, 0, 0, 0.24);
}

.bracket-match--horizontal .bracket-slot + .bracket-slot {
  border-left: 1px solid rgba(0, 0, 0, 0.24);
}

.bracket-slot.is-winner {
  background: #fff5c9;
}

.bracket-slot__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  text-align: center;
}

.bracket-slot__flag {
  width: 20px;
  height: 15px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 2px;
  object-fit: cover;
  background: var(--white);
}

.bracket-slot__name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
}

.bracket-slot__seed,
.bracket-slot__lock {
  font-size: 18px;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.5);
}

.bracket-match--r32 .bracket-slot__seed {
  font-size: 17px;
  color: rgba(0, 0, 0, 0.62);
}

.bracket-match--r16 .bracket-slot__lock,
.bracket-match--qf .bracket-slot__lock,
.bracket-match--sf .bracket-slot__lock,
.bracket-match--final .bracket-slot__lock,
.bracket-match--third .bracket-slot__lock {
  font-size: 22px;
}

.bracket-match:hover,
.bracket-match:focus-visible {
  filter: brightness(0.99);
  outline: none;
}

.guide-drag-label {
  margin-left: auto;
  color: rgba(0, 0, 0, 0.38);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.guide-item-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.guide-item-copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.guide-reorder-controls {
  display: inline-flex;
  gap: 6px;
}

.guide-reorder-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.guide-reorder-button:hover,
.guide-reorder-button:focus-visible {
  border-color: rgba(0, 0, 0, 0.42);
  background: #fff5c9;
  outline: none;
}

.guide-reorder-button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.72);
}

.bottom-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  padding-bottom: 30px;
}

.action-button {
  min-width: 168px;
  min-height: 42px;
  border-radius: 999px;
  border: 4px solid var(--black);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.action-button:hover,
.action-button:focus-visible {
  transform: translateY(-1px);
}

.random-button {
  background: var(--white);
  color: var(--black);
}

.next-button {
  border-color: var(--accent-dark);
  background: var(--accent);
  color: var(--white);
}

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

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.guide-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 8, 9, 0.72);
  backdrop-filter: blur(10px);
}

.guide-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 16px;
}

.guide-modal__burst {
  position: relative;
  width: min(1040px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px 24px 22px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(255, 213, 94, 0.16), transparent 28%),
    radial-gradient(circle at bottom left, rgba(53, 88, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 251, 241, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
  scrollbar-gutter: stable;
}

.guide-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: rgba(16, 16, 16, 0.82);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.guide-modal__step {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  width: fit-content;
  border-radius: 999px;
  background: rgba(188, 38, 43, 0.08);
  color: #bc262b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-modal__title {
  margin: 14px 0 8px;
  text-align: left;
  color: var(--text);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.02;
  font-weight: 900;
}

.guide-modal__copy {
  max-width: 760px;
  margin: 0 0 18px;
  text-align: left;
  color: rgba(0, 0, 0, 0.68);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

.guide-modal__body {
  width: 100%;
  min-width: 0;
}

.guide-preview-card {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.08);
}

.guide-preview-card__title {
  padding: 14px 18px;
  background: linear-gradient(135deg, #101010 0%, #2c2c2c 100%);
  text-align: left;
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-modal__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.guide-modal__layout--stack {
  grid-template-columns: 1fr;
}

.guide-modal__side {
  display: grid;
  gap: 14px;
}

.guide-side-card {
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

.guide-side-card__eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(188, 38, 43, 0.1);
  color: #bc262b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guide-side-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 900;
}

.guide-side-card p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.guide-side-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.guide-group-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(249, 249, 249, 0.86), rgba(239, 239, 239, 0.7));
}

.guide-group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 11px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  cursor: grab;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.guide-group-item:first-child {
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.guide-group-item .guide-preview-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-group-item.dragging {
  opacity: 0.45;
}

.guide-group-item.drop-before {
  box-shadow: inset 0 4px 0 #111;
}

.guide-group-item.drop-after {
  box-shadow: inset 0 -4px 0 #111;
}

.guide-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 11px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.68);
}

.guide-preview-row:first-child {
  border-top: 0;
}

.guide-preview-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--black);
  background: var(--white);
  font-size: 18px;
  font-weight: 900;
}

.guide-preview-flag {
  width: 27px;
  height: 20px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  object-fit: cover;
}

.guide-preview-name {
  font-size: 18px;
  font-weight: 700;
}

.guide-preview-note {
  margin-top: 16px;
  text-align: left;
  color: rgba(0, 0, 0, 0.68);
  font-size: 14px;
  font-weight: 700;
}

.guide-third-full {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.guide-third-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  cursor: grab;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.guide-third-item .team-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
}

.guide-third-item.dragging {
  opacity: 0.45;
}

.guide-third-item.is-qualified {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(164, 255, 192, 0.94));
}

.guide-third-item.is-eliminated {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(224, 224, 224, 0.92));
}

.guide-third-status {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.guide-modal__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.guide-action {
  min-width: 170px;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.guide-action--ghost {
  background: rgba(255, 255, 255, 0.92);
  color: var(--black);
}

.guide-action--primary {
  border-color: rgba(14, 35, 158, 0.22);
  background: linear-gradient(135deg, #3558ff 0%, #2447f0 100%);
  color: var(--white);
}

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

.knockout-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.knockout-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 6, 7, 0.74);
  backdrop-filter: blur(10px);
}

.knockout-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.knockout-modal__burst {
  position: relative;
  width: min(860px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px 24px 22px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(255, 213, 94, 0.18), transparent 30%),
    radial-gradient(circle at bottom left, rgba(53, 88, 255, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 249, 233, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow:
    0 34px 80px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
  scrollbar-gutter: stable;
}

.knockout-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: rgba(16, 16, 16, 0.82);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.knockout-modal__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(188, 38, 43, 0.08);
  color: #bc262b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.knockout-modal__title {
  margin: 14px 0 8px;
  text-align: center;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 0.96;
  font-weight: 900;
  color: var(--text);
}

.knockout-modal__copy {
  margin: 0 0 22px;
  text-align: center;
  color: rgba(0, 0, 0, 0.68);
  font-size: 15px;
  font-weight: 700;
}

.knockout-modal__body {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.knockout-source-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.knockout-source-action {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.knockout-source-action:hover,
.knockout-source-action:focus-visible {
  border-color: rgba(0, 0, 0, 0.42);
  background: #fff5c9;
  outline: none;
}

.knockout-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.knockout-pick__vs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-family: "Bebas Neue", sans-serif;
  font-size: 34px;
  letter-spacing: 0.06em;
  color: #bc262b;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.08);
}

.knockout-pick-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 220px;
  padding: 20px 18px 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.knockout-pick-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(14, 35, 158, 0.22);
  background: linear-gradient(180deg, #fffaf0 0%, #ffeab3 100%);
  box-shadow: 0 20px 34px rgba(26, 50, 196, 0.16);
}

.knockout-pick-card__badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #101010 0%, #2c2c2c 100%);
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.knockout-pick-card__flag {
  width: 92px;
  height: 68px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 20px;
  object-fit: cover;
  background: var(--white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.knockout-pick-card__name {
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.knockout-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.knockout-modal__cloud {
  display: none;
}

@media (max-width: 1100px) {
  .pointer-badge {
    left: 48px;
  }
}

@media (max-width: 760px) {
  .challenge-app {
    width: min(100vw - 10px, 100%);
    padding-top: 8px;
  }

  .bg-stripe {
    opacity: 0.82;
  }

  .stripe-a {
    left: -24px;
    top: -36px;
    width: 56px;
    height: 230px;
  }

  .stripe-b {
    left: 26px;
    top: -90px;
    width: 54px;
    height: 360px;
  }

  .stripe-c {
    left: 100px;
    top: -48px;
    width: 48px;
    height: 250px;
  }

  .stripe-d {
    right: 34px;
    top: -44px;
    width: 54px;
    height: 340px;
  }

  .stripe-e {
    right: -6px;
    top: 12px;
    width: 40px;
    height: 220px;
  }

  .stripe-f {
    right: -10px;
    top: 112px;
    width: 30px;
    height: 150px;
  }

  .top-controls {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .mode-switch {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    order: initial;
  }

  .icon-button {
    width: 32px;
    height: 32px;
    border-width: 2px;
    font-size: 17px;
  }

  .mode-button {
    min-height: 32px;
    font-size: 14px;
  }

  .stage-title-wrap {
    margin: 6px auto 8px;
  }

  .stage-title {
    min-width: 100%;
    padding: 7px 10px;
    font-size: 12px;
  }

  .pointer-badge {
    display: none;
  }

  .groups-grid,
  .third-ranking {
    grid-template-columns: 1fr;
  }

  .knockout-grid {
    padding-bottom: 2px;
  }

  .guide-third-full {
    grid-template-columns: 1fr;
  }

  .guide-modal__layout {
    grid-template-columns: 1fr;
  }

  .bottom-actions {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    margin-top: 8px;
    padding: 0 6px 18px;
  }

  .action-button {
    width: calc(50% - 5px);
    min-width: 0;
    max-width: none;
    min-height: 38px;
    border-width: 3px;
    font-size: 15px;
  }

  .cloud {
    bottom: -36px;
    width: 168px;
    height: 98px;
  }

  .cloud::before {
    bottom: 18px;
    width: 114px;
    height: 72px;
  }

  .cloud-left {
    left: -56px;
  }

  .cloud-right {
    right: -56px;
  }

  .bracket-shell.is-mobile .bracket-board__centerpiece {
    top: 2px;
  }

  .bracket-shell.is-mobile .bracket-champion {
    min-width: 124px;
    padding: 0 6px 2px;
    border-radius: 18px;
    background: none;
  }

  .bracket-shell.is-mobile .bracket-champion__cup {
    font-size: 24px;
  }

  .bracket-shell.is-mobile .bracket-champion__label {
    margin-top: 1px;
    font-size: 18px;
  }

  .bracket-shell.is-mobile .bracket-champion__prize {
    font-size: 9px;
  }

  .bracket-shell.is-mobile .bracket-result--champion {
    margin-top: 4px;
    min-width: 88px;
    min-height: 36px;
    padding: 3px 5px;
  }

  .bracket-shell.is-mobile .bracket-result__flag,
  .bracket-shell.is-mobile .bracket-slot__flag {
    width: 16px;
    height: 12px;
  }

  .bracket-shell.is-mobile .bracket-result__name,
  .bracket-shell.is-mobile .bracket-slot__name {
    font-size: 8px;
    line-height: 1.05;
  }

  .bracket-shell.is-mobile .bracket-slot {
    padding: 2px 3px;
  }

  .bracket-shell.is-mobile .bracket-slot__team {
    gap: 2px;
  }

  .bracket-shell.is-mobile .bracket-match {
    box-shadow: none;
  }

  .bracket-shell.is-mobile .bracket-third-label {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 10px;
    max-width: 126px;
  }

  .bracket-shell.is-mobile .bracket-result--third {
    margin-top: 6px;
    min-width: 88px;
    min-height: 36px;
    padding: 3px 5px;
  }

  .guide-modal__burst {
    padding: 20px 16px 18px;
    border-radius: 24px;
  }

  .guide-modal__close,
  .knockout-modal__close {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .guide-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .guide-drag-label {
    display: none;
  }

  .guide-item-tools {
    gap: 6px;
  }

  .guide-reorder-button {
    width: 34px;
    height: 34px;
  }

  .guide-action {
    width: 100%;
  }

  .knockout-modal__burst {
    padding: 20px 16px 18px;
    border-radius: 26px;
  }

  .knockout-pick {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .knockout-pick__vs {
    order: 2;
    width: 56px;
    height: 56px;
    margin: 0 auto;
    font-size: 28px;
    text-align: center;
  }

  .knockout-pick-card {
    min-height: 0;
    padding: 16px 14px;
    border-radius: 20px;
  }

  .knockout-pick-card__flag {
    width: 80px;
    height: 60px;
  }

  .knockout-pick-card__name {
    font-size: 18px;
  }

  .knockout-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .knockout-modal__cloud {
    display: none;
  }
}
