:root {
    --bg-color: #000000;
    --primary-blue: #2196F3;
    --primary-green: #249715;
    --primary-red: #FF0000;
    --primary-orange: #FF9800;
    --primary-gray: #757575;
    --text-yellow: #FFEB3B;
}

body {
    background-color: #1a1a1a;
    color: #FFFFFF;
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Moldura do Celular */
#phone-frame {
    width: 360px;
    height: 740px;
    background-color: var(--bg-color);
    border: 12px solid #333;
    border-radius: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

#screen-content {
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    text-align: center;
}

/* Tipografia */
.app-title {
    font-family: 'Black Ops One', cursive;
    font-size: 28px;
    color: #FFFFFF;
    margin: 10px 0;
}

.text-red { color: var(--primary-red); }

/* Logotipos Reais */
.main-logo {
    width: 200px; /* Aumentei um pouco para valorizar a imagem dos 4 símbolos */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    object-fit: contain;
}

.menu-logo {
    width: 120px;
    height: auto;
    border-radius: 8px;
    margin: 10px auto;
    display: block;
    object-fit: contain;
}

/* Seletor de Operações com Grade */
.logo-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.mini-logo {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: block;
    object-fit: contain;
}

.op-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.op-grid div {
    cursor: pointer;
    border-radius: 4px;
}

.op-grid div:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.op-hint {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-yellow);
    font-weight: bold;
}

/* Remove placeholders antigos */
.logo-placeholder { display: none; }

/* Inputs Estilo Android */
.input-group { width: 100%; margin: 20px 0; }
input {
    width: 90%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #666;
    color: white;
    padding: 12px;
    margin: 8px 0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}
input:focus { border-bottom-color: var(--primary-blue); }

/* Botões Estilo Material Design */
.btn {
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    transition: opacity 0.2s;
    width: 100%;
    margin: 5px 0;
}
.btn:active { transform: scale(0.98); }
.btn-large { padding: 18px; font-size: 18px; }

.btn-blue { background-color: var(--primary-blue); }
.btn-green { background-color: var(--primary-green); }
.btn-red { background-color: var(--primary-red); }
.btn-purple { background-color: #9C27B0; }
.btn-orange { background-color: var(--primary-orange); }
.btn-gray { background-color: var(--primary-gray); }

.button-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* User Info Bar */
.user-info {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    font-weight: bold;
    margin-bottom: 10px;
}
.user-info-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
#display-nickname { color: var(--text-yellow); font-size: 18px; }
#display-credits { color: #4CAF50; font-size: 16px; }
#display-record { color: #FFFFFF; font-size: 13px; opacity: 0.8; }

/* Game Area */
.game-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-weight: bold;
    color: var(--text-yellow);
}

.timer-circle {
    width: 60px;
    height: 60px;
    border: 3px solid var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 20px auto;
}

.math-expression {
    font-size: 54px;
    font-weight: bold;
    margin: 30px 0;
}

.answer-box {
    width: 120px !important;
    font-size: 32px !important;
    text-align: center;
    border-bottom: 3px solid white !important;
}

/* Ranking Table */
.ranking-section {
    width: 100%;
    background: #111;
    border-radius: 12px;
    padding: 10px;
    margin: 15px 0;
    max-height: 200px;
    overflow-y: auto;
}

/* Anúncio Intersticial (Web Simulator) */
#ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.ad-content {
    background: #222;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 80%;
    max-width: 300px;
    box-shadow: 0 0 30px rgba(33, 150, 243, 0.3);
}

.ad-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #444;
    border-top: 5px solid var(--primary-blue);
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ajuste no Timer para não ocupar espaço quando invisível */
.timer-circle {
    min-height: 60px;
}
.rank-row {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #222;
    font-size: 14px;
}

/* Carrossel de Dicas */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 300px;
    margin: 20px auto;
    background: #111;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid #333;
}

.tip-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tip-slide img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(33, 150, 243, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover { background: var(--primary-blue); }
.nav-btn.prev { left: 10px; }
.nav-btn.next { right: 10px; }

#tip-count {
    font-weight: bold;
    color: var(--text-yellow);
    margin-bottom: 20px;
}

/* --- INTEGRACAO LUCKIO --- */
.luckio-container {
    display: flex;
    align-items: center;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    padding: 12px;
    border-radius: 12px;
    margin: 15px 0;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.luckio-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 215, 0, 0.4);
}

.luckio-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: contain;
}

.luckio-container span {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* POPUP DE RECOMPENSA (ANIMAÇÃO) */
.reward-popup {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #FFD700;
    color: #000;
    padding: 15px 25px;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    z-index: 1000;
    animation: rewardPop 2s ease-out forwards;
    pointer-events: none;
    white-space: nowrap;
}

/* WIN SPLASH OVERLAY */
.win-splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.win-splash-content {
    background: #1a1a1a;
    border: 3px solid #FFD700;
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

.win-icon {
    font-size: 64px;
    margin-bottom: 10px;
}

.win-splash-content h2 {
    color: #FFD700;
    margin: 10px 0;
    font-family: 'Black Ops One', cursive;
}

.win-splash-content p {
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
}

@keyframes rewardPop {
    0% { transform: translate(-50%, 50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -150%) scale(0.8); opacity: 0; }
}
