/* --- základní nastavení a proměnné --- */
:root {
    --primary-color: #4a90e2;
    --primary-gradient: linear-gradient(135deg, #4a90e2 0%, #81c784 100%);
    --green-color: #4CAF50;
    --red-color: #F44336;
    --violet-color: #9C27B0;
    --big-color: #ff9800;
    --small-color: #03a9f4;
    --text-color: #333;
    --light-text: #888;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    display: flex;
    justify-content: center;
}

.mobile-container {
    width: 100%;
    max-width: 450px;
    background-color: var(--card-bg);
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
    min-height: 100vh;
    position: relative;
    padding-bottom: 70px; /* Footer space */
}

/* --- Header --- */
.header {
    background: var(--primary-gradient);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 20px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.balance {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}
.balance i { margin-right: 5px; }

.recharge-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.recharge-btn:active { transform: scale(0.95); }
.recharge-btn i { margin-right: 5px; }

/* --- Game Tabs --- */
.game-tabs {
    display: flex;
    margin: 20px 15px;
    background-color: #f8f9fa;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.tab-btn {
    flex: 1;
    padding: 12px 10px;
    border: none;
    background: none;
    font-size: 1em;
    font-weight: 500;
    color: var(--light-text);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 10px;
}
.tab-btn.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.4);
}

.game-area { padding: 0 15px; }

/* --- Period Info --- */
.period-info {
    display: flex;
    justify-content: space-between;
    text-align: center;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.period, .countdown { flex: 1; }
.period h3, .countdown h3 {
    margin: 0 0 8px 0;
    color: var(--light-text);
    font-size: 0.9em;
    font-weight: 500;
}
.period h3 i, .countdown h3 i { margin-right: 5px; }
.period p, .countdown p {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-color);
}
#timer { color: var(--green-color); }

/* --- Result History --- */
.result-history { margin-bottom: 20px; }
.result-history h4 { margin: 0 0 10px; font-weight: 600; }
.result-history h4 i { margin-right: 5px; color: var(--primary-color); }
.results-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.results-track::-webkit-scrollbar { height: 4px; }
.results-track::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.result-item {
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 1.1em;
}
.result-red { background: var(--red-color); }
.result-green { background: var(--green-color); }
.result-violet { background: var(--violet-color); }

/* --- Betting Options --- */
.bet-category {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}
.color-bets { grid-template-columns: repeat(3, 1fr); }
.number-bets { grid-template-columns: repeat(5, 1fr); }
.size-bets { grid-template-columns: repeat(2, 1fr); }

.bet-btn {
    padding: 12px 5px;
    border-radius: 10px;
    border: none;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.bet-btn:disabled { cursor: not-allowed; background-color: #e9ecef !important; color: #aaa !important; box-shadow: none; }
.bet-btn:active { transform: scale(0.95); box-shadow: none; }

.bet-btn.green { background-color: var(--green-color); color: white; }
.bet-btn.red { background-color: var(--red-color); color: white; }
.bet-btn.violet { background-color: var(--violet-color); color: white; }
.bet-btn.big { background-color: var(--big-color); color: white; }
.bet-btn.small { background-color: var(--small-color); color: white; }
.bet-btn.number { background-color: #f8f9fa; border: 1px solid var(--border-color); color: var(--text-color); }

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;
}
.modal-content {
    background: white;
    width: 100%;
    max-width: 450px;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

#modal-title { margin-top: 0; font-size: 1.4em; }

.bet-input-group { margin-bottom: 15px; text-align: left; }
.bet-input-group label { font-weight: 500; color: var(--light-text); margin-bottom: 5px; display: block; }
#bet-amount {
    width: 100%;
    padding: 12px;
    font-size: 1.5em;
    font-weight: 700;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
}

.quick-amounts { display: flex; justify-content: space-around; margin-bottom: 20px; }
.quick-amounts button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: #f8f9fa;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
}

.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions button {
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
}
#cancel-bet { background-color: #eee; color: #333; }
#confirm-bet { background: var(--primary-gradient); color: white; }

/* --- Footer Navigation --- */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    height: 65px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    border-radius: 20px 20px 0 0;
}
.nav-item {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--light-text);
    font-size: 0.8em;
}
.nav-item i { font-size: 1.4em; }
.nav-item.active { color: var(--primary-color); font-weight: 600; }

/* --- Message Container --- */
#message-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.5s;
    font-size: 0.9em;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
#message-container.show { opacity: 1; }