/* Équinoxe — multiplayer screens and the title menu's extra buttons. Builds on base.css and screens.css. */

/* Title menu: six entries must fit a phone, and scroll on the shortest screens. */
.eq-title-view { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; }
.eq-title-view::-webkit-scrollbar { display: none; }
.eq-title-view .eq-glyphs, .eq-title-view .eq-logo { flex: none; }
.eq-menu-nav { flex: none; }
.eq-menu-nav .eq-btn-lg { min-height: 50px; font-size: 17px; padding: 10px 22px; }
.eq-tagline { margin-bottom: 26px; }
.eq-foot { margin-top: 22px; }

/* Frame ----------------------------------------------------------------- */
.eq-online { width: min(780px, 100%); outline: none; }
.eq-online .eq-setup-spacer { flex: none; }
.eq-online .eq-setup-head .eq-title { flex: 1; min-width: 0; }
.eq-on-body { display: flex; flex-direction: column; padding-top: 14px; }
.eq-on-body > * { flex: none; }
.eq-on-foot { justify-content: flex-end; }
.eq-on-foot[hidden] { display: none; }
.eq-on-foot .eq-summary { flex: 1; min-width: 0; text-align: center; }
.eq-on-summary-bad { color: var(--accent-strong); }
.eq-on-lead { margin: 2px 0 14px; color: var(--text-dim); font-size: 15px; line-height: 1.4; }
.eq-online .eq-section { margin-top: 20px; }
.eq-online .eq-section:first-child { margin-top: 2px; }
.eq-on-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.eq-on-seg-wrap { flex-wrap: wrap; }
.eq-on-seg-wrap .eq-seg-item { flex: 1 1 30%; }
.eq-field[hidden] { display: none; }

.eq-on-row { display: flex; gap: 8px; align-items: stretch; }
.eq-on-row > .eq-input { min-width: 0; }
.eq-on-row-wrap { flex-wrap: wrap; justify-content: center; }
.eq-on-stack { display: flex; flex-direction: column; gap: 8px; }
.eq-on-error { margin: 8px 0 0; color: #ffb4a8; font-size: 14px; font-weight: 700; }
.eq-on-error[hidden] { display: none; }
#screens .eq-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.eq-on-chip { max-width: 40vw; }
.eq-on-chip .eq-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.eq-on-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #ffd9a8;
  background: rgba(240, 138, 75, 0.14);
  border: 1px solid rgba(240, 138, 75, 0.45);
}
.eq-on-banner[hidden] { display: none; }

.eq-on-wait { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 34px 0; color: var(--text-dim); font-weight: 700; }
.eq-on-spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  animation: eq-on-turn 0.9s linear infinite;
}
@keyframes eq-on-turn { to { transform: rotate(360deg); } }

.eq-on-message { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 12px 26px; }
.eq-on-message-ico { font-size: 42px; color: var(--accent); margin-bottom: 12px; }
.eq-on-message-title { margin: 0; font: 700 23px/1.2 var(--font-display); }
.eq-on-message-text { margin: 10px 0 20px; max-width: 46ch; color: var(--text-dim); font-size: 15.5px; line-height: 1.45; }
.eq-on-message-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* Home ------------------------------------------------------------------ */
.eq-on-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 20px; align-items: end; }
.eq-on-create { width: 100%; }
.eq-on-join { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.eq-on-join-input { text-transform: uppercase; letter-spacing: 0.18em; text-align: center; font-size: 18px; }
.eq-on-join-input::placeholder { letter-spacing: 0.18em; opacity: 0.55; }
.eq-on-games { display: flex; flex-direction: column; gap: 10px; }
.eq-on-empty { margin: 0; padding: 20px 14px; text-align: center; color: var(--text-dim); font-size: 14.5px; line-height: 1.4; border: 1px dashed var(--panel-border); border-radius: 14px; }
.eq-on-mycode { align-self: center; margin-top: 18px; }

.eq-on-card-wrap { position: relative; }
.eq-on-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 16px;
  border: 1.5px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: 400 14px/1.3 var(--font-ui);
  transition: transform 0.15s var(--ease), border-color 0.15s, background 0.15s;
}
.eq-on-card:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.08); }
.eq-on-card:active { transform: scale(0.99); }
.eq-on-card-emblems { display: flex; flex: none; width: 82px; }
.eq-on-card-emblems .eq-on-emblem { font-size: 34px; }
.eq-on-card-emblems .eq-on-emblem + .eq-on-emblem { margin-left: -10px; }
.eq-on-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.eq-on-card-status { font: 700 17px/1.2 var(--font-display); }
.eq-on-card-names { color: var(--text-dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.eq-on-card-detail { color: var(--text-faint); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.eq-on-card-go { color: var(--text-faint); font-size: 18px; }
.eq-on-card.is-turn {
  border-color: var(--accent-strong);
  background: linear-gradient(170deg, rgba(255, 207, 110, 0.22), rgba(240, 181, 74, 0.06));
  box-shadow: 0 0 22px rgba(240, 181, 74, 0.22);
}
.eq-on-card.is-turn .eq-on-card-status { color: var(--accent-strong); }
.eq-on-card.is-turn .eq-on-card-detail, .eq-on-card.is-turn .eq-on-card-go { color: var(--accent-strong); }
.eq-on-card.is-won .eq-on-card-status { color: var(--good); }
.eq-on-card.is-lost .eq-on-card-status { color: var(--text-dim); }
.eq-on-card.is-lobby .eq-on-card-status { color: var(--info); }
.eq-on-card.is-won, .eq-on-card.is-lost { padding-right: 104px; }
.eq-on-card.is-won .eq-on-card-go, .eq-on-card.is-lost .eq-on-card-go { display: none; }
.eq-on-card-remove { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); }
.eq-on-card-remove:hover { transform: translateY(-50%); }

.eq-on-emblem { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45)); }
.eq-on-emblem.is-dead { filter: grayscale(1) brightness(0.7); }
.eq-on-emblem-none {
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  color: var(--text-faint);
  line-height: 1;
}
.eq-on-emblem-none > span { font-size: 0.5em; font-weight: 800; }

/* Tribe picker ---------------------------------------------------------- */
.eq-on-tribes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.eq-on-tribe {
  --tc: #888;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 8px 10px;
  text-align: left;
  border-radius: 14px;
  border: 1.5px solid var(--panel-border);
  background: color-mix(in srgb, var(--tc) 8%, transparent);
  color: var(--text);
  font: 400 13px/1.2 var(--font-ui);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.2s;
}
.eq-on-tribe:hover:not(:disabled) { border-color: color-mix(in srgb, var(--tc) 70%, white 10%); }
.eq-on-tribe.is-on {
  border-color: var(--tc);
  background: color-mix(in srgb, var(--tc) 26%, transparent);
  box-shadow: 0 0 0 1px var(--tc), 0 6px 22px color-mix(in srgb, var(--tc) 32%, transparent);
}
#screens .eq-on-tribe:disabled { opacity: 0.45; cursor: not-allowed; }
.eq-on-tribe-emblem { font-size: 36px; }
.eq-on-tribe-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.eq-on-tribe-text strong { font: 700 15.5px/1.15 var(--font-display); color: var(--tcl, var(--text)); }
.eq-on-tribe-who { font-size: 12px; color: var(--text-dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.eq-on-tribe-who[hidden] { display: none; }

/* Seats (lobby, hot-seat) ------------------------------------------------ */
.eq-on-seats { display: flex; flex-direction: column; gap: 8px; }
.eq-on-seat {
  --tc: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(100deg, color-mix(in srgb, var(--tc) 16%, transparent), rgba(255, 255, 255, 0.03) 60%);
  transition: opacity 0.2s;
}
.eq-on-seat.is-absent { opacity: 0.6; }
.eq-on-seat-emblem { font-size: 42px; flex: none; }
.eq-on-seat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.eq-on-seat-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 700 17px/1.2 var(--font-display); color: var(--tcl, var(--text)); overflow-wrap: anywhere; }
.eq-on-seat-sub { color: var(--text-dim); font-size: 13px; }
.eq-on-seat .eq-seg { flex: none; width: 250px; }
.eq-on-seat .eq-seg-item { min-height: 36px; padding: 4px 6px; font-size: 14px; }
.eq-on-tag { padding: 2px 8px; border-radius: 999px; font: 800 11px/1.4 var(--font-ui); letter-spacing: 0.04em; color: var(--text-dim); background: rgba(255, 255, 255, 0.1); }
.eq-on-tag-you { color: #2b1b02; background: var(--accent-strong); }
.eq-on-dot { flex: none; width: 12px; height: 12px; margin: 0 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.eq-on-dot.is-on { background: var(--good); box-shadow: 0 0 10px rgba(111, 208, 140, 0.8); }

/* Lobby ------------------------------------------------------------------ */
.eq-on-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(240, 181, 74, 0.4);
  background: linear-gradient(170deg, rgba(240, 181, 74, 0.14), rgba(240, 181, 74, 0.03));
}
.eq-on-hero-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eq-on-gamecode {
  font: 900 clamp(38px, 11vw, 56px)/1.05 var(--font-display);
  letter-spacing: 0.14em;
  color: var(--accent-strong);
  user-select: text;
  -webkit-user-select: text;
}
.eq-on-hero-hint { color: var(--text-dim); font-size: 13.5px; }
.eq-on-share { flex: none; }
.eq-on-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.eq-on-chipline { padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--text-dim); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--panel-border); }
.eq-on-push { align-self: center; margin-top: 16px; }

/* Login code ------------------------------------------------------------- */
.eq-on-secret { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; border: 1px solid rgba(240, 181, 74, 0.4); background: rgba(240, 181, 74, 0.08); }
.eq-on-secret-code { font: 800 clamp(22px, 7vw, 32px)/1.1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.08em; color: var(--accent-strong); user-select: text; -webkit-user-select: text; }
.eq-on-link { margin: 8px 0 0; text-align: center; color: var(--text-faint); font-size: 12.5px; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.eq-on-code-input { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; text-transform: uppercase; }

/* Phones ----------------------------------------------------------------- */
@media (max-width: 720px) {
  .eq-online { width: 100%; }
  .eq-online .eq-setup-head .eq-title { text-align: center; }
  .eq-on-body { padding-top: 12px; }
  .eq-on-fields { grid-template-columns: 1fr; }
  .eq-on-actions { grid-template-columns: 1fr; }
  .eq-on-tribes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eq-on-seat { flex-wrap: wrap; gap: 8px 10px; }
  .eq-on-seat .eq-seg { width: 100%; }
  .eq-on-hero { flex-direction: column; align-items: stretch; text-align: center; }
  .eq-on-foot { flex-flow: row wrap; }
  .eq-on-foot .eq-summary { flex: 1 0 100%; order: -1; }
  .eq-on-foot .eq-btn { width: auto; flex: 1; min-height: 50px; }
  .eq-on-foot .eq-btn-primary { flex: 2; }
  .eq-on-chip { max-width: 30vw; }
  .eq-title-view { padding-top: 16px; padding-bottom: 16px; }
}

@media (max-height: 760px) {
  .eq-menu-nav { gap: 8px; }
  .eq-menu-nav .eq-btn-lg { min-height: 44px; font-size: 16px; padding: 8px 18px; }
  .eq-glyphs { margin-bottom: 8px; }
  .eq-tagline { margin: 10px 0 16px; }
  .eq-foot { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .eq-on-spin { animation-duration: 3s; }
}
