/* ===== PROTECTION ===== */
* {
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
}

body, html {
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Allow select only for input/textarea if needed */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* ===== PLACE BETS BUTTON ===== */
.place-bets-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 12px 24px;
    background: linear-gradient(135deg, #229ED9 0%, #1a7aae 100%);
    color: white;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(34, 158, 217, 0.4);
    transition: all 0.3s ease;
    margin-top: 16px;
    border: 2px solid transparent;
}

.place-bets-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34, 158, 217, 0.6);
    border-color: rgba(34, 158, 217, 0.5);
}

.place-bets-btn:active {
    transform: translateY(0);
}

.place-bets-btn i {
    font-size: 1.1rem;
}

/* ===== RESET & ROOT ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gold-light:   #f5e6a3;
    --gold-mid:     #d4a840;
    --gold-dark:    #8b5e1a;
    --gold-deep:    #5a3000;
    --bg-dark:      #0a0a12;
    --bg-mid:       #0f1528;
    --bg-card:      rgba(20, 16, 40, 0.85);
    --accent-cyan:  #00d4ff;
    --accent-glow:  rgba(212, 168, 64, 0.6);
    --text-bright:  #f0e8c8;
    --text-muted:   #9a8060;
}

html, body { width: 100%; min-height: 100%; font-family: 'Rajdhani', 'Segoe UI', sans-serif; }

body {
    background: radial-gradient(ellipse at 20% 20%, #1a1240 0%, #080820 40%, #0a0a0a 100%);
    background-attachment: fixed;
    color: var(--text-bright);
    overflow-x: hidden;
}

/* ===== BACKGROUND ORBS ===== */
.bg-orb {
    position: fixed; border-radius: 50%;
    filter: blur(80px); pointer-events: none; z-index: 0;
}
.orb1 { width: 600px; height: 600px; top: -200px; left: -150px; background: radial-gradient(circle, rgba(180,120,20,0.18) 0%, transparent 70%); animation: orbFloat 12s ease-in-out infinite; }
.orb2 { width: 500px; height: 500px; bottom: -150px; right: -100px; background: radial-gradient(circle, rgba(100,50,200,0.15) 0%, transparent 70%); animation: orbFloat 15s ease-in-out infinite reverse; }
.orb3 { width: 400px; height: 400px; top: 40%; left: 50%; transform: translateX(-50%); background: radial-gradient(circle, rgba(0,200,255,0.06) 0%, transparent 70%); animation: orbFloat 10s ease-in-out infinite 3s; }

@keyframes orbFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-40px) scale(1.08); }
}

/* ===== PARTICLES ===== */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.particle {
    position: absolute; width: 3px; height: 3px; border-radius: 50%;
    background: var(--gold-mid); opacity: 0;
    animation: particleFly linear infinite;
}
@keyframes particleFly {
    0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.7; }
    90%  { opacity: 0.3; }
    100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ===== CONTAINER ===== */
.container {
    position: relative; z-index: 1;
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: space-between;
    padding: 24px 20px;
}

/* ===== HEADER ===== */
.header { text-align: center; margin-bottom: 10px; animation: slideDown 0.9s cubic-bezier(0.22,1,0.36,1) both; }

.header-logo {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin-bottom: 8px;
}
.logo-icon { font-size: 1.6rem; color: var(--gold-mid); filter: drop-shadow(0 0 10px var(--gold-mid)); animation: iconPulse 3s ease-in-out infinite; }
.logo-icon:last-child { animation-delay: 1.5s; }

.header h1 {
    font-family: 'Cinzel', serif;
    font-size: 3.2rem; font-weight: 900;
    background: linear-gradient(180deg, #fff5c0 0%, #f0c040 30%, #c88820 65%, #f0c040 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    letter-spacing: 6px;
    filter: drop-shadow(0 2px 20px rgba(212,168,64,0.5));
}

.subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1rem; letter-spacing: 4px; color: var(--text-muted);
    text-transform: uppercase; margin-bottom: 14px;
}

.header-line {
    width: 280px; height: 1px; margin: 0 auto;
    background: linear-gradient(90deg, transparent, var(--gold-mid), transparent);
    box-shadow: 0 0 12px var(--gold-mid);
}

@keyframes iconPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }
@keyframes slideDown { from{opacity:0;transform:translateY(-40px)} to{opacity:1;transform:translateY(0)} }

/* ===== COIN STAGE ===== */
.coin-stage {
    position: relative; display: flex; align-items: center;
    justify-content: center; margin: 10px 0;
}

.coin-shadow {
    position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
    width: 180px; height: 30px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: shadowPulse 2s ease-in-out infinite;
}

.coin-container {
    perspective: 800px;
    width: 240px; height: 240px;
    display: flex; align-items: center; justify-content: center;
}

.coin {
    width: 220px; height: 220px;
    position: relative;
    filter: drop-shadow(0 8px 30px rgba(180,120,0,0.5));
    animation: coinIdle 4s ease-in-out infinite;
}

/* ===== COIN FACE — two SVGs, CSS shows correct one ===== */
.coin-face {
    position: absolute; inset: 0;
    border-radius: 50%; overflow: hidden;
    background: radial-gradient(circle at 38% 35%,
        #fff8d0 0%, #f0cc60 15%, #d4a030 35%,
        #a06820 60%, #7a4e10 80%, #5a3800 100%);
    box-shadow:
        inset 0 0 30px rgba(255,220,80,0.3),
        inset -8px -8px 20px rgba(0,0,0,0.5),
        inset 8px 8px 20px rgba(255,255,200,0.2);
}
.coin-face.is-tails {
    background: radial-gradient(circle at 38% 35%,
        #ffe8a0 0%, #d4980a 15%, #b07020 35%,
        #8a5010 60%, #6a3a00 80%, #4a2800 100%);
}

/* Two SVG layers — show only the correct one */
.face-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.face-heads { opacity: 1; }
.face-tails { opacity: 0; }
.coin-face.is-tails .face-heads { opacity: 0; }
.coin-face.is-tails .face-tails { opacity: 1; }

/* Win flash — reusable, no new DOM nodes */
.win-flash {
    position: fixed; inset: 0; pointer-events: none; z-index: 99;
    background: radial-gradient(ellipse, rgba(255,220,60,0.25) 0%, transparent 70%);
    opacity: 0;
}
.win-flash.active { animation: winFlash 0.9s ease-out forwards; }
@keyframes winFlash {
    0%   { opacity: 0; }
    20%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== COIN ANIMATIONS ===== */

@keyframes coinIdle {
    0%,100% { transform: translateY(0px); }
    50%     { transform: translateY(-8px); }
}

/*
  Professional coin toss:
  - Uses rotateY (natural left-right flip)
  - Parabolic arc via translateY (goes up, comes down)
  - Spins fast in the middle, slows at landing
  - Face swap happens at 50% (peak of arc, coin edge-on)
*/
@keyframes coinToss {
    0%   { transform: translateY(0px)    rotateY(0deg)   scaleX(1); }
    8%   { transform: translateY(-20px)  rotateY(50deg)  scaleX(0.85); }
    18%  { transform: translateY(-55px)  rotateY(120deg) scaleX(0.1); }
    25%  { transform: translateY(-80px)  rotateY(180deg) scaleX(1); }
    35%  { transform: translateY(-100px) rotateY(250deg) scaleX(0.1); }
    43%  { transform: translateY(-112px) rotateY(310deg) scaleX(0.85); }
    50%  { transform: translateY(-118px) rotateY(360deg) scaleX(1); }   /* peak — face swap here */
    57%  { transform: translateY(-112px) rotateY(410deg) scaleX(0.85); }
    65%  { transform: translateY(-100px) rotateY(470deg) scaleX(0.1); }
    73%  { transform: translateY(-78px)  rotateY(530deg) scaleX(1); }
    80%  { transform: translateY(-52px)  rotateY(580deg) scaleX(0.1); }
    88%  { transform: translateY(-24px)  rotateY(630deg) scaleX(0.85); }
    94%  { transform: translateY(-6px)   rotateY(660deg) scaleX(0.1); }
    100% { transform: translateY(0px)    rotateY(720deg) scaleX(1); }
}

.coin.flipping {
    animation: coinToss 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes shadowPulse {
    0%,100% { transform: translateX(-50%) scaleX(1);    opacity: 0.55; }
    50%     { transform: translateX(-50%) scaleX(0.55); opacity: 0.2; }
}

@keyframes shadowToss {
    0%   { transform: translateX(-50%) scaleX(1);    opacity: 0.55; }
    50%  { transform: translateX(-50%) scaleX(0.08); opacity: 0.02; }
    100% { transform: translateX(-50%) scaleX(1);    opacity: 0.55; }
}

.coin-shadow.spinning {
    animation: shadowToss 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ===== RESULT DISPLAY ===== */
.result-display {
    width: 100%; max-width: 420px;
    background: linear-gradient(135deg, rgba(30,20,5,0.9), rgba(15,10,30,0.9));
    border: 1px solid rgba(212,168,64,0.4);
    border-radius: 16px;
    padding: 2px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,240,150,0.1);
    backdrop-filter: blur(12px);
    animation: fadeInUp 0.8s ease-out;
}

.result-inner {
    background: linear-gradient(135deg, rgba(20,12,2,0.95), rgba(10,8,25,0.95));
    border-radius: 14px;
    padding: 18px 30px;
    border: 1px solid rgba(120,80,10,0.3);
    text-align: center;
    min-height: 70px;
    display: flex; align-items: center; justify-content: center;
}

.result-text {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem; font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.result-text.show-heads {
    font-size: 1.8rem;
    background: linear-gradient(180deg, #fff8c0, #f0c840, #c88820);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    filter: drop-shadow(0 0 20px rgba(240,200,0,0.8));
    animation: resultPop 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.result-text.show-tails {
    font-size: 1.8rem;
    background: linear-gradient(180deg, #ffe8a0, #d4980a, #8a5010);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    filter: drop-shadow(0 0 20px rgba(180,130,0,0.8));
    animation: resultPop 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes resultPop {
    0%   { transform: scale(0.6); opacity: 0; }
    60%  { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity:0; transform: translateY(20px); }
    to   { opacity:1; transform: translateY(0); }
}

/* ===== TIMER ===== */
.timer-wrap {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
}

.timer-ring {
    position: relative;
    width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 0 12px rgba(212,168,64,0.5));
}

.timer-svg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    transform: rotate(-90deg); /* start arc from top */
}

.timer-track {
    fill: none;
    stroke: rgba(80,50,10,0.4);
    stroke-width: 5;
}

.timer-progress {
    fill: none;
    stroke: url(#timerGrad);
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.9s linear;
}

.timer-progress.urgent { stroke: #ff4444; filter: drop-shadow(0 0 6px #ff4444); }

/* Inline SVG gradient for timer – injected via JS */
.timer-number {
    position: relative; z-index: 1;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem; font-weight: 900;
    background: linear-gradient(180deg, #f5e6a3, #c88820);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    line-height: 1;
    transition: color 0.3s;
    letter-spacing: 1px;
}

.timer-number.urgent {
    background: linear-gradient(180deg, #ff9999, #ff3333);
    -webkit-background-clip: text; background-clip: text;
    animation: urgentPulse 0.5s ease-in-out infinite;
}

.timer-label {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem; letter-spacing: 3px;
    color: var(--text-muted); text-transform: uppercase;
}

@keyframes urgentPulse {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.15); }
}

/* ===== LIVE VIEWERS ===== */
.live-bar {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 12px;
    background: rgba(10, 6, 2, 0.7);
    border: 1px solid rgba(212,168,64,0.25);
    border-radius: 30px;
    padding: 6px 16px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ff3b3b;
    box-shadow: 0 0 0 0 rgba(255,59,59,0.6);
    animation: livePing 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes livePing {
    0%   { box-shadow: 0 0 0 0   rgba(255,59,59,0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(255,59,59,0); }
    100% { box-shadow: 0 0 0 0   rgba(255,59,59,0); }
}

.live-text {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem; letter-spacing: 2px;
    color: var(--text-muted);
    white-space: nowrap;
}

#viewerCount {
    font-weight: 700;
    background: linear-gradient(90deg, #f5e098, #d4a030);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    transition: all 0.4s ease;
}

.viewer-bump {
    animation: viewerPop 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes viewerPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Viewer count slide animations */
#viewerCount {
    display: inline-block;
    overflow: hidden;
}

/* Going UP — old slides out upward, new comes in from below */
.count-out-up {
    animation: slideOutUp 0.25s ease-in forwards;
}
.count-in-below {
    animation: slideInFromBelow 0.35s cubic-bezier(0.22,1,0.36,1) forwards;
}

/* Going DOWN — old slides out downward, new comes in from above */
.count-out-down {
    animation: slideOutDown 0.25s ease-in forwards;
}
.count-in-above {
    animation: slideInFromAbove 0.35s cubic-bezier(0.22,1,0.36,1) forwards;
}

@keyframes slideOutUp {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-10px); }
}
@keyframes slideOutDown {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(10px); }
}
@keyframes slideInFromBelow {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInFromAbove {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== HISTORY ===== */
.history {
    width: 100%; max-width: 420px;
    background: linear-gradient(160deg, rgba(25,16,5,0.92), rgba(10,8,22,0.92));
    border: 1px solid rgba(140,90,20,0.35);
    border-radius: 18px;
    padding: 18px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--gold-dark) transparent;
}

.history::-webkit-scrollbar { width: 4px; }
.history::-webkit-scrollbar-track { background: transparent; }
.history::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 4px; }

.history-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem; letter-spacing: 4px;
    color: var(--text-muted); text-align: center;
    margin-bottom: 14px; text-transform: uppercase;
}

.history-list { display: flex; flex-direction: column; gap: 8px; }

.history-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-radius: 10px;
    animation: slideInLeft 0.35s ease-out;
    border: 1px solid transparent;
}

.history-item.heads {
    background: linear-gradient(90deg, rgba(200,160,30,0.12), rgba(200,160,30,0.05));
    border-color: rgba(200,160,30,0.2);
}

.history-item.tails {
    background: linear-gradient(90deg, rgba(140,100,10,0.12), rgba(140,100,10,0.05));
    border-color: rgba(140,100,10,0.2);
}

.history-badge {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 1px;
    padding: 4px 12px; border-radius: 20px;
}

.history-item.heads .history-badge {
    background: linear-gradient(90deg, #c88820, #f5e098);
    color: #2a1000;
}
.history-item.tails .history-badge {
    background: linear-gradient(90deg, #8a5010, #c88830);
    color: #ffe8a0;
}

.history-time {
    font-size: 0.78rem; color: var(--text-muted); letter-spacing: 1px;
}

.empty-history {
    text-align: center; color: var(--text-muted);
    font-size: 0.9rem; letter-spacing: 1px;
    padding: 20px; opacity: 0.6;
    font-family: 'Cinzel', serif;
}

@media (max-width: 480px) {
    .history {
        max-height: none;
        max-width: 100%;
        padding: 16px;
        border-radius: 12px;
    }
    
    .history-list {
        gap: 6px;
    }
    
    .history-item {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    
    .history-badge {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
    
    .history-time {
        font-size: 0.7rem;
    }
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 22px;
    width: 100%; max-width: 460px;
    margin: 0 auto;
    animation: fadeInUp 0.7s ease-out 0.2s both;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center; padding: 18px;
    color: var(--text-muted);
    font-size: 0.82rem; letter-spacing: 2px;
    border-top: 1px solid rgba(140,90,20,0.25);
    width: 100%;
}

/* ===== KEYFRAMES ===== */
@keyframes slideInLeft {
    from { opacity:0; transform: translateX(-16px); }
    to   { opacity:1; transform: translateX(0); }
}

@keyframes countBounce {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1);   opacity: 1; }
}

.stat-value.bump { animation: countBounce 0.45s cubic-bezier(0.34,1.56,0.64,1); }

/* win-flash defined in coin-face section above */

/* ===== TAB PANELS ===== */
.tab-panel {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}
.tab-panel.active { display: flex; }

/* History panel - full screen on mobile */
#panelHistory {
    gap: 0;
}

#panelHistory .history {
    border-radius: 0;
    max-height: calc(100vh - 120px);
    max-width: 100%;
    width: 100%;
}

@media (max-width: 480px) {
    #panelHistory {
        max-width: 100%;
        gap: 0;
    }
    
    #panelHistory .history {
        border-radius: 0;
        padding: 14px;
        max-height: calc(100vh - 140px);
        margin: 0;
    }
}

/* ===== TAB BAR ===== */
.tab-bar {
    position: sticky; bottom: 0;
    width: 100%; max-width: 460px;
    display: flex; gap: 10px;
    padding: 12px 0 8px;
    background: linear-gradient(to top, rgba(8,6,20,0.98) 70%, transparent);
    z-index: 20;
}

.tab-btn {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 10px;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem; font-weight: 700; letter-spacing: 2px;
    border: 1px solid rgba(140,90,20,0.35);
    border-radius: 14px; cursor: pointer;
    background: rgba(15,10,5,0.85);
    color: var(--text-muted);
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.tab-btn .tab-icon { font-size: 1.1rem; }

.tab-btn.active {
    background: linear-gradient(135deg, rgba(180,120,10,0.25), rgba(80,40,0,0.4));
    border-color: rgba(212,168,64,0.55);
    color: var(--gold-light);
    box-shadow: 0 0 20px rgba(180,120,0,0.2), 0 2px 12px rgba(0,0,0,0.4);
}
.tab-btn:hover:not(.active) {
    border-color: rgba(180,110,20,0.5);
    color: #c8a060;
}

/* ===== INLINE BET FEED ===== */
.bet-feed-wrap {
    width: 100%; max-width: 420px;
    background: linear-gradient(160deg, rgba(20,12,3,0.92), rgba(8,6,20,0.92));
    border: 1px solid rgba(140,90,20,0.3);
    border-radius: 18px;
    padding: 14px 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
    overflow: hidden;
}

.bet-feed-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(140,90,20,0.2);
}

.bet-feed-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #ff3b3b;
    animation: livePing 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

.bet-feed-title {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem; letter-spacing: 3px;
    color: var(--text-muted); text-transform: uppercase;
}

.bet-feed {
    display: flex; flex-direction: column; gap: 7px;
    min-height: 44px;
}

.bet-empty {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem; color: var(--text-muted);
    text-align: center; padding: 8px; opacity: 0.5;
}

.bet-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    animation: betSlideIn 0.5s cubic-bezier(0.22,1,0.36,1) both;
}

.bet-row.on-heads {
    background: linear-gradient(90deg, rgba(200,160,30,0.1), rgba(200,160,30,0.03));
    border-color: rgba(200,150,20,0.2);
}
.bet-row.on-tails {
    background: linear-gradient(90deg, rgba(140,90,10,0.1), rgba(140,90,10,0.03));
    border-color: rgba(140,90,10,0.2);
}

@keyframes betSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes betFadeOut {
    from { opacity: 1; max-height: 50px; margin-bottom: 0; }
    to   { opacity: 0; max-height: 0;    margin-bottom: -7px; }
}
.bet-row.removing {
    animation: betFadeOut 0.35s ease-in forwards;
}

.bet-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700; flex-shrink: 0;
    background: linear-gradient(135deg, #c88820, #5a3000);
    color: #ffe8a0;
    border: 1px solid rgba(212,168,64,0.35);
}

.bet-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }

.bet-name {
    font-family: 'Cinzel', serif;
    font-size: 0.70rem; font-weight: 700;
    color: #f0e0b0; letter-spacing: 0.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.bet-detail {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.80rem; color: var(--text-muted);
}
.bet-amount { color: #f0c840; font-weight: 700; }
.bet-side.heads { color: #f0c840; font-weight: 600; }
.bet-side.tails { color: #c88820; font-weight: 600; }
/* ===== INFO ROW — streak + bets today ===== */
.info-row {
    display: flex; gap: 12px;
    width: 100%; max-width: 420px;
}

.info-card {
    flex: 1; display: flex; align-items: center; gap: 10px;
    background: linear-gradient(160deg, rgba(20,12,3,0.92), rgba(8,6,20,0.92));
    border: 1px solid rgba(140,90,20,0.3);
    border-radius: 14px; padding: 12px 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 3px 16px rgba(0,0,0,0.4);
    transition: border-color 0.3s;
}

.info-icon {
    font-size: 1.3rem; flex-shrink: 0; line-height: 1;
    color: var(--gold-mid);
    width: 28px; text-align: center;
}

.info-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.info-label {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem; letter-spacing: 2px;
    color: var(--text-muted); text-transform: uppercase;
}

.info-val {
    font-family: 'Cinzel', serif;
    font-size: 1rem; font-weight: 700;
    background: linear-gradient(90deg, #f5e098, #c88820);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    white-space: nowrap;
}
/* FA icons inside gradient text need fill reset */
.info-val i, .htvt-left i, .htvt-right i {
    -webkit-text-fill-color: var(--gold-mid);
    color: var(--gold-mid);
    font-size: 0.9em;
}

/* Streak card glow when active */
.streak-card.heads-streak { border-color: rgba(240,200,40,0.55); box-shadow: 0 3px 20px rgba(240,180,0,0.2); }
.streak-card.tails-streak { border-color: rgba(160,100,20,0.55); box-shadow: 0 3px 20px rgba(160,100,0,0.2); }

.val-bump { animation: valPop 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes valPop {
    0%   { transform: scale(0.7); opacity: 0.4; }
    100% { transform: scale(1);   opacity: 1; }
}

/* ===== HEADS VS TAILS BAR ===== */
.htvt-wrap {
    width: 100%; max-width: 420px;
    background: linear-gradient(160deg, rgba(20,12,3,0.92), rgba(8,6,20,0.92));
    border: 1px solid rgba(140,90,20,0.3);
    border-radius: 14px; padding: 14px 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 3px 16px rgba(0,0,0,0.4);
}

.htvt-labels {
    display: flex; justify-content: space-between;
    margin-bottom: 8px;
    font-family: 'Cinzel', serif; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 1px;
}
.htvt-left  { color: #f0c840; }
.htvt-right { color: #c88820; }

.htvt-track {
    display: flex; height: 10px; border-radius: 10px;
    overflow: hidden; background: rgba(0,0,0,0.3);
    border: 1px solid rgba(140,90,20,0.2);
}

.htvt-bar-heads {
    background: linear-gradient(90deg, #d4a030, #f5e098);
    border-radius: 10px 0 0 10px;
    transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
    height: 100%;
}
.htvt-bar-tails {
    background: linear-gradient(90deg, #8a5010, #c88830);
    border-radius: 0 10px 10px 0;
    transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
    height: 100%;
}

.htvt-note {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.7rem; color: var(--text-muted);
    text-align: center; margin-top: 7px;
    opacity: 0.55; letter-spacing: 1px;
}
.tg-logo { width: 22px; height: 22px; flex-shrink: 0; }
.tg-note {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem; color: var(--text-muted); letter-spacing: 1px; opacity: 0.6;
}

@media (max-width: 480px) {
    .header h1 { font-size: 2rem; letter-spacing: 3px; }
    .header { margin-bottom: 8px; }
    .logo-icon { font-size: 1.2rem; }
    .subtitle { font-size: 0.8rem; letter-spacing: 2px; }
    .header-line { width: 200px; }
    
    .coin-container { width: 190px; height: 190px; }
    .coin { width: 170px; height: 170px; }
    .coin-shadow { width: 140px; }
    .history { max-height: 200px; }
    
    .container { padding: 16px 12px; }
    .main-content { gap: 16px; }
    
    .timer-wrap { gap: 6px; }
    .place-bets-btn { padding: 10px 20px; font-size: 0.8rem; margin-top: 12px; }
}

@media (max-width: 380px) {
    .header h1 { font-size: 1.6rem; letter-spacing: 2px; }
    .logo-icon { font-size: 1rem; }
    .subtitle { font-size: 0.7rem; letter-spacing: 1.5px; }
    .header-line { width: 160px; }
    
    .coin-container { width: 150px; height: 150px; }
    .coin { width: 140px; height: 140px; }
    .coin-shadow { width: 110px; }
    
    .timer-ring { width: 70px; height: 70px; }
    .timer-number { font-size: 0.95rem; }
    .timer-label { font-size: 0.55rem; }
    
    .result-text { font-size: 1.1rem; }
    .result-text.show-heads, .result-text.show-tails { font-size: 1.5rem; }
    
    .history { max-height: 180px; }
    .info-card { padding: 10px 12px; }
    .info-label { font-size: 0.55rem; }
    .info-val { font-size: 0.9rem; }
    
    .place-bets-btn { padding: 8px 16px; font-size: 0.7rem; gap: 0.5rem; }
}

@media (max-width: 320px) {
    .header h1 { font-size: 1.4rem; letter-spacing: 1px; }
    .logo-icon { font-size: 0.9rem; }
    .subtitle { font-size: 0.65rem; }
    .header-line { width: 140px; }
    
    .coin-container { width: 140px; height: 140px; }
    .coin { width: 130px; height: 130px; }
    .coin-shadow { width: 100px; }
    
    .container { padding: 12px 10px; }
    .main-content { gap: 12px; max-width: 300px; }
    
    .timer-ring { width: 60px; height: 60px; }
    .timer-number { font-size: 0.85rem; }
    
    .result-display { max-width: 300px; }
    .result-inner { padding: 14px 20px; }
    .result-text { font-size: 0.95rem; }
    .result-text.show-heads, .result-text.show-tails { font-size: 1.3rem; }
    
    .history { max-width: 300px; max-height: 150px; }
    .info-row { max-width: 300px; }
    .bet-feed-wrap { max-width: 300px; }
    .htvt-wrap { max-width: 300px; }
    .tab-bar { max-width: 300px; }
    
    .tab-btn { font-size: 0.7rem; padding: 10px 6px; }
    .tab-icon { font-size: 0.95rem; }
    
    .place-bets-btn { font-size: 0.65rem; padding: 6px 12px; margin-top: 10px; }
}
