/* Duel sheet, duel bar and duel start button. Colours come from the custom properties of style.css :root. */

.duel-bar {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; min-width: 0;
  padding: 8px 10px; border-radius: 14px; background: var(--surface); color: var(--text);
  box-shadow: 0 4px 12px var(--shadow); font-size: 14px; font-weight: 700;
}
.duel-bar[hidden], .duel-bar [hidden] { display: none !important; }
.duel-bar-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.duel-bar-title { font-weight: 900; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-status { min-height: 1.2em; color: var(--accent); font-weight: 900; font-variant-numeric: tabular-nums; }
.duel-row { display: grid; grid-template-columns: minmax(44px, auto) minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.duel-row-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.duel-track { position: relative; height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.duel-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: var(--accent); transition: width 120ms linear; }
.duel-row + .duel-row .duel-fill { background: var(--ghost); }
.duel-row-num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.duel-danger { color: var(--danger); font-size: 13px; min-height: 1em; }
.duel-live-box { display: flex; flex-direction: column; gap: 4px; }
.duel-bar-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.duel-bar-head .duel-bar-title { flex: 1 1 auto; min-width: 0; }
.duel-emotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.duel-emote, .duel-mute, .duel-leave {
  min-height: 32px; min-width: 0; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface2); color: var(--text); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
}
.duel-emote { min-height: 32px; padding: 2px 4px; font-size: 12px; line-height: 1.15; }
.duel-mute, .duel-leave { min-height: 34px; padding: 4px 10px; flex: none; }
.duel-emote:focus-visible, .duel-mute:focus-visible, .duel-leave:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.duel-live-more { display: flex; align-items: center; gap: 8px; min-width: 0; }
.duel-mute[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.duel-emote-line { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.duel-leave { color: var(--danger); }
.duel-jar { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.duel-jar-cv { display: block; width: 80px; height: 116px; border-radius: 10px; background: var(--surface2); }
.duel-cap { font-size: 11px; color: var(--muted); max-width: 80px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-height: 500px) {
  .duel-emote, .duel-mute, .duel-leave { font-size: 12px; }
  .duel-jar-cv { width: 64px; height: 92px; }
  .duel-cap { max-width: 64px; }
}
@media (min-width: 900px) and (min-aspect-ratio: 5/4) and (min-height: 520px) {
  .duel-jar-cv { width: 96px; height: 138px; }
  .duel-cap { max-width: 96px; }
  .duel-bar { font-size: 15px; }
  .duel-emote { min-height: 34px; font-size: 13px; }
  .duel-bar-head { flex-wrap: wrap; }
  .duel-bar-head .duel-bar-title { flex: 1 1 100%; white-space: normal; }
  .duel-bar-head .duel-mute { margin-left: auto; }
}

#duelCard { text-align: left; }
#duelCard .duel-h { margin: 4px 0 8px; font-size: 26px; font-weight: 900; line-height: 1.15; }
#duelCard .duel-h3 { margin: 16px 0 6px; font-size: 17px; font-weight: 900; }
#duelCard .duel-text { margin: 6px 0; color: var(--muted); font-size: 15px; font-weight: 700; line-height: 1.35; }
#duelCard .duel-round { margin: 4px 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
#duelCard .duel-link { margin: 8px 0; padding: 8px; border-radius: 10px; background: var(--surface2); font-size: 12px; font-weight: 700; word-break: break-all; user-select: all; }
#duelCard .duel-msg { min-height: 1.3em; margin: 8px 0 0; color: var(--accent); font-size: 14px; font-weight: 800; }
#duelCard .btn { min-height: 44px; min-width: 44px; margin: 6px 6px 0 0; }
#duelCard .duel-modes { border: 0; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#duelCard .duel-opt {
  display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
}
#duelCard .duel-opt input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
#duelCard .duel-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#duelCard .duel-opt-text strong { font-size: 16px; font-weight: 900; }
#duelCard .duel-rule { color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.3; }
#duelCard .duel-select { display: block; width: 100%; min-height: 44px; margin: 6px 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 700; }
#duelCard .duel-join { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
#duelCard .duel-code {
  width: 7em; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 18px; font-weight: 900; letter-spacing: 0.15em; text-transform: uppercase;
}
#duelCard .duel-hist { margin: 4px 0; padding-left: 18px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
#duelCard .duel-seats { margin: 8px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
#duelCard .duel-seat { min-height: 44px; display: flex; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; }
#duelCard .btn { white-space: nowrap; max-width: 100%; }
#duelCard .duel-quick { margin: 4px 0 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface2); }
#duelCard .duel-quick .duel-modes { margin: 6px 0 0; }
#duelCard .duel-wait { margin: 8px 0 2px; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--text); }
#duelCard .duel-online { margin: 2px 0 6px; font-size: 14px; }
#duelCard .duel-offer { margin: 8px 0; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); }
#duelCard .duel-offer .duel-text { margin-top: 0; }
/* the fallback button: smaller than the main actions and set clearly below the explanation (still a 44px touch target) */
#duelCard .duel-offer .btn { margin-top: 22px; margin-bottom: 4px; font-size: 15px; padding: 8px 16px; min-height: 44px; width: auto; }
@media (max-width: 380px) {
  #duelCard .btn { font-size: 14px; padding-left: 12px; padding-right: 12px; }
}
