/* ==========================================================================
   "I see Q" (ICQ) — Original Game Idea by MARKUS
   Responsive Mobile-First + Desktop Fullscreen Stylesheet
   ========================================================================== */

:root {
  --bg-main: #0b1120;
  --bg-card: #151f32;
  --bg-card-alt: #1e293b;
  --bg-tile: #1e293b;
  --bg-tile-hover: #283548;
  --border-color: rgba(148, 163, 184, 0.18);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --icq-green: #22c55e;
  --icq-green-glow: rgba(34, 197, 94, 0.35);
  --icq-red: #ef4444;
  --gold: #facc15;
  --gold-dark: #ca8a04;
  --accent-blue: #38bdf8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-board: "Courier New", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Theme 2: Retro ICQ 99b (Win98 / Classic Messenger) */
body.theme-retro99 {
  --bg-main: #008080;
  --bg-card: #d4d0c8;
  --bg-card-alt: #ece9d8;
  --bg-tile: #ffffff;
  --bg-tile-hover: #e4f0ff;
  --border-color: #808080;
  --text-main: #111827;
  --text-muted: #374151;
  --icq-green: #15803d;
  --gold: #b45309;
  --accent-blue: #000080;
}

/* Theme 3: Markus Dollar-VIP 💵 */
body.theme-markusvip {
  --bg-main: #090806;
  --bg-card: #17140d;
  --bg-card-alt: #241e12;
  --bg-tile: #1f1a10;
  --bg-tile-hover: #2e2616;
  --border-color: rgba(250, 204, 21, 0.32);
  --text-main: #fef9c3;
  --text-muted: #d6c792;
  --icq-green: #eab308;
  --icq-green-glow: rgba(234, 179, 8, 0.4);
  --gold: #fde047;
  --accent-blue: #f59e0b;
}

/* Theme 4: Matrix Q-Hacker */
body.theme-matrix {
  --bg-main: #020804;
  --bg-card: #06140b;
  --bg-card-alt: #0a2212;
  --bg-tile: #071c0e;
  --bg-tile-hover: #0d3119;
  --border-color: rgba(74, 222, 128, 0.3);
  --text-main: #4ade80;
  --text-muted: #22c55e;
  --icq-green: #4ade80;
  --gold: #a3e635;
  --accent-blue: #2dd4bf;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  touch-action: manipulation;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

input, select {
  user-select: text;
  -webkit-user-select: text;
}

/* App Shell */
#app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ==========================================================================
   TOP ICQ HEADER
   ========================================================================== */
.icq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

/* Animated CSS ICQ Flower */
.icq-flower {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.brand-area:hover .icq-flower,
.icq-flower.spin-burst {
  transform: rotate(180deg) scale(1.1);
}

.icq-flower .petal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 15px;
  margin-left: -5px;
  margin-top: -18px;
  background: #22c55e;
  border-radius: 50%;
  transform-origin: 50% 18px;
  box-shadow: 0 0 3px rgba(0,0,0,0.4);
}

.icq-flower .p1 { transform: rotate(0deg); }
.icq-flower .p2 { transform: rotate(45deg); }
.icq-flower .p3 { transform: rotate(90deg); background: #ef4444; } /* Classic 1 red petal! */
.icq-flower .p4 { transform: rotate(135deg); }
.icq-flower .p5 { transform: rotate(180deg); }
.icq-flower .p6 { transform: rotate(225deg); }
.icq-flower .p7 { transform: rotate(270deg); }
.icq-flower .p8 { transform: rotate(315deg); }

.icq-flower .flower-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  background: #facc15;
  color: #0f172a;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #0f172a;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text h1 {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.q-accent {
  color: var(--icq-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.icq-tag {
  font-size: 0.65rem;
  background: rgba(34, 197, 94, 0.16);
  color: var(--icq-green);
  border: 1px solid var(--icq-green);
  padding: 1px 5px;
  border-radius: 99px;
  font-weight: 700;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.brand-sub strong {
  color: var(--gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.pill-btn:hover, .icon-btn:hover {
  border-color: var(--icq-green);
  transform: translateY(-1px);
}

.cash-pill {
  color: var(--gold);
  border-color: rgba(250, 204, 21, 0.35);
}

.user-pill-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.user-pill-info strong {
  font-size: 0.78rem;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill-info small {
  font-size: 0.64rem;
  color: var(--text-muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-online { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.status-away { background: #eab308; }
.status-dnd { background: #ef4444; }
.status-invisible { background: #94a3b8; border: 1.5px dashed #f8fafc; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.fullscreen-btn {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--icq-green);
  color: var(--icq-green);
  font-weight: bold;
}

/* ==========================================================================
   MARKUS ICQ MESSENGER BAR
   ========================================================================== */
.icq-messenger-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.12), rgba(250, 204, 21, 0.08));
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.msg-avatar {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-card-alt);
  border: 1px solid var(--icq-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.msg-online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid var(--bg-main);
}

.msg-content {
  flex: 1;
  min-width: 0;
}

.msg-sender {
  font-size: 0.7rem;
  color: var(--icq-green);
}

.msg-uin {
  color: var(--text-muted);
  font-weight: normal;
}

.msg-text {
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-action-btn {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ==========================================================================
   MAIN STAGE & VIEWS
   ========================================================================== */
.main-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.view {
  display: none;
  width: 100%;
  height: 100%;
}

.view.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   VIEW 1: LOBBY
   ========================================================================== */
#view-lobby {
  overflow-y: auto;
  padding: 12px;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.lobby-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-header-row h2 {
  font-size: 1.02rem;
  font-weight: 800;
}

.device-sync-badge {
  font-size: 0.72rem;
  background: rgba(34, 197, 94, 0.15);
  color: var(--icq-green);
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-weight: 600;
}

.checkpoint-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-alt);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.checkpoint-bar select {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  flex: 1;
}

.checkpoint-hint {
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 700;
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--bg-card-alt);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.mode-btn:hover {
  transform: translateY(-2px);
  border-color: var(--icq-green);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.mode-btn.primary-mode {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(15, 23, 42, 0.85));
  border-color: var(--icq-green);
}

.mode-icon {
  font-size: 1.65rem;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mode-info {
  flex: 1;
  min-width: 0;
}

.mode-title {
  font-size: 0.94rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mode-info p {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.mode-badge {
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-blue);
  font-weight: 800;
}
.mode-badge.hot {
  background: var(--icq-green);
  color: #052e16;
}
.mode-badge.gold {
  background: var(--gold);
  color: #422006;
}

.mode-arrow {
  font-size: 1rem;
  color: var(--icq-green);
  font-weight: 900;
}

.personal-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: auto;
}

.p-stat {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  text-align: center;
}

.p-stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.p-stat strong {
  font-size: 0.95rem;
  color: var(--gold);
}

/* Lobby Side */
.lobby-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-lb-card {
  flex: 1;
  min-height: 200px;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--icq-green);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.lb-mini-tabs {
  display: flex;
  gap: 6px;
}

.lb-tab, .lb-tab-modal {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  cursor: pointer;
}

.lb-tab.active, .lb-tab-modal.active {
  background: var(--icq-green);
  color: #052e16;
  border-color: var(--icq-green);
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  overflow-y: auto;
  max-height: 220px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--bg-card-alt);
  font-size: 0.8rem;
}

.lb-row.is-me {
  border: 1px solid var(--icq-green);
  background: rgba(34, 197, 94, 0.12);
}

.lb-rank {
  width: 24px;
  font-weight: 900;
  text-align: center;
}

.lb-user {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-user small {
  color: var(--text-muted);
  font-size: 0.68rem;
  margin-left: 4px;
}

.lb-score {
  font-weight: 800;
  color: var(--gold);
}

.global-counter-bar {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 4px;
  border-top: 1px solid var(--border-color);
}

.global-counter-bar strong {
  color: var(--icq-green);
}

/* Markus Inventor Card */
.markus-tribute-card {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.14), rgba(34, 197, 94, 0.12));
  border-color: rgba(250, 204, 21, 0.4);
}

.markus-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.markus-seal {
  font-size: 1.7rem;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid rgba(250, 204, 21, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.markus-card-text h3 {
  font-size: 0.92rem;
}

.markus-card-text h3 span {
  color: var(--gold);
  text-decoration: underline;
}

.markus-card-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.markus-card-actions {
  display: flex;
  gap: 8px;
}

.applause-btn, .shop-shortcut-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.16);
  color: var(--gold);
  transition: transform 0.12s;
}

.shop-shortcut-btn {
  background: var(--bg-card-alt);
  color: var(--text-main);
  border-color: var(--border-color);
  flex: 0.65;
}

.applause-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   VIEW 2: ACTIVE GAME ARENA
   ========================================================================== */
#view-game {
  padding: 8px 10px;
  gap: 6px;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex-shrink: 0;
}

.hud-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hud-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hud-val {
  font-size: 1.05rem;
  font-weight: 900;
}

.target-val {
  color: var(--icq-green);
}

.combo-pill {
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 0.64rem;
  background: var(--gold);
  color: #0f172a;
  padding: 1px 5px;
  border-radius: 99px;
  font-weight: 900;
}

.lives-petals {
  font-size: 0.88rem;
  letter-spacing: 1px;
}

/* Timer Strip */
.timer-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.timer-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--bg-card);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #eab308);
  transition: width 0.1s linear;
}

.timer-bar-fill.frozen {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}

.timer-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.timer-text {
  font-size: 0.82rem;
  font-weight: 800;
  min-width: 46px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.modifier-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.78rem;
  text-align: center;
  flex-shrink: 0;
}

.modifier-banner.dollar-rush {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.25), rgba(34, 197, 94, 0.25));
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}

/* THE LETTER BOARD */
.board-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.letter-board {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 5px;
  place-items: stretch;
}

.tile {
  background: var(--bg-tile);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-board);
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  position: relative;
  transition: background-color 0.1s, transform 0.1s;
  line-height: 1;
  padding: 0;
}

.tile:hover {
  background: var(--bg-tile-hover);
}

.tile:active {
  transform: scale(0.92);
}

/* Tile States */
.tile.found-q {
  background: #22c55e !important;
  color: #052e16 !important;
  border-color: #fde047 !important;
  transform: scale(1.08);
  z-index: 2;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.8);
}

.tile.found-dollar-q {
  background: linear-gradient(135deg, #fde047, #eab308) !important;
  color: #0f172a !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.9);
}

.tile.wrong-tap {
  background: #ef4444 !important;
  color: #ffffff !important;
  animation: shakeTile 0.35s ease;
}

.tile.eliminated {
  opacity: 0.14;
  pointer-events: none;
  transform: scale(0.85);
}

/* Twist Modifiers on Tiles */
.tile.wobble span {
  display: inline-block;
  animation: tileWobble 2.4s infinite ease-in-out;
}

.tile.spin-slow span {
  display: inline-block;
  animation: tileSpin 6s infinite linear;
}

.tile.dollar-tile {
  border-color: rgba(250, 204, 21, 0.45);
}

@keyframes shakeTile {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-4px); }
}

@keyframes tileWobble {
  0%, 100% { transform: rotate(-18deg); }
  50% { transform: rotate(18deg); }
}

@keyframes tileSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Radar / Spotlight Overlay for "Invisible" Mode
   - Sweeps automatically hands-free!
   - If steered by finger on mobile, sits 95px ABOVE the thumb so the thumb never covers the Q! */
.flashlight-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background:
    radial-gradient(
      circle 125px at var(--fx-x, 50%) var(--fx-y, 35%),
      rgba(34, 197, 94, 0.08) 0%,
      transparent 65%,
      rgba(2, 6, 23, 0.62) 100%
    );
}

.flashlight-overlay::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  left: var(--fx-x, 50%);
  top: var(--fx-y, 35%);
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(34, 197, 94, 0.55);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.25) inset;
  pointer-events: none;
}

/* Highlight when Markus-Lupe powerup is used */
.tile.hint-zone {
  border-color: var(--gold) !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.55);
  animation: pulseHintZone 1s infinite ease-in-out;
}

@keyframes pulseHintZone {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Bottom Power-Up Dock */
.powerup-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex-shrink: 0;
}

.pu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: transform 0.12s, border-color 0.12s;
}

.pu-btn:hover {
  border-color: var(--icq-green);
}

.pu-btn:active {
  transform: scale(0.95);
}

.pu-icon {
  font-size: 1.05rem;
}

.pu-name {
  font-size: 0.75rem;
  font-weight: 700;
}

.pu-count {
  background: var(--icq-green);
  color: #052e16;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 99px;
}

.quit-btn {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-large {
  max-width: 580px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.08rem;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  cursor: pointer;
  font-weight: bold;
}

.profile-tabs {
  display: flex;
  gap: 6px;
}

.ptab {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.ptab.active {
  background: var(--icq-green);
  color: #052e16;
  border-color: var(--icq-green);
}

.ptab-content {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.ptab-content.active {
  display: flex;
}

.info-callout {
  background: var(--bg-card-alt);
  border-left: 4px solid var(--icq-green);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.info-callout p {
  margin-top: 4px;
  color: var(--text-muted);
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
}

.form-label small {
  font-weight: normal;
  color: var(--text-muted);
}

.form-label input,
.form-label select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  font-size: 0.92rem;
}

.form-feedback {
  font-size: 0.8rem;
  min-height: 18px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-primary, .btn-secondary, .btn-rescue {
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--icq-green);
  color: #052e16;
}

.btn-secondary {
  background: var(--bg-card-alt);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-rescue {
  background: linear-gradient(135deg, #fde047, #eab308);
  color: #0f172a;
}

/* Shop Modal */
.shop-balance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-alt);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.shop-cash {
  color: var(--gold);
  font-size: 1.05rem;
}

.shop-section-title {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 10px;
}

.shop-icon {
  font-size: 1.5rem;
  width: 40px;
  text-align: center;
}

.shop-details {
  flex: 1;
}

.shop-details strong {
  font-size: 0.88rem;
}

.shop-details p {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.shop-details small {
  font-size: 0.7rem;
  color: var(--icq-green);
}

.btn-buy {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--gold);
  color: #0f172a;
  font-weight: 800;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-buy.active-skin {
  background: var(--icq-green);
  color: #052e16;
}

/* Markus Modal */
.markus-hero-box {
  text-align: center;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(34, 197, 94, 0.15));
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 12px;
  padding: 16px;
}

.markus-big-badge {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.markus-quote {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-main);
}

.markus-story {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.markus-facts {
  margin-top: 8px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Gameover Modal */
.gameover-card {
  text-align: center;
}

.gameover-icon {
  font-size: 2.6rem;
}

.go-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.go-stat {
  background: var(--bg-card-alt);
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.go-stat span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.go-stat strong {
  font-size: 1.15rem;
}

.cash-text {
  color: var(--gold);
}

.new-record-banner {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid var(--icq-green);
  color: var(--icq-green);
  padding: 8px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.85rem;
}

/* Floating Particles */
#fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.fx-particle {
  position: absolute;
  font-size: 1.4rem;
  font-weight: 900;
  animation: floatUpFade 1.1s ease-out forwards;
}

@keyframes floatUpFade {
  0% { transform: translateY(0) scale(0.8); opacity: 1; }
  100% { transform: translateY(-70px) scale(1.25); opacity: 0; }
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   MOBILE RESPONSIVE TUNING (Phones Portrait & Small Screens)
   ========================================================================== */
@media (max-width: 780px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }

  .brand-sub {
    display: none;
  }

  .pu-name {
    display: none;
  }

  .pu-btn {
    padding: 9px 4px;
  }
}

@media (max-width: 420px) {
  .icq-header {
    padding: 6px 8px;
  }
  .brand-text h1 {
    font-size: 1.05rem;
  }
  .icq-tag {
    display: none;
  }
  .user-pill-info small {
    display: none;
  }
}

