/* ════════════ ONLINE: create / join / lobby / results ════════════ */
.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
}
.or-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, .35), transparent);
}
.or-divider em {
  font-size: 11px;
  letter-spacing: 2px;
  font-style: normal;
  font-family: var(--font-mono);
  color: rgba(0, 229, 255, .6);
}
.join-row { display: flex; gap: 8px; align-items: stretch; }
.code-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 800;
  letter-spacing: 8px;
  text-align: center;
  text-transform: uppercase;
  color: var(--brass-hi);
}
.join-row .btn { min-width: 0; white-space: nowrap; }
.online-msg {
  min-height: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--gem-ruby);
  margin-top: 10px;
  font-weight: 600;
}

/* ── Lobby ── */
.lobby-panel { max-width: min(760px, 94vw); width: 760px; }
.lobby-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.code-chip {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  background: rgba(10, 16, 28, .5);
  border: 1px solid rgba(0, 229, 255, .28);
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(0, 229, 255, .7);
}
.code-chip b {
  font-family: var(--font-mono);
  font-size: 24px;
  letter-spacing: 7px;
  color: var(--brass-hi);
  text-shadow: 0 0 12px rgba(0, 229, 255, .5);
}
.code-chip button {
  background: rgba(0, 229, 255, .16);
  border: none;
  color: var(--cream);
  border-radius: 7px;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 15px;
}
.code-chip button:hover { background: rgba(0, 229, 255, .32); }
#lobby-slots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.slot {
  aspect-ratio: 3 / 4;
  min-height: 0;
  border-radius: 12px;
  border: 2px solid rgba(0, 229, 255, .16);
  background: rgba(10, 16, 28, .55);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.slot.empty {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  color: rgba(0, 229, 255, .3);
  font-size: 26px;
  background: rgba(255, 255, 255, .03);
}
.slot.me { border-color: var(--gem-amethyst); box-shadow: 0 0 0 2px rgba(0, 229, 255, .45), 0 0 16px rgba(0, 229, 255, .35); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .nm {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 14px 3px 4px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  color: var(--cream);
  background: linear-gradient(0deg, rgba(10, 16, 28, .94), transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot .badge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: .5px;
  color: var(--deep);
}
.slot .badge.host { background: var(--gem-gold); }
.slot .badge.bot { background: #3A4D72; color: var(--cream); }
.slot .badge.you { background: var(--gem-amethyst); color: var(--cream); left: auto; right: 4px; }
.slot.afk img { filter: grayscale(.85) brightness(.5); }
.slot .afk-tag {
  position: absolute;
  top: 46%;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  font-weight: 900;
  color: var(--gem-ruby);
  letter-spacing: 3px;
  text-shadow: 0 2px 6px #000;
}
.lobby-cfg { display: flex; gap: 18px; flex-wrap: wrap; }
.lobby-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.lobby-action-right { display: flex; gap: 8px; flex-wrap: wrap; }
.lobby-action-right .btn { min-width: 0; }

/* ── Online results ── navy rows, cyan dividers, gold winner, mono times ── */
#mp-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 14px; }
#mp-list .lb-row {
  background: rgba(10, 16, 28, .55);
  border-bottom: 1px solid rgba(0, 229, 255, .14);
}
#mp-list .lb-row .rk,
#mp-list .lb-row .val { font-family: var(--font-mono); }
#mp-list .lb-row.top1 { box-shadow: inset 0 0 0 1.5px rgba(255, 215, 0, .5), 0 0 12px rgba(255, 215, 0, .22); }
#mp-list .lb-row.top1 .val,
#mp-list .lb-row.top1 .rk { color: var(--gem-gold); }
#mp-list .lb-row.afk .nm { color: var(--gem-ruby); opacity: .85; }
#mp-list .afk-flag { color: var(--gem-ruby); }
#mp-list .lb-row.me { background: rgba(0, 229, 255, .16); box-shadow: inset 0 0 0 1px rgba(0, 229, 255, .4); }

@media (max-width: 700px) {
  #lobby-slots { grid-template-columns: repeat(3, 1fr); }
  .lobby-panel { width: auto; }
}

/* ════════════ SHORT LANDSCAPE: keep CTAs reachable (no desktop change) ════════════ */
@media (orientation: landscape) and (max-height: 430px) {
  /* Safety net: bound both panels so the action buttons are always reachable */
  #screen-online .panel,
  #screen-lobby .panel,
  .lobby-panel {
    max-height: calc(100dvh - 10px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 16px;
  }
  /* Compact vertical rhythm */
  #screen-online .panel h2,
  #screen-lobby .panel h2 { font-size: clamp(18px, 4vw, 22px); margin-bottom: 6px; }
  .or-divider { margin: 8px 0 6px; }
  .join-row { gap: 6px; }
  .code-input { font-size: clamp(18px, 4vw, 22px); letter-spacing: 6px; }
  .online-msg { min-height: 14px; margin-top: 6px; font-size: 12px; }

  /* Lobby tightening */
  .code-chip b { font-size: 20px; letter-spacing: 5px; }
  #lobby-slots { gap: 6px; margin: 8px 0; }
  .slot .nm { padding: 10px 3px 3px; font-size: 10px; }
  .lobby-cfg { gap: 10px; }
  .lobby-actions { margin-top: 10px; gap: 8px; }

  /* Results: tighter rows */
  #mp-list { gap: 4px; margin: 8px 0 10px; }
}

/* ════════════ MOBILE GATE (landscape + fullscreen popup) ════════════ */
#mobile-gate {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at center, rgba(10, 16, 28, .8), rgba(4, 7, 14, .95));
  backdrop-filter: blur(5px);
}
#mobile-gate.hidden { display: none; }
.mg-card {
  max-width: 440px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: clamp(22px, 5vw, 32px) clamp(20px, 5vw, 30px);
  border-radius: 22px;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(14, 27, 51, .96), rgba(5, 13, 31, .98));
  border: 1px solid rgba(0, 229, 255, .3);
  box-shadow:
    inset 0 1px 0 rgba(127, 242, 255, .2),
    inset 0 0 0 1px rgba(0, 229, 255, .14),
    0 24px 60px rgba(0, 0, 0, .6);
}
.mg-ico {
  font-size: clamp(46px, 12vw, 62px);
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5));
}
.mg-ico .mg-rot {
  font-size: .55em;
  color: var(--brass-hi);
  display: inline-block;
  animation: mgRot 2s var(--zen-ease) infinite;
}
@keyframes mgRot { 0%, 60% { transform: rotate(0); } 80%, 100% { transform: rotate(90deg); } }
.mg-card h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(22px, 6vw, 28px);
  color: var(--brass-hi);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .4), 0 0 18px rgba(0, 229, 255, .35);
  margin: 0;
}
.mg-card p {
  font-family: var(--font-body);
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.6;
  opacity: .88;
  margin: 0 0 6px;
}
.mg-card p b { color: var(--brass-hi); }
.mg-card .btn { width: 100%; }
.mg-card .btn.ghost { opacity: .8; }
