/* ======== GLOBAL DESIGN SYSTEM & THEME ======== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
:root { --primary-bg: #0a192f; --primary-accent: #FFD700; --primary-accent-gradient: linear-gradient(145deg, #ffd700, #f0c400); --text-light: #FFFFFF; --text-dark: #333333; --border-color: #FFFFFF; --success-color: #00844E; --error-color: #dc3545; --warning-color: #ffc107; --disabled-color: #5a6a81; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Montserrat', sans-serif; background-color: var(--primary-bg); color: var(--text-light); display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
.hidden { display: none !important; }
.btn { padding: 12px 24px; border: none; cursor: pointer; font-size: 1rem; font-weight: bold; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.btn-primary { background: var(--primary-accent-gradient); color: var(--primary-bg); border: 2px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4); }
.btn-primary:disabled { background: var(--disabled-color); border-color: #888; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background-color: transparent; border: 2px solid var(--primary-accent); color: var(--primary-accent); border-radius: 8px; }
input[type="text"], input[type="tel"], input[type="password"], input[type="number"], select { width: 100%; padding: 12px; background-color: rgba(255, 255, 255, 0.1); border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-light); font-size: 1rem; margin-bottom: 15px; transition: all 0.3s ease; }
input:focus, select:focus { outline: none; border-color: var(--primary-accent); box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }

select {
    color: var(--primary-accent);
}
select option {
    color: var(--text-dark);
    background-color: var(--text-light);
}

.phone-input-group, .password-input-group { display: flex; align-items: center; position: relative; }
.phone-input-group select { width: auto; margin-right: 5px; margin-bottom: 15px; }
.password-input-group i { position: absolute; right: 15px; cursor: pointer; }
#app-header { width: 100%; padding: 15px 5%; background-color: rgba(10, 25, 47, 0.8); backdrop-filter: blur(10px); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
#app-header .logo a { font-size: 1.5rem; font-weight: bold; color: var(--primary-accent); text-decoration: none; line-height: 1.2; }
#app-header .actions-area { display: flex; align-items: center; gap: 20px; }
#logged-in-view { display: flex; align-items: center; gap: 15px; }
#app-header .user-info-display { font-weight: bold; margin-right: 10px; }
.btn-header-action { background-color: transparent; border: 1px solid var(--primary-accent); color: var(--primary-accent); padding: 8px 16px; border-radius: 6px; font-size: 0.9rem; font-weight: normal; transition: all 0.2s ease; transform: none !important; box-shadow: none !important; }
.btn-header-action:hover { background-color: var(--primary-accent); color: var(--primary-bg); }

#app-header .actions-area #language-selector {
    background-color: transparent;
    border: 1px solid var(--primary-accent);
    color: var(--primary-accent);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 1em;
    padding-right: 2em;
}

.btn-logout { border-color: var(--error-color); color: var(--error-color); }
.btn-logout:hover { background-color: var(--error-color); color: var(--text-light); }
#app-footer { width: 100%; padding: 20px 5%; background-color: rgba(10, 25, 47, 0.9); display: flex; justify-content: center; align-items: center; gap: 30px; flex-wrap: wrap; margin-top: auto; font-size: 0.9rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
#app-footer a { color: var(--primary-accent); text-decoration: none; }
#app-main { flex-grow: 1; display: flex; justify-content: center; align-items: center; padding: 20px; }
.app-screen { width: 100%; height: 100%; }
.app-screen.active { display: block; }
#home-screen { display: flex; justify-content: center; align-items: center; }
.btn-extra-large { padding: 25px 80px; font-size: 3rem; }
.pulse { animation: pulse-animation 2s infinite; }
@keyframes pulse-animation { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); } 70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(255, 215, 0, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); } }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 200; }
.modal-content { background-color: var(--primary-bg); padding: 30px 40px; border-radius: 12px; border: 1px solid var(--border-color); position: relative; width: 90%; max-width: 500px; text-align: center; }
.modal-large { max-width: 800px; }
.modal-xl { max-width: 1000px; max-height: 90vh; display: flex; }
.close-modal-btn { position: absolute; top: 10px; right: 20px; font-size: 2rem; color: var(--text-light); cursor: pointer; z-index: 10; }
.modal-content h2, .modal-content h3 { color: var(--primary-accent); margin-bottom: 20px; }
.modal-content label { display: block; text-align: left; margin-bottom: 5px; font-weight: bold; }
.modal-content .btn-primary { width: 100%; margin-top: 20px; }
.login-options, .terms-agreement { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; font-size: 0.9rem; }
.login-options a { color: var(--primary-accent); text-decoration: none; }
.terms-agreement { justify-content: center; gap: 10px; }
.terms-agreement a { color: var(--primary-accent); }
.modal-switch-link { margin-top: 20px; font-size: 0.9rem; }
.modal-switch-link a { color: var(--primary-accent); font-weight: bold; text-decoration: none; }
.error-text { color: var(--error-color); font-size: 0.9rem; text-align: left; margin-top: -10px; margin-bottom: 10px; }
.warning-note { margin-top: 15px; font-size: 0.8rem; color: var(--warning-color); }
.coming-soon-note { font-style: italic; color: #ccc; font-size: 0.9rem; margin-top: 10px; }
.betting-layout { display: flex; gap: 20px; height: 100%; }
.slots-main-area { flex-grow: 1; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.slots-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; width: 100%; }
.slot-btn { display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 20px; font-weight: bold; color: var(--text-dark); background: var(--primary-accent-gradient); border: 2px solid var(--border-color); border-radius: 8px; cursor: pointer; text-align: center; }
.slot-win-amount { background-color: rgba(10, 25, 47, 0.4); color: var(--text-light); font-size: 1.2rem; padding: 5px 15px; border-radius: 6px; margin-bottom: 15px; font-weight: bold; width: 100%; border: 1px solid var(--primary-accent); }
.slot-title { font-size: 1.8rem; line-height: 1.2; margin-bottom: 10px; }
.slot-fullness-display { font-size: 1rem; font-weight: normal; }
.bet-controls { display: flex; align-items: center; gap: 20px; margin-top: 20px; }
.amount-display { background-color: rgba(255,255,255,0.1); padding: 15px; border-radius: 8px; font-size: 1.2rem; font-weight: bold; }
.winners-sidebar { width: 250px; background-color: rgba(0,0,0,0.2); padding: 20px; border-radius: 8px; overflow-y: auto; }
.winners-sidebar h3 { color: var(--primary-accent); }
#recent-winners-list { list-style-type: none; margin-top: 10px; }
#recent-winners-list li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.2); }
#betting-grid-modal .modal-content { display: flex; flex-direction: column; max-height: 90vh; }
#betting-grid-container { overflow-y: auto; margin: 20px 0; padding-right: 10px; }
.betting-grid { display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr); gap: 3px; }
.grid-label, .grid-box { width: 100%; aspect-ratio: 1 / 1; display: flex; justify-content: center; align-items: center; font-weight: bold; }
.grid-box { background-color: #3d5a80; cursor: pointer; border-radius: 4px; transition: background-color 0.2s; }
.grid-box.selected { background-color: var(--primary-accent); color: var(--text-dark); }
.grid-box.unavailable { background-color: var(--error-color); cursor: not-allowed; }
.settings-layout { display: flex; width: 100%; height: 100%; text-align: left; }
.settings-tabs { display: flex; flex-direction: column; flex-shrink: 0; width: 220px; padding: 20px; background-color: rgba(0,0,0,0.2); border-right: 1px solid rgba(255,255,255,0.2); }
.tab-link { background: none; border: none; color: var(--text-light); padding: 15px 20px; cursor: pointer; font-size: 1rem; text-align: left; border-radius: 8px; margin-bottom: 5px; display: flex; align-items: center; transition: all 0.2s ease-in-out; }
.tab-link:not(.active):hover { background-color: rgba(255, 215, 0, 0.1); color: var(--primary-accent); }
.tab-link.active, .tab-link:hover { font-weight: bold; }
.tab-link.active { background-color: var(--primary-accent); color: var(--primary-bg); }
.tab-link i { margin-right: 15px; width: 20px; text-align: center; }
.settings-content { flex-grow: 1; padding: 30px 40px; overflow-y: auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content hr { border: none; height: 1px; background-color: rgba(255, 255, 255, 0.2); margin: 30px 0; }
.table-container { max-height: 50vh; overflow-y: auto; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th, .history-table td { padding: 12px 15px; text-align: left; }
.history-table thead { position: sticky; top: 0; background-color: var(--primary-bg); }
.history-table th { font-weight: bold; color: var(--primary-accent); border-bottom: 2px solid var(--primary-accent); }
.history-table tbody tr:nth-child(even) { background-color: rgba(255, 255, 255, 0.05); }
.history-table tbody tr { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.amount-positive { color: var(--success-color); font-weight: bold; }
.amount-negative { color: var(--error-color); font-weight: bold; }
.status-completed { color: var(--success-color); }
.status-pending { color: var(--warning-color); }
.status-failed { color: var(--error-color); }
.status-canceled { color: var(--error-color); }
.result-win { color: var(--success-color); font-weight: bold; }
.result-loss { color: var(--error-color); }
#toast-notification { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 15px 30px; border-radius: 8px; color: var(--text-light); font-weight: bold; z-index: 300; opacity: 0; transition: opacity 0.5s, transform 0.5s; width: 90%; max-width: 500px; text-align: center; }
#toast-notification.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast-notification.success { background-color: var(--success-color); }
#toast-notification.error { background-color: var(--error-color); }
#update-screen { display: flex; justify-content: center; align-items: center; text-align: center; padding: 20px; height: 100%; }
.update-container { background-color: rgba(0, 0, 0, 0.3); padding: 40px; border-radius: 12px; border: 1px solid var(--border-color); max-width: 500px; }
.update-container h2 { color: var(--primary-accent); margin-bottom: 20px; }
.update-container p { margin-bottom: 30px; line-height: 1.6; }
.update-container .btn { width: 100%; }
#register-step-1b .btn { display: block; width: 100%; margin-top: 15px; }
#register-step-1b p.small-text { margin-top: 5px; }
.slot-bet-cost { font-size: 1.1rem; font-weight: bold; color: var(--text-dark); margin: 8px 0; background-color: rgba(255, 255, 255, 0.3); padding: 4px 10px; border-radius: 4px; }

@media (max-width: 768px) {
    #app-main { padding: 10px; }
    html { font-size: 14px; }
    #app-header { flex-wrap: wrap; padding: 10px 4%; gap: 10px; }
    #app-header .actions-area { gap: 10px; width: 100%; justify-content: space-between; }
    #logged-in-view { gap: 8px; flex-wrap: wrap; }
    #app-footer { flex-direction: column; gap: 10px; text-align: center; }
    .btn-extra-large { padding: 5vw 10vw; font-size: clamp(2rem, 10vw, 3rem); }
    .modal-content { padding: 25px 20px; width: 95%; }
    .modal-content h2 { font-size: 1.5rem; }
    .betting-layout { flex-direction: column; }
    .winners-sidebar { width: 100%; max-height: 200px; }
    .slots-container { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
    .slot-btn { padding: 15px; }
    .settings-layout { flex-direction: column; height: 100%; }
    .settings-tabs { flex-direction: row; width: 100%; overflow-x: auto; border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.2); flex-shrink: 0; padding: 5px; }
    .tab-link { padding: 10px 15px; justify-content: center; flex-shrink: 0; }
    .tab-link span { display: none; }
    .tab-link i { margin-right: 0; font-size: 1.2rem; }
    .settings-content { padding: 20px 15px; }
    .table-container { overflow-x: auto; }
    .history-table { white-space: nowrap; }
}

/* --- All previous styles from the last complete version --- */

/* ... (paste all your existing CSS here) ... */

/* --- NEW STYLES FOR HOME SCREEN LAYOUT --- */

#home-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; /* This is the default, but let's be explicit */
}

/* This new container will manage the layout of the two buttons */
.home-screen-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px; /* Adds space between the "Get App" and "PLAY" buttons */
}

#get-app-link {
    padding: 12px 24px; /* A standard button size */
    font-size: 1.2rem;
    text-decoration: none; /* ** THIS REMOVES THE UNDERLINE ** */
    color: var(--primary-bg); /* Ensure text color matches other primary buttons */
}

/* --- STYLES FOR FORCE UPDATE SCREEN --- */
#update-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    height: 100%;
}
.update-container {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 500px;
}
.update-container h2 {
    color: var(--primary-accent);
    margin-bottom: 20px;
}
.update-container p {
    margin-bottom: 30px;
    line-height: 1.6;
}
.update-container .btn {
    width: 100%;
}