:root {
  color-scheme: dark;
  --canvas: #050813;
  --canvas-deep: #02050c;
  --surface: rgba(10, 15, 28, 0.94);
  --surface-strong: rgba(14, 20, 36, 0.98);
  --surface-soft: rgba(18, 25, 43, 0.8);
  --surface-hover: rgba(25, 34, 57, 0.92);
  --border: rgba(151, 170, 210, 0.16);
  --border-strong: rgba(151, 170, 210, 0.3);
  --primary: #8b5cf6;
  --primary-bright: #a78bfa;
  --primary-deep: #6d28d9;
  --primary-soft: rgba(139, 92, 246, 0.16);
  --secondary: #2dd4bf;
  --secondary-soft: rgba(45, 212, 191, 0.14);
  --team-a: #60a5fa;
  --team-a-soft: rgba(96, 165, 250, 0.14);
  --team-b: #fb7185;
  --team-b-soft: rgba(251, 113, 133, 0.14);
  --success: #4ade80;
  --warning: #fb923c;
  --danger: #fb7185;
  --text: #f7f8fc;
  --text-soft: #c3cad9;
  --text-muted: #8590a6;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas-deep);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 2%, rgba(124, 58, 237, 0.23), transparent 30%),
    radial-gradient(circle at 9% 22%, rgba(45, 212, 191, 0.08), transparent 27%),
    linear-gradient(180deg, #030611 0%, var(--canvas) 45%, var(--canvas-deep) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary-bright);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  width: min(100%, 1880px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px clamp(12px, 2vw, 28px) 28px;
}

.draft-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  margin-bottom: 14px;
}

.draft-brand__identity {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.draft-brand__name {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.draft-brand__section {
  color: var(--primary-bright);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.draft-brand__back {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}

.draft-brand__back:hover {
  color: var(--text);
}

.ad-zone {
  min-height: 0;
  margin: 10px auto 16px;
  overflow: hidden;
}

.panel {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.create-layout {
  max-width: 900px;
  margin: 7vh auto 0;
}

.create-main {
  padding: clamp(20px, 3vw, 34px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.create-lead {
  max-width: 700px;
  margin-bottom: 28px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.segmented button,
.chip-row button,
.secondary-button,
.primary-button,
.confirm-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  text-align: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.segmented button,
.chip-row button,
.secondary-button,
.icon-button {
  min-height: 44px;
  color: var(--text-soft);
  background: rgba(9, 14, 26, 0.8);
  border: 1px solid var(--border-strong);
}

.segmented button:hover,
.chip-row button:hover,
.secondary-button:hover,
.icon-button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.segmented button.active,
.chip-row button.active {
  color: #fff;
  background: var(--primary-soft);
  border-color: rgba(167, 139, 250, 0.58);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field label,
.field-title {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--text);
  background: #090e1a;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.field input::placeholder {
  color: #657087;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row button {
  min-width: 58px;
  padding: 0 12px;
}

.opponent-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  border: 1px solid rgba(167, 139, 250, 0.72);
  border-radius: var(--radius-sm);
  box-shadow: 0 9px 24px rgba(109, 40, 217, 0.28);
  cursor: pointer;
  font-weight: 800;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.opponent-link:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.opponent-link--compact {
  min-height: 38px;
  padding: 0 12px;
  font-size: 11px;
}

.opponent-link svg,
.confirm-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.create-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.primary-button,
.confirm-button {
  min-height: 48px;
  padding: 0 18px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  border: 1px solid rgba(167, 139, 250, 0.55);
  box-shadow: 0 10px 28px rgba(109, 40, 217, 0.27);
}

.primary-button:hover,
.confirm-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.lobby-status i,
.lobby-presence i,
.ready-status i {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 999px;
  background: currentColor;
}

.sequence-editor-wrap {
  margin-top: 22px;
}

.sequence-editor {
  padding: 14px;
  background: rgba(7, 11, 22, 0.54);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.sequence-editor__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.sequence-editor__hint {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

.sequence-editor__scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.sequence-editor__grid {
  display: grid;
  gap: 7px;
  min-width: calc(var(--sequence-length) * 38px + 90px);
}

.sequence-track {
  display: grid;
  grid-template-columns: repeat(var(--sequence-length), 32px);
  gap: 6px;
}

.sequence-track--editable {
  grid-template-columns: repeat(var(--sequence-length), 32px) 42px 42px;
}

.sequence-track--numbers {
  color: var(--text-muted);
  font-size: 9px;
  text-align: center;
}

.sequence-track--numbers span {
  display: block;
  text-align: center;
}

.sequence-editor-step {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 7px;
}

.sequence-editor-step {
  color: var(--text-muted);
  background: rgba(9, 14, 26, 0.86);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  font-size: 19px;
  font-weight: 900;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.sequence-editor-step > span {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sequence-editor-step.ban > span {
  font-family: Arial, sans-serif;
  line-height: 0.75;
}

.sequence-editor-step:hover {
  transform: translateY(-1px);
  border-color: var(--primary-bright);
}

.sequence-editor-step.ban { color: var(--danger); }
.sequence-editor-step.pick { color: var(--secondary); }
.sequence-editor-step.empty {
  color: rgba(133, 144, 166, 0.35);
  background: rgba(133, 144, 166, 0.08);
  border-color: rgba(133, 144, 166, 0.16);
}

.sequence-track--a .sequence-editor-step:not(.empty) {
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.1);
}

.sequence-track--b .sequence-editor-step:not(.empty) {
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.1);
}

.sequence-editor--live .sequence-editor__grid {
  min-width: calc(80px + var(--sequence-length) * 38px);
}

.sequence-track--live {
  grid-template-columns: 80px repeat(var(--sequence-length), 32px);
}

.sequence-track__label {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sequence-editor-step--live {
  cursor: default;
}

.sequence-editor-step--live.done {
  opacity: 0.58;
}

.sequence-editor-step--live.current {
  border-color: var(--primary-bright);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.24);
}

.sequence-track--a .sequence-editor-step--live.current {
  border-bottom-color: transparent;
  border-radius: 7px 7px 0 0;
}

.sequence-track--b .sequence-editor-step--live.current {
  border-top-color: transparent;
  border-radius: 0 0 7px 7px;
}

.sequence-counter {
  width: 42px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.sequence-counter--pick {
  color: var(--secondary);
}

.sequence-counter--ban {
  color: var(--danger);
}

.lobby-shell {
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 960px;
  margin: 6vh auto 0;
  text-align: center;
}

.lobby-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--secondary);
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lobby-title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 0;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 0.98;
  text-transform: uppercase;
}

.lobby-title em {
  color: var(--text-muted);
  font-size: 0.35em;
  font-style: normal;
  letter-spacing: 0.1em;
}

.lobby-shell > .opponent-link {
  margin-top: 2px;
}

.lobby-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  color: var(--text-muted);
  font-size: 11px;
}

.lobby-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  margin-top: 24px;
}

.lobby-team {
  display: grid;
  gap: 18px;
  min-height: 220px;
  padding: 24px;
  text-align: left;
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.lobby-team--own.team-a { border-color: rgba(96, 165, 250, 0.48); }
.lobby-team--own.team-b { border-color: rgba(251, 113, 133, 0.48); }

.lobby-team__header,
.lobby-team__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lobby-team__footer {
  min-height: 48px;
}

.lobby-team__header .team-side {
  padding: 0;
  background: transparent;
}

.lobby-presence,
.ready-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 10px;
}

.lobby-presence.online { color: var(--secondary); }
.ready-status.ready { color: var(--success); }

.lobby-name-field {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lobby-name-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(9, 14, 26, 0.8);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 20px;
  font-weight: 800;
}

.lobby-name-field input:disabled {
  color: var(--text-soft);
  cursor: default;
  opacity: 0.72;
}

.lobby-team-name {
  align-self: center;
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
}

.room-shell {
  display: grid;
  gap: 12px;
}

.room-view {
  min-height: 100%;
}

.draft-rotate-notice,
.action-bar--mobile-side {
  display: none;
}

.room-topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  background: rgba(5, 8, 19, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(18px) saturate(125%);
}

.room-meta,
.room-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-actions {
  justify-content: flex-end;
}

.room-role {
  color: var(--text-muted);
  font-size: 12px;
}

.room-team-name,
.mobile-room-mode {
  display: none;
}

.connection-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: var(--warning);
}

.connection-dot.connected {
  background: var(--success);
}

.turn-center {
  min-width: 230px;
  text-align: center;
}

.turn-label {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.turn-label.team-a {
  color: var(--team-a);
}

.turn-label.team-b {
  color: var(--team-b);
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 900;
}

.secondary-button,
.icon-button {
  padding: 0 12px;
}

.draft-layout {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr) minmax(220px, 290px);
  gap: 12px;
  align-items: start;
}

.draft-center-column {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.team-panel,
.hero-panel {
  min-height: 0;
}

.team-panel {
  position: sticky;
  top: 86px;
  padding: 16px;
}

.team-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.team-name {
  margin: 0;
  font-size: 16px;
}

.team-side {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.team-side__short {
  display: none;
}

.team-a .team-side {
  color: var(--team-a);
  background: var(--team-a-soft);
}

.team-b .team-side {
  color: var(--team-b);
  background: var(--team-b-soft);
}

.team-block + .team-block {
  margin-top: 18px;
}

.team-block h3 {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.mini-list {
  display: grid;
  gap: 6px;
}

.mini-list--slots {
  grid-template-columns: repeat(auto-fill, 54px);
}

.mini-hero,
.empty-slot {
  box-sizing: border-box;
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-sm);
}

.mini-hero {
  position: relative;
  overflow: hidden;
  color: var(--text-soft);
  background: rgba(9, 14, 26, 0.72);
  border: 1px solid var(--border);
}

.mini-hero img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.empty-slot {
  background: rgba(9, 14, 26, 0.42);
  border: 1px dashed var(--border-strong);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-panel {
  padding: 14px;
}

.hero-complete-state {
  min-height: 270px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
}

.hero-complete-state strong {
  color: var(--text-soft);
  font-size: 18px;
}

.hero-complete-state__mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--success);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 999px;
  font-size: 24px;
  font-weight: 900;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.hero-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: #080d19;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  aspect-ratio: 0.86;
}

.hero-card:hover:not(:disabled) {
  border-color: rgba(167, 139, 250, 0.45);
  transform: translateY(-1px);
}

.hero-card.selected {
  border-color: var(--primary-bright);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25), 0 12px 24px rgba(0, 0, 0, 0.3);
}

.hero-card.used {
  cursor: default;
}

.hero-card.used img {
  filter: grayscale(0.72) brightness(0.46);
}

.hero-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.hero-name {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 18px 6px 6px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(transparent, rgba(2, 5, 12, 0.96));
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-state {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-state.banned {
  color: #fff;
  background: rgba(190, 35, 65, 0.9);
}

.hero-state.picked-a {
  color: #fff;
  background: rgba(37, 99, 235, 0.92);
}

.hero-state.picked-b {
  color: #fff;
  background: rgba(225, 29, 72, 0.92);
}

.action-bar {
  position: sticky;
  bottom: 10px;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 12px;
  background: rgba(5, 8, 19, 0.93);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.action-bar.action-bar--mobile-side {
  display: none;
}

.selected-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
}

.selected-summary img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
}

.confirm-button {
  min-width: 210px;
}

.notice,
.error-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}

.notice {
  color: var(--text-soft);
  background: var(--secondary-soft);
  border: 1px solid rgba(45, 212, 191, 0.24);
}

.error-box {
  color: #fecdd3;
  background: rgba(127, 29, 29, 0.3);
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.message-panel {
  max-width: 1060px;
  margin: 6vh auto 0;
  padding: clamp(20px, 3vw, 34px);
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 1050px) {
  .draft-layout {
    grid-template-columns: minmax(180px, 230px) minmax(0, 1fr) minmax(180px, 230px);
  }

  .hero-grid {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 8px 8px 18px;
  }

  .draft-brand {
    min-height: 44px;
    margin: 0 4px 8px;
  }

  .draft-brand__name {
    font-size: 15px;
  }

  .draft-brand__section {
    font-size: 10px;
  }

  .create-layout {
    grid-template-columns: 1fr;
    margin-top: 3vh;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .room-topbar {
    top: 6px;
    grid-template-columns: 1fr auto;
    min-height: 58px;
    padding: 8px 10px;
  }

  .room-meta {
    min-width: 0;
  }

  .turn-center {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    padding-top: 5px;
    border-top: 1px solid var(--border);
  }

  .room-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .draft-layout {
    display: block;
  }

  .team-panel {
    position: static;
    display: none;
  }

  .hero-panel {
    padding: 8px;
  }

  .hero-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .hero-card {
    aspect-ratio: 0.88;
  }

  .hero-name {
    font-size: 10px;
  }

  .mobile-compositions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .mobile-team-summary {
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    font-size: 11px;
  }

  .mobile-team-summary strong {
    display: block;
    margin-bottom: 4px;
  }

  .mobile-team-summary span {
    color: var(--text-muted);
  }

  .action-bar {
    bottom: 6px;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .selected-summary {
    min-height: 38px;
  }

  .selected-summary img {
    width: 38px;
    height: 38px;
  }

  .confirm-button {
    width: 100%;
    min-width: 0;
    min-height: 50px;
  }

  .sequence-editor__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .sequence-editor__hint {
    text-align: left;
  }

  .lobby-shell {
    margin-top: 3vh;
  }

  .lobby-title {
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
  }

  .lobby-title em {
    font-size: 0.3em;
    line-height: 1;
  }

  .lobby-teams {
    grid-template-columns: 1fr;
    margin-top: 12px;
  }

  .lobby-team {
    min-height: 190px;
    padding: 18px;
  }
}

@media (min-width: 821px) {
  .mobile-compositions {
    display: none;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  html,
  body {
    overflow: hidden;
  }

  body {
    min-height: 100svh;
  }

  .app-shell {
    width: 100%;
    height: 100svh;
    min-height: 100svh;
    padding: 4px 6px 6px;
    overflow: hidden;
  }

  .room-view,
  .room-view .room-shell {
    height: 100%;
    min-height: 0;
  }

  .room-view .draft-brand,
  .room-view .ad-zone,
  .room-view .mobile-compositions,
  .room-view .sequence-editor--live,
  .room-view .action-bar--desktop {
    display: none;
  }

  .room-view .room-shell {
    display: block;
  }

  .room-view .room-shell > .error-box {
    position: fixed;
    top: 34px;
    left: 50%;
    z-index: 45;
    width: min(90vw, 360px);
    padding: 6px 9px;
    transform: translateX(-50%);
    font-size: 9px;
    text-align: center;
  }

  .room-topbar {
    position: static;
    display: block;
    z-index: auto;
    width: 0;
    height: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .room-meta,
  .room-actions,
  .turn-center,
  .mobile-room-mode {
    position: fixed;
    z-index: 40;
  }

  .room-meta {
    top: 5px;
    left: 7px;
    min-height: 24px;
    padding: 3px 7px;
    color: var(--text-muted);
    background: rgba(5, 8, 19, 0.82);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 9px;
    backdrop-filter: blur(12px);
  }

  .room-meta .room-team-name,
  .room-actions .room-team-name {
    display: block;
    max-width: 64px;
    overflow: hidden;
    font-size: 9px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .room-meta .room-team-name--a {
    color: var(--team-a);
  }

  .room-actions .room-team-name--b {
    color: var(--team-b);
  }

  .room-meta .room-role {
    display: none;
  }

  .room-actions {
    top: 4px;
    right: 6px;
    gap: 4px;
  }

  .room-actions #copy-opponent,
  .room-actions #copy-watch {
    display: none;
  }

  .turn-center {
    top: 4px;
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 136px;
    min-width: 136px;
    max-width: calc(100vw - 184px);
    height: 26px;
    padding: 2px 8px;
    transform: translateX(-50%);
    background: rgba(5, 8, 19, 0.9);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
  }

  .turn-label {
    max-width: 78px;
    margin: 0;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timer {
    font-size: 15px;
    line-height: 1;
  }

  .mobile-room-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    top: 4px;
    min-height: 26px;
    background: rgba(5, 8, 19, 0.9);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
  }

  .mobile-room-mode {
    right: calc(50% + 74px);
    min-width: 48px;
    max-width: 48px;
    overflow: hidden;
    padding: 0 5px;
    color: var(--text-muted);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .draft-layout {
    display: grid;
    grid-template-columns: minmax(48px, 60px) minmax(0, 1fr) minmax(48px, 60px);
    gap: 5px;
    height: 100%;
    min-height: 0;
    padding-top: 28px;
    align-items: stretch;
  }

  .team-panel {
    position: relative;
    top: auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 5px 4px 4px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  }

  .team-heading {
    min-width: 0;
    margin-bottom: 5px;
    gap: 3px;
  }

  .team-name {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .team-side {
    flex: 0 0 auto;
    padding: 2px 4px;
    font-size: 7px;
  }

  .team-side__full {
    display: none;
  }

  .team-side__short {
    display: inline;
  }

  .team-block {
    min-height: 0;
  }

  .team-block + .team-block {
    margin-top: 4px;
  }

  .team-block h3 {
    display: none;
  }

  .team-name {
    display: none;
  }

  .mini-list--slots {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .mini-hero,
  .empty-slot {
    width: clamp(20px, 7.5svh, 30px);
    height: clamp(20px, 7.5svh, 30px);
    min-width: 0;
    min-height: 0;
    justify-self: center;
    aspect-ratio: 1;
    border-radius: 4px;
  }

  .mini-hero--pick,
  .empty-slot--pick {
    border-color: rgba(74, 222, 128, 0.68);
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.12);
  }

  .mini-hero--ban,
  .empty-slot--ban {
    border-color: rgba(251, 113, 133, 0.68);
    box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.12);
  }

  .draft-center-column {
    display: block;
    min-width: 0;
    min-height: 0;
  }

  .hero-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 4px;
    overflow: hidden;
    border-radius: 8px;
  }

  .hero-grid {
    flex: 1 1 auto;
    grid-template-columns: repeat(auto-fill, minmax(clamp(40px, 8vw, 88px), 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 3px;
    min-height: 0;
    padding-bottom: clamp(34px, 10svh, 42px);
    overflow: hidden;
    align-content: stretch;
  }

  .hero-card {
    height: 100%;
    aspect-ratio: auto;
    border-radius: 4px;
  }

  .hero-card:hover:not(:disabled) {
    transform: none;
  }

  .hero-name {
    padding: 9px 3px 3px;
    font-size: 8px;
  }

  .hero-state {
    top: 2px;
    left: 2px;
    padding: 1px 3px;
    font-size: 7px;
  }

  .hero-complete-state {
    min-height: 100%;
  }

  .hero-panel .action-bar--mobile-side {
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 10;
    display: block;
    width: min(180px, 46%);
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .hero-panel .action-bar--mobile-side .selected-summary {
    display: none;
  }

  .hero-panel .action-bar--mobile-side .confirm-button {
    width: 100%;
    min-width: 0;
    min-height: clamp(30px, 9svh, 40px);
    padding: 0 3px;
    border-radius: 6px;
    font-size: 9px;
    line-height: 1.05;
    white-space: normal;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  .room-view .sequence-editor--live {
    display: none;
  }

  .draft-rotate-notice {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 7px;
    padding: 24px;
    color: var(--text);
    background:
      radial-gradient(circle at 50% 25%, rgba(124, 58, 237, 0.2), transparent 38%),
      #030611;
    text-align: center;
  }

  .draft-rotate-notice__icon {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    margin-bottom: 5px;
    color: var(--primary-bright);
    background: var(--primary-soft);
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: 20px;
  }

  .draft-rotate-notice__icon svg {
    width: 52px;
    height: 52px;
  }

  .draft-rotate-notice .eyebrow {
    margin: 0;
  }

  .draft-rotate-notice h2 {
    margin: 0;
    font-size: clamp(25px, 8vw, 36px);
    letter-spacing: -0.03em;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
