/* ===== Games launcher + Color Dice (shared by chat.php / feed.php) ===== */

.fm-games-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border, rgba(255,255,255,.1));
  background: var(--surface-2, #1e1e2a);
  color: var(--text-2, #9494a8);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition, .2s ease);
  padding: 0;
}
.fm-games-btn:hover {
  color: #fff;
  border-color: var(--primary, #5b5fea);
  background: rgba(var(--primary-rgb, 91,95,234), .15);
}

.fm-games-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2147483000;
}
.fm-games-overlay.open { display: flex; }

.fm-games-modal {
  width: min(380px, 100%);
  max-height: min(740px, 92vh);
  background: var(--surface, #16161e);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text, #e8e8ee);
  animation: fmgPop .18s ease;
}
@keyframes fmgPop {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fm-games-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.1));
  flex-shrink: 0;
}
.fm-games-title {
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.fm-games-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border, rgba(255,255,255,.1));
  background: var(--surface-2, #1e1e2a);
  color: var(--text-2, #9494a8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition, .2s ease);
  font-size: 13px;
}
.fm-games-close:hover { color: #fff; border-color: var(--red, #ef4444); }

.fm-games-body { overflow-y: auto; flex: 1; min-height: 0; padding: 14px; }
.fm-games-list { display: flex; flex-direction: column; gap: 10px; }

.fm-game-item {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--surface-2, #1e1e2a);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  color: var(--text, #e8e8ee);
  font-family: inherit;
  transition: var(--transition, .2s ease);
}
.fm-game-item:hover {
  border-color: var(--primary, #5b5fea);
  background: var(--surface-3, #262636);
  transform: translateY(-1px);
}
.fm-game-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary, #5b5fea), #818cf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.fm-game-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fm-game-name { font-weight: 700; font-size: 14px; }
.fm-game-desc { font-size: 12px; color: var(--text-3, #6b6b80); line-height: 1.4; }
.fm-game-arrow { color: var(--text-3, #6b6b80); }

.fm-games-foot {
  border-top: 1px solid var(--border, rgba(255,255,255,.1));
  padding: 10px 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fm-games-back {
  border: 1px solid var(--border, rgba(255,255,255,.1));
  background: var(--surface-2, #1e1e2a);
  color: var(--text-2, #9494a8);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition, .2s ease);
}
.fm-games-back:hover { color: #fff; border-color: var(--primary, #5b5fea); }

/* ===== Color Dice ===== */
.fmg-dice { display: flex; flex-direction: column; gap: 12px; }
.fmg-dice.flash { border-radius: 12px; animation: fmgCdCardFlash 1.2s ease-in-out infinite; }
@keyframes fmgCdCardFlash {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 193, 7, 0); }
  50% { box-shadow: 0 0 30px rgba(255, 193, 7, 0.6), inset 0 0 20px rgba(34, 197, 94, 0.25); }
}
.fmg-dice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fmg-dice-head-title { font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
.fmg-dice-round { font-size: 12px; color: var(--text-2, #9494a8); }

.fmg-timer {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 10px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 183, 0.5);
  background: rgba(52, 211, 153, 0.13);
  color: #6ee7b7;
  box-shadow: 0 0 14px rgba(110, 231, 183, 0.28);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.4;
  box-sizing: border-box;
  transition: color .3s ease, border-color .3s ease, background .3s ease, box-shadow .3s ease;
}
.fmg-timer > i.fa { font-size: 12px; opacity: 0.9; }
.fmg-timer-txt { position: relative; z-index: 1; white-space: nowrap; }
.fmg-timer-radar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
}
.fmg-timer-radar i {
  position: absolute;
  top: 0;
  left: -45%;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: #a7f3d0;
  animation: fmgTimerSweep 1.5s linear infinite;
}
@keyframes fmgTimerSweep {
  0% { left: -45%; }
  100% { left: 110%; }
}
.fmg-timer-open {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.6);
  background: rgba(52, 211, 153, 0.15);
  box-shadow: 0 0 16px rgba(110, 231, 183, 0.32);
}
.fmg-timer-open .fmg-timer-radar i { background: #a7f3d0; }
.fmg-timer-wait {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.5);
  background: rgba(52, 211, 153, 0.12);
  box-shadow: 0 0 12px rgba(110, 231, 183, 0.22);
}
.fmg-timer-wait .fmg-timer-radar i { background: #a7f3d0; }
.fmg-timer-roll {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.55);
  background: rgba(52, 211, 153, 0.13);
  animation: fmgTimerRollPulse 1s ease-in-out infinite;
}
.fmg-timer-roll .fmg-timer-radar i { background: #a7f3d0; }
@keyframes fmgTimerRollPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(110, 231, 183, 0.3); }
  50% { box-shadow: 0 0 18px rgba(110, 231, 183, 0.6); }
}
.fmg-timer-off { color: var(--text-3, #6b6b80); opacity: 0.85; }
.fmg-timer-off .fmg-timer-radar i { background: #a7f3d0; animation: none; }
.fmg-dice-status { font-size: 13px; color: var(--text-2, #9494a8); line-height: 1.45; }
.fmg-dice-status.err { color: #f87171; }
.fmg-dice-balance { font-size: 13px; color: var(--text, #e8e8ee); font-weight: 700; }

.fmg-dice-colors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fmg-tile {
  background: var(--surface-2, #1e1e2a);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.fmg-tile.mine { border-color: var(--primary, #5b5fea); }
.fmg-tile-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: block;
  box-shadow: inset -2px -3px 6px rgba(0,0,0,.25);
}
.fmg-tile-name { font-weight: 800; font-size: 13px; }
.fmg-tile-meta { font-size: 11px; color: var(--text-3, #6b6b80); }
.fmg-tile-mybet { font-size: 11px; color: var(--primary, #5b5fea); font-weight: 800; }
.fmg-tile-bet { display: flex; gap: 6px; margin-top: 2px; }
.fmg-amount-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: var(--surface, #16161e);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  color: var(--text, #e8e8ee);
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.fmg-amount-input:focus { border-color: var(--primary, #5b5fea); }
.fmg-amount-input:disabled { opacity: .5; }
.fmg-bet-btn {
  flex-shrink: 0;
  border: none;
  background: var(--primary, #5b5fea);
  color: #fff;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition, .2s ease);
}
.fmg-bet-btn:hover { background: var(--primary-hover, #7074f0); }
.fmg-bet-btn:disabled { opacity: .5; cursor: not-allowed; }

.fmg-dice-roll {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 16, .88);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 5;
}
.fmg-dice-roll-label { font-weight: 800; font-size: 14px; letter-spacing: .03em; }
.fmg-dice-roll-row { display: flex; gap: 10px; }
.fmg-die {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
}
.fmg-die-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: block;
  background: var(--c, #888);
  box-shadow: inset -2px -3px 6px rgba(0,0,0,.25);
}

.colordice-last {
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.colordice-last-head {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.colordice-last-dice {
  font-size: 1.3rem;
  letter-spacing: 4px;
}
.colordice-last-winners {
  font-size: 0.7rem;
  color: #ffc107;
  margin-top: 4px;
}
.colordice-last-winners.none {
  color: rgba(255, 255, 255, 0.5);
}

/* In-game Color Dice report log */
.fmg-dice-log {
  margin-top: 12px;
  border-radius: 10px;
  background: rgba(15, 15, 24, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.fmg-dice-log-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  font-weight: 800;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.fmg-dice-log-body {
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 0;
}
.fmg-dice-log-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 0.72rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.fmg-dice-log-row:last-child { border-bottom: none; }
.fmg-dice-log-round {
  flex-shrink: 0;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  min-width: 34px;
}
.fmg-dice-log-dice {
  flex-shrink: 0;
  letter-spacing: 2px;
}
.fmg-dice-log-wins {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffc107;
}
.fmg-dice-log-none {
  color: rgba(255, 255, 255, 0.4);
}

/* Winner board (shown when there are winners) */
.colordice-win-board {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  padding: 12px 10px;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.16), rgba(34, 197, 94, 0.14), rgba(59, 130, 246, 0.16));
  border: 1px solid rgba(255, 193, 7, 0.5);
  box-shadow: 0 0 24px rgba(255, 193, 7, 0.3), inset 0 0 18px rgba(34, 197, 94, 0.12);
  animation: fmgCdWinPop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.4), fmgCdWinGlow 1.8s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
@keyframes fmgCdWinPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fmgCdWinGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 193, 7, 0.28); }
  50% { box-shadow: 0 0 34px rgba(34, 197, 94, 0.5); }
}
.colordice-win-glow {
  position: absolute;
  top: -60%;
  left: -30%;
  width: 160%;
  height: 220%;
  background: conic-gradient(from 0deg, transparent 0 40deg, rgba(255, 255, 255, 0.12) 50deg, transparent 60deg);
  animation: fmgCdWinSweep 2.4s linear infinite;
  pointer-events: none;
}
@keyframes fmgCdWinSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.colordice-win-dice {
  font-size: 1.5rem;
  letter-spacing: 3px;
  line-height: 1;
  color: #fff;
  animation: fmgCdWinBounce 1s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.8));
}
@keyframes fmgCdWinBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.06); }
}
.colordice-win-title {
  font-family: var(--brand-font, 'Inter', system-ui, sans-serif);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #ffc107;
  text-shadow: 0 0 14px rgba(255, 193, 7, 0.8);
}
.colordice-win-text {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 95%;
  text-align: center;
}

.fmg-dice-payouts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fmg-dice-payouts-timer { justify-content: center; }
.fmg-dice-payouts + .fmg-dice-payouts { margin-top: 12px; justify-content: center; }
.fmg-dice-payouts span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2, #9494a8);
  background: var(--surface-2, #1e1e2a);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 999px;
  padding: 4px 10px;
}

/* Feed chat input button sizing */
.feed-chat-input-row .fm-games-btn {
  width: 34px;
  height: 34px;
  font-size: 14px;
}
.lc-composer-row .fm-games-btn { width: 38px; height: 38px; }

/* ===== Rock Paper Scissors ===== */
.fmg-rps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 4px 2px;
  color: #e6e6e6;
}
.fmg-rps.flash { border-radius: 14px; animation: fmgRpsWinGlow 1.3s ease-in-out infinite; }
@keyframes fmgRpsWinGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(250, 204, 21, 0); }
  50% { box-shadow: 0 0 34px rgba(250, 204, 21, .45), inset 0 0 22px rgba(250, 204, 21, .12); }
}

.fmg-rps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: radial-gradient(1200px 600px at 50% 0%, rgba(99,102,241,.18), rgba(20,20,30,.92));
  border: 1px solid rgba(99,102,241,.35);
  box-shadow: 0 10px 40px -20px rgba(99,102,241,.55), inset 0 1px 0 rgba(255,255,255,.08);
}

.fmg-rps-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: .2px;
  text-shadow: 0 2px 14px rgba(99,102,241,.45);
}

.fmg-rps-head-title i { color: #a5b4fc; }

.fmg-rps-round {
  font-size: 12px;
  opacity: .9;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15,15,24,.5);
  border: 1px solid rgba(255,255,255,.12);
}

.fmg-rps-status {
  text-align: center;
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(20,20,30,.6);
  border: 1px solid rgba(255,255,255,.1);
  min-height: 20px;
}
.fmg-rps-status.err {
  color: #fecaca;
  background: rgba(127, 29, 29, .35);
  border-color: rgba(248, 113, 113, .5);
  text-shadow: 0 0 10px rgba(248, 113, 113, .45);
}

.fmg-rps-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(15,15,24,.45);
  border: 1px solid rgba(255,255,255,.1);
  width: fit-content;
  margin: 0 auto;
}

.fmg-rps-players, .fmg-rps-ready { display: flex; align-items: center; gap: 6px; opacity: .95; }
.fmg-rps-balance { opacity: .95; }

.fmg-rps-arena {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 10px 10px;
  border-radius: 14px;
  background: radial-gradient(1400px 700px at 50% 40%, rgba(99,102,241,.16), rgba(15,15,24,.96));
  border: 1px solid rgba(99,102,241,.35);
  box-shadow: 0 20px 60px -30px rgba(99,102,241,.7), inset 0 1px 0 rgba(255,255,255,.08);
  min-height: 190px;
  overflow: hidden;
}

.fmg-rps-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vw, 28px);
  width: 100%;
}

.fmg-rps-vs-txt {
  font-weight: 900;
  font-size: clamp(18px, 4vw, 26px);
  letter-spacing: 1px;
  text-shadow: 0 6px 40px rgba(99,102,241,.6);
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(15,15,24,.5);
  border: 1px solid rgba(255,255,255,.15);
}

.fmg-rps-hand-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 0;
  max-width: 46%;
}

.fmg-rps-hand-name {
  font-size: 12px;
  opacity: .95;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15,15,24,.5);
  border: 1px solid rgba(255,255,255,.12);
}

.fmg-rps-hand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(84px, 18vw, 120px);
  height: clamp(84px, 18vw, 120px);
  border-radius: 50%;
  background: radial-gradient(120% 120% at 50% 40%, rgba(255,255,255,.22), rgba(40,40,60,.95));
  border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 18px 60px -24px rgba(99,102,241,.95), inset 0 2px 0 rgba(255,255,255,.25), inset 0 -10px 40px -20px rgba(0,0,0,.6);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  will-change: transform;
  user-select: none;
}

.fmg-rps-hand-emoji {
  font-size: clamp(40px, 9vw, 56px);
  line-height: 1;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,.45));
  transition: transform .25s ease;
}

.fmg-rps-hand-wrap.right .fmg-rps-hand,
.fmg-rps-hand-wrap.right .fmg-rps-hand-emoji {
  transform: scaleX(-1);
}

.fmg-rps-hand[data-hand="rock"] { border-color: rgba(148,163,184,.55); }
.fmg-rps-hand[data-hand="paper"] { border-color: rgba(96,165,250,.6); }
.fmg-rps-hand[data-hand="scissors"] { border-color: rgba(34,197,94,.6); }
.fmg-rps-hand[data-hand="none"] { opacity: .65; }

.fmg-rps-arena.rps-shake .fmg-rps-hand-wrap.left .fmg-rps-hand { animation: fmg-rps-shake-left .9s ease-in-out; }
.fmg-rps-arena.rps-shake .fmg-rps-hand-wrap.right .fmg-rps-hand { animation: fmg-rps-shake-right .9s ease-in-out; }

@keyframes fmg-rps-shake-left {
  0%,100% { transform: translateY(0) rotate(0deg); }
  15% { transform: translateY(-6px) rotate(-6deg); }
  30% { transform: translateY(0) rotate(4deg); }
  45% { transform: translateY(-4px) rotate(-4deg); }
  60% { transform: translateY(0) rotate(3deg); }
  75% { transform: translateY(-3px) rotate(-3deg); }
  90% { transform: translateY(0) rotate(1deg); }
}

@keyframes fmg-rps-shake-right {
  0%,100% { transform: translateY(0) rotate(0deg) scaleX(-1); }
  15% { transform: translateY(-6px) rotate(6deg) scaleX(-1); }
  30% { transform: translateY(0) rotate(-4deg) scaleX(-1); }
  45% { transform: translateY(-4px) rotate(4deg) scaleX(-1); }
  60% { transform: translateY(0) rotate(-3deg) scaleX(-1); }
  75% { transform: translateY(-3px) rotate(3deg) scaleX(-1); }
  90% { transform: translateY(0) rotate(-1deg) scaleX(-1); }
}

.fmg-rps-arena.rps-reveal .fmg-rps-hand-wrap.left .fmg-rps-hand { transform: translateX(4px) scale(1.05); }
.fmg-rps-arena.rps-reveal .fmg-rps-hand-wrap.right .fmg-rps-hand { transform: translateX(-4px) scale(1.05) scaleX(-1); }

.fmg-rps-arena.rps-win-left .fmg-rps-hand-wrap.left .fmg-rps-hand,
.fmg-rps-arena.rps-win-right .fmg-rps-hand-wrap.right .fmg-rps-hand {
  box-shadow: 0 0 0 3px rgba(34,197,94,.45), 0 24px 80px -20px rgba(34,197,94,.9), inset 0 2px 0 rgba(255,255,255,.3);
  animation: fmg-rps-bounce .6s ease-in-out 2;
}

.fmg-rps-arena.rps-win-left .fmg-rps-hand-wrap.right .fmg-rps-hand {
  box-shadow: 0 0 0 3px rgba(248,113,113,.4), 0 20px 70px -24px rgba(248,113,113,.8), inset 0 2px 0 rgba(255,255,255,.2);
}
.fmg-rps-arena.rps-win-right .fmg-rps-hand-wrap.left .fmg-rps-hand {
  box-shadow: 0 0 0 3px rgba(248,113,113,.5), 0 22px 80px -22px rgba(248,113,113,.95), inset 0 2px 0 rgba(255,255,255,.25);
}

/* "You" hand shines gold when you win, red when you lose */
.fmg-rps-arena.rps-win-left .fmg-rps-hand-wrap.left .fmg-rps-hand-emoji {
  filter: drop-shadow(0 0 8px rgba(250,204,21,.9)) drop-shadow(0 0 22px rgba(250,204,21,.55));
  animation: fmg-rps-glow-gold 1s ease-in-out infinite;
}
.fmg-rps-arena.rps-win-right .fmg-rps-hand-wrap.left .fmg-rps-hand-emoji {
  filter: drop-shadow(0 0 8px rgba(248,113,113,.9)) drop-shadow(0 0 22px rgba(248,113,113,.55));
  animation: fmg-rps-glow-red 1s ease-in-out infinite;
}
@keyframes fmg-rps-glow-gold {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(250,204,21,.9)) drop-shadow(0 0 22px rgba(250,204,21,.55)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(250,204,21,1)) drop-shadow(0 0 34px rgba(250,204,21,.75)); }
}
@keyframes fmg-rps-glow-red {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(248,113,113,.6)) drop-shadow(0 0 14px rgba(248,113,113,.4)); }
  50% { transform: scale(1.04); filter: drop-shadow(0 0 12px rgba(248,113,113,.95)) drop-shadow(0 0 28px rgba(248,113,113,.65)); }
}

@keyframes fmg-rps-bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px) scale(1.05); }
}

.fmg-rps-arena.rps-win-right .fmg-rps-hand-wrap.right .fmg-rps-hand { animation-name: fmg-rps-bounce-right; }
@keyframes fmg-rps-bounce-right {
  0%,100% { transform: translateY(0) scaleX(-1); }
  50% { transform: translateY(-6px) scale(1.05) scaleX(-1); }
}

.fmg-rps-arena.rps-draw .fmg-rps-hand {
  box-shadow: 0 0 0 2px rgba(250,204,21,.45), 0 20px 70px -24px rgba(250,204,21,.9), inset 0 2px 0 rgba(255,255,255,.25);
}

.fmg-rps-draw-heart {
  position: absolute;
  z-index: 20;
  font-size: 20px;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: fmg-rps-heart-up 1.8s ease-out forwards;
  filter: drop-shadow(0 0 6px rgba(244,63,94,.7)) drop-shadow(0 0 16px rgba(244,63,94,.45));
}
@keyframes fmg-rps-heart-up {
  0% { opacity: 0; transform: translate(-50%, -50%) translateY(8px) scale(.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(calc(var(--dx)), calc(var(--dy))) scale(1.1); }
}

.fmg-rps-result {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: rgba(15,15,24,.85);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 14px 50px -20px rgba(99,102,241,.95), inset 0 1px 0 rgba(255,255,255,.15);
  max-width: min(92vw, 320px);
  z-index: 2;
}

.fmg-rps-choices {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 4px;
}

.fmg-rps-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px 6px;
  min-width: clamp(68px, 20vw, 82px);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(20,20,30,.92));
  border: 1px solid rgba(255,255,255,.18);
  color: #e6e6e6;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

.fmg-rps-choice span {
  font-size: clamp(28px, 6vw, 36px);
  line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.45));
}

.fmg-rps-choice small {
  font-size: 11px;
  opacity: .95;
}

.fmg-rps-choice:hover { transform: translateY(-1px); }
.fmg-rps-choice:active { transform: translateY(1px) scale(.995); }
.fmg-rps-choice:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.fmg-rps-choice.picked {
  border-color: rgba(99,102,241,.7);
  background: linear-gradient(180deg, rgba(165,180,252,.28), rgba(30,30,50,.96));
  box-shadow: 0 0 0 2px rgba(99,102,241,.35), 0 18px 60px -20px rgba(99,102,241,.95), inset 0 1px 0 rgba(255,255,255,.25);
}

.fmg-rps-payouts-timer { justify-content: center; }

.fmg-rps-players-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(15,15,24,.45);
  border: 1px solid rgba(255,255,255,.1);
  max-height: 120px;
  overflow: auto;
}

.fmg-rps-pl-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(20,20,30,.6);
  border: 1px solid rgba(255,255,255,.12);
}

.fmg-rps-pl-item.me {
  border-color: rgba(99,102,241,.65);
  background: rgba(40,40,70,.7);
}

.fmg-rps-pl-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmg-rps-pl-move { font-size: 16px; line-height: 1; }

.fmg-rps-bet { color: #fcd34d; }
.fmg-coin-win { color: #4ade80; }
.fmg-coin-lose { color: #f87171; }

.fmg-coin-fly {
  position: absolute;
  z-index: 40;
  width: 26px;
  height: 26px;
  font-size: 22px;
  line-height: 26px;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px rgba(250,204,21,.55));
}
.fmg-coin-fly.up { animation: fmg-coin-fly-up 1.15s cubic-bezier(.25,.46,.45,.94) forwards; }
.fmg-coin-fly.down { animation: fmg-coin-fly-down 1.15s ease-in forwards; }
@keyframes fmg-coin-fly-up {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.9); }
}
@keyframes fmg-coin-fly-down {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  40% { opacity: 1; transform: translate(calc(-50% + var(--mx)), calc(-50% + var(--my))) scale(1.05); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.8); }
}
.fmg-rps-balance { transition: color .3s ease, text-shadow .3s ease, transform .3s ease; }
.fmg-rps-balance.fmg-coin-up { color: #ffe066; text-shadow: 0 0 14px rgba(250,204,21,.9); transform: scale(1.35); }
.fmg-rps-balance.fmg-coin-down { color: #f87171; text-shadow: 0 0 14px rgba(248,113,113,.9); transform: scale(.85); }
.fmg-rps-arena.rps-coin-win { box-shadow: 0 20px 60px -30px rgba(250,204,21,.8), inset 0 1px 0 rgba(255,255,255,.08); }
.fmg-rps-arena.rps-coin-lose { box-shadow: 0 20px 60px -30px rgba(248,113,113,.7), inset 0 1px 0 rgba(255,255,255,.08); }

/* ---------- Rock Paper Scissors duels ---------- */
.fmg-rps-duels,
.fmg-rps-challengers {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15,15,24,.55);
  border: 1px solid rgba(255,255,255,.1);
}

.fmg-duels-title,
.fmg-chlg-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .3px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255,255,255,.14);
  margin-bottom: 8px;
  color: #cfd3f0;
}

.fmg-duel-row,
.fmg-chlg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(20,20,30,.6);
  border: 1px solid rgba(255,255,255,.1);
  margin-bottom: 6px;
  font-size: 12.5px;
}

.fmg-duel-row:last-child,
.fmg-chlg-row:last-child { margin-bottom: 0; }

.fmg-duel-row.settled { border-color: rgba(34,197,94,.4); }
.fmg-duel-row.cancelled { opacity: .6; }

.fmg-duel-row.win { border-color: rgba(250,204,21,.45); }
.fmg-duel-row.lose { border-color: rgba(248,113,113,.4); }
.fmg-duel-row.draw { border-color: rgba(148,163,184,.35); }
.fmg-rps-log-moves { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; line-height: 1.5; }
.fmg-rps-log-vs { opacity: .5; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.fmg-rps-log-opp { opacity: .6; font-size: 11px; }

.fmg-duel-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; line-height: 1.45; }
.fmg-duel-sub { opacity: .65; font-size: 11px; }
.fmg-duel-label { opacity: .75; font-size: 11px; font-weight: 600; }

.fmg-duel-actions,
.fmg-chlg-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fmg-duel-btn,
.fmg-duel-move {
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(20,20,30,.92));
  color: #e6e6e6;
  cursor: pointer;
  border-radius: 9px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.fmg-duel-btn { padding: 6px 12px; font-size: 12px; font-weight: 600; }
.fmg-duel-move { padding: 6px 10px; font-size: 15px; line-height: 1; }
.fmg-duel-btn:hover,
.fmg-duel-move:hover { transform: translateY(-1px); border-color: rgba(99,102,241,.55); box-shadow: 0 6px 16px -8px rgba(99,102,241,.7); }
.fmg-duel-btn.cancel,
.fmg-duel-btn.decline { border-color: rgba(239,68,68,.4); color: #fda4a4; }
.fmg-duel-btn.cancel:hover,
.fmg-duel-btn.decline:hover { border-color: rgba(239,68,68,.7); }

.fmg-chlg-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: -4px;
  margin-right: 2px;
}

.fmg-chlg-wait { opacity: .65; font-size: 11.5px; font-style: italic; }

.fmg-chlg-empty {
  padding: 10px;
  border-radius: 10px;
  background: rgba(20,20,30,.5);
  border: 1px dashed rgba(255,255,255,.14);
  font-size: 12px;
  opacity: .85;
  text-align: center;
}

.fmg-chlg-byuser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,.14);
}

.fmg-duel-name {
  flex: 1 1 130px;
  min-width: 130px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(10,10,18,.85);
  color: #e6e6e6;
  font-size: 12.5px;
}
.fmg-duel-name:focus { outline: none; border-color: rgba(99,102,241,.6); }

.fmg-name-suggest { position: relative; flex: 1 1 130px; min-width: 130px; }
.fmg-name-suggest .fmg-duel-name { width: 100%; flex: none; }
.fmg-name-suggest-list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(15,15,24,.98);
  border: 1px solid rgba(99,102,241,.45);
  border-radius: 10px;
  box-shadow: 0 16px 50px -16px rgba(0,0,0,.85);
}
.fmg-name-suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background .12s ease;
}
.fmg-name-suggest-item:hover { background: rgba(99,102,241,.18); }
.fmg-name-suggest-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,.1);
}
.fmg-name-suggest-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fmg-name-suggest-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmg-name-suggest-uname { font-size: 11px; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmg-name-suggest-go { color: rgba(255,255,255,.45); font-size: 11px; flex-shrink: 0; }
.fmg-name-suggest-empty { padding: 9px 11px; font-size: 12px; opacity: .75; }

.fmg-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, rgba(99,102,241,.85), rgba(168,85,247,.85));
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 2px 8px -2px rgba(0,0,0,.5);
  user-select: none;
}
.fmg-chlg-avatar.fmg-avatar-fallback {
  width: 20px;
  height: 20px;
  font-size: 11px;
  border-radius: 50%;
  vertical-align: -4px;
  margin-right: 2px;
}
.fmg-name-suggest-avatar.fmg-avatar-fallback {
  width: 30px;
  height: 30px;
  font-size: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fmg-duel-amount-wrap {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.fmg-duel-amount {
  width: 74px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(10,10,18,.85);
  color: #e6e6e6;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* Shared RPS challenge/duel modifiers */
.fmg-chlg-wait { opacity: .65; font-size: 11.5px; font-style: italic; white-space: nowrap; }
.fmg-duel-move.act {
  border-color: rgba(52,211,153,.45);
  background: rgba(52,211,153,.12);
}
.fmg-duel-move:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Mobile: all games go full screen */
@media (max-width: 640px) {
  .fm-games-overlay {
    padding: 0;
    background: var(--surface, #16161e);
  }
  .fm-games-modal {
    width: 100%;
    max-width: 100%;
    max-height: none;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* Plappy Bird: true full screen (toggle button / Esc) */
.fm-games-overlay.fmg-fs {
  padding: 0;
  background: #05060a;
}
.fm-games-overlay.fmg-fs .fm-games-modal {
  width: 100%;
  max-width: 100%;
  max-height: none;
  height: 100%;
  height: 100dvh;
  border-radius: 0;
  border: none;
  box-shadow: none;
  /* the pop animation transforms the modal, which would make the
     viewport-anchored stage resolve against the modal instead of the
     viewport and leave a gap at the top */
  animation: none;
}
.fm-games-overlay.fmg-fs .fm-games-head,
.fm-games-overlay.fmg-fs .fm-games-foot { display: none; }
.fm-games-overlay.fmg-fs .fm-games-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fm-games-overlay.fmg-fs .fmg-flappy {
  position: relative;
  flex: 0 0 auto;
  min-height: 0;
  gap: 0;
  padding: 0;
}
/* Playfield owns the whole viewport; the HUD floats on top of it.
   position:fixed + inset:0 anchors the canvas to the viewport itself, so no
   padding/border/rounding anywhere in the chain can leave a gap at the top. */
.fm-games-overlay.fmg-fs .fmg-flappy-stage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0;
  border: none;
}
/* Scores and coins sit at the very top of the playfield. The header keeps
   only the exit button, floated to the top-right, so nothing pushes the HUD
   down. The stage and the HUD are all viewport-fixed: the flappy view is a
   sibling of .fm-games-body rather than a child, so anchoring to it would
   drop the HUD into the middle of the screen. */
.fm-games-overlay.fmg-fs .fmg-flappy-head {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  z-index: 4;
  padding: 8px 10px;
  background: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  pointer-events: none;
}
.fm-games-overlay.fmg-fs .fmg-flappy-head-title,
.fm-games-overlay.fmg-fs .fmg-flappy-head-note { display: none; }
.fm-games-overlay.fmg-fs .fmg-flappy-fs { pointer-events: auto; }
.fm-games-overlay.fmg-fs .fmg-flappy-stats {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  /* right padding reserves the corner the exit button occupies */
  padding: 8px 52px 12px 10px;
  background: linear-gradient(180deg, rgba(5,6,10,.78), rgba(5,6,10,0));
  pointer-events: none;
}
.fm-games-overlay.fmg-fs .fmg-flappy-stat { pointer-events: auto; }
.fm-games-overlay.fmg-fs .fmg-flappy-lb { display: none !important; }

/* ---------- RPS Duel Arena modal ---------- */
.fm-rps-arena-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483200;
  background: rgba(0, 0, 0, .68);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fm-rps-arena-card {
  width: min(340px, 100%);
  background: radial-gradient(1200px 700px at 50% 0%, rgba(99,102,241,.2), rgba(15,15,24,.98));
  border: 1px solid rgba(99,102,241,.5);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.08);
  color: #e8e8ee;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  animation: fmgPop .18s ease;
}
.fm-rps-arena-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fm-rps-arena-title {
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fm-rps-arena-title i { color: #a5b4fc; }
.fm-rps-arena-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(15,15,24,.6);
  color: #d6d6e4;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fm-rps-arena-close:hover { border-color: rgba(239,68,68,.6); color: #fda4a4; }

.fm-rps-arena-vs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(15,15,24,.55);
  border: 1px solid rgba(99,102,241,.3);
}
.fm-rps-arena-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fm-rps-arena-hand {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  background: radial-gradient(circle at 50% 35%, rgba(99,102,241,.35), rgba(15,15,24,.9));
  border: 1px solid rgba(99,102,241,.4);
  box-shadow: inset 0 0 22px rgba(99,102,241,.28);
}
.fm-rps-arena-hand-emoji { line-height: 1; }
.fm-rps-arena-name {
  font-size: 12.5px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fm-rps-arena-vs-txt {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 1px;
  color: #a5b4fc;
  text-shadow: 0 0 14px rgba(99,102,241,.6);
}
.fm-rps-arena-status {
  min-height: 22px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.5;
  color: #dcdcf0;
}
.fm-rps-arena-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.fm-rps-arena-moves {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .fm-rps-arena-modal { padding: 10px; }
}

/* ---------- RPS Duel invite modal (pops up for the challenged player) ---------- */
.fm-rps-invite-modal { z-index: 2147483400; }
.fm-rps-invite-modal .fm-rps-arena-card {
  width: min(360px, 100%);
  border-color: rgba(165,180,252,.6);
}
.fm-rps-invite-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 2px;
}
.fm-rps-invite-av { flex: 0 0 auto; }
.fm-rps-invite-avatar {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 50%;
  border: 2px solid rgba(165,180,252,.6);
  object-fit: cover;
  background: rgba(15,15,24,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  color: #cdd5f8;
}
.fm-rps-invite-txt {
  font-size: 13.5px;
  line-height: 1.5;
  color: #dcdcf0;
}
.fm-rps-invite-txt b { color: #fff; }
.fm-rps-invite-actions {
  display: flex;
  gap: 8px;
}
.fm-rps-invite-actions .fmg-duel-btn { flex: 1; }
.fm-rps-invite-actions .fmg-duel-btn i { margin-right: 4px; }

/* ===== Plappy Bird ===== */
.fmg-flappy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 4px 2px;
  color: #e6e6e6;
}
.fmg-flappy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: radial-gradient(1200px 600px at 50% 0%, rgba(251,146,60,.18), rgba(20,20,30,.92));
  border: 1px solid rgba(251,146,60,.35);
  box-shadow: 0 10px 40px -20px rgba(251,146,60,.55), inset 0 1px 0 rgba(255,255,255,.08);
}
.fmg-flappy-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: .2px;
  text-shadow: 0 2px 14px rgba(251,146,60,.45);
}
.fmg-flappy-head-title i { color: #fdba74; }
.fmg-flappy-head-note {
  font-size: 11px;
  opacity: .9;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15,15,24,.5);
  border: 1px solid rgba(255,255,255,.12);
}
.fmg-flappy-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fmg-flappy-fs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(15,15,24,.5);
  border: 1px solid rgba(255,255,255,.12);
  color: #e6e6e6;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.fmg-flappy-fs i { pointer-events: none; }
.fmg-flappy-fs:hover {
  background: rgba(251,146,60,.22);
  border-color: rgba(251,146,60,.55);
  color: #fdba74;
}
.fmg-flappy-fs.act {
  background: rgba(251,146,60,.3);
  border-color: rgba(251,146,60,.7);
  color: #fff;
}
.fmg-flappy-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fmg-flappy-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(20,20,30,.6);
  border: 1px solid rgba(255,255,255,.1);
  color: #cfd0e4;
}
.fmg-flappy-stat i { color: #fbbf24; }
.fmg-flappy-stat b {
  color: #fff;
  font-size: 13px;
}
.fmg-flappy-stat-logo {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  object-fit: contain;
  background: rgba(15,15,24,.4);
  border: 1px solid rgba(255,255,255,.18);
  filter: drop-shadow(0 0 6px #fde047) drop-shadow(0 0 14px rgba(250,204,21,.6));
  animation: fmgCoinFloat 1.6s ease-in-out infinite;
}
@keyframes fmgCoinFloat {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50%      { transform: translateY(-2px) rotate(8deg); }
}
.fmg-flappy-stage {
  position: relative;
  height: 470px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, #4fb3ff, #a4dcff 60%, #dff3ff);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.fmg-flappy-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.fmg-flappy-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(10,16,28,.22);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.fmg-flappy-card {
  width: min(250px, 92%);
  text-align: center;
  background: rgba(16,20,34,.9);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  padding: 18px 16px 16px;
  box-shadow: 0 18px 50px -20px rgba(0,0,0,.7);
  color: #eee;
}
.fmg-flappy-bird {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #7c2d12;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 0 20px rgba(250,204,21,.7);
  animation: fmgBirdBob 1.4s ease-in-out infinite;
}
@keyframes fmgBirdBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.fmg-flappy-card h3 {
  margin: 10px 0 2px;
  font-size: 18px;
  letter-spacing: .3px;
}
.fmg-flappy-card p {
  margin: 4px 0 10px;
  font-size: 12px;
  opacity: .85;
  line-height: 1.5;
}
.fmg-flappy-result {
  font-size: 13px;
  font-weight: 700;
  margin: 6px 0 2px;
  color: #fff;
}
.fmg-flappy-result .fmg-flappy-good { color: #fbbf24; text-shadow: 0 0 12px rgba(250,204,21,.6); }
.fmg-flappy-bestlabel {
  font-size: 12px;
  opacity: .8;
  margin-bottom: 10px;
  color: #c9cae0;
}
.fmg-flappy-play {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.15);
  background: linear-gradient(135deg, #f97316, #f59e0b);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 10px 26px -14px rgba(249,115,22,.9);
}
.fmg-flappy-play:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.fmg-flappy-play:active {
  transform: translateY(0) scale(.98);
}
.fmg-flappy-award {
  margin-top: 6px;
  font-size: 13px;
  color: #fde047;
  text-shadow: 0 0 10px rgba(250,204,21,.55);
}
.fmg-flappy-fin {
  margin-top: 8px;
  font-size: 14px;
  color: #fff;
}
.fmg-flappy-stat.boss b {
  color: #f87171;
  text-shadow: 0 0 10px rgba(248,113,113,.7);
}
.fmg-flappy-stat.boss {
  border: 1px solid rgba(248,113,113,.45);
}
.fmg-flappy-lb {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(20,20,30,.55);
  padding: 8px;
}
.fmg-flappy-lb-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  padding: 2px 4px 8px;
}
.fmg-flappy-lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 12.5px;
}
.fmg-flappy-lb-row + .fmg-flappy-lb-row { border-top: 1px solid rgba(255,255,255,.06); }
.fmg-flappy-lb-row.me {
  background: rgba(251,146,60,.14);
  border: 1px solid rgba(251,146,60,.3);
}
.fmg-flappy-lb-rank {
  width: 20px;
  font-weight: 800;
  color: #94a3b8;
  text-align: center;
}
.fmg-flappy-lb-row.gold .fmg-flappy-lb-rank { color: #fbbf24; }
.fmg-flappy-lb-row.silver .fmg-flappy-lb-rank { color: #d7dbe7; }
.fmg-flappy-lb-row.bronze .fmg-flappy-lb-rank { color: #ea8c4a; }
.fmg-flappy-lb-av {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(15,15,24,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: #cfd0e4;
}
.fmg-flappy-lb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #dcdcf0;
}
.fmg-flappy-lb-best b { color: #fff; }
.fmg-flappy-lb-best small { opacity: .6; margin-left: 2px; }
.fmg-flappy-lb-earned { color: #fde047; font-weight: 700; white-space: nowrap; }
.fmg-flappy-lb-empty {
  padding: 12px 8px;
  text-align: center;
  font-size: 12px;
  color: #9aa0b8;
}
.fmg-flappy-lb-mine {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 12px;
  text-align: center;
  color: #dcdcf0;
  background: rgba(15,15,24,.6);
  border: 1px dashed rgba(255,255,255,.15);
}
.fmg-flappy-lb-mine b { color: #fde047; }
@media (max-height: 560px) {
  .fmg-flappy-stage { height: 390px; }
}