/* दिल से - Family Connection Game */
:root {
    --primary: #FF6B6B;
    --primary-dark: #EE5A5A;
    --secondary: #FFE66D;
    --accent: #4ECDC4;
    --success: #48BB78;
    --love: #FF6B9D;
    --family: #9B59B6;
    --dark: #2D3748;
    --gray: #718096;
    --light: #F7FAFC;
    --white: #FFFFFF;
    --gradient-love: linear-gradient(135deg, #FF6B6B 0%, #FF6B9D 100%);
    --gradient-family: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans Devanagari', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screens */
.screen {
    min-height: 100vh;
    width: 100%;
    display: none;
}

.screen.active {
    display: flex;
}

.screen.hidden {
    display: none !important;
}

/* Splash Screen */
#splash {
    background: var(--gradient-love);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.splash-content {
    text-align: center;
    color: var(--white);
    animation: fadeInUp 0.8s ease;
}

.heart-beat {
    font-size: 6rem;
    animation: heartbeat 1.5s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
}

.splash-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tagline {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--white);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Auth Screen */
#auth-screen {
    background: var(--gradient-love);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

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

.logo-big {
    font-size: 4rem;
    margin-bottom: 10px;
}

.auth-container h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--gray);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.auth-form {
    margin-bottom: 30px;
}

.auth-form input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 16px;
    text-align: center;
    font-family: inherit;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-love);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--light);
    border-radius: var(--radius);
    text-align: left;
}

.feature-item span {
    font-size: 1.5rem;
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 500;
}

/* Main Game */
#main-game {
    flex-direction: column;
    background: var(--light);
    padding-bottom: 80px;
}

/* Header */
.game-header {
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-love);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border: 3px solid var(--white);
    box-shadow: var(--shadow);
}

.player-info {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
}

.player-stats {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
}

.stat {
    color: var(--primary);
    font-weight: 600;
}

.header-right {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--light);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* Navigation */
.game-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--gray);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(255, 107, 107, 0.1);
}

.nav-icon {
    font-size: 1.5rem;
}

/* Game Content */
.game-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Daily Card */
.daily-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.daily-card:hover {
    border-color: var(--primary);
}

.daily-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.daily-header h3 {
    font-size: 1.1rem;
    color: var(--dark);
}

.daily-timer {
    background: var(--primary);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.question-box {
    background: linear-gradient(135deg, #FFF5F5 0%, #FFF 100%);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
}

.question-box p {
    font-size: 1.1rem;
    color: var(--dark);
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.6;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-btn {
    padding: 14px 16px;
    border: 2px solid #E2E8F0;
    background: var(--white);
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
}

.answer-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.05);
}

.answer-btn.selected {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.share-prompt {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #E2E8F0;
}

.share-prompt p {
    color: var(--gray);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #25D366;
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Family Status */
.family-status {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.family-status h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.family-members {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.family-member {
    flex-shrink: 0;
    text-align: center;
}

.member-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-family);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 8px;
    border: 3px solid var(--white);
    box-shadow: var(--shadow);
    position: relative;
}

.member-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.member-name {
    font-size: 0.8rem;
    color: var(--dark);
    font-weight: 500;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: var(--light);
    color: var(--dark);
    border: 2px dashed var(--gray);
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Quick Games */
.quick-games {
    margin-bottom: 20px;
}

.quick-games h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.game-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.game-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.game-card h4 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 4px;
}

.game-card p {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Challenge Card */
.challenge-card {
    background: linear-gradient(135deg, #FFF5F5 0%, #FFFFFF 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.challenge-header h3 {
    font-size: 1.1rem;
    color: var(--dark);
}

.challenge-reward {
    background: var(--primary);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.challenge-card > p {
    color: var(--dark);
    margin-bottom: 16px;
    font-size: 1rem;
}

.challenge-progress {
    margin-bottom: 16px;
}

.progress-bar {
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-love);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.challenge-progress span {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Play Tab */
.game-modes {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mode-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.mode-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.mode-card.featured {
    background: var(--gradient-love);
    color: var(--white);
}

.mode-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary);
    color: var(--dark);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.mode-card h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.mode-card p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.mode-stats {
    font-size: 0.8rem;
    opacity: 0.8;
}

.modes-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.modes-row .mode-card {
    padding: 20px;
}

.modes-row .mode-icon {
    font-size: 2rem;
}

.modes-row h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.modes-row p {
    font-size: 0.8rem;
}

/* Family Tab */
.family-header {
    text-align: center;
    padding: 20px;
    background: var(--gradient-family);
    border-radius: var(--radius-lg);
    color: var(--white);
    margin-bottom: 20px;
}

.family-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.family-rank {
    font-size: 0.9rem;
    opacity: 0.9;
}

.family-tree {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.tree-member {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #E2E8F0;
}

.tree-member:last-child {
    border-bottom: none;
}

.tree-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-love);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.tree-info {
    flex: 1;
}

.tree-info h4 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 4px;
}

.tree-info p {
    font-size: 0.85rem;
    color: var(--gray);
}

.tree-hearts {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 700;
}

.family-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.family-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray);
}

/* Messages Tab */
.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.messages-header h2 {
    font-size: 1.3rem;
}

.btn-compose {
    padding: 10px 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.messages-list {
    margin-bottom: 20px;
}

.message-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
}

.message-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-love);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-sender {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.message-text {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.message-time {
    font-size: 0.75rem;
    color: var(--gray);
}

.message-templates {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.message-templates h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.template-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border: 2px solid #E2E8F0;
    background: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.template-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.05);
}

.template-btn span:first-child {
    font-size: 1.8rem;
}

.template-btn span:last-child {
    font-size: 0.85rem;
    color: var(--dark);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.modal:not(.hidden) .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    text-align: center;
}

.modal-content > p {
    text-align: center;
    color: var(--gray);
    margin-bottom: 24px;
}

/* Share Modal */
.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.share-btn.whatsapp {
    background: #25D366;
    color: var(--white);
}

.share-btn.telegram {
    background: #0088cc;
    color: var(--white);
}

.share-btn.copy {
    background: var(--light);
    color: var(--dark);
}

.invite-code {
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 20px;
}

.invite-code strong {
    font-size: 1.3rem;
    color: var(--primary);
    letter-spacing: 2px;
}

.btn-close {
    width: 100%;
    padding: 16px;
    background: var(--light);
    color: var(--dark);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
}

/* Game Modal */
.game-modal-content {
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.game-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--gradient-love);
    color: var(--white);
}

.back-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
}

.game-header-bar h3 {
    flex: 1;
    text-align: center;
    margin: 0 !important;
}

.game-timer {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
}

.game-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Notification */
.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--white);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transition: transform 0.3s ease;
}

.notification:not(.hidden) {
    transform: translateX(-50%) translateY(0);
}

.notification span:first-child {
    font-size: 1.5rem;
}

.notification span:last-child {
    font-weight: 600;
    color: var(--dark);
}

/* Responsive */
@media (max-width: 380px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .modes-row {
        grid-template-columns: 1fr;
    }
    
    .family-actions {
        grid-template-columns: 1fr;
    }
    
    .family-stats {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    #main-game {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
    }
    
    .game-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}