.duel-lobby, .duel-info-page {
  --lobby-line: var(--line);
  --lobby-muted: var(--muted);
  --lobby-gold: var(--gold);
  --lobby-panel: var(--panel);
}
.duel-lobby {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  color: var(--ink);
  padding: 0 0 28px;
}
.duel-lobby-main { min-width: 0; }
.lobby-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 390px); align-items: center; gap: 24px; margin: 1px 0 26px; }
.lobby-title { margin: 0; color: var(--ink); font: 400 clamp(36px, 4vw, 48px)/1.08 var(--serif, Georgia, serif); letter-spacing: -.035em; }
.lobby-subtitle { margin: 7px 0 0; color: var(--lobby-muted); font: 15px/1.5 var(--sans, Arial, sans-serif); }
.lobby-rating-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 12px; padding: 13px 17px; border: 1px solid var(--lobby-line); border-radius: 10px; background: var(--lobby-panel); }
.lobby-rail-title { display: flex; align-items: center; gap: 7px; color: var(--lobby-muted); font: 13px var(--sans, Arial, sans-serif); }
.lobby-rail-title svg { color: var(--lobby-gold); }
.lobby-rating-value { grid-column: 1; color: var(--ink); font: 400 30px/1 var(--serif, Georgia, serif); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; letter-spacing: -.02em; }
.lobby-rating-stats { display: flex; grid-column: 2; grid-row: 1 / span 2; align-items: center; gap: 14px; color: var(--lobby-muted); font: 12px var(--sans, Arial, sans-serif); }
.lobby-resume-match { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -10px 0 18px; padding: 10px 13px; border-left: 2px solid var(--lobby-gold); background: color-mix(in srgb, var(--lobby-panel) 75%, transparent); color: var(--muted); font: 13px var(--sans, Arial, sans-serif); }
.lobby-section { min-width: 0; }
.lobby-section-title { margin: 0; color: var(--ink); font: 400 20px/1.2 var(--serif, Georgia, serif); }
.lobby-mode-section { margin-top: 0; }
.lobby-mode-section > .lobby-section-title { margin-bottom: 11px; }
.lobby-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lobby-mode-card { position: relative; display: flex; min-width: 0; min-height: 112px; align-items: center; gap: 14px; padding: 16px 46px 16px 16px; color: var(--ink); text-align: left; border: 1px solid var(--lobby-line); border-radius: 10px; background: var(--lobby-panel); cursor: pointer; transition: border-color .16s, background-color .16s; }
.lobby-mode-card:hover { border-color: color-mix(in srgb, var(--lobby-gold) 55%, var(--lobby-line)); }
.lobby-mode-card.is-selected { border: 1.5px solid var(--lobby-gold); background: color-mix(in srgb, var(--lobby-panel) 84%, var(--lobby-gold)); }
.lobby-mode-check { position: absolute; top: 14px; right: 14px; display: grid; width: 22px; height: 22px; place-items: center; color: transparent; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 12px; font-weight: 700; }
.lobby-mode-card.is-selected .lobby-mode-check { color: var(--on-accent); border-color: var(--lobby-gold); background: var(--lobby-gold); }
.lobby-mode-title { display: flex; min-width: 0; align-items: center; gap: 11px; }
.lobby-mode-title svg { flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; color: var(--lobby-gold); border: 1px solid var(--line-strong); border-radius: 50%; }
.lobby-mode-card.is-selected .lobby-mode-title svg { border-color: var(--accent-border); }
.lobby-mode-title strong { color: var(--ink); font: 400 18px/1.2 var(--serif, Georgia, serif); }
.lobby-mode-copy p { margin: 5px 0 0 55px; color: var(--lobby-muted); font: 13px/1.4 var(--sans, Arial, sans-serif); }
.lobby-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lobby-topic-section { margin-top: 25px; }
.lobby-topic-count { color: var(--lobby-muted); font: 12px var(--sans, Arial, sans-serif); }
.lobby-topic-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; gap: 10px; margin-top: 11px; }
.lobby-topic-card { position: relative; min-width: 0; overflow: hidden; padding: 0; color: var(--ink); text-align: left; border: 1px solid var(--lobby-line); border-radius: 10px; background: var(--lobby-panel); cursor: pointer; transition: border-color .16s; }
.lobby-topic-card:hover { border-color: var(--accent-border); }
.lobby-topic-card.is-selected { border: 2px solid var(--lobby-gold); }
.lobby-topic-card.is-featured { display: grid; width: 100%; min-height: 120px; grid-column: 1 / -1; grid-template-columns: minmax(180px, 28%) minmax(0, 1fr); }
.lobby-topic-image { position: relative; height: 104px; background-color: var(--accent-surface); background-position: center; background-size: cover; }
.lobby-topic-card.is-featured .lobby-topic-image { height: 100%; min-height: 120px; }
.lobby-topic-card.is-featured .lobby-topic-copy { align-content: center; gap: 7px; padding: 17px 20px; }
.lobby-topic-card.is-featured .lobby-topic-copy strong { font-size: 20px; white-space: normal; }
.lobby-topic-card.is-featured .lobby-topic-copy > span { font-size: 13px; }
.lobby-topic-check { position: absolute; top: 8px; right: 8px; display: grid; width: 22px; height: 22px; place-items: center; color: transparent; border: 1px solid var(--muted); border-radius: 50%; background: color-mix(in srgb, var(--ground) 52%, transparent); font-size: 12px; font-weight: 700; }
.lobby-topic-card.is-selected .lobby-topic-check { color: var(--on-accent); border-color: var(--lobby-gold); background: var(--lobby-gold); }
.lobby-topic-copy { display: grid; gap: 5px; padding: 10px 11px 11px; }
.lobby-topic-copy strong { overflow: hidden; color: var(--ink); font: 400 16px/1.2 var(--serif, Georgia, serif); text-overflow: ellipsis; white-space: nowrap; }
.lobby-topic-copy > .lobby-topic-period { min-height: 18px; overflow: hidden; color: var(--lobby-muted); font: 12px/1.4 var(--sans, Arial, sans-serif); text-overflow: ellipsis; white-space: nowrap; }
.lobby-topic-description { margin: 4px 0 0; color: var(--muted); font: 13px/1.45 var(--sans, Arial, sans-serif); }
.lobby-topic-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--lobby-gold); }
.lobby-topic-meta svg { flex: 0 0 auto; }
.lobby-topic-meta small { color: var(--lobby-muted); font: 12px var(--sans, Arial, sans-serif); }
.lobby-topic-empty { display: grid; min-height: 100px; grid-column: 1 / -1; align-content: center; gap: 7px; padding: 18px; border: 1px dashed var(--lobby-line); border-radius: 10px; color: var(--lobby-muted); }
.lobby-topic-empty strong { color: var(--ink); font: 400 17px var(--serif, Georgia, serif); }
.lobby-topic-empty span { font-size: 13px; }
.lobby-results-reset { justify-self:start; min-height:40px; margin-top:5px; padding:6px 12px; border:1px solid var(--lobby-line); border-radius:6px; color:var(--ink); background:transparent; font:14px var(--sans); }
.lobby-results-reset:hover { border-color:var(--lobby-gold); background:color-mix(in srgb, var(--ink) 3%, transparent); }
.lobby-controls { margin-top: 18px; padding: 0; border: 0; background: transparent; }
.lobby-controls-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.lobby-kicker { color: var(--gold); font: 13px var(--sans, Arial, sans-serif); }
.lobby-settings-summary { color: var(--lobby-muted); font: 12px var(--sans, Arial, sans-serif); }
.lobby-selectors { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.2fr); align-items: end; gap: 10px; }
.lobby-control { display: grid; min-width: 0; gap: 5px; }
.lobby-control-label { display: block; color: var(--muted); font: 13px var(--sans, Arial, sans-serif); }
.lobby-select, .lobby-advanced-summary { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: space-between; gap: 8px; padding: 0 11px; color: var(--ink); border: 1px solid var(--lobby-line); border-radius: 8px; background: var(--lobby-panel); font: 14px var(--sans, Arial, sans-serif); }
.lobby-select { color-scheme:dark; appearance:none; padding-right:38px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%23A1B0BE' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 13px center; }
.lobby-advanced { position: relative; min-width: 0; }
.lobby-advanced-summary { list-style: none; cursor: pointer; }
.lobby-advanced-summary::-webkit-details-marker { display: none; }
.lobby-advanced-summary::after { content: "⌄"; color: var(--lobby-muted); font-size: 15px; }
.lobby-format-selection { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.lobby-format-panel { position: absolute; z-index: 6; top: calc(100% + 7px); right: 0; width: min(440px, calc(100vw - 38px)); padding: 14px; border: 1px solid var(--lobby-line); border-radius: 9px; background: var(--lobby-panel); box-shadow: 0 12px 36px #0008; }
.lobby-format-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 12px; }
.lobby-format-choice { display: flex; align-items: center; gap: 7px; color: var(--muted); font: 12px/1.4 var(--sans, Arial, sans-serif); cursor: pointer; }
.lobby-format-choice input { flex: 0 0 auto; accent-color: var(--lobby-gold); }
.lobby-controls-note { margin: 8px 0 0; color: var(--lobby-muted); font: 12px/1.45 var(--sans, Arial, sans-serif); }
.lobby-action-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 18px; margin-top: 18px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--lobby-gold) 36%, var(--lobby-line)); border-radius: 10px; background: color-mix(in srgb, var(--lobby-panel) 82%, var(--lobby-gold)); }
.lobby-action-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 13px var(--sans, Arial, sans-serif); }
.lobby-primary-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.lobby-main-cta { display: inline-flex; min-height: 48px; min-width: 230px; align-items: center; justify-content: center; gap: 10px; padding: 0 22px; color: var(--on-accent); border: 1px solid var(--lobby-gold); border-radius: 8px; background: var(--gold-soft); font: 600 15px var(--sans, Arial, sans-serif); cursor: pointer; transition: filter .16s; }
.lobby-main-cta:hover:not(:disabled) { filter: brightness(1.06); }
.lobby-main-cta:disabled { cursor: not-allowed; opacity: .48; }
.lobby-main-cta svg { width: 20px; height: 20px; }
.lobby-action-caption { color: var(--lobby-muted); font: 12px var(--sans, Arial, sans-serif); }
.lobby-queue-copy { display: grid; gap: 3px; min-width: 0; }
.lobby-queue-meta { color: var(--lobby-muted); font: 12px/1.4 var(--sans, Arial, sans-serif); font-variant-numeric: tabular-nums; }
.lobby-join-form { display: flex; grid-column: 1 / -1; align-items: center; flex-wrap: wrap; gap: 9px; padding-top: 10px; border-top: 1px solid var(--lobby-line); }
.lobby-join-form .lobby-control-label { margin-right: auto; }
.lobby-join-note { flex-basis: 100%; color: var(--lobby-muted); font: 12px/1.4 var(--sans, Arial, sans-serif); }
.lobby-join-error { flex-basis: 100%; margin: 0; color: var(--red); font: 12px/1.4 var(--sans, Arial, sans-serif); }
.lobby-join-error:empty { display: none; }
.lobby-code-input[aria-invalid="true"] { border-color: color-mix(in srgb, var(--red) 62%, var(--lobby-line)); }
/* Visually hidden but still read by screen readers (no shared utility existed in web/*.css). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); border: 0; white-space: nowrap; }
.lobby-code-input { width: 170px; min-height: 38px; padding: 0 11px; color: var(--ink); border: 1px solid var(--lobby-line); border-radius: 7px; background: var(--panel-raised); font: 13px var(--sans, Arial, sans-serif); }
.lobby-code-input::placeholder { color: var(--lobby-muted); opacity: 1; }
.lobby-join-button, .lobby-cancel-queue { min-height: 38px; padding: 0 14px; color: var(--lobby-gold); border: 1px solid var(--accent-border); border-radius: 7px; background: transparent; font: 12px var(--sans, Arial, sans-serif); cursor: pointer; }
.lobby-join-button:hover, .lobby-cancel-queue:hover { background: color-mix(in srgb, var(--lobby-gold) 12%, transparent); }
.lobby-join-button:disabled, .lobby-code-input:disabled { cursor: not-allowed; opacity: .48; }
.lobby-cancel-queue { grid-column: 2; justify-self: end; margin-top: -4px; }
.lobby-rail-link { padding: 0; color: var(--lobby-gold); border: 0; background: none; font: 12px var(--sans, Arial, sans-serif); cursor: pointer; }
.lobby-rail-link:hover { color: var(--gold-soft); }
.lobby-rail-card:not(.lobby-rating-card), .lobby-last-match, .lobby-opponents-card { display: none; }
.duel-lobby :focus-visible { outline: 2px solid var(--lobby-gold); outline-offset: 3px; }

@media (max-width: 900px) {
  .lobby-intro { grid-template-columns: minmax(0, 1fr) minmax(240px, 310px); gap: 16px; }
  .lobby-topic-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lobby-topic-card.is-featured { grid-column: 1 / -1; }
  .lobby-mode-grid { gap: 8px; }
  .lobby-mode-card { padding-left: 12px; }
  .lobby-mode-title { gap: 9px; }
  .lobby-mode-title svg { flex-basis: 38px; width: 38px; height: 38px; padding: 8px; }
  .lobby-mode-title strong { font-size: 16px; }
  .lobby-mode-copy p { margin-left: 47px; font-size: 12px; }
}
@media (max-width: 640px) {
  .lobby-intro { grid-template-columns: 1fr; gap: 15px; margin-bottom: 22px; }
  .lobby-title { font-size: clamp(34px, 10vw, 44px); }
  .lobby-mode-grid { grid-template-columns: 1fr; }
  .lobby-mode-card { min-height: 86px; }
  .lobby-mode-copy p { max-width: 320px; }
  .lobby-topic-row { display: flex; overflow-x: auto; padding: 1px 1px 7px; scrollbar-width: thin; }
  .lobby-topic-card { flex: 0 0 190px; }
  .lobby-topic-card.is-featured { display: grid; min-height: 0; flex: 1 0 100%; grid-template-columns: 1fr; }
  .lobby-topic-card.is-featured .lobby-topic-image { height: 150px; min-height: 150px; }
  .lobby-topic-card.is-featured .lobby-topic-copy { padding: 14px; }
  .lobby-controls-heading { align-items: baseline; }
  .lobby-selectors { grid-template-columns: 1fr; }
  .lobby-action-panel { grid-template-columns: 1fr; gap: 10px; }
  .lobby-primary-actions { justify-content: stretch; }
  .lobby-main-cta { width: 100%; }
  .lobby-action-caption { width: 100%; text-align: center; }
  .lobby-join-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .lobby-join-form .lobby-control-label, .lobby-join-note { grid-column: 1 / -1; }
  .lobby-code-input { width: 100%; }
  .lobby-cancel-queue { grid-column: auto; justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .lobby-mode-card, .lobby-topic-card, .lobby-main-cta { transition: none; }
}

/* Primary duel lobby reference: clear topic discovery and a persistent selection bar. */
.duel-lobby { padding:0 0 24px; }
.lobby-intro { display:block; margin:0 0 20px; }
.lobby-title { font-size:clamp(42px,4vw,56px); letter-spacing:-.025em; }
.lobby-subtitle { margin-top:4px; font-size:17px; }
.lobby-mode-section { margin:0; }
.lobby-mode-grid { gap:14px; }
.lobby-mode-card { display:grid; grid-template-columns:58px minmax(0,1fr); min-height:108px; padding:14px 20px; gap:16px; border-radius:11px; }
.lobby-mode-check { display:none; }
.lobby-mode-icon { display:grid; width:58px; height:58px; place-items:center; color:var(--lobby-gold); border-radius:50%; background:var(--accent-surface); }
.lobby-mode-icon svg { width:26px; height:26px; }
.lobby-mode-copy { display:grid; min-width:0; align-content:center; gap:5px; }
.lobby-mode-title-text { color:var(--ink); font:400 20px/1.2 var(--serif, Georgia, serif); }
.lobby-mode-copy p { margin:0; color:var(--lobby-muted); font:14px/1.4 var(--sans, Arial, sans-serif); }
.lobby-mode-card.is-selected { border-width:1px; background:linear-gradient(110deg,var(--accent-surface),var(--panel-raised)); }
.lobby-mode-card.is-selected .lobby-mode-icon { color:var(--gold); background:var(--accent-surface); }
.lobby-finder { margin-top:24px; }
.lobby-search-row { display:grid; grid-template-columns:minmax(0,1fr) 180px; gap:16px; }
.lobby-search { display:flex; min-width:0; min-height:54px; align-items:center; gap:15px; padding:0 17px; color:var(--muted); border:1px solid var(--line); border-radius:11px; background:var(--panel); }
.lobby-search svg { flex:0 0 auto; }
.lobby-search input { width:100%; min-width:0; border:0; outline:0; color:var(--ink); background:transparent; font:15px var(--sans); }
.lobby-search input::placeholder { color:var(--muted); opacity:1; }
.lobby-filter-button { display:flex; min-height:54px; align-items:center; justify-content:center; gap:12px; color:var(--ink); border:1px solid var(--line); border-radius:11px; background:var(--panel); font:14px var(--sans); cursor:pointer; }
.lobby-filter-button svg:first-of-type { color:var(--gold-soft); }
.lobby-filter-button svg { flex:0 0 auto; }
.lobby-filter-button svg:last-child { margin-left:6px; }
.lobby-filter-button:hover,.lobby-search:focus-within { border-color:var(--accent-border); }
.lobby-search:focus-within { box-shadow:0 0 0 2px color-mix(in srgb, var(--lobby-gold) 55%, transparent); }
.lobby-filter-panel { display:grid; grid-template-columns:repeat(2,minmax(180px,260px)); gap:12px; margin-top:10px; padding:14px; border:1px solid var(--lobby-line); border-radius:10px; background:var(--panel); }
.lobby-filter-field { display:grid; gap:7px; color:var(--lobby-muted); font:12px var(--sans); }
.lobby-quick-filters { display:flex; flex-wrap:wrap; gap:6px; overflow:visible; padding:13px 0 2px; }
.lobby-filter-chip { flex:none; min-height:37px; padding:0 12px; color:var(--muted); border:1px solid var(--line); border-radius:20px; background:transparent; font:13px var(--sans); white-space:nowrap; cursor:pointer; }
.lobby-filter-chip:hover:not(:disabled),.lobby-filter-chip.is-active { color:var(--gold-soft); border-color:var(--accent-border); background:var(--accent-surface); }
.lobby-filter-chip:disabled { color:var(--muted); border-color:var(--line); cursor:not-allowed; opacity:.7; }
.lobby-topic-section { margin-top:24px; }
.lobby-section-head { align-items:center; }
.lobby-recommendation-tabs { display:flex; overflow:hidden; border:1px solid var(--line); border-radius:24px; background:var(--panel); }
.lobby-recommendation-tab { min-height:42px; padding:0 23px; color:var(--muted); border:0; border-radius:22px; background:transparent; font:14px var(--sans); cursor:pointer; }
.lobby-recommendation-tab.is-active { color:var(--gold-soft); border:1px solid var(--accent-border); background:var(--accent-surface); }
.lobby-all-topics { display:inline-flex; align-items:center; gap:10px; padding:8px 2px; color:var(--gold); border:0; background:transparent; font:14px var(--sans); cursor:pointer; }
.lobby-all-topics:hover { color:var(--gold-soft); }
.lobby-topic-row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 18px; margin-top:12px; }
.lobby-topic-card { display:grid; grid-template-columns:158px minmax(0,1fr); height:80px; min-height:80px; align-items:stretch; border-radius:10px; background:var(--panel); }
.lobby-topic-card.is-selected { border-width:1px; background:linear-gradient(105deg,var(--accent-surface),var(--panel-raised) 75%); }
.lobby-topic-image { height:78px; min-height:78px; overflow:hidden; background:var(--panel-raised); }
.lobby-topic-image img { display:block; width:100%; height:78px; min-height:78px; object-fit:cover; }
.lobby-topic-image.is-empty { display:grid; place-items:center; color:color-mix(in srgb, var(--gold) 52%, var(--panel-raised)); background:radial-gradient(120% 90% at 30% 20%, color-mix(in srgb, var(--gold) 7%, var(--panel-raised)), var(--panel)); }
.lobby-topic-initial { font:400 44px/1 var(--serif); }
.lobby-topic-image.is-empty svg { width:26px; height:26px; }
.lobby-topic-copy { position:relative; display:grid; min-width:0; align-content:center; gap:4px; height:78px; padding:8px 52px 8px 16px; }
.lobby-topic-copy strong,.lobby-topic-copy > .lobby-topic-period { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lobby-topic-copy strong { font-size:18px; }
.lobby-topic-copy > .lobby-topic-period { min-height:0; font-size:13px; }
.lobby-topic-check { top:50%; right:15px; width:32px; height:32px; transform:translateY(-50%); color:var(--muted); border-color:var(--line-strong); border-radius:50%; background:transparent; font-size:18px; font-weight:400; }
.lobby-topic-card.is-selected .lobby-topic-check { color:var(--on-accent); border-color:var(--gold); background:var(--gold); font-size:16px; }
.lobby-topic-empty { grid-column:1/-1; min-height:116px; }
.lobby-controls { margin-top:18px; padding:0; border:0; background:transparent; }
.lobby-controls-summary { width:max-content; color:var(--lobby-muted); cursor:pointer; font-size:13px; }
.lobby-selectors { max-width:640px; margin-top:12px; }
.lobby-action-panel { position:sticky; bottom:10px; z-index:15; grid-template-columns:minmax(0,1fr) auto; gap:12px 20px; margin:24px -12px 0; padding:16px 22px; border-color:var(--line); border-radius:12px; background:color-mix(in srgb,var(--panel) 97%,transparent); box-shadow:0 12px 32px #0008; backdrop-filter:blur(16px); }
.lobby-action-status { min-width:0; flex-wrap:wrap; gap:12px; }
.lobby-action-status > strong { color:var(--ink); font:500 16px var(--sans); white-space:nowrap; }
.lobby-selected-chips { display:flex; min-width:0; flex-wrap:wrap; gap:8px; }
.lobby-selected-chip { display:inline-flex; max-width:210px; min-height:40px; align-items:center; gap:12px; padding:0 12px; color:var(--ink); border:1px solid var(--accent-border); border-radius:8px; background:var(--accent-surface); font:13px var(--sans); cursor:pointer; }
.lobby-selected-chip span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lobby-selected-chip span:last-child { color:var(--gold-soft); font-size:18px; }
.lobby-clear-selection { padding:8px 2px; color:var(--gold); border:0; background:transparent; font:13px var(--sans); text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.lobby-selection-hint { color:var(--lobby-muted); font-size:13px; }
.lobby-primary-actions { align-items:center; }
.lobby-main-cta { min-width:260px; min-height:58px; border-radius:10px; background:var(--gold); font-size:16px; }
.lobby-main-cta:disabled { opacity:.55; }
.lobby-action-caption { max-width:240px; text-align:right; line-height:1.4; }
.lobby-action-status.is-searching { grid-column:1; }
.lobby-join-form { grid-column:1/-1; }
.duel-lobby :focus-visible { outline:2px solid var(--gold-soft); outline-offset:3px; }

@media(min-width:1101px) and (max-width:1320px) {
  .lobby-filter-chip { min-height:35px; padding:0 8px; font-size:12px; }
}

@media(min-width:1321px) {
  .lobby-quick-filters { gap:4px; }
  .lobby-filter-chip { padding-inline:10px; }
}

@media(max-width:1100px) {
  .lobby-mode-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .lobby-mode-card { grid-template-columns:46px minmax(0,1fr); padding:12px; gap:12px; }
  .lobby-mode-icon { width:46px; height:46px; }
  .lobby-mode-icon svg { width:22px; height:22px; }
  .lobby-mode-title-text { font-size:18px; }
  .lobby-mode-copy p { font-size:13px; }
  .lobby-topic-row { gap:9px; }
  .lobby-topic-card { grid-template-columns:120px minmax(0,1fr); }
  .lobby-action-panel { margin-right:0; margin-left:0; }
}
@media(max-width:760px) {
  .lobby-title { font-size:42px; }
  .lobby-subtitle { font-size:15px; }
  .lobby-mode-grid { grid-template-columns:1fr; gap:8px; }
  .lobby-mode-card { grid-template-columns:46px minmax(0,1fr); min-height:82px; padding:10px 14px; gap:12px; }
  .lobby-mode-icon { width:46px; height:46px; }
  .lobby-mode-title-text { font-size:18px; }
  .lobby-mode-copy p { font-size:13px; }
  .lobby-search-row { grid-template-columns:minmax(0,1fr) 52px; gap:8px; }
  .lobby-search { min-height:48px; padding:0 12px; }
  .lobby-search input { font-size:13px; }
  .lobby-filter-button { min-height:48px; gap:0; font-size:0; }
  .lobby-filter-button svg { flex:0 0 auto; }
  .lobby-filter-panel { grid-template-columns:1fr; }
  .lobby-filter-chip { min-height:34px; padding:0 13px; font-size:12px; }
  .lobby-section-head { align-items:flex-start; }
  .lobby-recommendation-tabs { max-width:calc(100% - 72px); }
  .lobby-recommendation-tab { min-height:38px; padding:0 12px; font-size:12px; }
  .lobby-all-topics { font-size:12px; white-space:nowrap; }
  .lobby-topic-row { display:grid; grid-template-columns:1fr; gap:8px; overflow:visible; padding:0; }
  .lobby-topic-card { flex:none; grid-template-columns:100px minmax(0,1fr); height:74px; min-height:74px; }
  .lobby-topic-image,.lobby-topic-image img { height:72px; min-height:72px; }
  .lobby-topic-copy { height:72px; }
  .lobby-topic-copy { padding:10px 46px 10px 12px; }
  .lobby-topic-copy strong { font-size:16px; }
  .lobby-topic-copy > .lobby-topic-period { font-size:12px; }
  .lobby-topic-check { right:10px; width:28px; height:28px; }
  .lobby-action-panel { grid-template-columns:1fr; gap:12px; margin:18px 0 0; padding:14px; }
  .duel-lobby .lobby-action-panel { position:static; bottom:auto; }
  .lobby-action-status { align-items:flex-start; flex-direction:column; gap:9px; }
  .lobby-primary-actions { justify-content:stretch; }
  .lobby-main-cta { width:100%; min-height:52px; }
  .lobby-action-caption { max-width:none; text-align:left; }
}
@media(max-height:820px) {
  .duel-lobby .lobby-action-panel { position:static; bottom:auto; margin:18px 0 8px; }
}

.duel-info-page { min-width: 0; padding-bottom: 34px; color: var(--ink); }
.duel-info-intro { margin: 0 0 24px; }
.duel-info-intro .lobby-title { font-size: clamp(42px, 4vw, 56px); }
.duel-info-intro .lobby-subtitle { max-width: 68ch; }
.duel-leader-tabs {
  display: flex;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--lobby-line, var(--line));
  border-radius: 11px;
  background: var(--panel);
  scrollbar-width: thin;
}
.duel-leader-tab {
  flex: 1 0 auto;
  min-height: 42px;
  padding: 0 18px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: 14px var(--sans, Arial, sans-serif);
}
.duel-leader-tab.is-active { color: var(--gold-soft); border-color: var(--accent-border); background: var(--accent-surface); }
.duel-leader-tab.is-unavailable { cursor:not-allowed; color:var(--muted); }
.duel-leader-results { min-width: 0; }
.duel-leader-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
  margin: 32px 0 20px;
}
.duel-podium-player {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 230px;
  padding: 22px 12px 20px;
  border: 1px solid var(--lobby-line, var(--line));
  border-radius: 11px;
  background: linear-gradient(150deg, var(--panel), var(--panel));
  text-align: center;
}
.duel-podium-player.is-first { min-height: 254px; border-color: var(--accent-border); background: linear-gradient(150deg, var(--accent-surface), var(--panel)); }
.duel-podium-player.is-current-player, .duel-leader-row.is-current-player { outline: 1px solid var(--gold); outline-offset: -2px; }
.duel-podium-rank { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.duel-podium-portrait { position:relative; display:grid; width:136px; height:140px; align-items:center; justify-items:center; color:var(--gold); }
.duel-podium-portrait.is-rank-2 { color:var(--muted); }
.duel-podium-portrait.is-rank-3 { color:var(--gold); }
.duel-podium-wreath { position:absolute; inset:0; width:136px; height:136px; stroke-width:.9; }
.duel-podium-crown { position:absolute; z-index:2; top:-12px; width:26px; height:26px; fill:currentColor; stroke-width:1; }
.duel-podium-medal { position:absolute; z-index:2; bottom:0; display:grid; width:34px; height:34px; place-items:center; border:1px solid currentColor; border-radius:50%; background:var(--gold); color:var(--on-accent); font:24px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.is-rank-2 .duel-podium-medal { background:#b1bfc1; }
.is-rank-3 .duel-podium-medal { background:var(--gold); }
.duel-podium-player.is-first .duel-podium-rank { color: var(--gold-soft); }
.duel-podium-avatar { width: 94px; height: 94px; overflow: hidden; border: 2px solid var(--accent-border); border-radius: 50%; }
.duel-podium-player.is-first .duel-podium-avatar { width: 104px; height: 104px; border-color: var(--accent-border); }
.duel-podium-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.duel-podium-name { max-width: 100%; overflow-wrap: anywhere; color: var(--ink); font: 400 18px/1.2 var(--serif, Georgia, serif); }
.duel-podium-rating { color: var(--gold-soft); font: 400 24px/1 var(--serif, Georgia, serif); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.duel-leader-table-wrap { overflow-x: auto; border: 1px solid var(--lobby-line, var(--line)); border-radius: 10px; background: var(--panel); }
.duel-leader-table { width: 100%; border-collapse: collapse; font: 14px var(--sans, Arial, sans-serif); }
.duel-leader-table th { padding: 12px 14px; color: var(--lobby-muted, var(--muted)); border-bottom: 1px solid var(--lobby-line, var(--line)); font-size: 12px; font-weight: 400; text-align: left; }
.duel-leader-table th:nth-child(n+3), .duel-leader-table td:nth-child(n+3) { text-align: right; }
.duel-leader-table td { padding: 9px 14px; color: var(--muted); border-bottom: 1px solid var(--line); }
.duel-leader-table tr:last-child td { border-bottom: 0; }
.duel-leader-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--ink) 2%, transparent); }
.duel-leader-table .duel-leader-rank, .duel-leader-number { color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.duel-leader-table .duel-leader-unavailable { color:var(--muted); }
.duel-leader-player { display: flex; align-items: center; gap: 10px; text-align: left !important; }
.duel-leader-player strong { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.duel-leader-avatar { flex: 0 0 32px; width: 32px; height: 32px; overflow: hidden; border-radius: 50%; }
.duel-leader-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.duel-leader-table-empty, .duel-leader-table-note { margin: 12px 2px; color: var(--lobby-muted, var(--muted)); font: 13px/1.5 var(--sans, Arial, sans-serif); }
.duel-info-empty { display: grid; gap: 7px; min-height: 150px; align-content: center; margin-top: 22px; padding: 22px; border: 1px dashed var(--lobby-line, var(--line)); border-radius: 10px; color: var(--lobby-muted, var(--muted)); }
.duel-info-empty strong { color: var(--ink); font: 400 20px var(--serif, Georgia, serif); }
.duel-rules-overview {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--lobby-line, var(--line));
  border-radius: 11px;
  background: linear-gradient(120deg, var(--panel), var(--panel));
}
.duel-rules-overview-icon, .duel-rule-icon { display: grid; place-items: center; color: var(--gold); background: var(--accent-surface); }
.duel-rules-overview-icon { width: 72px; height: 72px; border-radius: 9px; }
.duel-rules-overview h2, .duel-rules-cta h2 { margin: 0 0 7px; color: var(--ink); font: 400 24px/1.2 var(--serif, Georgia, serif); }
.duel-rules-overview p, .duel-rules-cta p { margin: 0; color: var(--muted); font: 14px/1.6 var(--sans, Arial, sans-serif); }
.duel-rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.duel-rule-card { min-width: 0; min-height: 188px; padding: 20px; border: 1px solid var(--lobby-line, var(--line)); border-radius: 10px; background: var(--panel); }
.duel-rule-heading { display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.duel-rule-icon { flex:0 0 36px; width:36px; height:36px; background:transparent; }
.duel-rule-heading h2 { margin:0; }
.duel-rule-points { margin:0; padding-left:18px; color:var(--muted); font:14px/1.6 var(--sans,Arial,sans-serif); }
.duel-rule-points li + li { margin-top:6px; }
.duel-rule-card h2 { margin: 0 0 8px; color: var(--ink); font: 400 19px/1.25 var(--serif, Georgia, serif); }
.duel-rule-card p { margin: 0; color: var(--muted); font: 13px/1.55 var(--sans, Arial, sans-serif); }
.duel-rules-cta { display: grid; grid-template-columns:44px minmax(0, 1fr) auto; align-items: center; gap: 18px; margin-top: 18px; padding: 18px 20px; border: 1px solid var(--lobby-line, var(--line)); border-radius: 10px; background: var(--panel); }
.duel-rules-cta-laurel { color:var(--gold); }
.duel-rules-cta .lobby-main-cta { min-width: 190px; text-decoration: none; }
.duel-info-page :focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.duel-info-page button, .duel-info-page a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

@media(max-width: 760px) {
  .duel-leader-tabs { width: 100%; }
  .duel-leader-tab { min-height: 40px; padding-inline: 12px; font-size: 13px; }
  .duel-leader-podium { gap: 8px; margin-top: 22px; }
  .duel-podium-player, .duel-podium-player.is-first { min-height: 160px; padding: 13px 6px; gap: 7px; }
  .duel-podium-portrait { width:90px; height:96px; }
  .duel-podium-wreath { width:90px; height:90px; }
  .duel-podium-crown { top:-6px; width:20px; height:20px; }
  .duel-podium-medal { width:28px; height:28px; font-size:20px; }
  .duel-podium-avatar { width: 54px; height: 54px; }
  .duel-podium-player.is-first .duel-podium-avatar { width: 62px; height: 62px; }
  .duel-podium-name { font-size: 15px; }
  .duel-podium-rating { font-size: 20px; }
  .duel-leader-table-wrap { overflow: visible; border: 0; background: transparent; }
  .duel-leader-table, .duel-leader-table tbody { display: block; width: 100%; }
  .duel-leader-table thead { display: none; }
  .duel-leader-table tbody tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) 70px; align-items: center; gap: 8px; margin-bottom: 6px; padding: 5px 8px; border: 1px solid var(--lobby-line, var(--line)); border-radius: 8px; background: var(--panel); }
  .duel-leader-table tbody td { padding: 4px 0; border: 0; font-size: 13px; }
  .duel-leader-table tbody td:nth-child(n+4) { display: none; }
  .duel-leader-table tbody td:nth-child(3) { text-align: right; }
  .duel-rules-overview { grid-template-columns: 54px minmax(0, 1fr); gap: 13px; padding: 16px; }
  .duel-rules-overview-icon { width: 52px; height: 52px; }
  .duel-rules-overview h2 { font-size: 21px; }
  .duel-rules-overview p { font-size: 13px; }
  .duel-rules-grid { grid-template-columns: 1fr; gap: 8px; }
  .duel-rule-card { min-height: 0; padding: 16px; }
  .duel-rule-icon { width: 36px; height: 36px; margin-bottom: 10px; }
  .duel-rule-heading .duel-rule-icon { margin-bottom:0; }
  .duel-rules-cta { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .duel-rules-cta .lobby-main-cta { width: 100%; }
}

/* Let long topic names wrap without hiding their meaning. */
.duel-lobby .lobby-topic-card:not(.is-featured) { height: auto; min-height: 80px; }
.duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-image { height: auto; min-height: 78px; align-self: stretch; }
.duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-image img { height: 100%; min-height: 78px; }
.duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-copy { height: auto; min-height: 78px; align-content: center; }
.duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-copy strong {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
.duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-copy > .lobby-topic-period {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
@media(max-width: 760px) {
  .duel-lobby .lobby-topic-card:not(.is-featured) { min-height: 74px; }
  .duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-image { min-height: 72px; }
  .duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-image img { min-height: 72px; }
  .duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-copy { min-height: 72px; }
}

@media(min-width:1321px) {
  .duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-image { height:78px; min-height:78px; }
  .duel-lobby .lobby-topic-card:not(.is-featured) .lobby-topic-image img { width:100%; height:78px; min-height:78px; object-fit:cover; }
}

/* Invitation to a friend's room: a name is enough. */
.duel-invite { display: grid; place-items: start center; padding: clamp(24px, 6vw, 72px) 16px; }
.duel-invite-card { width: min(100%, 480px); display: grid; gap: 14px; padding: 28px; }
.duel-invite-card h1 { margin: 0; font-family: var(--serif, inherit); font-size: clamp(26px, 3vw, 34px); font-weight: 500; }
.duel-invite-card p { margin: 0; }
.duel-invite-form { display: grid; gap: 8px; margin-top: 6px; }
.duel-invite-form label { font-size: 14px; color: var(--muted); }
.duel-invite-form input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong, var(--line)); border-radius: 8px; background: var(--panel-raised); color: var(--ink); font: inherit; }
.duel-invite-form input:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.duel-invite-form input[aria-invalid="true"] { border-color: var(--danger, #d97a6c); }
.duel-invite-error:empty { display: none; }
.duel-invite-error { color: var(--danger, #d97a6c); font-size: 14px; }
.duel-invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.game-invite-link { margin: 4px 0 0; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; user-select: all; }
/* Podium metals: gold, silver, bronze read as three different places (29.10.2026). */
.duel-podium-portrait.is-rank-1 { color:var(--gold-soft); }
.is-rank-1 .duel-podium-medal { background:var(--gold-soft); }
.duel-podium-portrait.is-rank-3 { color:color-mix(in srgb, var(--gold) 62%, #7A4A2E); }
.is-rank-3 .duel-podium-medal { background:color-mix(in srgb, var(--gold) 62%, #7A4A2E); }
