/* ===========================
   ROOT VARIABLES & RESET
   =========================== */
:root {
    --bg-dark: #0a0818;
    --bg-deep-purple: #240b54;
    --accent-gold: #fbbf24;
    --accent-purple: #a855f7;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-bright: rgba(255, 255, 255, 0.25);
    --metal-border: linear-gradient(135deg, #e2e8f0, #94a3b8, #e2e8f0);
    --shadow-deep: 0 10px 40px rgba(0,0,0,0.6);
    --board-glow: 0 0 30px rgba(168, 85, 247, 0.25);
    --orb-speed: 1;
}

#slot-reel {
    background: radial-gradient(circle at center, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    padding: 10px;
    box-shadow: inset 0 -5px 10px rgba(0,0,0,0.3);
}

@keyframes flashPulse {
    0% { background-color: transparent; }
    20% { background-color: var(--flash-color, rgba(255, 255, 255, 0.2)); }
    100% { background-color: transparent; }
}
.flash-pulse {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 100;
    animation: flashPulse 0.5s ease-out;
}

.user-avatar { 
    font-size:1.2rem; 
    width:32px; 
    height:32px; 
    background: #3b82f6; /* Blue for guests */
    border-radius:50%; 
    display:flex; 
    align-items:center; 
    justify-content:center; 
    flex-shrink:0; 
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

* { margin:0; padding:0; box-sizing:border-box; font-family:'Outfit',sans-serif; -webkit-tap-highlight-color:transparent; }

body {
    background: 
        radial-gradient(circle at top, rgba(36, 11, 84, 0.4), rgba(10, 8, 24, 0.8)),
        url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh; min-height: 100dvh;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden; color: #fff; position: relative;
    touch-action: manipulation;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.25;
    pointer-events: none;
    animation: orbFloat calc(12s / var(--orb-speed)) ease-in-out infinite alternate;
    transition: all 0.5s ease;
}

.orb-1 {
    width: 600px; height: 600px;
    background: var(--accent-purple);
    top: -200px; left: -200px;
    animation-duration: calc(14s / var(--orb-speed));
}

.orb-2 {
    width: 500px; height: 500px;
    background: var(--accent-pink);
    bottom: -150px; right: -150px;
    animation-duration: calc(18s / var(--orb-speed));
    animation-delay: -4s;
}

.orb-3 {
    width: 400px; height: 400px;
    background: var(--accent-teal);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: calc(11s / var(--orb-speed));
    animation-delay: -7s;
    opacity: 0.18;
}
@keyframes orbFloat { from{transform:scale(1) translate(0,0)} to{transform:scale(1.15) translate(20px,30px)} }

#game-container {
    position:relative; width:100%; max-width:var(--container-max-w);
    height:100vh; height:100dvh;
    display:flex; flex-direction:column; gap:var(--container-gap);
    padding:var(--container-padding);
    padding-top:max(var(--container-padding), env(safe-area-inset-top));
    padding-bottom:max(var(--container-padding), env(safe-area-inset-bottom));
    z-index:1;
}

#top-bar { display:flex; justify-content:space-between; align-items:center; gap:6px; flex-shrink:0; }

.user-pill { display:flex; align-items:center; gap:8px; background:var(--glass-bg); backdrop-filter:blur(12px); border:1px solid var(--glass-border); border-radius:50px; padding:6px 12px 6px 6px; box-shadow:var(--shadow-glow); flex:1; min-width:0; }
.user-avatar { font-size:1.2rem; width:32px; height:32px; background:#3b82f6; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.user-text { display:flex; flex-direction:column; min-width:0; }
#user-display { font-size:var(--user-font); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#level-display { font-size:var(--level-font); color:var(--accent-gold); font-weight:500; }

.top-actions { display:flex; gap:6px; flex-shrink:0; }
.action-btn, .audio-btn { 
    width: var(--btn-size); height: var(--btn-size); 
    border-radius: 50%; border: 1px solid var(--glass-border); 
    background: var(--glass-bg); backdrop-filter: blur(12px); 
    font-size: var(--btn-font); cursor: pointer; 
    display: flex; align-items: center; justify-content: center; 
    box-shadow: var(--shadow-glow); transition: all 0.15s; 
    color: var(--text-color); -webkit-user-select: none; user-select: none; 
}
.action-btn:hover, .audio-btn:hover { background: var(--glass-bg-hover); transform: translateY(-2px); }
.action-btn:active, .audio-btn:active { transform: scale(0.92); }
.audio-btn.muted { opacity:0.4; }

/* Enhanced Shop Button */
.shop-btn-enhanced {
    width: 80px !important;
    height: auto !important;
    min-height: var(--btn-size);
    border-radius: 16px !important;
    flex-direction: column;
    padding: 6px 0;
    gap: 2px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
    border-color: rgba(251, 191, 36, 0.4);
    animation: shopPulse 2s ease-in-out infinite;
}

.shop-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent-gold);
    line-height: 1;
}

.shop-icon {
    font-size: 1.2rem;
    line-height: 1;
}

@keyframes shopPulse {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-glow); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(251, 191, 36, 0.4); }
}

#score-bar { display:flex; gap:6px; flex-shrink:0; }
.score-box, .next-box { 
    flex: 1; padding: 10px; border-radius: 20px; 
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
    backdrop-filter: blur(20px); border: 1px solid var(--glass-border);
    display: flex; flex-direction: column; align-items: center;
    box-shadow: var(--shadow-deep); transition: transform 0.2s;
}

.score-box:hover, .next-box:hover {
    transform: translateY(-3px);
    border-color: var(--glass-border-bright);
}
.label { font-size:var(--label-font); text-transform:uppercase; letter-spacing:1.5px; color:var(--text-muted); font-weight:500; }
#score, #high-score { font-size:var(--score-font); font-weight:800; }
#next-preview { 
    height: 2.4em; 
    overflow: hidden; 
    position: relative; 
    width: 100%; 
    display: flex; 
    justify-content: center;
    align-items: center;
}
#slot-reel {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    font-size: var(--preview-font);
    line-height: 2.4em;
}
.slot-spin {
    animation: slotBlur 0.15s infinite linear;
}
@keyframes slotBlur {
    0%, 100% { filter: blur(0px); }
    50% { filter: blur(1.5px); transform: translateY(1px); }
}
.high-score-box {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(251,191,36,0.04));
    animation: goldGlow 4s linear infinite;
}

@keyframes goldGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(251, 191, 36, 0.1); }
    50%      { box-shadow: 0 0 30px rgba(251, 191, 36, 0.3); }
}
.score-bump { animation:bump 0.2s ease-out; }
@keyframes bump { 0%{transform:scale(1)} 50%{transform:scale(1.15)} 100%{transform:scale(1)} }

#combo-popup { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); z-index:200; font-size:clamp(1.5rem,5vw,2.4rem); font-weight:800; color:white; text-shadow:0 0 20px rgba(168,85,247,0.8),0 0 40px rgba(254,60,114,0.5); text-align:center; pointer-events:none; opacity:0; transition:opacity 0.3s ease; }
#combo-popup.active { opacity:1; animation:comboPop 0.4s ease-out; }
.combo-multiplier { display:block; font-size:0.7em; color:var(--accent-gold); font-weight:600; }
@keyframes comboPop { 0%{transform:translate(-50%,-50%) scale(0.5);opacity:0} 60%{transform:translate(-50%,-50%) scale(1.15);opacity:1} 100%{transform:translate(-50%,-50%) scale(1);opacity:1} }

#game-board {
    flex: 1;
    position: relative;
    background: linear-gradient(165deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(25px) saturate(200%);
    border: 3px solid rgba(255,255,255,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom-left-radius: 60px;
    border-bottom-right-radius: 60px;
    box-shadow: 
        inset 0 0 100px rgba(0,0,0,0.3),
        var(--board-glow),
        var(--shadow-deep);
    overflow: hidden;
    margin: 15px;
    z-index: 5;
    touch-action: none;
}

#game-board::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    z-index: 10; filter: blur(1px);
}

#game-board canvas { display:block; width:100%; height:100%; border-radius: inherit; position: absolute; top:0; left:0; pointer-events: none; }
#emoji-overlay { position:absolute; top:0; left:0; width:100%; height:100%; pointer-events:none; z-index:10; }

#limit-line { position:absolute; top:50px; left:5%; right:5%; height:2px; background:linear-gradient(90deg,rgba(255,255,255,0.4),transparent); opacity:0.6; z-index:5; pointer-events:none; }
#limit-line::after { content:'⚠ zona de perigo'; position:absolute; right:0; top:4px; font-size:0.6rem; color:rgba(255,255,255,0.4); opacity:0.7; white-space:nowrap; }
.danger-pulse { animation:dangerPulse 0.3s ease-in-out 3; }
@keyframes dangerPulse { 0%,100%{opacity:0.6} 50%{opacity:1;height:3px} }

#drop-guide { position:absolute; top:0; width:2px; height:100%; background:linear-gradient(180deg,rgba(255,255,255,0.2),transparent 60%); z-index:3; display:none; pointer-events:none; }
#ghost-emoji { position:absolute; top:8px; transform:translateX(-50%); z-index:5; pointer-events:none; opacity:0.6; filter:grayscale(0.3); display:none; }
.shake { animation:shakeBoard 0.3s ease-in-out; }
@keyframes shakeBoard { 0%{transform:translateX(0)} 25%{transform:translateX(-4px)} 50%{transform:translateX(4px)} 75%{transform:translateX(-2px)} 100%{transform:translateX(0)} }
.shake-heavy { animation: shakeHeavy 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shakeHeavy {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

#confetti-canvas { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:250; }

.hidden { display:none !important; }
#game-over-overlay, #login-overlay { position:absolute; inset:0; background:rgba(0,0,0,0.7); backdrop-filter:blur(8px); display:flex; align-items:center; justify-content:center; z-index:300; padding:20px; }
.overlay-card { max-width:400px; width:100%; padding:32px 28px; border-radius:28px; background:linear-gradient(145deg,rgba(30,25,50,0.95),rgba(20,16,38,0.98)); border:1px solid var(--glass-border-bright); box-shadow:0 20px 60px rgba(0,0,0,0.5),0 0 40px rgba(168,85,247,0.08); text-align:center; }
.overlay-card h1 { font-size:var(--h1-font); margin-bottom:8px; background:linear-gradient(to bottom, #fff 0%, #a855f7 100%); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; font-weight:800; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }

/* Novo Estilo Jelly 3D */
.jelly-title {
    font-family: 'Fredoka', sans-serif !important;
    font-size: clamp(2.5rem, 10vw, 3.8rem) !important;
    position: relative;
    display: inline-block;
    color: #fff !important;
    -webkit-text-fill-color: initial !important;
    background: none !important;
    text-shadow: 
        0 0 0 transparent,
        0 1px 0 #d946ef,
        0 2px 0 #c026d3,
        0 3px 0 #a21caf,
        0 4px 0 #86198f,
        0 5px 0 #701a75,
        0 6px 1px rgba(0,0,0,.1),
        0 0 5px rgba(0,0,0,.1),
        0 1px 3px rgba(0,0,0,.3),
        0 3px 5px rgba(0,0,0,.2),
        0 5px 10px rgba(0,0,0,.25),
        0 10px 10px rgba(0,0,0,.2),
        0 20px 20px rgba(0,0,0,.15);
    animation: jellyBounce 3s infinite ease-in-out;
}

.jelly-title::before {
    content: 'Jelly Drop';
    position: absolute;
    top: 0; left: 0; right: 0;
    color: rgba(255,255,255,0.8);
    filter: blur(2px);
    z-index: -1;
}

/* Reflexo de brilho removido a pedido do usuário */
.jelly-title::after {
    display: none;
}

@keyframes jellyBounce {
    0%, 100% { transform: scale(1) translateY(0); }
    50%      { transform: scale(1.05) translateY(-5px); }
}

.subtitle { font-size:0.8rem; color:rgba(255,255,255,0.7); margin-bottom:15px; line-height:1.3; }
.game-over-emoji { font-size:3.5rem; margin-bottom:8px; }
.game-logo {
    font-size: 4.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
    animation: jellyPulse 3s infinite ease-in-out;
}

@keyframes jellyPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.1) rotate(5deg); }
}
.final-score-wrap { display:flex; gap:12px; margin-bottom:16px; }
.final-score-item { flex:1; display:flex; flex-direction:column; align-items:center; padding:12px 8px; background:var(--glass-bg); border-radius:14px; border:1px solid var(--glass-border); }
.final-val { font-size:1.8rem; font-weight:800; }
.record-val { color:var(--accent-gold); }
#new-record-badge { background:linear-gradient(135deg,var(--accent-gold),var(--accent-orange)); color:#000; padding:8px 18px; border-radius:20px; font-weight:700; font-size:0.85rem; margin-bottom:12px; display:inline-block; animation:bump 0.5s ease; }
.game-over-stats { display:flex; gap:8px; margin-bottom:16px; }
.go-stat { flex:1; text-align:center; }
.go-stat-val { display:block; font-size:1.2rem; font-weight:700; color:var(--accent-teal); }
.go-stat-label { font-size:0.65rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; }
#restart-btn { width:100%; padding:14px; border:none; border-radius:14px; background:linear-gradient(135deg,var(--accent-purple),var(--accent-pink)); color:white; font-size:1rem; font-weight:700; cursor:pointer; transition:all 0.2s; font-family:inherit; letter-spacing:1px; }
#restart-btn:hover { filter:brightness(1.15); transform:translateY(-1px); }
#restart-btn:active { transform:scale(0.98); }

#revive-btn { width:100%; padding:14px; border:2px solid var(--accent-teal); border-radius:14px; background:rgba(6,182,212,0.1); color:var(--accent-teal); font-size:1rem; font-weight:800; cursor:pointer; margin-bottom:12px; transition:0.2s; font-family:inherit; }
#revive-btn:hover { background:rgba(6,182,212,0.2); transform:scale(1.02); }
#revive-btn:disabled { opacity:0.5; cursor:wait; }
.auth-buttons { display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin-bottom:10px; }
.auth-btn { padding:10px 12px; border-radius:12px; border:1px solid var(--accent-purple); background:rgba(168,85,247,0.1); backdrop-filter:blur(8px); color:white; font-size:0.8rem; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px; font-weight:700; font-family:inherit; transition:all 0.15s; min-height:44px; }
.auth-btn.guest { background:rgba(168,85,247,0.15); }
#help-toggle-home { grid-column: span 2; margin-top: 5px; }
.auth-btn img { width:16px; height:16px; }
.auth-btn:hover { 
    background: var(--glass-bg-hover); 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-color: var(--accent-purple);
}
.auth-btn:active { transform: scale(0.96); }
.login-card { max-width:400px; padding: 24px 20px !important; }
.login-hint { font-size:0.65rem; color:var(--text-muted); margin-top:4px; margin-bottom: 8px; }


/* Ad Containers */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    min-height: 50px;
    position: relative;
}
.ad-container::before {
    content: 'ANÚNCIO';
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 1px;
}
/* Mock Ad Appearance for Dev */
.adsbygoogle {
    background: linear-gradient(90deg, #333, #444);
    position: relative;
    display: block !important;
}
.adsbygoogle::after {
    content: 'Google AdSense Placeholder';
    color: #666;
    font-size: 10px;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

/* MODALS & OVERLAYS */
.overlay-common {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.modal-card {
    width: 100%; max-width: 400px;
    background: linear-gradient(145deg, rgba(30,25,50,0.98), rgba(20,16,38,1));
    border: 1px solid var(--glass-border-bright);
    border-radius: 28px; padding: 28px; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-card h2 { margin-bottom: 20px; font-weight: 800; background: linear-gradient(to right, #60a5fa, #a855f7); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.modal-close {
    position: absolute; top: 5px; right: 5px;
    background: transparent; border: none; color: white; font-size: 1.8rem; cursor: pointer; opacity: 0.6;
    z-index: 100; padding: 15px; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; outline: none; -webkit-tap-highlight-color: transparent;
}
.modal-close:hover { opacity: 1; }

/* Shop Style */
.shop-balance { font-size: 0.9rem; color: var(--accent-gold); margin-bottom: 15px; font-weight: 700; background: rgba(251,191,36,0.1); padding: 8px 12px; border-radius: 10px; display: inline-block; }
/* Shop Layout Refinements */
.shop-section h3 { margin: 12px 0 8px; font-size: 1rem; color: var(--accent-gold); display: flex; align-items: center; gap: 6px; }
.shop-content-scroll::-webkit-scrollbar { width: 5px; }
.shop-content-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 15px; width: 100%; max-width: 100%; box-sizing: border-box; }
.shop-item { background: var(--glass-bg); padding: 8px 10px; border-radius: 12px; border: 1px solid var(--glass-border); display: flex; align-items: center; gap: 6px; transition: all 0.2s; cursor: pointer; min-width: 0; overflow: hidden; }
.shop-item:hover { border-color: var(--accent-gold); transform: translateY(-2px); background: rgba(255,255,255,0.05); }
.item-icon { font-size: 1.2rem; flex-shrink: 0; }
.item-info { flex: 1; min-width: 0; overflow: hidden; }
.item-info h3 { margin: 0; font-size: 0.8rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }
.item-info p { margin: 2px 0 0; font-size: 0.6rem; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-price { background: var(--accent-gold); color: #000; padding: 2px 6px; border-radius: 20px; font-weight: 800; font-size: 0.7rem; flex-shrink: 0; }

.shop-footer-actions { margin-top: 20px; display: flex; justify-content: center; width: 100%; }
.exit-shop-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: #94a3b8; padding: 10px 30px; border-radius: 15px; font-weight: 700; cursor: pointer; transition: 0.2s; font-size: 0.9rem; }
.exit-shop-btn:hover { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: #f87171; }

.shop-vip-section { margin-top: 25px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }
.shop-vip-section h3 { font-size: 0.9rem; margin-bottom: 15px; color: var(--accent-purple); display: flex; align-items: center; gap: 8px; }
.vip-item { background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(254,60,114,0.15)); border: 1px solid var(--accent-purple); }
.vip-item .item-price { background: var(--accent-purple); color: white; }

/* Help Style */
.help-content { display: flex; flex-direction: column; gap: 12px; margin: 15px 0; }
.help-item { display: flex; align-items: center; gap: 15px; padding: 12px; background: rgba(255,255,255,0.03); border-radius: 12px; }
.help-item span { font-size: 1.8rem; }
.help-item p { font-size: 0.85rem; line-height: 1.4; }

/* Profile & Tabs Style */
.profile-card { max-width: 440px; }
.profile-header { text-align: center; margin-bottom: 25px; }
.large-avatar { font-size: 4.5rem; margin-bottom: 8px; filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3)); }
.profile-tabs { display: flex; background: rgba(0,0,0,0.3); border-radius: 14px; padding: 5px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 10px; border: none; background: none; color: var(--text-muted); cursor: pointer; border-radius: 10px; transition: 0.2s; font-weight: 700; font-family: inherit; }
.tab-btn.active { background: rgba(255,255,255,0.1); color: white; }

.stats-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ranking-list { display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow-y: auto; padding-right: 5px; }
.rank-item { 
    display: grid; grid-template-columns: 40px 30px 1fr 80px; align-items: center;
    padding: 12px 15px; background: rgba(255,255,255,0.04); 
    border-radius: 14px; font-size: 0.9rem; transition: 0.2s;
    border: 1px solid transparent;
}
.rank-item:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.1); }
.rank-item.mine { border: 1px solid var(--accent-gold); background: rgba(251,191,36,0.12); font-weight: bold; }
.rank-pos { color: var(--text-muted); font-weight: 800; font-size: 0.8rem; }
.rank-avatar { font-size: 1.2rem; }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }
.rank-points { text-align: right; color: var(--accent-teal); font-weight: 800; font-size: 1rem; }
.rank-loading { text-align: center; padding: 20px; color: var(--text-muted); font-style: italic; }

/* Skin Styles */
.skin-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.skin-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}
.skin-card:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-3px); border-color: var(--accent-purple); }
.skin-card.active { border-color: var(--accent-gold); background: rgba(251, 191, 36, 0.08); box-shadow: 0 0 15px rgba(251, 191, 36, 0.1); }
.skin-preview { font-size: 1.5rem; margin-bottom: 8px; letter-spacing: -5px; }
.skin-info { display: flex; flex-direction: column; gap: 2px; }
.skin-name { font-weight: 800; font-size: 0.9rem; color: white; }
.skin-status { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.skin-card.active .skin-status { color: var(--accent-gold); }

/* Share Style */
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.share-btn { 
    padding: 12px 5px; 
    border-radius: 14px; 
    border: none; 
    color: white; 
    font-weight: 800; 
    cursor: pointer; 
    transition: all 0.2s; 
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
.share-btn:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.share-btn.fb { background: #1877F2; }
.share-btn.wa { background: #25D366; }
.share-btn.tw { background: #000000; border: 1px solid rgba(255,255,255,0.1); }
.share-btn.tt { background: #010101; border: 1px solid rgba(0,242,234,0.3); box-shadow: 2px 2px 0 rgba(255,0,80,0.5); }
.auth-btn.facebook:hover { border-color: #1877F2; }

#toast-container { position:absolute; bottom:80px; left:50%; transform:translateX(-50%); z-index:500; display:flex; flex-direction:column; gap:6px; align-items:center; }
.toast { padding:8px 18px; border-radius:20px; background:rgba(30,25,50,0.9); backdrop-filter:blur(8px); border:1px solid var(--glass-border); font-size:0.8rem; font-weight:600; animation:toastIn 0.3s ease-out,toastOut 0.3s 2.8s ease-in forwards; white-space:nowrap; }
@keyframes toastIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
@keyframes toastOut { from{opacity:1} to{opacity:0;transform:translateY(-10px)} }

canvas { display:block; border-radius:var(--board-radius); }
.evo-card::-webkit-scrollbar, .stats-card::-webkit-scrollbar { width:4px; }
.ranking-list::-webkit-scrollbar { width: 5px; }
.ranking-list::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }

/* REWARD MODAL */
.reward-card {
    text-align: center;
    background: linear-gradient(135deg, #2a1a45, #1a0f30);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.2);
}
.reward-sparkles {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}
.reward-calendar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 25px 0;
}
.reward-day {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    opacity: 0.6;
}
.reward-day.current {
    opacity: 1;
    border-color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.1);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}
.reward-day.claimed {
    opacity: 0.4;
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}
.reward-day.claimed::after {
    content: '✓';
    position: absolute;
    color: #10b981;
    font-weight: bold;
}
.reward-day:last-child {
    grid-column: span 2;
    background: linear-gradient(to bottom, rgba(251, 191, 36, 0.2), transparent);
}
.day-label { font-size: 0.7rem; color: var(--text-muted); }
.day-reward { font-size: 1.5rem; }
.day-value { font-weight: 800; font-size: 0.9rem; color: var(--accent-gold); }

#claim-reward-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--accent-gold), #f59e0b);
    color: #000;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s;
}
#claim-reward-btn:active { transform: scale(0.96); }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* RESPONSIVE — ≤400px (small phone) */
@media (max-width: 400px) {
    #game-container { --container-max-w:100%; --container-padding:6px; --container-gap:5px; --board-radius:12px; --btn-size:36px; --btn-font:0.85rem; --score-font:1.2rem; --label-font:0.5rem; --preview-font:1.4rem; --user-font:0.75rem; --level-font:0.6rem; --h1-font:1.4rem; }
    .user-pill { padding:4px 8px 4px 4px; gap:6px; }
    .user-avatar { width:26px; height:26px; font-size:1rem; }
    .top-actions { gap:3px; }
    .score-box, .next-box { padding:5px 6px; border-radius:10px; }
    .overlay-card { padding:20px 16px; border-radius:20px; }
    .game-logo { font-size:3.5rem; }
    .game-over-emoji { font-size:2.5rem; }
    .auth-btn { padding:11px 14px; font-size:0.8rem; min-height:44px; }
    .final-val { font-size:1.4rem; }
    .evo-emoji { font-size:1.4rem; width:32px; }
}

/* RESPONSIVE — 401–767px (phone) */
@media (min-width: 401px) and (max-width: 767px) {
    #game-container { --container-max-w:460px; }
}

/* RESPONSIVE — 768–1023px (tablet) */
@media (min-width: 768px) and (max-width: 1023px) {
    #game-container { --container-max-w:560px; --container-padding:14px; --container-gap:10px; --board-radius:22px; --btn-size:46px; --btn-font:1.1rem; --score-font:1.7rem; --preview-font:2rem; --user-font:0.95rem; --h1-font:2rem; }
    .user-pill { padding:8px 16px 8px 8px; }
    .user-avatar { width:38px; height:38px; font-size:1.4rem; }
    .stats-grid { grid-template-columns:repeat(3,1fr); }
    .overlay-card { max-width:460px; padding:36px 32px; }
    .auth-btn { padding:15px 20px; font-size:1rem; }
}

/* RESPONSIVE — 1024px+ (desktop) */
@media (min-width: 1024px) {
    #game-container { --container-max-w:640px; --container-padding:18px; --container-gap:12px; --board-radius:24px; --btn-size:50px; --btn-font:1.2rem; --score-font:2rem; --preview-font:2.4rem; --user-font:1rem; --h1-font:2.2rem; }
    .user-pill { padding:10px 18px 10px 10px; }
    .user-avatar { width:42px; height:42px; font-size:1.5rem; }
    .overlay-card { max-width:500px; padding:40px 36px; }
    .stats-grid { grid-template-columns:repeat(3,1fr); }
    .game-logo { font-size:6rem; }
    .game-over-emoji { font-size:4rem; }
}

/* LANDSCAPE */
@media (max-height: 500px) and (orientation: landscape) {
    #game-container { --container-padding:4px; --container-gap:3px; flex-direction:row; flex-wrap:wrap; max-width:100%; }
    #top-bar { width:100%; flex-shrink:0; }
    #score-bar { width:120px; flex-direction:column; flex-shrink:0; }
    #game-board { flex:1; min-width:0; }
    .overlay-card { padding:16px 14px; }
    .game-logo { font-size:2.5rem; }
    .game-over-emoji { font-size:2rem; }
    .auth-btn { padding:8px 12px; font-size:0.75rem; min-height:36px; }
}

/* DUEL HUD STYLES */
#duel-hud {
    position: absolute;
    top: 5px;
    left: 20px;
    right: 20px;
    background: rgba(10, 8, 24, 0.4);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    padding: 4px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 40;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none; /* Allow clicking through the HUD */
    opacity: 0.8;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.duel-player {
    display: flex;
    align-items: center;
    gap: 10px;
}
.duel-player.me { justify-content: flex-end; }

.duel-player span:first-child, .duel-player span:last-child {
    font-size: 1.2rem;
    background: rgba(255,255,255,0.05);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.duel-info {
    display: flex;
    flex-direction: column;
    min-width: 60px;
}
.me .duel-info { text-align: right; }

.duel-info span:first-child {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
}
.duel-info span:last-child {
    font-size: 0.9rem;
    font-weight: 800;
    color: white;
}

.duel-progress-wrap {
    flex: 1;
    height: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 5px;
    padding: 1px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

.duel-progress-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

#duel-progress-fill {
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, #f87171, #60a5fa);
    border-radius: 5px;
    transition: width 0.3s ease;
}

#duel-progress-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    z-index: 2;
    filter: drop-shadow(0 0 2px black);
}

#duel-result {
    margin: 20px 0;
    padding: 15px;
    border-radius: 15px;
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--accent-gold);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#duel-result-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    color: var(--accent-gold);
    margin-bottom: 5px;
}

#duel-result-subtext {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* CHALLENGE BUTTON IN RANKING */
.challenge-btn {
    background: var(--accent-purple);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
    margin-left: 10px;
}
.challenge-btn:hover {
    background: var(--accent-pink);
    transform: scale(1.05);
}
.challenge-btn:active { transform: scale(0.95); }

/* Skins Bloqueadas e Itens Especiais */
.skin-card.locked {
    filter: grayscale(1) contrast(0.8);
    opacity: 0.7;
    position: relative;
}
.skin-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -10%);
    font-size: 1.5rem;
    z-index: 5;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.skin-card.locked .skin-preview {
    filter: blur(2px);
}
.rainbow-item .item-icon {
    animation: rainbowPulse 2s linear infinite;
}
@keyframes rainbowPulse {
    0% { filter: hue-rotate(0deg) drop-shadow(0 0 5px #fff); }
    100% { filter: hue-rotate(360deg) drop-shadow(0 0 10px #fff); }
}

/* RAINBOW EFFECT */
.rainbow-effect {
    background: linear-gradient(135deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3) !important;
    background-size: 600% 600% !important;
    animation: rainbow-anim 8s ease infinite !important;
    position: relative;
    overflow: hidden;
    border: none !important;
    color: white !important;
}

@keyframes rainbow-anim {
    0% { background-position: 0% 50% }
    50% { background-position: 100% 50% }
    100% { background-position: 0% 50% }
}

.rainbow-effect::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: sheen 4s linear infinite;
}

@keyframes sheen {
    from { transform: rotate(0deg) translate(-10%, -10%); }
    to { transform: rotate(360deg) translate(-10%, -10%); }
}

/* INVENTORY SLOTS */
#inventory-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
    pointer-events: none;
}

.powerup-slot {
    width: 54px;
    height: 54px;
    background: var(--glass-bg);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(8px);
}

.powerup-slot:hover {
    transform: scale(1.1) translateY(-5px);
    border-color: var(--accent-purple);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.powerup-slot.active {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 15px var(--accent-gold);
    background: rgba(251, 191, 36, 0.2) !important;
}

.powerup-slot.empty {
    opacity: 0.5;
    cursor: default;
    filter: grayscale(1);
    pointer-events: none;
}

.powerup-slot .count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-pink);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--deep-bg);
    min-width: 14px;
    text-align: center;
}

.powerup-slot .icon {
    font-size: 24px;
}

/* Hammer targeting mode */
.hammer-mode canvas {
    cursor: crosshair !important;
}

.powerup-slot[id="slot-hammer"].active {
    animation: pulse-gold 1.5s infinite;
}

@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

/* Poop Item Special Style */
.poop-item {
    background: rgba(120, 85, 72, 0.1) !important;
    border-color: #795548 !important;
}
.poop-item:hover {
    background: rgba(120, 85, 72, 0.2) !important;
    box-shadow: 0 0 15px rgba(121, 85, 72, 0.5);
}

.powerup-slot[id="slot-poop"].active {
    animation: poopShake 0.5s infinite;
    border-color: #795548 !important;
    box-shadow: 0 0 10px #795548;
}

@keyframes poopShake {
    0%, 100% { transform: scale(1.1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.emoji-poop {
    filter: drop-shadow(0 0 5px rgba(121, 85, 72, 0.5));
}

.shop-footer-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

.exit-shop-btn {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.exit-shop-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    border-color: #fff;
}
/* CHECKOUT MODAL STYLES */
.checkout-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 400px;
    padding: 30px;
}

.checkout-header h2 {
    color: white;
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.checkout-header p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.payment-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.checkout-form .input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.checkout-form .input-row {
    display: flex;
    gap: 15px;
}

.checkout-form label {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.checkout-form input {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.checkout-form input:focus {
    border-color: var(--accent-gold);
    outline: none;
}

.checkout-total {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.security-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    font-size: 0.75rem;
    color: #64748b;
}

.checkout-footer {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pay-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.pay-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.cancel-pay-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px;
}

.loader-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes jellyBlink {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; filter: drop-shadow(0 0 8px var(--accent-gold)); }
}
