/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0088cc;
    --secondary-color: #006699;
    --accent-color: #00aaff;
    --background: #ffffff;
    --surface: #f5f5f5;
    --text-primary: #212121;
    --text-secondary: #757575;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --border-radius: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding-bottom: 80px;
}

.screen.active {
    display: block;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 16px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.coins-display {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.coin-icon {
    font-size: 18px;
}

.back-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.back-button:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
    padding: 16px;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Main Collection Button */
.main-button-container {
    margin-bottom: 24px;
}

.main-collect-button {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: white;
    border: none;
    padding: 24px;
    border-radius: var(--border-radius);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.3);
    transition: transform 0.1s, box-shadow 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.main-collect-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 136, 204, 0.2);
}

.button-icon {
    font-size: 48px;
}

.button-text {
    font-size: 18px;
}

.button-amount {
    font-size: 14px;
    opacity: 0.9;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-button {
    background: var(--surface);
    border: 2px solid var(--primary-color);
    padding: 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.action-button:active {
    background: var(--primary-color);
    color: white;
    transform: scale(0.95);
}

.action-icon {
    font-size: 32px;
}

.action-text {
    font-size: 14px;
    font-weight: 500;
}

/* Content Area */
.content {
    padding: 16px;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.item-card {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.item-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-details {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Profile Info */
.profile-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-stat {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.achievement-card {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.achievement-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.achievement-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Loading Screen */
#loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    animation: fadeIn 0.3s ease-out;
}

/* Button States */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

