/* ============================================================
   Lineup — Online multiplayer UX (stub)
   Lobby browser, host setup, waiting rooms, in-game bar.
   ============================================================ */

.online-panel {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.online-panel[hidden] { display: none; }

/* ---- Generic bits ---- */
.ol-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ol-head .back {
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-soft);
  background: var(--card-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ol-head .back:hover { transform: translateX(-2px); box-shadow: var(--shadow-sm); }
.ol-title { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.1; }
.ol-sub { color: var(--ink-soft); font-size: 14px; font-weight: 600; margin-top: 3px; }
.ol-pill {
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  background: oklch(0.95 0.04 150); color: oklch(0.42 0.1 150);
  border-radius: 999px; padding: 5px 11px; display: inline-flex; align-items: center; gap: 6px;
}
.ol-pill .live-dot { width: 8px; height: 8px; border-radius: 50%; background: oklch(0.66 0.17 150); box-shadow: 0 0 0 0 oklch(0.66 0.17 150 / .6); animation: live-pulse 1.8s ease-out infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 oklch(0.66 0.17 150 / .55); } 70%,100% { box-shadow: 0 0 0 7px oklch(0.66 0.17 150 / 0); } }

/* ---- Avatars ---- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 16px; color: white;
  background: radial-gradient(circle at 35% 28%, oklch(0.92 0.04 var(--ah, 255)), var(--ac, oklch(0.62 0.13 255)) 70%);
  box-shadow: inset 0 -3px 6px oklch(0 0 0 / .16), inset 0 3px 6px oklch(1 0 0 / .35), var(--shadow-sm);
  text-shadow: 0 1px 2px oklch(0 0 0 / .25);
}
.avatar.sm { width: 34px; height: 34px; font-size: 14px; }
.avatar.lg { width: 52px; height: 52px; font-size: 21px; }

/* ---- Identity row ---- */
.ol-id {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 12px;
}
.ol-id .who { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.ol-id .who label { font-size: 11px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.ol-id .name-input {
  font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink);
  background: transparent; border: none; border-bottom: 2px dashed transparent; padding: 1px 0;
  width: 100%; max-width: 220px; outline: none; transition: border-color .15s ease;
}
.ol-id .name-input:hover { border-bottom-color: var(--line); }
.ol-id .name-input:focus { border-bottom-color: var(--board); }
.ol-id .conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: oklch(0.52 0.12 150); }
.dot-online { width: 9px; height: 9px; border-radius: 50%; background: oklch(0.66 0.17 150); box-shadow: 0 0 0 3px oklch(0.66 0.17 150 / .22); }

/* ---- Create button ---- */
.ol-create {
  font-family: var(--font-display); font-weight: 600; font-size: 16px; color: white;
  background: linear-gradient(180deg, var(--board), var(--board-deep));
  border: none; border-radius: 16px; padding: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: var(--shadow-md); transition: transform .15s ease, box-shadow .15s ease;
}
.ol-create:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ol-create:active { transform: translateY(0); }

/* ---- Game list ---- */
.ol-list-head { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.ol-list-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.ol-list-head .count { font-size: 12px; font-weight: 700; color: var(--ink-faint); }
.refresh {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2);
  color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .25s ease, box-shadow .15s ease;
}
.refresh:hover { box-shadow: var(--shadow-sm); color: var(--ink); }
.refresh.spin svg { animation: spin .6s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

.ol-list { display: flex; flex-direction: column; gap: 9px; max-height: 340px; overflow-y: auto; padding: 2px; margin: -2px; }
.ol-list::-webkit-scrollbar { width: 8px; }
.ol-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.game-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 11px 13px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  animation: row-in .32s cubic-bezier(.34,1.56,.5,1) both;
}
.game-row:hover { box-shadow: var(--shadow-sm); border-color: oklch(0.86 0.03 255); }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.game-row .gr-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.game-row .gr-host { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.game-row .gr-meta { font-size: 12px; font-weight: 700; color: var(--ink-faint); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.game-row .gr-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-faint); opacity: .5; }
.gr-meta .st-wait { color: oklch(0.55 0.1 150); }
.gr-meta .st-play { color: var(--ink-faint); }

.badge {
  font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: .01em;
  border-radius: 9px; padding: 6px 9px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent;
}
.badge .dots { display: inline-flex; gap: 2px; }
.badge .dots i { width: 6px; height: 6px; border-radius: 50%; }
.badge.c3 { background: oklch(0.95 0.04 255); color: oklch(0.42 0.09 255); }
.badge.c4 { background: oklch(0.95 0.045 290); color: oklch(0.44 0.1 290); }
.badge.ttt { background: oklch(0.95 0.04 150); color: oklch(0.42 0.09 150); }
.badge .dot-r { background: var(--red); }
.badge .dot-y { background: var(--yellow-deep); }

.join-btn {
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: white;
  background: linear-gradient(180deg, oklch(0.7 0.15 150), oklch(0.6 0.16 150));
  border: none; border-radius: 11px; padding: 10px 18px; cursor: pointer; flex: none;
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.join-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.join-btn:active { transform: translateY(0); }
.join-btn.watch { background: var(--card); color: var(--ink-soft); border: 1px solid var(--line); }
.join-btn.full { background: var(--card); color: var(--ink-faint); border: 1px solid var(--line); cursor: not-allowed; box-shadow: none; }

.ol-empty { text-align: center; color: var(--ink-faint); font-weight: 700; font-size: 14px; padding: 30px 10px; }
.ol-empty .big { font-size: 30px; margin-bottom: 8px; }

/* ---- Host setup ---- */
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-card {
  text-align: left; cursor: pointer; background: var(--card-2);
  border: 2px solid var(--line); border-radius: 16px; padding: 13px;
  display: flex; flex-direction: column; gap: 9px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.type-card.sel { border-color: var(--board-deep); background: linear-gradient(180deg, var(--card), oklch(0.96 0.03 255)); box-shadow: var(--shadow-md); }
.type-card .mini { display: grid; gap: 3px; padding: 8px; background: oklch(0.9 0.05 255); border-radius: 10px; width: fit-content; }
.type-card.ttt-mini .mini { background: oklch(0.96 0.02 255); }
.type-card .mini i { width: 10px; height: 10px; border-radius: 50%; background: var(--hole); box-shadow: inset 0 1px 2px oklch(0 0 0 / .18); }
.type-card .mini i.r { background: var(--red); }
.type-card .mini i.y { background: var(--yellow); }
.type-card .tc-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.type-card .tc-desc { font-size: 12px; font-weight: 600; color: var(--ink-faint); line-height: 1.35; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.choice-row { display: flex; gap: 8px; }
.choice {
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-soft);
  background: var(--card-2); border: 2px solid var(--line); border-radius: 12px; padding: 10px 16px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all .15s ease;
}
.choice:hover { color: var(--ink); }
.choice.sel { border-color: var(--board-deep); color: var(--ink); background: var(--card); box-shadow: var(--shadow-sm); }
.choice .swatch { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 -2px 3px oklch(0 0 0 / .18), inset 0 2px 3px oklch(1 0 0 / .4); }
.choice .swatch.r { background: radial-gradient(circle at 35% 28%, oklch(0.84 0.1 32), var(--red) 62%); }
.choice .swatch.y { background: radial-gradient(circle at 35% 28%, oklch(0.96 0.07 92), var(--yellow) 60%); }

/* ---- Waiting room ---- */
.room {
  background: linear-gradient(180deg, oklch(0.97 0.025 255), oklch(0.94 0.04 255));
  border: 1px solid var(--line); border-radius: 20px; padding: 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.room .rk-label { font-size: 12px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .12em; }
.room .rk-code {
  font-family: var(--font-display); font-weight: 600; font-size: 42px; letter-spacing: .14em; color: var(--ink);
  display: inline-flex; align-items: center; gap: 12px;
}
.room .copy {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, color .15s ease, box-shadow .15s ease;
}
.room .copy:hover { color: var(--ink); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.room .copy.ok { color: oklch(0.6 0.16 150); border-color: oklch(0.8 0.1 150); }
.room .share { font-size: 13px; font-weight: 700; color: var(--ink-faint); }
.room .share b { color: var(--ink-soft); }

.slots { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; width: 100%; }
.slots .vs { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink-faint); }
.slot {
  display: flex; align-items: center; gap: 11px; padding: 13px;
  border-radius: 16px; border: 2px solid var(--line); background: var(--card);
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.slot .si { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.slot .si .nm { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .si .role { font-size: 11px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.slot.filled { border-color: oklch(0.82 0.07 150); background: linear-gradient(180deg, var(--card), oklch(0.97 0.03 150)); }
.slot.you { border-color: var(--board); }
.slot.empty { justify-content: center; color: var(--ink-faint); border-style: dashed; }
.slot.empty .si .nm { color: var(--ink-faint); }
.slot.just-joined { animation: slot-pop .5s cubic-bezier(.34,1.56,.5,1); }
@keyframes slot-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

.slot-ph {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center;
}
.waitline { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink-soft); }
.dots3 { display: inline-flex; gap: 4px; }
.dots3 i { width: 7px; height: 7px; border-radius: 50%; background: var(--board-deep); animation: d3 1.1s ease-in-out infinite; }
.dots3 i:nth-child(2) { animation-delay: .15s; }
.dots3 i:nth-child(3) { animation-delay: .3s; }
@keyframes d3 { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--board-deep); animation: spin360 .8s linear infinite; }
.spinner.lg { width: 46px; height: 46px; border-width: 4px; }
@keyframes spin360 { to { transform: rotate(360deg); } }
.connecting { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 38px 10px; text-align: center; }
.connecting .ct { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); }
.connecting .cs { font-size: 13px; font-weight: 700; color: var(--ink-faint); }

.ol-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ol-note { font-size: 12px; font-weight: 700; color: var(--ink-faint); text-align: center; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.demo-tag {
  font-family: var(--font-display); font-weight: 700; font-size: 10px; letter-spacing: .08em;
  background: oklch(0.92 0.06 75); color: oklch(0.46 0.12 70); border-radius: 6px; padding: 3px 6px;
}

/* ---- Toast ---- */
.ol-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: white; font-family: var(--font-display); font-weight: 600; font-size: 14px;
  padding: 12px 20px; border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 95;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  display: inline-flex; align-items: center; gap: 9px;
}
.ol-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- In-game online bar ---- */
.online-bar {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 9px 13px;
  flex-wrap: wrap;
}
.online-bar[hidden] { display: none; }
.online-bar .ob-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.online-bar .ob-conn { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: oklch(0.5 0.12 150); }
.online-bar .ob-room { font-size: 12px; font-weight: 700; color: var(--ink-faint); }
.online-bar .ob-room b { color: var(--ink-soft); font-family: var(--font-display); letter-spacing: .06em; }
.online-bar .ob-ping { font-size: 12px; font-weight: 700; color: var(--ink-faint); }
.online-bar .leave {
  font-family: var(--font-display); font-weight: 600; font-size: 13px; color: oklch(0.5 0.14 25);
  background: var(--card); border: 1px solid oklch(0.86 0.07 25); border-radius: 10px; padding: 8px 14px;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.online-bar .leave:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); background: var(--red-soft); }
.online-bar .ob-thinking { color: var(--ink-soft); }

.is-hidden { display: none !important; }
