:root {
    --primary-color: #FF5E3A;
    --primary-dark: #E04B2A;
    --bg-color: #F8F9FA;
    --surface-color: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Sarabun', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out;
}

.splash-content {
    text-align: center;
    opacity: 0;
}

.fade-in {
    animation: fadeIn 1.5s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-container {
    width: 100px;
    height: 100px;
    background: var(--primary-color);
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 25px rgba(255, 94, 58, 0.3);
}

.splash-icon {
    font-size: 50px;
    color: white;
}

.splash-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.splash-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* Auth Screen */
.auth-container {
    min-height: 100vh;
    background: #111827;
    color: white;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container-small {
    width: 60px; height: 60px;
    background: var(--primary-color);
    border-radius: 16px;
    display: flex; justify-content: center; align-items: center;
    margin: 0 auto 16px;
}
.logo-container-small span { font-size: 32px; color: white; }

.auth-form .input-group {
    margin-bottom: 20px;
}
.auth-form label {
    display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px;
}
.auth-form input {
    width: 100%; padding: 14px;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 12px;
    color: white; font-size: 16px;
}
.auth-form input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn-primary {
    width: 100%; padding: 16px;
    background: var(--primary-color);
    color: white; border: none; border-radius: 12px;
    font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-primary:active { background: var(--primary-dark); }

.divider {
    text-align: center; margin: 24px 0;
    position: relative;
}
.divider::before {
    content: ""; position: absolute; top: 50%; left: 0; right: 0;
    border-top: 1px solid #374151; z-index: 1;
}
.divider span {
    background: #111827; padding: 0 10px; color: #9CA3AF;
    position: relative; z-index: 2; font-size: 14px;
}

.btn-google {
    width: 100%; padding: 14px;
    background: white; color: #1F2937;
    border: none; border-radius: 12px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    display: flex; justify-content: center; align-items: center; gap: 8px;
}

/* Main App Shell */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: 60px; background: var(--surface-color);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}
.header-title { font-weight: 700; font-size: 18px; color: var(--primary-color); }
.coin-badge {
    background: #FEF3C7; color: #D97706;
    padding: 4px 10px; border-radius: 16px;
    font-size: 13px; font-weight: 700;
}

.app-content {
    padding: 80px 20px 80px;
    min-height: 100vh;
}

.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 65px; background: var(--surface-color);
    display: flex; justify-content: space-around; align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100; padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center;
    background: none; border: none; color: var(--text-muted);
    font-size: 10px; gap: 4px; cursor: pointer;
}
.nav-item * { pointer-events: none; }
.nav-item.active { color: var(--primary-color); font-weight: 700; }

/* Home Content */
.hero-banner {
    background: linear-gradient(135deg, #FF5E3A, #FF9A9E);
    border-radius: 16px; padding: 24px; color: white;
    margin-bottom: 24px;
}
.hero-banner h3 { font-size: 20px; margin-bottom: 8px; }
.hero-banner p { font-size: 14px; margin-bottom: 16px; opacity: 0.9; }
.btn-secondary {
    background: white; color: var(--primary-color);
    border: none; padding: 8px 16px; border-radius: 8px;
    font-weight: 700; font-size: 14px;
}

.section-title { font-weight: 700; font-size: 18px; margin-bottom: 16px; }

.novel-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.novel-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.novel-cover { width: 100%; height: 160px; }
.novel-info { padding: 12px; }
.novel-info h4 { font-size: 14px; margin-bottom: 4px; }
.novel-info p { font-size: 11px; color: var(--text-muted); }

/* Profile Content */
.profile-header {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px 0;
}
.avatar {
    width: 80px; height: 80px; background: #E5E7EB;
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    margin-bottom: 16px;
}
.avatar span { font-size: 40px; color: #9CA3AF; }

.profile-stats {
    display: flex; gap: 16px; margin-bottom: 24px;
}
.stat-box {
    flex: 1; background: white; padding: 16px; border-radius: 16px;
    text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.stat-val { display: block; font-size: 20px; font-weight: 700; color: var(--primary-color); margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-muted); }

.profile-menu { background: white; border-radius: 16px; overflow: hidden; }
.menu-item {
    width: 100%; padding: 16px 20px; display: flex; align-items: center; gap: 16px;
    background: none; border: none; border-bottom: 1px solid #F3F4F6;
    font-size: 15px; font-weight: 600; color: var(--text-main); text-align: left;
}
.menu-item:last-child { border-bottom: none; }

.search-bar {
    width: 100%; padding: 16px; border-radius: 12px;
    border: 1px solid var(--border-color); font-size: 15px;
}
.empty-state { text-align: center; color: var(--text-muted); padding: 40px 0; }

/* Daily Check-in Card */
.daily-checkin-card {
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.1);
    transition: opacity 0.3s ease;
}
.checkin-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
.checkin-icon {
    background: #F59E0B;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}
.checkin-text h4 {
    color: #92400E;
    font-size: 15px;
    margin-bottom: 2px;
}
.checkin-text p {
    color: #B45309;
    font-size: 12px;
}
.checkin-text .highlight {
    font-weight: 700;
}
.btn-claim {
    background: #F59E0B;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}
.btn-claim:active {
    background: #D97706;
}
