/* ============================================
   Toto 4D Pools - Desain Meriah & Modern
   ============================================ */

/* Google Sans - font global (variable font, weight 400-700) */
@font-face {
    font-family: 'Google Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 400 700;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/google-sans:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --secondary: #ffd93d;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --dark: #1a1a2e;
    --darker: #0f0f1a;
    --light: #f8f9fa;
    --gold: #ffd700;
    --success: #00b894;
    --gradient-main: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ffd93d 100%);
    --gradient-dark: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,107,53,0.15) 0%, rgba(108,92,231,0.15) 100%);
    --shadow-glow: 0 0 40px rgba(255,107,53,0.3);
    --shadow-card: 0 10px 40px rgba(0,0,0,0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --font-main: 'Google Sans', sans-serif;
    --font-display: 'Google Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--darker);
    color: var(--light);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

/* Background Effects */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255,107,53,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(108,92,231,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255,217,61,0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.confetti-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255,107,53,0.1) 0%, transparent 2px),
        radial-gradient(circle at 90% 10%, rgba(255,217,61,0.1) 0%, transparent 2px),
        radial-gradient(circle at 30% 90%, rgba(108,92,231,0.1) 0%, transparent 2px);
    background-size: 50px 50px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15,15,26,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,107,53,0.2);
    padding: 0.75rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--light);
    font-weight: 700;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: rgba(248,249,250,0.8);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: rgba(255,107,53,0.15);
}

.nav-link.nav-link-btn {
    background: var(--gradient-main);
    color: var(--dark);
    font-weight: 600;
}
.nav-link.nav-link-btn:hover,
.nav-link.nav-link-btn.active {
    color: var(--dark);
    background: var(--gradient-main);
    box-shadow: var(--shadow-glow);
}

/* User dropdown (desktop) */
.user-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255,107,53,0.25);
    background: rgba(15, 15, 26, 0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 45px rgba(0,0,0,0.35);
    display: none;
    z-index: 200;
}

.user-nav.open .user-nav-dropdown {
    display: block;
}

.user-nav-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem 0.85rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
    font-size: 0.9rem;
}

.user-nav-balance-label {
    color: rgba(248, 249, 250, 0.65);
    font-weight: 600;
}

.user-nav-balance-value {
    color: var(--primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.user-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: rgba(248,249,250,0.9);
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-nav-item:hover {
    background: rgba(255,107,53,0.15);
    color: var(--primary);
}

.user-nav-item-danger:hover {
    background: rgba(255, 100, 100, 0.18);
    color: #ffb3b3;
}

/* Mobile Bottom Navigation - hidden on desktop, only show on mobile */
.mobile-bottom-nav {
    display: none;
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }

    /* Sembunyikan footer links di desktop - navigasi sudah ada di header */
    .footer-links {
        display: none !important;
    }
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 4rem 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-main);
    color: var(--dark);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

.hero-badge-icon {
    font-size: 1.2rem;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,53,0.4); }
    50% { box-shadow: 0 0 0 15px rgba(255,107,53,0); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.title-line {
    display: block;
}

.title-line.accent {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(248,249,250,0.8);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    min-height: 48px;
    min-width: 44px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    line-height: 1.2;
}

.btn-primary {
    background: var(--gradient-main);
    color: var(--dark);
    box-shadow: 0 4px 20px rgba(255,107,53,0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: rgba(255,107,53,0.2);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-outline:hover {
    background: rgba(255,217,61,0.2);
}

/* Number Ball Grid */
.hero-visual {
    display: flex;
    justify-content: center;
}

.number-ball-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.ball {
    width: 70px;
    height: 70px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    box-shadow: 0 5px 20px rgba(255,107,53,0.5);
    animation: ballFloat 3s ease-in-out infinite;
}

.ball:nth-child(1) { animation-delay: 0s; }
.ball:nth-child(2) { animation-delay: 0.2s; }
.ball:nth-child(3) { animation-delay: 0.4s; }
.ball:nth-child(4) { animation-delay: 0.6s; }
.ball:nth-child(5) { animation-delay: 0.8s; }
.ball:nth-child(6) { animation-delay: 1s; }
.ball:nth-child(7) { animation-delay: 1.2s; }
.ball:nth-child(8) { animation-delay: 1.4s; }

@keyframes ballFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

/* Features */
.features {
    padding: 4rem 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--gradient-card);
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(255,107,53,0.4);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.feature-card p {
    color: rgba(248,249,250,0.8);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.feature-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: gap 0.3s;
}

.feature-link:hover {
    color: var(--secondary);
}

/* Quick Result */
.quick-result {
    padding: 4rem 0;
}

.result-preview {
    background: var(--gradient-card);
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
}

.result-date {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.result-numbers {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-num {
    width: 60px;
    height: 60px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
}

/* Markets (Daftar Pasaran) */
.markets {
    padding: 4rem 0;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1.75rem;
}

.market-card {
    background: var(--gradient-card);
    border-radius: var(--radius);
    border: 1px solid rgba(255,107,53,0.25);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.market-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(255,107,53,0.2);
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.market-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.market-meta {
    font-size: 0.9rem;
    color: rgba(248,249,250,0.75);
}

.market-actions {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    min-height: 40px;
    font-size: 0.85rem;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 3rem 0;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: rgba(248,249,250,0.7);
}

/* Result Section */
.result-section {
    padding: 2rem 0;
}

.result-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-select,
.filter-date {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,107,53,0.3);
    background: rgba(26,26,46,0.8);
    color: var(--light);
    font-family: var(--font-main);
}

.result-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 2rem;
}

.result-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    color: rgba(248, 249, 250, 0.65);
    border: 1px dashed rgba(255, 107, 53, 0.25);
    border-radius: var(--radius);
    background: rgba(26, 26, 46, 0.35);
}

.result-card {
    background: var(--gradient-card);
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: rgba(255,107,53,0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.result-card h3 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.result-card .result-date {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row .label {
    color: rgba(248,249,250,0.7);
}

/* Histori mutasi saldo (main/histori.php) */
.histori-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    max-height: calc(100dvh - 19rem - env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: 0.35rem;
}

.histori-list::-webkit-scrollbar {
    width: 8px;
}

.histori-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.histori-list::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.45);
    border-radius: 4px;
}

.histori-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 53, 0.65);
}

@media (max-width: 768px) {
    .histori-list {
        max-height: calc(100dvh - 15rem - 80px - env(safe-area-inset-bottom, 0px));
    }
}

.histori-card {
    padding: 1rem 1.25rem;
}

.histori-row-head {
    align-items: flex-start;
}

.histori-meta {
    color: rgba(248, 249, 250, 0.85);
    font-size: 0.92rem;
}

.histori-amt {
    font-variant-numeric: tabular-nums;
}

.histori-amt--in {
    color: #8ef5c0;
}

.histori-amt--out {
    color: #ff9a9a;
}

.result-row.main .numbers {
    display: flex;
    gap: 0.5rem;
}

.result-row .num {
    width: 45px;
    height: 45px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--dark);
}

/* Live Draw */
.live-draw-section {
    padding: 2rem 0;
}

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,184,148,0.2);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 2rem;
}

.live-indicator {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: liveBlink 1s ease-in-out infinite;
}

@keyframes liveBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.draw-container {
    background: var(--gradient-card);
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius);
    padding: 3rem;
}

.draw-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary);
}

.draw-machine {
    text-align: center;
    margin-bottom: 2rem;
}

.machine-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.draw-digit {
    width: 80px;
    height: 80px;
    background: var(--dark);
    border: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.draw-digit--rolling {
    border-color: rgba(255, 107, 53, 0.55);
    color: rgba(255, 180, 120, 0.95);
}

.draw-time {
    color: rgba(248,249,250,0.7);
}

.draw-schedule h3 {
    margin-bottom: 1rem;
    color: var(--secondary);
}

.draw-schedule ul {
    list-style: none;
}

.draw-schedule li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.live-status--idle {
    background: rgba(108, 117, 125, 0.25);
    color: rgba(248, 249, 250, 0.85);
}

.live-indicator--idle {
    background: rgba(248, 249, 250, 0.45);
    animation: none;
}

.live-draw-hint {
    color: rgba(248, 249, 250, 0.65);
    font-size: 0.95rem;
    margin: 0 0 1rem;
    max-width: 42rem;
}

.live-draw-hint--live {
    color: rgba(0, 184, 148, 0.95);
}

.live-draw-clock {
    color: rgba(248, 249, 250, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.live-draw-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.live-draw-market--on-air {
    border-color: rgba(0, 184, 148, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 184, 148, 0.2);
}

.live-draw-market-head {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.live-draw-market-head h2 {
    margin: 0;
    text-align: center;
}

.market-code-pill {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 107, 53, 0.25);
    color: var(--secondary);
}

.live-draw-meta {
    text-align: center;
    color: rgba(248, 249, 250, 0.65);
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
}

.meta-sep {
    margin: 0 0.35rem;
    opacity: 0.5;
}

.market-closed-label {
    color: rgba(255, 193, 7, 0.9);
    font-weight: 600;
}

.draw-schedule--footer {
    margin-top: 2rem;
    padding: 1.5rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.live-draw-footnote {
    color: rgba(248, 249, 250, 0.65);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    max-width: 40rem;
}

/* Prediction */
.prediction-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.prediction-card {
    background: var(--gradient-card);
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius);
    padding: 2rem;
}

.prediction-card h2 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.prediction-date {
    color: rgba(248,249,250,0.7);
    margin-bottom: 1.5rem;
}

.prediction-numbers {
    margin-bottom: 1.5rem;
}

.prediction-numbers h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.num-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.num-grid.small .pred-num {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.pred-num {
    width: 50px;
    height: 50px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--dark);
}

.prediction-card .disclaimer {
    font-size: 0.85rem;
    color: rgba(248,249,250,0.5);
}

/* About */
.about-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.about-card {
    background: var(--gradient-card);
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius);
    padding: 2rem;
}

.about-card h2 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.about-card p,
.about-card li {
    color: rgba(248,249,250,0.8);
    line-height: 1.6;
}

.about-card ul {
    list-style: none;
}

.about-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

/* Auth (Login / Daftar) */
.auth-section {
    padding: 2rem 0 4rem;
    max-width: 440px;
    margin: 0 auto;
}
.auth-card {
    background: var(--gradient-card);
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius);
    padding: 2rem;
}
.auth-message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.auth-message a {
    color: var(--secondary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.auth-message a:hover {
    color: var(--primary);
}
.auth-error {
    background: rgba(255,100,100,0.2);
    border: 1px solid rgba(255,100,100,0.4);
    color: #ffb3b3;
}
.auth-success {
    background: rgba(0,184,148,0.2);
    border: 1px solid rgba(0,184,148,0.4);
    color: #81e6d9;
}
.auth-form .form-group {
    margin-bottom: 1.25rem;
}
.auth-form label {
    display: block;
    margin-bottom: 0.4rem;
    color: rgba(248,249,250,0.9);
    font-weight: 500;
}
.auth-form .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,107,53,0.3);
    background: rgba(26,26,46,0.8);
    color: var(--light);
    font-family: var(--font-main);
    font-size: 1rem;
}
.auth-form .form-input::placeholder {
    color: rgba(248,249,250,0.4);
}
.auth-form .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.2);
}
.password-field-wrap {
    position: relative;
}
.password-field-wrap .form-input {
    padding-right: 2.75rem;
}
.password-toggle-btn {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(248,249,250,0.55);
    cursor: pointer;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
}
.password-toggle-btn:hover {
    color: var(--primary);
    background: rgba(255,107,53,0.12);
}
.password-toggle-btn:focus {
    outline: none;
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255,107,53,0.35);
}
.password-toggle-btn:focus:not(:focus-visible) {
    box-shadow: none;
}
.password-toggle-btn:focus-visible {
    outline: none;
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255,107,53,0.35);
}
.password-toggle-btn .material-symbols-rounded {
    font-size: 1.35rem;
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.btn-block {
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0;
}
.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(248,249,250,0.8);
}
.auth-switch a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.auth-switch a:hover {
    text-decoration: underline;
}

.history-card {
    width: 100%;
}

.history-section {
    max-width: 1100px;
}

.history-sort-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.history-sort-form label {
    color: rgba(248,249,250,0.9);
    font-weight: 600;
}

.history-sort-form .filter-select {
    min-width: 160px;
}

.history-sort-form .btn {
    padding: 0.75rem 1rem;
    min-height: 44px;
}

.history-table-wrap {
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(255,255,255,0.03);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.history-table thead th {
    text-align: left;
    padding: 0.85rem 0.9rem;
    font-size: 0.85rem;
    color: rgba(248,249,250,0.85);
    background: rgba(255,107,53,0.12);
    border-bottom: 1px solid rgba(255,107,53,0.25);
}

.history-table tbody td {
    padding: 0.8rem 0.9rem;
    font-size: 0.95rem;
    color: rgba(248,249,250,0.9);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-table tbody tr:hover td {
    background: rgba(255,255,255,0.04);
}

.history-table tbody tr.is-highlight td {
    background: rgba(255,217,61,0.14);
}

.history-table .time-short {
    display: none;
}

/* Hasil: tabel sempit, scroll vertikal mengisi sisa tinggi layar */
.hasil-table-wrap {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    margin-top: 0.75rem;
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Sisa tinggi layar; nav bawah mobile memakan area — kurangi agar scroll area terasa pas */
    max-height: calc(100dvh - 18rem);
}

@media (min-width: 901px) {
    .hasil-table-wrap {
        max-height: calc(100dvh - 12rem);
    }
}

.hasil-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.9rem;
}

.hasil-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    padding: 0.55rem 0.45rem;
    font-size: 0.8rem;
    color: rgba(248,249,250,0.9);
    background: rgba(26, 26, 40, 0.98);
    border-bottom: 1px solid rgba(255,107,53,0.3);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

.hasil-table tbody td {
    padding: 0.55rem 0.45rem;
    color: rgba(248,249,250,0.92);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hasil-table tbody tr:last-child td {
    border-bottom: none;
}

.hasil-table tbody tr:hover td {
    background: rgba(255,255,255,0.04);
}

.hasil-table__date {
    width: 6.5rem;
    white-space: nowrap;
}

.hasil-table__market {
    width: 46%;
}

.hasil-table__hasil {
    text-align: right;
}

.hasil-table .hasil-digit {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.hasil-table thead th:not(:first-child),
.hasil-table tbody td:not(:first-child) {
    text-align: right;
}

.bet-grid-head {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.bet-grid-head .form-group {
    margin-bottom: 0;
}

.bet-table-wrap {
    margin-bottom: 0.75rem;
}

.bet-table .col-row {
    width: 56px;
    text-align: center;
}

.bet-table tbody td {
    vertical-align: middle;
}

.bet-table .form-input {
    margin: 0;
    min-height: 42px;
}

.bet-table .col-action {
    width: 78px;
    text-align: center;
}

.bet-table .col-subtotal {
    min-width: 120px;
}

.bet-table .js-field-subtotal {
    background: rgba(15, 15, 26, 0.35);
    color: rgba(248, 249, 250, 0.92);
    font-variant-numeric: tabular-nums;
}

.pasang-balance-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(255, 107, 53, 0.22);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
    color: rgba(248, 249, 250, 0.88);
}

.pasang-balance-hint strong {
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.pasang-discount-card {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(108, 92, 231, 0.12);
    border: 1px solid rgba(108, 92, 231, 0.28);
}

.pasang-discount-card__title {
    margin-bottom: 0.55rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-light);
}

.pasang-discount-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(26, 26, 46, 0.45);
}

.pasang-discount-table {
    width: auto;
    min-width: 320px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.pasang-discount-table th,
.pasang-discount-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    white-space: nowrap;
}

.pasang-discount-table th:not(:first-child),
.pasang-discount-table td:not(:first-child) {
    min-width: 58px;
    text-align: center;
}

.pasang-discount-table th {
    color: rgba(248, 249, 250, 0.72);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(15, 15, 26, 0.35);
}

.pasang-discount-table tbody tr:last-child td {
    border-bottom: none;
}

.pasang-discount-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.pasang-discount-table td:not(:first-child) {
    color: var(--secondary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pasang-discount-table td:first-child strong {
    color: var(--light);
}

/* Modal konfirmasi pasang — selaras tema gelap situs (bukan panel putih) */
.pasang-confirm-modal .panel-modal__backdrop {
    background: rgba(15, 15, 26, 0.82);
    backdrop-filter: blur(4px);
}

.pasang-confirm-modal .panel-modal__dialog.pasang-modal__dialog {
    width: min(100%, 760px);
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--gradient-card);
    border: 1px solid rgba(255, 107, 53, 0.28);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    padding: 1.35rem 1.35rem 1.1rem;
}

.pasang-confirm-modal .panel-modal__title {
    color: var(--light);
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.pasang-modal__lead {
    margin: 0 0 12px;
    font-size: 0.875rem;
    color: rgba(248, 249, 250, 0.72);
    line-height: 1.45;
}

.pasang-modal__table-wrap {
    overflow: auto;
    max-height: 42vh;
    border: 1px solid rgba(255, 107, 53, 0.22);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: rgba(15, 15, 26, 0.45);
}

.pasang-modal__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: rgba(248, 249, 250, 0.92);
}

.pasang-modal__table th,
.pasang-modal__table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.pasang-modal__table th {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.98) 0%, rgba(26, 26, 46, 0.92) 100%);
    color: var(--secondary);
    font-weight: 700;
    z-index: 1;
    border-bottom: 1px solid rgba(255, 107, 53, 0.25);
}

.pasang-modal__table tbody tr:hover td {
    background: rgba(255, 107, 53, 0.06);
}

.pasang-modal__totals {
    display: grid;
    gap: 6px;
    font-size: 0.875rem;
    color: rgba(248, 249, 250, 0.78);
    margin-bottom: 10px;
}

.pasang-modal__totals strong {
    color: var(--light);
    font-variant-numeric: tabular-nums;
}

.pasang-modal__totals .pasang-modal__grand {
    font-size: 1rem;
    color: var(--secondary);
}

.pasang-modal__totals .pasang-modal__grand strong {
    color: var(--secondary);
    font-size: 1.05rem;
}

.pasang-modal__error {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.35);
    color: #ffb3b3;
    font-size: 0.875rem;
    font-weight: 600;
}

.pasang-modal__actions {
    margin-top: auto;
    padding-top: 4px;
}

.pasang-confirm-modal .panel-modal__btn {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.pasang-confirm-modal .panel-modal__btn--cancel {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}

.pasang-confirm-modal .panel-modal__btn--cancel:hover {
    background: rgba(255, 107, 53, 0.18);
    filter: none;
    transform: translateY(-1px);
}

.pasang-confirm-modal .panel-modal__btn--confirm {
    background: var(--gradient-main);
    color: var(--dark);
    border: 1px solid rgba(255, 217, 61, 0.35);
}

.pasang-confirm-modal .panel-modal__btn--confirm:hover:not(:disabled) {
    filter: brightness(1.05);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.pasang-confirm-modal .panel-modal__btn--confirm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pasang-confirm-modal .panel-modal__btn:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
}

.btn.btn-sm {
    min-height: 36px;
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
}

.bet-actions {
    margin-bottom: 0.85rem;
}

.history-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.history-actions .btn {
    margin-top: 0;
}

.history-actions-form {
    flex: 1;
}

.about-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    background: rgba(15,15,26,0.95);
    border-top: 1px solid rgba(255,107,53,0.2);
    padding: 2rem 1rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
}


.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

@media (min-width: 769px) {
    .footer-brand {
        margin-bottom: 1rem;
    }
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: rgba(248,249,250,0.8);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom p {
    color: rgba(248,249,250,0.5);
    font-size: 0.9rem;
}

.footer-bottom .disclaimer {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ============================================
   Mobile First & Responsive
   ============================================ */

@media (max-width: 768px) {
    .auth-section.history-section {
        max-width: 100% !important;
        margin: 0;
    }

    .history-card {
        padding: 1rem;
    }

    .main-nav {
        display: none;
    }

    /* Mobile Bottom Navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: rgba(15,15,26,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255,107,53,0.2);
        padding: 0.5rem 0;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        justify-content: space-around;
        align-items: center;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.5rem 0.25rem;
        min-width: 56px;
        text-decoration: none;
        color: rgba(248,249,250,0.7);
        font-size: 0.7rem;
        font-weight: 500;
        transition: all 0.2s ease;
        border-radius: var(--radius-sm);
    }

    .bottom-nav-item:hover,
    .bottom-nav-item.active {
        color: var(--primary);
    }

    .bottom-nav-item.active .bottom-nav-icon {
        transform: scale(1.1);
    }

    .bottom-nav-icon {
        font-size: 1.4rem;
        line-height: 1;
        transition: transform 0.2s;
    }

    .bottom-nav-label {
        white-space: nowrap;
    }

    /* Spacer for fixed bottom nav */
    body {
        padding-bottom: 80px;
    }

    body .site-footer {
        margin-bottom: 0;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem 0;
        gap: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .number-ball-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .ball {
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .features {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .result-preview {
        padding: 2rem 1.5rem;
    }

    .result-num {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .page-header {
        padding: 2rem 0;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .result-filters {
        flex-direction: column;
    }

    .filter-select,
    .filter-date {
        width: 100%;
        min-height: 48px;
    }

    .result-card {
        padding: 1.5rem;
    }

    .result-row.main .numbers {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .result-row .num {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .history-sort-form {
        flex-direction: column;
        align-items: stretch;
    }

    .history-sort-form .filter-select {
        width: 100%;
        min-width: 0;
    }

    .history-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .history-table {
        min-width: 760px;
        table-layout: fixed;
    }

    .history-table thead th,
    .history-table tbody td {
        padding: 0.65rem 0.55rem;
        font-size: 0.82rem;
        white-space: nowrap;
        line-height: 1.3;
    }

    .history-table .col-ticket { width: 190px; }
    .history-table .col-market { width: 85px; }
    .history-table .col-type { width: 70px; }
    .history-table .col-number { width: 90px; }
    .history-table .col-amount { width: 110px; }
    .history-table .col-time { width: 135px; }
    .history-table .col-status { width: 90px; }

    .history-table .time-full {
        display: none;
    }

    .history-table .time-short {
        display: inline;
    }

    .history-actions {
        flex-direction: column;
    }

    .history-actions-form {
        width: 100%;
    }

    .bet-grid-head {
        grid-template-columns: 1fr;
    }

    .bet-table .col-row {
        width: 44px;
    }

    .bet-table .col-action {
        width: 64px;
    }

    .bet-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bet-table {
        min-width: 720px;
        table-layout: fixed;
    }

    .bet-table .col-row { width: 48px; }
    .bet-table .col-market { width: 120px; }
    .bet-table .col-type { width: 80px; }
    .bet-table .col-number { width: 120px; }
    .bet-table .col-amount { width: 120px; }
    .bet-table .col-subtotal { width: 118px; }
    .bet-table .col-action { width: 72px; }

    .bet-table .form-input {
        min-height: 40px;
        padding: 0.55rem 0.65rem;
        font-size: 0.9rem;
    }

    .bet-table .col-action .btn {
        width: 100%;
        min-height: 40px;
    }

    .draw-container {
        padding: 1.5rem;
    }

    .machine-display {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .draw-digit {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .footer-links a {
        padding: 0.5rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .site-header {
        padding: 0.5rem 0.75rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .ball {
        width: 58px;
        height: 58px;
        font-size: 1.35rem;
    }

    .number-ball-grid {
        gap: 0.5rem;
    }

    .result-num {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .result-numbers {
        gap: 0.5rem;
    }

    .draw-digit {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }

    .pred-num {
        width: 44px;
        height: 44px;
    }

    .num-grid.small .pred-num {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .feature-card:hover {
        transform: none;
    }

    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }

    .nav-link:hover {
        background: rgba(255,107,53,0.1);
    }
}
