/* Teamazo · Fenêtres au style commun : Salon Live (lobby, QR code, membres), Agenda. */

/* --- Salon Live : lobby (code en plaque, QR code, membres en ligne et hors ligne) --- */
#online-dialog {
  width: min(580px, calc(100vw - 20px));
}
#online-dialog .online-entry-grid {
  gap: 10px;
}
#online-dialog .online-choice {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--raised);
  padding: 16px;
}
#online-dialog .online-choice h3 {
  font: 800 italic 19px/1.1 var(--display);
  text-transform: uppercase;
}
#online-dialog .online-mode-summary {
  border-radius: var(--ui-r);
}
.lobby {
  display: grid;
  gap: 12px;
}
.lobby-plate {
  --plate-accent: var(--lime);
  position: relative;
  overflow: hidden;
  padding: 14px 18px 14px 22px;
  border: 1px solid #2c3a30;
  border-radius: 18px;
  background:
    repeating-linear-gradient(-60deg, #ffffff07 0 9px, transparent 9px 18px) right / 42% 100% no-repeat,
    linear-gradient(160deg, #19241c 0%, #0b100d 72%);
  box-shadow:
    inset 0 1px 0 #ffffff14,
    0 16px 34px -22px #000;
  color: #f2f6ee;
}
:root[data-theme='light'] .lobby-plate {
  --plate-accent: #3ddc78;
}
.lobby-plate::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  background: var(--plate-accent);
}
.lobby-plate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lobby-eyebrow {
  color: #a9b8ab;
  font: 700 11px/1 var(--font);
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.lobby-role,
.lm-role,
.lm-me {
  padding: 5px 9px;
  border: 1px solid #ffffff2e;
  border-radius: 6px;
  color: #c9d3cb;
  font: 800 italic 11px/1 var(--display);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}
.lobby-role[data-role='host'] {
  border-color: var(--plate-accent);
  background: var(--plate-accent);
  color: #0b0e0c;
}
.lobby-code {
  display: flex;
  gap: clamp(4px, 1.4vw, 8px);
  margin: 12px 0;
}
.lobby-code span {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(40px, 11.5vw, 60px);
  height: clamp(52px, 15vw, 74px);
  border: 1px solid #35443a;
  border-radius: 9px;
  background: linear-gradient(180deg, #26322a 0 50%, #1a231d 50% 100%);
  box-shadow:
    inset 0 1px 0 #ffffff1c,
    inset 0 -3px 0 #00000059,
    0 6px 14px -8px #000;
  color: #fff;
  font: 800 italic clamp(32px, 9.4vw, 50px) / 1 var(--display);
  text-shadow: 0 2px 0 #000;
}
.lobby-code span::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  background: #0000009e;
}
.lobby-plate-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.lobby-title {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: #f2f6ee;
  font: 800 italic 17px/1.15 var(--display);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.lobby-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #a9b8ab;
  font: 600 12px/1.3 var(--font);
}
.lobby-state::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc78;
  box-shadow: 0 0 0 3px #3ddc7826;
}
.lobby-state[data-state='sync']::before {
  background: #f2c14e;
  box-shadow: 0 0 0 3px #f2c14e26;
}
.lobby-state[data-state='offline']::before {
  background: #f59e0b;
  box-shadow: 0 0 0 3px #f59e0b26;
}
.lobby-state[data-state='error']::before {
  background: #ff6d75;
  box-shadow: 0 0 0 3px #ff6d7526;
}
.lobby-invite {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--raised);
}
.lobby-qr {
  width: 136px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 0 0 4px var(--panel),
    0 0 0 5px var(--line);
}
.lobby-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.lobby-invite-side {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.lobby-invite-hint {
  margin: 0 0 2px;
  font: 800 italic 15px/1.15 var(--display);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
#online-dialog .lobby-invite-side :is(.primary-btn, .outline-btn) {
  width: 100%;
}
#online-dialog .lobby-link {
  min-height: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font: 600 12px/1 var(--font);
  text-overflow: ellipsis;
}
.lobby-box {
  padding: 14px;
}
.lobby-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.lobby-heading h3 {
  margin: 0;
  font: 800 italic 16px/1 var(--display);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.lobby-heading small {
  color: var(--muted);
  font: 600 12px/1.2 var(--font);
  text-align: right;
}
.lobby-members {
  display: grid;
  gap: 6px;
  max-height: 312px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.lobby-member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 7px 10px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.lobby-member.is-me {
  box-shadow: inset 3px 0 0 var(--lime);
}
.lm-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: hsl(var(--hue, 120) 38% 30%);
  color: #fff;
  font: 800 italic 16px/1 var(--display);
}
:root[data-theme='light'] .lm-avatar {
  background: hsl(var(--hue, 120) 48% 42%);
}
.lm-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: #8a958c;
}
.is-online .lm-dot {
  background: #3ddc78;
}
.is-away .lm-avatar {
  filter: grayscale(0.7);
  opacity: 0.7;
}
.lm-who {
  min-width: 0;
}
.lm-who strong {
  display: block;
  overflow: hidden;
  font: 700 15px/1.2 var(--font);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.is-away .lm-who strong {
  color: var(--muted);
}
.lm-who small {
  display: block;
  color: var(--muted);
  font: 600 12px/1.3 var(--font);
}
.is-online .lm-who small {
  color: var(--ok);
}
.lm-tags {
  display: flex;
  gap: 5px;
}
.lm-role,
.lm-me {
  border-color: var(--line);
  color: var(--muted);
}
.lm-role.is-host {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--accent-ink, #15200e);
}
.lm-me {
  border-color: transparent;
  background: var(--soft);
  color: var(--lime);
}
.lobby-empty {
  color: var(--muted);
  font-size: 13px;
}
.lobby-error {
  margin: 10px 0 0;
  color: #ff7a80;
  font-size: 13px;
}
.lobby-you {
  display: grid;
  gap: 10px;
}
#online-dialog .lobby-me .form-field {
  margin: 0;
}
.lobby-activity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#online-dialog .lobby-activity .activity-latest {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#online-dialog .lobby-activity .outline-btn {
  flex: none;
  margin-left: auto;
}
#online-dialog .host-controls:not([hidden]) {
  display: block;
  padding: 14px;
  font-size: inherit;
}
#online-dialog .host-controls small {
  width: auto;
  padding: 0;
  font-size: 12px;
}
#online-dialog .lobby-switch {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.lobby-switch span {
  display: grid;
  gap: 2px;
}
.lobby-switch strong {
  font: 700 14px/1.2 var(--font);
}
.lobby-switch small {
  color: var(--muted);
  font-size: 12px;
}
#online-dialog .lobby-switch input {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--input);
  appearance: none;
  cursor: pointer;
  transition: background 0.18s;
}
#online-dialog .lobby-switch input::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s var(--ease-out);
}
#online-dialog .lobby-switch input:checked {
  border-color: var(--lime);
  background: var(--lime);
}
#online-dialog .lobby-switch input:checked::before {
  background: var(--accent-ink, #15200e);
  transform: translateX(18px);
}
.lobby-host-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.lobby-leave {
  display: flex;
  justify-content: center;
}
#online-dialog #online-leave {
  min-height: 36px;
  font-size: 13px;
}
@media (hover: hover) {
  #online-dialog #online-leave:hover {
    color: #ff7a80;
  }
}
@media (max-width: 480px) {
  .lobby-invite {
    gap: 12px;
    padding: 12px;
  }
  .lobby-qr {
    width: 112px;
  }
  .lobby-plate {
    padding: 12px 12px 12px 18px;
  }
  .lobby-activity {
    flex-wrap: wrap;
  }
}

/* --- Agenda : prochain match en grande carte, formulaire compact --- */
#schedule-dialog {
  width: min(1100px, calc(100vw - 20px));
}
.agenda-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  align-items: start;
  gap: 22px;
}
.agenda-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.agenda-main .ui-section-title {
  margin: 6px 0 -2px;
}
.agenda-plans,
.agenda-archives {
  display: grid;
  gap: 8px;
}
.agenda-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.agenda-hero {
  position: relative;
  display: grid;
  gap: 10px;
  overflow: hidden;
  padding: 18px 20px 18px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--soft) 0%, var(--panel) 78%);
  box-shadow:
    inset 6px 0 0 var(--lime),
    0 18px 40px -26px #000;
}
.agenda-hero::before,
.agenda-hero::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.agenda-hero::before {
  top: 50%;
  right: -70px;
  width: 230px;
  height: 230px;
  border: 2px solid var(--line);
  border-radius: 50%;
  transform: translateY(-50%);
  opacity: 0.8;
}
.agenda-hero::after {
  top: 0;
  right: 44px;
  bottom: 0;
  width: 2px;
  background: var(--line);
  opacity: 0.8;
}
.agenda-hero > * {
  position: relative;
  z-index: 1;
}
.ah-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ah-eyebrow {
  color: var(--lime);
  font: 800 11px/1 var(--font);
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.ah-count {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input);
  color: var(--white);
  font: 800 italic 14px/1 var(--display);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  transform: skewX(-8deg);
}
.ah-count.soon {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--accent-ink, #15200e);
}
.ah-count.past {
  color: var(--muted);
}
.ah-name {
  margin: 2px 0 0;
  max-width: calc(100% - 60px);
  color: var(--white);
  font: 800 italic clamp(28px, 4.2vw, 42px) / 0.98 var(--display);
  letter-spacing: 0.3px;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.ah-when {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--white);
  font: 700 16px/1.25 var(--font);
}
.ah-when .icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--lime);
}
.ah-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ah-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
#schedule-dialog .ah-actions .primary-btn {
  min-width: 170px;
  min-height: 46px;
  font-size: 15px;
}
.agenda-hero.is-past {
  box-shadow: inset 6px 0 0 var(--line);
}
.agenda-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}
.agenda-row.is-past {
  opacity: 0.75;
}
.ar-date {
  display: grid;
  place-content: center;
  width: 48px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--input);
  text-align: center;
}
.ar-date b {
  font: 800 italic 23px/1 var(--display);
}
.ar-date small {
  color: var(--muted);
  font: 700 11px/1.2 var(--font);
  text-transform: uppercase;
}
.ar-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.ar-main strong {
  overflow: hidden;
  font: 700 15px/1.2 var(--font);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-main span {
  color: var(--muted);
  font: 600 12px/1.35 var(--font);
}
.agenda-row .ah-count {
  font-size: 12px;
  padding: 5px 9px;
}
.ar-actions,
.aa-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
#schedule-dialog :is(.ar-actions, .aa-actions) .outline-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}
#schedule-dialog :is(.ar-actions, .aa-actions) .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--ui-r);
  color: var(--muted);
}
.agenda-archive {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 12px 14px;
}
.aa-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.aa-main strong {
  font: 700 15px/1.2 var(--font);
}
.aa-main small {
  color: var(--muted);
  font: 600 12px/1.3 var(--font);
}
.aa-teams {
  font: 800 italic 16px/1.15 var(--display);
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.aa-result {
  align-self: start;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--lime);
  font: 800 italic 12px/1.1 var(--display);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transform: skewX(-8deg);
}
.aa-actions {
  grid-column: 1 / -1;
}
.agenda-form {
  padding: 16px;
}
.agenda-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.plan-days {
  flex-wrap: nowrap;
}
.plan-days .ui-pill {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 4px;
  text-transform: capitalize;
}
.plan-when {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 8px;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--ui-r);
  background: var(--input);
  color: var(--muted);
  font: 600 13px/1.35 var(--font);
}
.plan-when b {
  color: var(--white);
}
.plan-when > .icon {
  width: 17px;
  height: 17px;
  color: var(--lime);
}
.plan-hint {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font: 600 12px/1.3 var(--font);
}
.plan-hint .icon {
  flex: none;
  width: 14px;
  height: 14px;
}
#schedule-dialog .plan-roster-box {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
}
#schedule-dialog .plan-roster-box summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  font: 700 14px/1.2 var(--font);
}
#schedule-dialog .plan-roster-box summary .summary-chevron {
  margin-left: auto;
}
#schedule-dialog .plan-roster-box .season-checklist {
  max-height: 230px;
  padding: 0 10px 10px;
  overflow-y: auto;
}
@media (max-width: 860px) {
  .agenda-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .agenda-main {
    display: contents;
  }
  .agenda-main > :nth-child(1) {
    order: 1;
  }
  .agenda-main > :nth-child(2) {
    order: 2;
  }
  .agenda-form {
    order: 3;
  }
  .agenda-main > :nth-child(3) {
    order: 4;
  }
  .agenda-main > :nth-child(4) {
    order: 5;
  }
  .agenda-main > :nth-child(5) {
    order: 6;
  }
}
@media (max-width: 560px) {
  .agenda-hero {
    padding: 14px 14px 14px 20px;
  }
  #schedule-dialog .ah-actions .primary-btn {
    flex: 1;
  }
  .agenda-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .ar-actions {
    grid-column: 2 / -1;
    justify-content: flex-end;
  }
  .agenda-form {
    padding: 14px 12px;
  }
}
