/* =================== زون كيو — fun features =================== */
.nav-emoji { width: 20px; text-align: center; font-size: 17px; }
.daily-dot { width: 9px; height: 9px; border-radius: 50%; background: #F43F5E; margin-inline-start: auto; box-shadow: 0 0 0 3px rgba(244, 63, 94, .2); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); } }
.trophy { margin-inline-start: 4px; font-size: 13px; }
.status-chip { background: var(--primary-soft); color: var(--primary); border-radius: 99px; padding: 1px 8px; font-size: 11px; margin-inline-start: 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-btn { font-size: 19px; }

/* typing */
.typing-line { color: var(--primary) !important; font-weight: 700; }
.dots { display: inline-flex; gap: 3px; margin-inline-end: 4px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* message layout: bubble + reactions stack, hover actions */
.msg .stack { display: flex; flex-direction: column; min-width: 0; }
.msg.out .stack { align-items: flex-end; }
.msg.in .stack { align-items: flex-start; }
.msg-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; align-self: center; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg-actions button { border: 0; background: var(--surface); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; color: var(--muted); box-shadow: var(--shadow); font-size: 13px; }
.msg-actions button:hover { color: var(--primary); }
.msg.flash .bubble-m { animation: flash 1.4s; }
@keyframes flash { 30% { box-shadow: 0 0 0 4px var(--primary-2); } }
.from-bot .bubble-m { border: 1px dashed #CFC8FF; }

/* reactions */
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -6px; padding: 0 8px; position: relative; z-index: 1; }
.react-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 1px 7px; font-size: 14px; cursor: pointer; display: inline-flex; gap: 3px; align-items: center; box-shadow: var(--shadow); }
.react-chip small { font-size: 11px; color: var(--muted); font-weight: 700; }
.react-chip.mine { border-color: var(--primary); background: var(--primary-soft); }
.react-bar { position: fixed; z-index: 60; background: var(--surface); border-radius: 99px; padding: 6px 8px; box-shadow: var(--shadow-lg); display: flex; gap: 2px; animation: pop .15s; }
.react-bar button { border: 0; background: none; font-size: 24px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.react-bar button:hover { transform: scale(1.25); background: var(--bg); }

/* reply */
.quote { display: block; border-inline-start: 3px solid var(--primary); background: rgba(108, 92, 231, .08); border-radius: 10px; padding: 4px 10px; margin-bottom: 6px; font-size: 13px; cursor: pointer; overflow: hidden; }
.quote b { display: block; color: var(--primary); font-size: 12px; }
.quote span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); max-width: 320px; }
.composer-wrap { margin: 12px 18px 18px; }
.composer-wrap .composer { margin: 0; }
.reply-bar { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 18px 18px 0 0; padding: 8px 14px 14px; margin-bottom: -10px; box-shadow: var(--shadow); }
.reply-bar .quote { flex: 1; margin: 0; cursor: default; }
.reply-bar .close { border: 0; background: var(--bg); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }

/* composer popovers */
.composer .pop { position: absolute; bottom: 64px; inset-inline-end: 8px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 10px; z-index: 5; }
.composer .icon-btn { flex: none; }
.sticker-pop { display: grid; grid-template-columns: repeat(6, 54px); gap: 4px; max-height: 300px; overflow-y: auto; }
.sticker-pop button { border: 0; background: none; cursor: pointer; border-radius: 12px; padding: 2px; }
.sticker-pop button:hover { background: var(--bg); }
.games-pop { width: 260px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.game-opt { border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 10px 4px; cursor: pointer; font-weight: 700; font-size: 12px; display: grid; gap: 2px; justify-items: center; }
.game-opt b { font-size: 24px; }
.game-opt:hover { border-color: var(--primary); }
.games-pop > .game-opt:first-child, .game-opt.wide { grid-column: 1 / -1; display: flex; justify-content: center; gap: 8px; align-items: center; }
.game-sep { grid-column: 1 / -1; font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 4px; }

/* stickers */
.sticker { position: relative; width: 130px; height: 130px; }
.sticker img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: 0 8px 20px rgba(76, 64, 160, .25); border: 4px solid #fff; }
.sticker .st-emoji { position: absolute; bottom: 4px; inset-inline-end: -4px; font-size: 40px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); animation: wobble 2.5s ease-in-out infinite; }
.sticker .st-word { position: absolute; top: -6px; inset-inline-start: -10px; background: #fff; color: #3B2F8F; font-weight: 900; font-size: 15px; padding: 4px 10px; border-radius: 14px 14px 14px 4px; box-shadow: 0 4px 10px rgba(0, 0, 0, .12); transform: rotate(-6deg); }
.sticker.sm { width: 50px; height: 50px; }
.sticker.sm img { border-width: 2px; }
.sticker.sm .st-emoji { font-size: 18px; bottom: -2px; inset-inline-end: -4px; animation: none; }
@keyframes wobble { 50% { transform: rotate(-12deg) scale(1.1); } }
.bubble-m.bare { background: none !important; box-shadow: none; padding: 6px 4px 0; }
.bubble-m.bare .foot { justify-content: center; }

/* gifts (in chat) */
.bubble-m.gift.big { min-width: 220px; background: radial-gradient(circle at 50% 0%, #FFF1C2, #FFD36E) !important; }
.bubble-m.gift.big .gift-icon { font-size: 58px; }
.pop-in { animation: giftIn .7s cubic-bezier(.2, 1.6, .4, 1); display: inline-block; }
@keyframes giftIn { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }

/* gift box (modal) */
.gift-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gift-card { border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px 6px; cursor: pointer; display: grid; gap: 4px; justify-items: center; transition: all .15s; }
.gift-card:hover { transform: translateY(-2px); border-color: #CFC8FF; }
.gift-card.sel { border-color: var(--primary); box-shadow: 0 8px 18px rgba(108, 92, 231, .25); }
.gift-card .g-emoji { font-size: 38px; }
.gift-card b { font-size: 14px; }
.gift-card .g-price { font-size: 12px; color: var(--primary); font-weight: 800; }
.gift-card.premium { background: linear-gradient(160deg, #FFF8E1, #FFE9A8); border-color: #F6D57A; }
[data-theme="dark"] .gift-card.premium { background: linear-gradient(160deg, #3D3212, #4A3A0E); border-color: #6B5418; }
.amount-input { font-size: 26px; font-weight: 900; text-align: center; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 700; font-size: 13px; }
.chip:hover { border-color: var(--primary); color: var(--primary); }

/* games in chat */
.bubble-m.game { text-align: center; min-width: 170px; }
.bubble-m.game.wide { min-width: 240px; }
.die { font-size: 46px; line-height: 1; display: inline-block; }
.die.big { font-size: 64px; animation: roll .6s ease-out; }
@keyframes roll { from { transform: rotate(-360deg) scale(.4); } }
.rps { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 40px; }
.rps small { font-size: 12px; color: var(--muted); }
.rps-res { font-weight: 800; }
.rps-res.win { color: var(--success); }
.rps-res.lose { color: var(--danger); }
.challenge .ch-title { font-weight: 900; font-size: 16px; }
.challenge .ch-stake { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.challenge .ch-stake b { color: #B7791F; font-size: 16px; }
.ch-status { font-weight: 700; margin-top: 8px; }
.ch-status.turn { color: var(--primary); animation: pulseText 1.2s infinite; }
.ch-status.win { color: var(--success); }
.ch-status.lose { color: var(--danger); }
.ch-status.muted { color: var(--muted); }
@keyframes pulseText { 50% { opacity: .55; } }
.challenge .row-btns { margin-top: 10px; }
.challenge .row-btns .btn { padding: 8px 18px; }
.dice-duel { display: flex; justify-content: center; align-items: center; gap: 14px; }
.dice-duel > div { display: grid; justify-items: center; }
.dice-duel small { color: var(--muted); font-size: 12px; }
.xo-board { display: grid; grid-template-columns: repeat(3, 62px); gap: 6px; justify-content: center; margin: 6px auto 0; direction: ltr; }
.xo-cell { width: 62px; height: 62px; border-radius: 14px; border: 0; background: var(--bg); font-size: 30px; font-weight: 900; cursor: default; box-shadow: inset 0 2px 6px rgba(76, 64, 160, .08); color: var(--text); }
.xo-board.my-turn .xo-cell:not(:disabled) { cursor: pointer; background: var(--primary-soft); }
.xo-board.my-turn .xo-cell:not(:disabled):hover { background: #DCD5FF; }
.xo-cell.x { color: var(--primary); }
.xo-cell.o { color: #F59E0B; }
.stake-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stake { border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 12px 4px; cursor: pointer; display: grid; justify-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.stake b { font-size: 22px; color: var(--text); }
.stake.sel { border-color: var(--primary); background: var(--primary-soft); }

/* question of the day + system messages */
.bubble-m.question { min-width: 240px; background: linear-gradient(160deg, #EEF2FF, #E0E7FF) !important; border: 1px solid #C7D2FE; }
[data-theme="dark"] .bubble-m.question { background: linear-gradient(160deg, #1E2147, #252A5C) !important; border-color: #3B4290; }
.q-tag { font-size: 12px; font-weight: 800; color: var(--primary); }
.q-text { font-size: 17px; font-weight: 800; margin: 6px 0; }
.q-hint { font-size: 12px; color: var(--muted); }
.q-solved { font-weight: 800; color: var(--success); }
.sys-msg { align-self: center; background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #78350F; font-weight: 700; font-size: 13px; padding: 7px 16px; border-radius: 99px; box-shadow: var(--shadow); margin: 6px 0; text-align: center; max-width: 90%; }

/* daily reward */
.daily-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.daily-day { border: 2px solid var(--line); border-radius: 16px; padding: 10px 4px; display: grid; justify-items: center; gap: 2px; background: var(--surface); }
.daily-day small { font-size: 11px; color: var(--muted); }
.daily-day .dd-icon { font-size: 24px; }
.daily-day b { font-size: 14px; }
.daily-day.got { opacity: .55; }
.daily-day.today { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 8px 18px rgba(108, 92, 231, .25); animation: bob 2s ease-in-out infinite; }
.daily-day.big { grid-column: span 2; background: linear-gradient(160deg, #FFF8E1, #FFE9A8); border-color: #F6D57A; }
.daily-day.big .dd-icon { font-size: 32px; }

/* leaderboard */
.leaderboard { display: grid; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; cursor: pointer; }
.lb-row:hover { background: var(--bg); }
.lb-row .meta { flex: 1; min-width: 0; }
.lb-row small { display: block; color: var(--muted); direction: ltr; text-align: end; }
.lb-rank { width: 30px; text-align: center; font-weight: 900; font-size: 18px; color: var(--muted); }
.lb-total { font-weight: 900; color: #B7791F; white-space: nowrap; }
.lb-row.top1 { background: linear-gradient(135deg, #FFF8E1, #FFEDB3); }
.lb-row.top2 { background: linear-gradient(135deg, #F8FAFC, #E2E8F0); }
.lb-row.top3 { background: linear-gradient(135deg, #FFF1E6, #FED7AA); }
[data-theme="dark"] .lb-row.top1, [data-theme="dark"] .lb-row.top2, [data-theme="dark"] .lb-row.top3 { background: var(--bg); }

/* custom top-up (wallet) */
.custom-topup { display: flex; gap: 10px; margin-top: 14px; align-items: stretch; flex-wrap: wrap; }
.custom-topup .input { flex: 1; min-width: 160px; font-size: 18px; font-weight: 800; }

@media (max-width: 560px) {
  .sticker-pop { grid-template-columns: repeat(5, 50px); }
  .msg-actions { opacity: 1; }
  .msg-actions button { width: 24px; height: 24px; font-size: 11px; }
  .xo-board { grid-template-columns: repeat(3, 54px); }
  .xo-cell { width: 54px; height: 54px; }
  .gift-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- طرة لو كتابة ---------- */
.coin-row { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.coin-face { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 900; color: #7A5200;
  background: radial-gradient(circle at 35% 30%, #FFE58F, #F5B700 60%, #C98A00); box-shadow: inset -2px -3px 0 rgba(0, 0, 0, .15); }
.coin3d { position: relative; width: 74px; height: 74px; margin: 4px auto 6px; transform-style: preserve-3d; animation: coinFlip 1.3s cubic-bezier(.3, .7, .4, 1) both; }
.coin3d .coin-face { position: absolute; inset: 0; width: 100%; height: 100%; font-size: 34px; backface-visibility: hidden; box-shadow: inset -4px -6px 0 rgba(0, 0, 0, .15), 0 8px 16px rgba(0, 0, 0, .18); }
.coin3d .coin-face.tails { transform: rotateY(180deg); }
.coin3d.tails { transform: rotateY(180deg); animation-name: coinFlipTails; }
@keyframes coinFlip { from { transform: rotateY(0) translateY(0); } 40% { transform: rotateY(900deg) translateY(-26px); } to { transform: rotateY(1440deg); } }
@keyframes coinFlipTails { from { transform: rotateY(0) translateY(0); } 40% { transform: rotateY(900deg) translateY(-26px); } to { transform: rotateY(1620deg); } }
.coin-res { font-weight: 900; font-size: 16px; color: #B7791F; }

/* ---------- محيبس ---------- */
.fists-row { grid-column: 1 / -1; display: flex; justify-content: center; gap: 4px; direction: ltr; }
.fists-row .fist { border: 0; background: var(--bg); width: 42px; height: 46px; border-radius: 14px; font-size: 24px; cursor: pointer; transition: transform .12s; display: grid; place-items: center; }
.fists-row button.fist:hover { transform: translateY(-4px) rotate(-8deg); background: var(--primary-soft); }
.fists-row.result { margin: 4px 0 8px; }
.fists-row.result .fist { cursor: default; animation: openFist .5s ease-out both; }
.fists-row.result .fist.picked { outline: 3px solid var(--primary); background: var(--primary-soft); }
.fists-row.result .fist.ring { background: linear-gradient(160deg, #FFF8E1, #FFE08A); animation: openFist .5s ease-out both, shine 1.6s .6s ease-in-out infinite; }
@keyframes openFist { from { transform: scale(.6) rotate(-20deg); opacity: 0; } }
@keyframes shine { 50% { box-shadow: 0 0 0 4px rgba(245, 183, 0, .35); } }
.hide-box { background: var(--bg); border-radius: 18px; padding: 12px; margin-bottom: 14px; }
.hide-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-align: center; }
.hands-row { display: flex; justify-content: center; gap: 12px; }
.hands-row.in-chat { margin: 4px 0; }
.hand-pick { border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 10px 16px; cursor: pointer; display: grid; justify-items: center; gap: 2px; font-weight: 700; font-size: 13px; color: var(--text); min-width: 84px; }
.hand-pick .hand-emoji { font-size: 30px; }
.hand-pick.big .hand-emoji { font-size: 38px; }
.hand-pick:not(:disabled):hover { border-color: var(--primary); transform: translateY(-2px); }
.hand-pick.sel { border-color: var(--primary); background: var(--primary-soft); }
.hand-pick:disabled { cursor: default; opacity: .85; }
.hand-pick.open { cursor: default; animation: openFist .5s ease-out both; }
.hand-pick.guessed { border-color: var(--primary); }
