#defis .duels-page {
  display: grid;
  gap: 15px;
  max-width: 1180px;
  margin: 0 auto;
}

#defis .duels-page-hero {
  padding: 29px 32px;
  border: 1px solid rgba(120, 166, 226, .15);
  border-radius: 27px;
  background:
    radial-gradient(ellipse at 90% 12%, rgba(67, 113, 205, .23), transparent 38%),
    linear-gradient(130deg, rgba(29, 39, 71, .92), rgba(13, 20, 37, .98) 67%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .2);
}

#defis .duels-hero-head {
  align-items: center;
}

#defis .duels-hero-kicker,
#defis .duels-section-kicker {
  color: #a9c8ff;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .13em;
}

#defis .duels-title {
  margin: 8px 0 0;
  color: #f7f9ff;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

#defis .duels-subtitle {
  max-width: 650px;
  margin-top: 10px;
  color: rgba(224, 231, 249, .68);
  font-size: .93rem;
  line-height: 1.55;
}

#defis .duels-hero-mark {
  display: grid;
  place-items: center;
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(160, 186, 246, .2);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(102, 133, 220, .24), rgba(37, 54, 99, .35));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 12px 30px rgba(0, 0, 0, .2);
  font-size: 2rem;
  transform: rotate(4deg);
}

#defis .duels-grid {
  margin-top: 0 !important;
  grid-template-columns: minmax(0, 1fr);
}

#defis .duels-card {
  min-width: 0;
  padding: 22px !important;
  border: 1px solid rgba(149, 174, 224, .12) !important;
  border-radius: 24px !important;
  background: linear-gradient(155deg, rgba(23, 30, 53, .97), rgba(13, 19, 35, .98)) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18) !important;
}

#defis .duels-create-card {
  background:
    radial-gradient(ellipse at 100% 0, rgba(80, 110, 193, .1), transparent 43%),
    linear-gradient(155deg, rgba(23, 30, 53, .97), rgba(13, 19, 35, .98)) !important;
}

#defis .duels-card-head {
  align-items: center;
  margin-bottom: 15px;
}

#defis .duels-card-head h3 {
  margin: 5px 0 0;
  color: #f7f9ff;
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: -.03em;
}

#defis .duels-card-sub {
  max-width: 620px;
  color: rgba(219, 228, 247, .55);
  font-size: .79rem;
  line-height: 1.45;
}

#defis .duels-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 12px;
  margin-top: 17px;
  padding: 15px;
  border: 1px solid rgba(148, 174, 220, .1);
  border-radius: 18px;
  background: rgba(255, 255, 255, .022);
}

#defis .duels-form label {
  min-width: 0;
  gap: 7px;
}

#defis .duels-form > label:nth-of-type(2),
#defis .duels-form > button {
  grid-column: 1 / -1;
}

#defis .duels-form > label span {
  color: rgba(226, 235, 251, .79);
  font-size: .76rem;
  font-weight: 800;
}

#defis .duels-form input:not([type="checkbox"]),
#defis .duels-form select {
  min-height: 48px;
  border: 1px solid rgba(158, 180, 221, .14);
  border-radius: 13px;
  background-color: rgba(5, 11, 24, .62);
  color: #f5f7ff;
  box-shadow: none;
  font-size: .86rem;
}

#defis .duels-form label > small {
  color: rgba(216, 228, 248, .5);
  font-size: .7rem;
  line-height: 1.4;
}

#defis .duel-opponent-field {
  display: grid;
  min-width: 0;
  grid-column: 1 / -1;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

#defis .duel-opponent-field legend {
  padding: 0;
  color: rgba(226, 235, 251, .79);
  font-size: .76rem;
  font-weight: 800;
}

#defis .duel-opponent-field > small {
  color: rgba(216, 228, 248, .5);
  font-size: .7rem;
  line-height: 1.4;
}

#defis .duel-opponent-search {
  position: relative;
  display: block;
}

#defis .duel-opponent-search > span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  color: rgba(204, 218, 248, .55);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1;
  transform: translateY(-55%);
  pointer-events: none;
}

#defis .duel-opponent-search input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px 9px 39px;
  border: 1px solid rgba(158, 180, 221, .14);
  border-radius: 12px;
  background: rgba(5, 11, 24, .48);
  color: #f5f7ff;
  font-size: .8rem;
}

#defis .duel-opponent-search input::placeholder {
  color: rgba(209, 219, 241, .38);
}

#defis .duel-opponent-search input:focus {
  border-color: rgba(137, 166, 255, .58);
  box-shadow: 0 0 0 3px rgba(100, 131, 226, .13);
  outline: none;
}

#defis .duel-opponent-selected {
  display: grid;
  min-height: 54px;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(126, 157, 255, .25);
  border-radius: 12px;
  background: rgba(91, 120, 224, .09);
  color: #dce5ff;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#defis .duel-opponent-selected.has-selection {
  border-color: rgba(126, 157, 255, .32);
  background: linear-gradient(135deg, rgba(91, 120, 224, .13), rgba(91, 120, 224, .045));
}

#defis .duel-opponent-selected__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

#defis .duel-opponent-selected__head strong {
  color: #e3eaff;
  font-size: .74rem;
}

#defis .duel-opponent-selected__head > span,
#defis .duel-opponent-selected__empty {
  color: rgba(216, 228, 248, .48);
  font-size: .67rem;
}

#defis .duel-opponent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#defis .duel-opponent-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 11px;
  border: 1px solid rgba(147, 172, 255, .22);
  border-radius: 999px;
  background: rgba(120, 150, 246, .13);
  color: #e5ecff;
  font: inherit;
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
}

#defis .duel-opponent-chip > span {
  color: rgba(225, 233, 255, .65);
  font-size: 1rem;
  line-height: 1;
}

#defis .duel-opponent-chip:active {
  background: rgba(120, 150, 246, .24);
  transform: scale(.98);
}

#defis .duel-opponent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding: 1px 3px 3px 1px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#defis .duel-opponent-list:empty {
  display: none;
}

#defis .duel-opponent-no-results {
  grid-column: 1 / -1;
  padding: 12px;
  color: rgba(216, 228, 248, .5);
  font-size: .75rem;
  text-align: center;
}

#defis .duel-opponent-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 11px;
  padding: 9px 38px 9px 11px;
  border: 1px solid rgba(158, 180, 221, .11);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .042), rgba(255, 255, 255, .018));
  color: rgba(239, 243, 255, .88);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
  -webkit-tap-highlight-color: transparent;
}

#defis .duel-opponent-option:has(input:checked) {
  border-color: rgba(126, 157, 255, .48);
  background: linear-gradient(145deg, rgba(91, 120, 224, .2), rgba(91, 120, 224, .08));
  box-shadow: inset 0 0 0 1px rgba(126, 157, 255, .08);
}

#defis .duel-opponent-option[hidden] {
  display: none;
}

#defis .duel-opponent-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#defis .duel-opponent-avatar {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(177, 195, 255, .17);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(112, 141, 231, .24), rgba(64, 83, 147, .21));
  color: #dbe5ff;
  font-size: .79rem;
  font-weight: 850;
  text-transform: uppercase;
}

#defis .duel-opponent-name {
  min-width: 0;
  color: rgba(242, 245, 255, .9);
  font-size: .78rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

#defis .duel-opponent-check {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(183, 198, 232, .24);
  border-radius: 7px;
  color: transparent;
  font-size: .72rem;
  font-weight: 900;
  transform: translateY(-50%);
}

#defis .duel-opponent-option:has(input:checked) .duel-opponent-check {
  border-color: #829eff;
  background: #6c88e4;
  color: white;
  box-shadow: 0 3px 10px rgba(61, 84, 175, .32);
}

#defis .duel-opponent-option:focus-within {
  outline: 2px solid rgba(137, 166, 255, .68);
  outline-offset: 2px;
}

#defis .duels-rules {
  display: grid;
  gap: 6px;
  margin-top: 13px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 174, 220, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .022);
  color: rgba(220, 230, 249, .64);
  font-size: .75rem;
  line-height: 1.5;
}

#defis .duels-rules strong {
  color: #eaf0ff;
  font-size: .78rem;
}

#defis .duels-form input::placeholder {
  color: rgba(209, 219, 241, .33);
}

#defis .duels-form input:focus,
#defis .duels-form select:focus {
  border-color: rgba(137, 166, 255, .58);
  box-shadow: 0 0 0 3px rgba(100, 131, 226, .13);
}

#defis .duels-form > button {
  min-height: 49px;
  border-radius: 13px;
  background: linear-gradient(135deg, #557fe8, #405fc2);
  box-shadow: 0 10px 23px rgba(55, 81, 177, .22);
  font-weight: 850;
}

#defis .duels-list-card {
  margin-top: 0 !important;
}

#defis .duels-block {
  margin-top: 14px;
}

#defis .duel-list-toolbar {
  gap: 11px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(156, 178, 220, .1);
}

#defis .duel-filter-chips {
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

#defis .duel-filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  border-color: rgba(164, 183, 225, .14);
  background: rgba(255, 255, 255, .035);
  color: rgba(222, 231, 250, .69);
  font-size: .7rem;
  font-weight: 800;
}

#defis .duel-filter-chip.is-active {
  border-color: rgba(126, 157, 255, .4);
  background: rgba(91, 120, 224, .2);
  color: #dce5ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

#defis .duel-pager {
  gap: 8px;
}

#defis .duel-pager__meta {
  color: rgba(212, 224, 247, .52);
  font-size: .73rem;
}

#defis .duel-pager .btn {
  min-height: 34px;
  border-radius: 10px;
  font-size: .7rem;
}

#defis .duel-list {
  gap: 10px;
}

#defis .duel-item {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(151, 173, 217, .12);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .015));
  box-shadow: none;
  transition: border-color .18s ease, background .18s ease;
}

#defis .duel-item:focus-within,
#defis .duel-item:hover {
  border-color: rgba(128, 157, 241, .24);
  background: linear-gradient(145deg, rgba(83, 106, 183, .08), rgba(255, 255, 255, .018));
}

#defis .duel-item__title {
  color: #f6f8ff;
  font-size: 1rem;
  letter-spacing: -.015em;
}

#defis .duel-item__meta {
  color: rgba(216, 226, 246, .49);
  font-size: .73rem;
}

#defis .duel-item__line {
  grid-template-columns: minmax(74px, .25fr) minmax(0, 1fr);
  gap: 9px;
  color: rgba(220, 230, 249, .65);
  font-size: .78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#defis .duel-item__line strong {
  color: rgba(234, 240, 255, .82);
  font-size: .72rem;
}

#defis .duel-status {
  padding: 6px 9px;
  font-size: .68rem;
}

#defis .duel-actions {
  gap: 8px;
}

#defis .duel-actions .btn {
  min-height: 41px;
  padding-inline: 13px;
  border-radius: 11px;
  font-size: .76rem;
  font-weight: 800;
}

#defis .duel-score-grid {
  gap: 10px;
}

#defis .duel-score-col {
  min-width: 0;
  padding: 13px;
  border-color: rgba(153, 176, 222, .12);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
}

#defis .duel-score-col.is-me {
  border-color: rgba(112, 151, 255, .25);
  background: linear-gradient(145deg, rgba(82, 112, 204, .11), rgba(255, 255, 255, .02));
}

#defis .duel-score-col__head {
  color: #f5f7ff;
  font-size: .86rem;
}

#defis .duel-score-col__state,
#defis .duel-score-col label span {
  color: rgba(216, 228, 250, .52);
  font-size: .69rem;
}

#defis .duel-score-col__inputs {
  grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
  gap: 8px;
}

#defis .duel-score-col input {
  min-height: 42px;
  border-color: rgba(154, 176, 222, .13);
  border-radius: 11px;
  background: rgba(5, 11, 24, .6);
  font-variant-numeric: tabular-nums;
}

#defis .duel-score-note {
  border-color: rgba(145, 169, 218, .11);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  color: rgba(216, 228, 248, .56);
  font-size: .73rem;
  line-height: 1.45;
}

#defis .duel-score-reviews {
  display: grid;
  gap: 8px;
}

#defis .duel-score-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(145, 169, 218, .11);
  border-radius: 12px;
  color: rgba(220, 230, 249, .7);
  font-size: .73rem;
}

#defis .duel-score-review .btn {
  min-height: 34px;
  flex: 0 0 auto;
}

#defis .duel-elo {
  color: #b9caff;
  font-size: .8rem;
  white-space: nowrap;
}

#defis .duel-empty {
  padding: 17px;
  border-color: rgba(152, 174, 219, .17);
  border-radius: 16px;
  background: rgba(255, 255, 255, .022);
  color: rgba(218, 229, 248, .59);
  font-size: .81rem;
}

@media (max-width: 760px) {
  #defis .duels-page {
    gap: 11px;
  }

  #defis .duels-page-hero {
    padding: 20px 18px;
    border-radius: 22px;
  }

  #defis .duels-hero-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  #defis .duels-hero-head > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  #defis .duels-title {
    font-size: 1.75rem;
  }

  #defis .duels-subtitle {
    margin-top: 8px;
    font-size: .82rem;
    line-height: 1.48;
  }

  #defis .duels-hero-mark {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
    border-radius: 17px;
    font-size: 1.45rem;
  }

  #defis .duels-grid {
    gap: 10px;
  }

  #defis .duels-card {
    padding: 15px !important;
    border-radius: 20px !important;
  }

  #defis .duels-card-head {
    gap: 8px;
  }

  #defis .duels-card-head h3 {
    font-size: 1.1rem;
  }

  #defis .duels-card-sub {
    font-size: .72rem;
  }

  #defis .duels-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    margin-top: 13px;
    padding: 12px;
    border-radius: 15px;
  }

  #defis .duels-form > label:nth-of-type(2),
  #defis .duels-form > button {
    grid-column: auto;
  }

  #defis .duels-form input:not([type="checkbox"]),
  #defis .duels-form select {
    min-height: 46px;
  }

  #defis .duel-opponent-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: 270px;
  }

  #defis .duel-opponent-option {
    min-height: 56px;
  }

  #defis .duel-opponent-selected__head > span {
    font-size: .62rem;
  }

  #defis .duels-form > button {
    width: 100%;
    min-height: 47px;
  }

  #defis .duels-list-card {
    margin-top: 0 !important;
  }

  #defis .duel-filter-chips {
    margin-inline: -2px;
    padding-inline: 2px;
  }

  #defis .duel-pager {
    justify-content: space-between;
  }

  #defis .duel-pager__meta {
    flex: 1 1 100%;
  }

  #defis .duel-pager .btn {
    flex: 1;
  }

  #defis .duel-item {
    padding: 13px;
    border-radius: 16px;
  }

  #defis .duel-item__head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }

  #defis .duel-item__head > div:first-child {
    min-width: 0;
    flex: 1;
  }

  #defis .duel-item__title {
    font-size: .9rem;
    line-height: 1.35;
  }

  #defis .duel-item__line {
    grid-template-columns: 1fr;
    gap: 3px;
    margin-top: 7px;
    font-size: .74rem;
  }

  #defis .duel-actions {
    flex-wrap: nowrap;
  }

  #defis .duel-actions .btn {
    flex: 1;
    min-width: 0;
    padding-inline: 8px;
    font-size: .71rem;
  }

  #defis .duel-score-grid {
    grid-template-columns: 1fr;
  }

  #defis .duel-score-review {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #defis .duel-score-review .btn {
    flex: 1 1 auto;
  }

  #defis .duel-score-col__inputs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #defis .duel-leaderboard__row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  #defis .duel-rank {
    font-size: 1.05rem;
  }

  #defis .duel-player {
    min-width: 0;
  }

  #defis .duel-player strong {
    overflow-wrap: anywhere;
  }

  #defis .duel-player span {
    font-size: .7rem;
  }

  #defis .duel-winrate {
    grid-column: auto;
    justify-self: end;
    font-size: .75rem;
  }
}

@media (max-width: 380px) {
  #defis .duels-page-hero {
    padding: 17px 15px;
  }

  #defis .duels-title {
    font-size: 1.55rem;
  }

  #defis .duels-hero-mark {
    flex-basis: 45px;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    font-size: 1.2rem;
  }

  #defis .duels-card {
    padding: 13px !important;
  }

  #defis .duel-status {
    padding: 5px 7px;
    font-size: .61rem;
  }
}
