.duel-page { --duel-hot: #ff936a; --duel-green: #35e77b; --duel-red: #ff697c; }
.duel-page [hidden] { display: none !important; }
.duel-header { display: flex; justify-content: space-between; min-height: 59px; padding-block: 6px; }
.duel-back { color: var(--muted); font-size: 14px; font-weight: 730; text-align: right; }
.duel-main, .duel-footer { max-width: 1030px; }
.duel-main { padding-block: clamp(21px, 5vw, 54px) 0; }
.duel-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 24px; flex-wrap: wrap; margin-block-end: 19px; }
.duel-intro .tag { margin: 0 0 5px; }
.duel-intro h1 { margin: 0; font-size: clamp(36px, 7.5vw, 66px); line-height: 1; font-weight: 920; letter-spacing: -.055em; }
.duel-intro h1 span { color: var(--duel-hot); }
.duel-intro p:not(.tag) { margin: 6px 0 0; color: var(--muted); }
.duel-form {
  padding: clamp(10px, 2vw, 18px); border: 1px solid #3e3131; border-radius: 9px;
  background: linear-gradient(102deg, #251b1b, var(--panel) 42%); position: relative; z-index: 2;
}
.duel-form-players { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: clamp(5px, 2vw, 14px); align-items: end; }
.duel-picker, .duel-combobox { position: relative; min-width: 0; }
.duel-picker label { display: block; margin-block-end: 4px; color: #f0dcd6; font-size: 14px; font-weight: 750; }
.duel-picker :is(input, select), .duel-share input {
  min-width: 0; width: 100%; min-height: 46px; padding: 8px 10px; border: 1px solid #54434a;
  border-radius: 5px; background: #111114; color: var(--ink); font: inherit;
}
.duel-picker input::placeholder { color: var(--muted); }
.duel-picker input[aria-invalid="true"] { border-color: var(--duel-red); }
.duel-form-vs { align-self: end; margin-block-end: 13px; font-size: 13px; color: var(--duel-hot); font-weight: 900; }
.duel-form-actions { display: flex; justify-content: flex-end; margin-block-start: 10px; }
.duel-primary, .duel-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px;
  border: 1px solid var(--duel-hot); border-radius: 5px; padding: 7px 13px;
  color: #23130f; background: var(--duel-hot); font: 790 14px/1.2 system-ui, sans-serif; cursor: pointer;
}
.duel-primary:hover { background: #ffb198; }
.duel-secondary { color: #ffd0b9; background: #292028; border-color: #694d43; }
.duel-secondary:hover { background: #39272a; }
.duel-share { position: relative; min-width: 0; }
.duel-share input { display: block; margin-block-start: 6px; }
.duel-copy-status { font-size: 13px; }
.duel-copy-status:empty { display: none; }
.duel-choices {
  position: absolute; z-index: 3; inset: calc(100% + 4px) 0 auto; max-height: min(240px, 38vh); overflow: auto;
  overscroll-behavior: contain; list-style: none; padding: 3px; margin: 0; border: 1px solid #65504b;
  border-radius: 6px; background: #211e23; box-shadow: 0 12px 27px #000a;
}
.duel-choices li { min-height: 44px; padding: 6px 7px; cursor: pointer; line-height: 1.16; overflow-wrap: anywhere; font-size: 14px; }
.duel-choices li+li { border-block-start: 1px solid var(--line); }
.duel-choices li:is(:hover, [aria-selected="true"]) { color: #fff; background: #4a2e2d; }
.duel-choices small { display: block; margin-top: 3px; font-size: 12px; color: #efae96; }
.duel-search-note { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.duel-error, .duel-empty, .duel-disclaimer { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.duel-error { color: #ffb6be; }
.duel-empty { border: 1px solid var(--line); border-radius: 7px; padding: 12px 14px; }
.duel-results { margin-block-start: 17px; }
.duel-matchup { border: 1px solid #4d3937; border-radius: 9px; background: var(--panel); overflow: hidden; }
.duel-stats { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.duel-metric-col { width: clamp(71px, 20vw, 162px); }
.duel-stats :is(th, td) { text-align: center; overflow-wrap: anywhere; }
.duel-side { background: radial-gradient(ellipse at 50% 30%, #44302e, #1d191e 62%); vertical-align: top; }
.duel-side-right { background: radial-gradient(ellipse at 50% 30%, #2d364a, #191b23 62%); }
.duel-side.is-favorite { background: radial-gradient(ellipse at 51% 23%, #634032, #2e211e 62%); box-shadow: inset 0 3px var(--duel-hot); }
.duel-player-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 5px 9px; color: var(--ink); }
.duel-player-card:focus-visible { outline-offset: -3px; }
.duel-portrait { position: relative; display: grid; place-items: center; width: clamp(58px, 15vw, 126px); aspect-ratio: 1; border: 1px solid #885945; border-radius: 8px; color: #fff0eb; background: repeating-linear-gradient(130deg, #ff8a5a10 0 9px, transparent 9px 14px), #342522; overflow: hidden; }
.duel-side-right:not(.is-favorite) .duel-portrait { background: repeating-linear-gradient(130deg, #93b1ff17 0 9px, transparent 9px 14px), #2b354c; border-color: #596686; }
.duel-portrait img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.duel-portrait span { font-size: clamp(26px, 6vw, 58px); font-weight: 910; line-height: 1; letter-spacing: -.06em; }
.duel-player-name { display: block; font-size: clamp(15px, 3vw, 30px); font-weight: 860; line-height: 1.08; letter-spacing: -.025em; overflow-wrap: anywhere; }
.duel-favorite-tag { padding: 1px 5px; border-radius: 3px; background: var(--duel-hot); color: #24130c; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.duel-favorite-placeholder { visibility: hidden; }
.duel-vs { background: #151317; color: #ffb297; font-weight: 940; font-size: clamp(18px, 4vw, 43px); font-style: italic; letter-spacing: -.07em; }
.duel-stats tbody tr { border-block-start: 1px solid var(--line); }
.duel-stats tbody th { padding: 8px 2px; color: var(--muted); background: #16161b; font-size: clamp(11px, 2.3vw, 15px); font-weight: 680; line-height: 1.15; }
.duel-stats tbody td { padding: 6px 4px; font-size: clamp(16px, 4vw, 26px); font-weight: 820; line-height: 1.19; }
.duel-win { color: var(--duel-green); }
.duel-loss { color: var(--duel-red); }
.duel-unavailable, .duel-no-trophy { color: var(--muted); }
.duel-level { display: inline-block; padding: 3px 7px; border: 1px solid color-mix(in srgb, var(--rank-tone) 58%, #251a21); border-radius: 4px; color: var(--rank-tone); background: #231d23; font-size: .85em; }
.duel-stats tbody .duel-trophy-row td { padding: 8px 5px; font-size: clamp(12px, 2vw, 14px); font-weight: 580; }
.duel-trophy-rail { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.duel-trophy-rail li { min-width: 0; }
.duel-trophy { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid #534038; border-radius: 4px; padding: 3px; color: #ffd391; background: #2e2423; }
.duel-trophy img, .duel-trophy svg { flex: none; object-fit: contain; }
.duel-trophy span { font-size: 12px; line-height: 1.18; }
.duel-trophy .duel-club-trophy { width: 48px; max-width: 100%; height: auto; aspect-ratio: 1; }
.duel-trophy .duel-trophy-level { display: inline-block; padding: 1px 4px; margin: 2px 0 1px; border: 1px solid color-mix(in srgb, var(--rank-tone) 60%, #2e2423); border-radius: 3px; color: var(--rank-tone); background: #20171a; font-size: 10px; font-weight: 800; }
.duel-trophy-evidence { font-size: 10px; line-height: 1.2; color: #c9b6a9; }
.duel-trophy:hover, .duel-trophy:focus-visible { color: #fff1cc; background: #473123; }
.duel-prediction {
  display: flex; align-items: flex-start; gap: 10px; margin-block-start: 12px; padding: clamp(10px, 2vw, 17px);
  border: 1px solid #67453b; border-radius: 7px; background: linear-gradient(121deg, #30211f, var(--panel) 55%);
}
.duel-prediction-icon { display: grid; place-items: center; flex: 0 0 31px; height: 31px; border: 1px solid #825341; border-radius: 4px; color: #ffbc9e; background: #412b26; }
.duel-prediction h2 { margin: 2px 0 4px; font-size: clamp(19px, 4vw, 29px); line-height: 1.16; letter-spacing: -.024em; }
.duel-prediction p { margin: 0; color: #e0d4d3; }
.duel-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 400px) {
  .duel-form-players { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 7px; }
  .duel-form-vs { display: none; }
  .duel-form-actions, .duel-primary { width: 100%; }
  .duel-side .duel-player-card { min-height: 122px; }
}

.duel-result-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 5px 11px; }
.duel-change {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #ffd0b9;
  text-decoration: underline;
  text-decoration-color: #986957;
  text-underline-offset: .18em;
  font-size: 14px;
  font-weight: 750;
}
.duel-results + .duel-form { margin-block-start: 17px; scroll-margin-block-start: 12px; }
.duel-header-links { display: flex; justify-content: flex-end; gap: 4px min(4vw, 15px); flex-wrap: wrap; }

/* Keep mobile choices in the form flow, away from the next field and button. */
@media (max-width: 650px) {
  .duel-form-players { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 7px; }
  .duel-form-vs { display: none; }
  .duel-choices { position: relative; inset: auto; margin-top: 4px; box-shadow: none; }
}
