/* ══════════════════════════════════════
   BINGO — Stylesheet
   Optimised: minimal animations, full responsive
   ══════════════════════════════════════ */

:root {
  --bg:    #0d0d1a;
  --card:  #14142b;
  --bdr:   #2a2a4a;
  --a1:    #f72585;
  --a2:    #7209b7;
  --a3:    #4cc9f0;
  --a4:    #f8961e;
  --a5:    #06d6a0;
  --text:  #f0f0ff;
  --muted: #8888aa;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  /* Subtle static star pattern — no animation */
  background-image:
    radial-gradient(1px 1px at 12% 20%, rgba(255,255,255,.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 38% 72%, rgba(255,255,255,.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 68% 14%, rgba(255,255,255,.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 58%, rgba(255,255,255,.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 52% 88%, rgba(255,255,255,.3)  0%, transparent 100%),
    radial-gradient(1px 1px at 25% 44%, rgba(255,255,255,.2)  0%, transparent 100%);
}


/* ══════════════════════════════════════
   SCREENS
   ══════════════════════════════════════ */

.screen { display: none; position: relative; z-index: 1; }
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 2rem 1rem 3rem;
}


/* ══════════════════════════════════════
   LOGO  (static — no bounce animation)
   ══════════════════════════════════════ */

.logo {
  font-family: 'Bitcount Grid Double', sans-serif; 
  font-size: clamp(3rem, 12vw, 5.5rem);
  letter-spacing: 2px; 
  margin-bottom: .25rem;
  user-select: none;
  font-weight: 700;
}
.logo span:nth-child(1) { color: var(--a1); }
.logo span:nth-child(2) { color: var(--a3); }
.logo span:nth-child(3) { color: var(--a5); }
.logo span:nth-child(4) { color: var(--a4); }
.logo span:nth-child(5) { color: var(--a2); }

.tagline {
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}


/* ══════════════════════════════════════
   CARD PANELS
   ══════════════════════════════════════ */

.card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
}
.card-title {
  font-family: 'Boogaloo', cursive;
  font-size: 1.4rem;
  text-align: center;
  color: var(--a3);
  margin-bottom: 1.1rem;
}


/* ══════════════════════════════════════
   TABS  (welcome screen)
   ══════════════════════════════════════ */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 1.1rem;
}
.tab-btn {
  flex: 1;
  padding: .55rem .4rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: 'Boogaloo', cursive;
  font-size: 1rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--a3);
  border-bottom-color: var(--a3);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }


/* ══════════════════════════════════════
   FORM FIELDS
   ══════════════════════════════════════ */

.field { margin-bottom: .85rem; }
.field label {
  display: block;
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: .32rem;
}
.field input {
  width: 100%;
  padding: .65rem .9rem;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--a3); }
.field input.big {
  font-family: 'Boogaloo', cursive;
  font-size: 1.8rem;
  text-align: center;
  letter-spacing: 8px;
  text-transform: uppercase;
}

.field-row {
  display: flex;
  gap: .6rem;
  align-items: flex-end;
}
.field-row .field { flex: 1; margin-bottom: 0; }


/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .72rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Boogaloo', cursive;
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  margin-top: .45rem;
  text-align: center;
}
.btn:hover  { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-primary   { background: var(--a1); color: #fff; }
.btn-secondary { background: transparent; color: var(--a3); border: 1.5px solid var(--a3); }
.btn-success   { background: var(--a5); color: #071a10; }
.btn-warn      { background: var(--a4); color: #1a0800; }
.btn-ghost     { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--bdr); }
.btn-sm        { width: auto; padding: .4rem .9rem; font-size: .9rem; margin-top: 0; }
.btn-icon      { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 1rem; margin-top: 0; flex-shrink: 0; }

.divider {
  text-align: center;
  color: var(--muted);
  font-size: .78rem;
  margin: .9rem 0;
  position: relative;
}
.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--bdr);
  z-index: 0;
}
.divider span {
  position: relative;
  z-index: 1;
  background: var(--card);
  padding: 0 .6rem;
}


/* ══════════════════════════════════════
   ROOM BROWSER
   ══════════════════════════════════════ */

.room-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: .7rem;
}
.room-list::-webkit-scrollbar { width: 4px; }
.room-list::-webkit-scrollbar-thumb { background: var(--bdr); border-radius: 4px; }

.room-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .8rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  transition: border-color .12s;
}
.room-item:hover { border-color: var(--a3); }
.room-info { flex: 1; min-width: 0; }
.room-host {
  font-weight: 700;
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-meta { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.lock-icon { font-size: .9rem; flex-shrink: 0; }

.room-empty {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding: 1.5rem 0;
}

.refresh-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
}
.refresh-label { font-size: .72rem; color: var(--muted); }

/* Quick-join pane */
.qj-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  padding: .8rem 0;
  text-align: center;
}
.qj-icon { font-size: 2.8rem; line-height: 1; }
.qj-desc { font-size: .85rem; color: var(--muted); }

/* Create pane */
.create-pane { display: flex; flex-direction: column; gap: .1rem; }


/* ══════════════════════════════════════
   GRID-SIZE STEPPER
   ══════════════════════════════════════ */

.gs-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin: .4rem 0;
}
.gs-stepper button {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--a3);
  background: transparent;
  color: var(--a3);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
  flex-shrink: 0;
}
.gs-stepper button:hover { background: rgba(76,201,240,.15); }
.gs-val {
  font-family: 'Boogaloo', cursive;
  font-size: 1.6rem;
  color: var(--a4);
  min-width: 52px;
  text-align: center;
}

/* Password row inside create pane */
.pw-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .3rem;
}
.tog-wrap {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.tog {
  width: 30px; height: 16px;
  background: rgba(255,255,255,.1);
  border-radius: 20px;
  position: relative;
  transition: background .15s;
  flex-shrink: 0;
}
.tog.on { background: var(--a5); }
.tog::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: left .15s;
}
.tog.on::after { left: 16px; }


/* ══════════════════════════════════════
   BADGE / AVATAR
   ══════════════════════════════════════ */

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Boogaloo', cursive;
  font-size: .85rem;
  flex-shrink: 0;
}
.badge {
  font-size: .6rem;
  padding: 2px 6px;
  border-radius: 20px;
  margin-left: auto;
  flex-shrink: 0;
}
.badge-host { background: rgba(247,37,133,.2);  color: var(--a1); }
.badge-you  { background: rgba(76,201,240,.15); color: var(--a3); }
.badge-lock { background: rgba(248,150,30,.15); color: var(--a4); font-size: .7rem; padding: 2px 7px; }


/* ══════════════════════════════════════
   STATUS BAR
   ══════════════════════════════════════ */

.status-bar {
  text-align: center;
  font-size: .7rem;
  color: var(--muted);
  margin-top: .6rem;
}
.ping {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--a5);
  margin-right: 4px;
  vertical-align: middle;
  /* Minimal animation — one blink per 2s */
  animation: ping 2s ease-in-out infinite;
}
@keyframes ping {
  0%, 80%, 100% { opacity: 1; }
  40%            { opacity: .25; }
}


/* ══════════════════════════════════════
   LOBBY SCREEN
   ══════════════════════════════════════ */

.room-code-box {
  font-family: 'Boogaloo', cursive;
  font-size: 2.6rem;
  letter-spacing: 10px;
  text-align: center;
  color: var(--a4);
  background: rgba(248,150,30,.07);
  border: 1.5px dashed rgba(248,150,30,.35);
  border-radius: var(--radius-md);
  padding: .6rem;
  margin-bottom: 1rem;
}
.player-list { list-style: none; margin-bottom: 1rem; }
.player-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .48rem .65rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04);
  margin-bottom: .38rem;
  font-size: .88rem;
  font-weight: 600;
}

/* Host lobby settings */
.lobby-settings {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-sm);
  padding: .8rem;
  margin-bottom: .9rem;
}
.lobby-settings-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: .6rem;
}


/* ══════════════════════════════════════
   SETUP SCREEN
   ══════════════════════════════════════ */

#setupScreen { padding: 1rem 1rem 3rem; }

.setup-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  width: 100%;
  max-width: 520px;
}
.setup-panel {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-lg);
  padding: 1rem;
  width: 100%;
}
.sec-title {
  font-family: 'Boogaloo', cursive;
  font-size: 1.15rem;
  color: var(--a3);
  text-align: center;
  margin-bottom: .65rem;
}

.setup-grid { display: grid; gap: 4px; margin: 0 auto; }
.setup-cell {
  border: 1.5px solid var(--bdr);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Boogaloo', cursive;
  cursor: pointer;
  background: rgba(255,255,255,.03);
  aspect-ratio: 1;
  transition: border-color .12s, background .12s;
}
.setup-cell:hover:not(.filled) { border-color: var(--a3); background: rgba(76,201,240,.08); }
.setup-cell.filled { background: rgba(76,201,240,.1); border-color: rgba(76,201,240,.4); color: var(--a3); }
.setup-cell.drop-target { border-color: var(--a4); background: rgba(248,150,30,.1); }

.num-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  max-height: 120px;
  overflow-y: auto;
}
.nchip {
  font-family: 'Boogaloo', cursive;
  font-size: .85rem;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255,255,255,.06);
  border: 1.5px solid var(--bdr);
  color: var(--text);
  transition: border-color .1s, background .1s;
}
.nchip:hover { border-color: var(--a3); }
.nchip.sel   { background: var(--a4); border-color: var(--a4); color: #1a0800; }
.nchip.used  { opacity: .2; cursor: not-allowed; pointer-events: none; }

.setup-actions { display: flex; gap: .5rem; margin-top: .65rem; }


/* ══════════════════════════════════════
   GAME SCREEN  — TOPBAR
   ══════════════════════════════════════ */

#gameScreen { padding: .6rem .8rem 2rem; }

.topbar {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  max-width: 980px;
  margin-bottom: .7rem;
  flex-wrap: wrap;
}
.tlogo {
  font-family: 'Bitcount Grid Double', sans-serif; 
  font-size: 1.6rem;
  letter-spacing: 2px;
  flex-shrink: 0;
  font-weight: 700;
}
.tlogo span:nth-child(1) { color: var(--a1); }
.tlogo span:nth-child(2) { color: var(--a3); }
.tlogo span:nth-child(3) { color: var(--a5); }
.tlogo span:nth-child(4) { color: var(--a4); }
.tlogo span:nth-child(5) { color: var(--a2); }

.room-pill {
  font-family: 'Boogaloo', cursive;
  font-size: .85rem;
  color: var(--a4);
  letter-spacing: 3px;
  background: rgba(248,150,30,.1);
  padding: .2rem .7rem;
  border-radius: 20px;
}
.player-pill { font-size: .78rem; color: var(--muted); margin-left: auto; }


/* ══════════════════════════════════════
   GAME LAYOUT
   ══════════════════════════════════════ */

.game-layout {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 980px;
  align-items: flex-start;
}

/* ── Bingo board ── */
.game-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-lg);
  padding: .9rem;
  flex-shrink: 0;
}
.bingo-header {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
}
.bingo-header div {
  font-family: 'Boogaloo', cursive;
  font-size: 1.35rem;
  text-align: center;
  height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.h-B { color: var(--a1); } .h-I { color: var(--a3); }
.h-N { color: var(--a5); } .h-G { color: var(--a4); } .h-O { color: var(--a2); }

.bingo-grid { display: grid; gap: 4px; }
.gcell {
  border: 1.5px solid var(--bdr);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Boogaloo', cursive;
  cursor: pointer;
  background: rgba(255,255,255,.03);
  aspect-ratio: 1;
  user-select: none;
  transition: border-color .1s, background .1s;
}
.gcell:hover:not(.marked) { border-color: var(--a3); background: rgba(76,201,240,.08); }
.gcell.called:not(.marked){ border-color: var(--a4); background: rgba(248,150,30,.12); }
.gcell.marked  { background: var(--a1); border-color: var(--a1); color: #fff; }
.gcell.winline { background: var(--a4); border-color: var(--a4); color: #1a0800; }

/* Auto-mark toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .6rem;
  font-size: .76rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}


/* ── Side panel ── */
.side-panel {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-lg);
  padding: .85rem;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  overflow-y: auto;
}
.phead {
  font-family: 'Boogaloo', cursive;
  font-size: .9rem;
  color: var(--a3);
  margin-bottom: .25rem;
}

/* Turn banner */
.turn-box {
  border-radius: var(--radius-sm);
  padding: .6rem .85rem;
  text-align: center;
}
.turn-box.mine  { background: rgba(248,150,30,.13); border: 1.5px solid rgba(248,150,30,.45); }
.turn-box.other { background: rgba(255,255,255,.04); border: 1px solid var(--bdr); }
.turn-name { font-family: 'Boogaloo', cursive; font-size: 1.25rem; }
.turn-hint { font-size: .72rem; color: var(--muted); margin-top: .12rem; }

/* Number picker */
.picker { display: none; }
.picker.show { display: block; }
.picker-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 130px;
  overflow-y: auto;
  margin-bottom: .4rem;
}
.pnum {
  font-family: 'Boogaloo', cursive;
  font-size: .82rem;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255,255,255,.06);
  border: 1.5px solid var(--bdr);
  transition: border-color .1s;
}
.pnum:hover  { border-color: var(--a3); }
.pnum.picked { background: var(--a4); border-color: var(--a4); color: #1a0800; }
.pnum.done   { opacity: .2; cursor: not-allowed; pointer-events: none; text-decoration: line-through; }

/* Last called */
.last-box { text-align: center; }
.last-num {
  font-family: 'Boogaloo', cursive;
  font-size: 2.4rem;
  color: var(--a4);
  line-height: 1;
}
.last-lbl { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* Called chips */
.chips { display: flex; flex-wrap: wrap; gap: 3px; max-height: 66px; overflow-y: auto; }
.chip  { font-family: 'Boogaloo', cursive; font-size: .72rem; padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.06); color: var(--muted); }
.chip.new { background: rgba(248,150,30,.2); color: var(--a4); }

/* Progress pips */
.prow  { display: flex; align-items: center; gap: .4rem; font-size: .78rem; padding: .12rem 0; }
.pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pips  { display: flex; gap: 3px; flex-shrink: 0; }
.pip   { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid var(--bdr); }
.pip.on { background: var(--a5); border-color: var(--a5); }

/* Rankings */
.rrow {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .32rem .48rem;
  border-radius: 7px;
  background: rgba(255,255,255,.04);
  margin-bottom: .28rem;
  font-size: .8rem;
}

/* Chat */
.chat-msgs {
  max-height: 100px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .22rem;
  margin-bottom: .35rem;
}
.cmsg    { font-size: .73rem; line-height: 1.35; }
.cmsg .cn { font-weight: 700; }
.chat-row { display: flex; gap: .38rem; }
.chat-inp {
  flex: 1;
  padding: .36rem .6rem;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--bdr);
  border-radius: 7px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: .76rem;
  outline: none;
  transition: border-color .12s;
}
.chat-inp:focus { border-color: var(--a3); }
.chat-btn {
  padding: .36rem .7rem;
  border: none;
  border-radius: 7px;
  background: var(--a3);
  color: #071518;
  font-family: 'Boogaloo', cursive;
  font-size: .85rem;
  cursor: pointer;
}
.chat-btn:hover { opacity: .85; }


/* ══════════════════════════════════════
   WIN OVERLAY
   ══════════════════════════════════════ */

#winOverlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
#winOverlay.show { display: flex; }

.win-box {
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 460px;
  width: 100%;
  animation: wsl .35s ease-out;
}
@keyframes wsl {
  from { transform: translateY(-24px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.win-ttl {
  font-family: 'Boogaloo', cursive;
  font-size: clamp(3rem, 14vw, 7rem);
  color: var(--a4);
  line-height: 1;
}
.final-list { margin: .9rem 0; text-align: left; }
.fitem {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .48rem .7rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  margin-bottom: .38rem;
  font-size: .92rem;
}
.fmed { font-family: 'Boogaloo', cursive; font-size: 1.15rem; width: 26px; text-align: center; }

.confetti-c { position: fixed; inset: 0; pointer-events: none; z-index: 101; }


/* ══════════════════════════════════════
   OVERLAYS — Password modal
   ══════════════════════════════════════ */

.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 90;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 340px;
  animation: wsl .25s ease-out;
}
.modal h3 {
  font-family: 'Boogaloo', cursive;
  font-size: 1.3rem;
  color: var(--a3);
  margin-bottom: .8rem;
  text-align: center;
}
.modal-btns { display: flex; gap: .5rem; margin-top: .7rem; }
.modal-btns .btn { margin-top: 0; }


/* ══════════════════════════════════════
   RANK POPUP & TOAST
   ══════════════════════════════════════ */

.rank-pop {
  position: fixed;
  top: 1.2rem; left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: var(--a4);
  color: #1a0800;
  font-family: 'Boogaloo', cursive;
  font-size: 1.1rem;
  padding: .55rem 1.6rem;
  border-radius: 50px;
  z-index: 150;
  transition: transform .3s ease-out;
  pointer-events: none;
  white-space: nowrap;
}
.rank-pop.show { transform: translateX(-50%) translateY(0); }

.toast {
  position: fixed;
  bottom: 1.2rem; left: 50%;
  transform: translateX(-50%);
  background: var(--a3);
  color: #071518;
  font-family: 'Boogaloo', cursive;
  font-size: .92rem;
  padding: .5rem 1.5rem;
  border-radius: 50px;
  z-index: 200;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; }


/* ══════════════════════════════════════
   LOADING SPINNER
   ══════════════════════════════════════ */

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--a3);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ══════════════════════════════════════
   RESPONSIVE — DESKTOP (≥900px)
   Side-by-side game layout, larger cells
   ══════════════════════════════════════ */

@media (min-width: 900px) {
  .screen.active { padding: 1.5rem 2rem 2rem; }

  .game-layout { flex-direction: row; align-items: flex-start; }
  .side-panel  { max-height: calc(100vh - 100px); width: 260px; flex: none; }

  .chat-msgs   { max-height: 130px; }
  .picker-nums { max-height: 160px; }
}


/* ══════════════════════════════════════
   RESPONSIVE — TABLET (600–899px)
   ══════════════════════════════════════ */

@media (min-width: 600px) and (max-width: 899px) {
  .game-layout { flex-direction: row; flex-wrap: wrap; }
  .side-panel  { width: 100%; max-height: none; flex-direction: row; flex-wrap: wrap; gap: .6rem; }
  .side-panel > div { flex: 1 1 200px; }
  .card { max-width: 520px; }
}


/* ══════════════════════════════════════
   RESPONSIVE — MOBILE (<600px)
   Stacked layout, compact cells
   ══════════════════════════════════════ */

@media (max-width: 599px) {
  .screen.active { padding: 1rem .75rem 2.5rem; }

  .game-layout { flex-direction: column; }
  .game-card   { width: 100%; }
  .side-panel  { width: 100%; max-height: none; }

  .logo { font-size: clamp(2.6rem, 15vw, 4rem); letter-spacing: 4px; }
  .room-code-box { font-size: 2rem; letter-spacing: 7px; }
  .win-ttl { font-size: clamp(2.5rem, 18vw, 5rem); }

  .chat-msgs   { max-height: 80px; }
  .picker-nums { max-height: 100px; }
}


/* ══════════════════════════════════════
   ACCESSIBILITY — Reduce motion
   ══════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* ══════════════════════════════════════
   EXIT BUTTON
   ══════════════════════════════════════ */

.btn-exit {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border: 1.5px solid rgba(247,37,133,.4);
  border-radius: 20px;
  background: transparent;
  color: var(--a1);
  font-family: 'Boogaloo', cursive;
  font-size: .88rem;
  cursor: pointer;
  transition: background .12s, opacity .12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-exit:hover  { background: rgba(247,37,133,.12); }
.btn-exit:active { opacity: .7; }


/* ══════════════════════════════════════
   PASSWORD INPUT WRAPPER
   (input + eye toggle + optional confirm)
   ══════════════════════════════════════ */

.pw-input-wrap {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.pw-input-wrap input {
  flex: 1;
  min-width: 0;
}
.pw-eye-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--bdr);
  border-radius: 7px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
  padding: 0;
}
.pw-eye-btn:hover      { background: rgba(255,255,255,.1); color: var(--text); }
.pw-eye-btn.visible    { color: var(--a3); border-color: var(--a3); }
.pw-confirm-btn {
  flex-shrink: 0;
  height: 32px;
  margin-top: 0 !important;
}


/* ══════════════════════════════════════
   ONLINE / OFFLINE PRESENCE DOTS
   ══════════════════════════════════════ */

.presence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 2px;
}
.presence-dot.online  { background: var(--a5); }
.presence-dot.offline { background: var(--muted); opacity: .5; }


/* ══════════════════════════════════════
   KICK BUTTON (host only, lobby)
   ══════════════════════════════════════ */

.kick-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(247,37,133,.35);
  background: transparent;
  color: var(--a1);
  font-size: .7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
  margin-left: auto;
  padding: 0;
  line-height: 1;
}
.kick-btn:hover { background: rgba(247,37,133,.15); }

