* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f2f4f7;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: #ffffff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

h1 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    color: #1a1a1a;
}

form {
    text-align: left;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin: 14px 0 6px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d8dce1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #4f7cff;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.captcha-row img {
    border-radius: 6px;
    border: 1px solid #d8dce1;
}

#refreshCaptcha {
    border: 1px solid #d8dce1;
    background: #f7f8fa;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    margin-top: 22px;
    padding: 11px;
    background: #4f7cff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background: #3d68e8;
}

.switch-link {
    margin-top: 18px;
    font-size: 13px;
    color: #555;
}

.switch-link a {
    color: #4f7cff;
    text-decoration: none;
    font-weight: 600;
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: left;
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}

.alert-error {
    background: #fdecec;
    color: #b3261e;
    border: 1px solid #f5c2c0;
}

.alert-success {
    background: #eaf7ea;
    color: #1e7d1e;
    border: 1px solid #bfe6bf;
}

.field-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #777;
}

.optional-tag {
    font-weight: 400;
    color: #999;
}

.referral-box {
    margin-top: 18px;
    padding: 12px 14px;
    background: #f7f8fa;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    text-align: left;
}

.referral-box label {
    margin: 0 0 6px;
}

.referral-box input {
    background: #fff;
}

.tooltip-wrap {
    position: relative;
}

.field-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 10;
    background: #2b2f38;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: 6px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.field-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 16px;
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent #2b2f38 transparent;
}

.field-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   APP SHELL (home / dashboard / stadium / history / profile)
   Same palette as the auth pages: #4f7cff primary,
   #f2f4f7 background, 12px radius, soft shadows.
   ===================================================== */

body.app-page {
    display: block;
    align-items: initial;
    justify-content: initial;
    padding: 0;
    min-height: 100vh;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #ffffff;
    border-bottom: 1px solid #e2e5ea;
    position: sticky;
    top: 0;
    z-index: 50;
}

.app-header .logo {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 15px;
    text-decoration: none;
}

.app-header .balance-pill {
    background: #eef2ff;
    color: #4f7cff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.app-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 16px 100px;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 16px;
}

/* ---- Bottom Nav ---- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #e2e5ea;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.06);
    z-index: 100;
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: #9aa1ab;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 0;
}

.bottom-nav a svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav a.active {
    color: #4f7cff;
}

/* ---- Live Activity Feed ---- */
.activity-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-top: 20px;
    overflow: hidden;
}

.activity-panel .activity-header {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid #f0f1f3;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a1a;
}

.activity-panel .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1e9e5a;
    display: inline-block;
    animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.activity-list {
    max-height: 260px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f6f8;
    animation: activity-pop 0.35s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.activity-icon.invest   { background: #eef2ff; color: #4f7cff; }
.activity-icon.deposit  { background: #eafaf0; color: #1e9e5a; }
.activity-icon.withdraw { background: #fff3e6; color: #c9760a; }

.activity-text {
    font-size: 13.5px;
    color: #333;
}

.activity-time {
    font-size: 11px;
    color: #9aa1ab;
    margin-left: auto;
    white-space: nowrap;
}

@keyframes activity-pop {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Shared small helpers for app pages ---- */
.section-title {
    margin: 26px 0 4px;
    font-size: 1.15rem;
    color: #1a1a1a;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 16px;
}

.stat-card .label {
    color: #777;
    font-size: 0.82rem;
}

.stat-card .value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 4px;
}

.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-active,
.badge-completed-success { background: #eafaf0; color: #1e9e5a; }
.badge-completed { background: #eef2ff; color: #4f7cff; }
.badge-cancelled,
.badge-failed { background: #fdecec; color: #b3261e; }
.badge-pending { background: #fff3e6; color: #c9760a; } 
.action-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.action-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 14px 6px; border-radius: 14px; color: #fff; text-decoration: none;
    font-size: .8rem; font-weight: 600; text-align: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    transition: transform .15s ease, box-shadow .15s ease;
}
.action-btn .icon { font-size: 1.4rem; line-height: 1; }
.action-btn:active { transform: scale(.96); box-shadow: 0 3px 8px rgba(0,0,0,0.15); }
.action-btn.topup    { background: linear-gradient(135deg, #16a34a, #22c55e); }
.action-btn.pickpick { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.action-btn.bankkudi { background: linear-gradient(135deg, #7c3aed, #a855f7); }