@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap");

:root {
    /* --- Game Theme Palette (Deep Space/Ocean) --- */
    --bg-dark: #16213e;
    --bg-darker: #1a1a2e;
    --primary-color: #0f3460;
    --primary-light: #533483;

    /* Vibrant Accents */
    --accent-color: #e94560;
    /* Vibrant Red/Pink */
    --accent-glow: rgba(233, 69, 96, 0.5);

    --success-color: #00b894;
    /* Minty Green */
    --success-glow: rgba(0, 184, 148, 0.5);

    --warning-color: #fdcb6e;
    /* Warm Yellow */
    --text-primary: #ffffff;
    --text-secondary: #a2a8d3;
    /* Soft Blue-Gray */

    /* Glassmorphism 3.0 (Game Style) */
    --glass-bg: rgba(22, 33, 62, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.15);

    /* Dimensions & Spacing */
    --nav-height: 80px;
    --header-height: 70px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 999px;

    /* Animations */
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Remove mobile blue tap box */
    outline: none;
}

body {
    font-family: "Nunito", sans-serif;
    /* Soft, rounded game font */
    background-color: var(--bg-darker);
    background-image: radial-gradient(circle at 10% 20%, rgba(83, 52, 131, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(233, 69, 96, 0.2) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    user-select: none;
    /* Prevent text selection like a native app */
    -webkit-user-select: none;
    touch-action: pan-y;
    line-height: 1.5;
}

/* --- Animated Background Stars --- */
/* --- Animated Background Particles (Fireflies) --- */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 8s infinite linear;
}

@keyframes floatParticle {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }

    20% {
        opacity: 0.6;
        transform: translateY(-20px) scale(1.2);
    }

    80% {
        opacity: 0.6;
        transform: translateY(-80px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.2);
    }
}

.container {
    max-width: 500px;
    /* Wider for better game feel on desktop */
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 120px;
    /* More space for floating nav */
    position: relative;
    z-index: 1;
}

/* --- Header --- */
/* --- Header --- */
.header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(26, 26, 46, 0.85);
    /* Darker, richer */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-title {
    font-family: "Fredoka", "Nunito", sans-serif;
    /* Round header font */
    font-size: 22px;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 0 #000;
}

.points-badge {
    background: linear-gradient(135deg, #ffd700, #ffa502);
    color: #583300;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 0 #b37400, 0 8px 10px rgba(0, 0, 0, 0.3);
    /* 3D Effect */
    transform: translateY(-2px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.points-badge:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #b37400;
}

/* --- Navigation --- */
.nav-bottom {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    /* Floating look */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 448px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 12px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    border-radius: 16px;
    flex: 1;
    position: relative;
    opacity: 0.6;
}

.nav-item a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-icon {
    font-size: 24px;
    transition: transform 0.3s var(--ease-elastic);
    margin-bottom: 2px;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Cart Icon with Badge */
.cart-icon {
    position: relative;
    display: inline-block;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: linear-gradient(135deg, var(--accent-color), #ff6b87);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(233, 69, 96, 0.5);
    animation: badgePop 0.3s var(--ease-elastic);
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.nav-avatar {
    font-size: 24px;
    transition: transform 0.3s var(--ease-elastic);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.nav-item.active .nav-avatar {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* --- Screens & Layout --- */
.screen {
    animation: fadeIn 0.5s var(--ease-smooth) forwards;
}

.dashboard,
.islands-map,
.order-section,
.cart-section,
.ships-section,
.rewards-section,
.profile-section {
    padding: 24px !important;
}

/* Specific padding for Order Section to clear the fixed summary panel */
.order-section {
    padding-bottom: 140px !important;
}

/* Glass Card Style (Base) */
.card-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* --- Hero Section --- */
.hero-section {
    text-align: center;
    margin-bottom: 32px;
    padding: 40px 20px;
    background: radial-gradient(circle at top right, rgba(52, 211, 153, 0.1), transparent 60%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.welcome-emoji {
    font-size: 56px;
    display: inline-block;
    margin-bottom: 16px;
    animation: floatEmoji 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

@keyframes floatEmoji {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.welcome-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Current Island Card --- */
.current-island-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.current-island-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.05) 0%, transparent 50%);
    animation: rotateLight 10s linear infinite;
}

@keyframes rotateLight {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.current-island-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.current-island-icon {
    font-size: 40px;
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.current-island-info h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.current-island-info p {
    font-size: 13px;
    color: var(--success-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Game Progress Bar --- */
.progress-container {
    position: relative;
    z-index: 1;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-bar {
    height: 14px;
    /* Thicker */
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00b894, #00cec9);
    border-radius: var(--radius-full);
    transition: width 0.8s var(--ease-elastic);
    position: relative;
    box-shadow: 0 0 10px rgba(0, 184, 148, 0.6);
    /* Striped Logic could go here if needed */
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.stat-card:active {
    transform: scale(0.98);
    background: rgba(30, 41, 59, 0.6);
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* --- Buttons --- */
.action-btn,
.order-btn,
.save-btn {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: #022c22;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 8px 20px -6px rgba(52, 211, 153, 0.5);
    display: block;
    text-align: center;
    text-decoration: none;
}

.action-btn:active,
.order-btn:active,
.save-btn:active {
    transform: scale(0.96);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    border: 1px solid transparent;
    width: 100%;
    margin-top: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.98);
}

/* --- Islands Map --- */
.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.map-header {
    text-align: center;
    margin-bottom: 10px;
}

.map-title,
.section-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.map-subtitle,
.section-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.map-container {
    position: relative;
    width: 100%;
    min-height: 800px;
}

.map-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.path-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 4;
    stroke-dasharray: 8 4;
    stroke-linecap: round;
}

.path-progress {
    fill: none;
    stroke: var(--success-color);
    stroke-width: 4;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px var(--success-glow));
}

.island-wrapper {
    position: absolute;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s var(--ease-elastic);
}

.island-wrapper:active {
    transform: scale(0.95);
}

.island-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: var(--primary-light);
    border: 4px solid var(--primary-bg);
    box-shadow: 0 0 0 2px var(--glass-border);
    transition: all 0.3s ease;
    z-index: 2;
}

.island-wrapper.locked .island-circle {
    filter: grayscale(1);
    opacity: 0.7;
    border-color: #334155;
    background: #1e293b;
}

.island-wrapper.claimable {
    cursor: pointer;
    animation: bounce 2s infinite;
}

.island-wrapper.claimable .island-circle {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

.claim-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    color: #000;
    border-radius: 50%;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 5;
    animation: pulseBadge 1s infinite;
}

@keyframes pulseBadge {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.island-wrapper.current .island-circle {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.3), 0 0 30px var(--accent-glow);
    transform: scale(1.1);
    animation: pulseIsland 2s infinite;
}

@keyframes pulseIsland {
    0% {
        box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.3), 0 0 20px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.1), 0 0 40px var(--accent-glow);
    }

    100% {
        box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.3), 0 0 20px var(--accent-glow);
    }
}

.island-wrapper.completed .island-circle {
    border-color: var(--success-color);
    color: var(--success-color);
    box-shadow: 0 0 15px var(--success-glow);
}

.island-info {
    margin-top: 12px;
    text-align: center;
    background: rgba(15, 23, 42, 0.8);
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
    z-index: 3;
}

.island-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.island-requirement {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

.island-requirement.unlocked {
    color: var(--success-color);
}

/* --- Medicine List --- */
.medicine-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.medicine-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.medicine-item:nth-child(n) {
    animation-delay: 0.05s;
}

.medicine-item:nth-child(2n) {
    animation-delay: 0.1s;
}

.medicine-item:nth-child(3n) {
    animation-delay: 0.15s;
}

/* Add more if needed or do via JS */

.medicine-item.has-quantity {
    border-color: var(--success-color);
    background: rgba(52, 211, 153, 0.05);
}

.medicine-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}

.medicine-info {
    flex: 1;
}

.medicine-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.medicine-price {
    font-size: 13px;
    color: var(--accent-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stock-count {
    font-size: 11px;
    color: #00d4ff;
    font-weight: 500;
}

.stock-count.out-of-stock {
    color: #f87171;
}

.medicine-item.out-of-stock {
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}

.qty-btn:disabled,
.qty-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.qty-btn:active {
    transform: scale(0.9);
    background: var(--primary-bg);
}

.qty-display {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* --- Order Summary --- */
.order-summary {
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.4);
    margin-top: 16px;
    margin-bottom: 20px;
}


.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-row .summary-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Payment Type Selector */
.payment-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.payment-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.payment-select option:disabled {
    color: rgba(255, 255, 255, 0.4);
}

.summary-total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-total .summary-label {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 700;
}

.summary-total .summary-value {
    font-size: 24px;
    color: var(--success-color);
    font-weight: 800;
}

.order-btn {
    margin-top: 20px;
}

.order-btn:disabled {
    opacity: 0.5;
    filter: grayscale(1);
    cursor: not-allowed;
}

/* --- Profile --- */
.profile-header {
    text-align: center;
    margin-bottom: 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: var(--glass-bg);
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 30px var(--accent-glow);
    cursor: pointer;
}

.profile-name {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.profile-rank {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--accent-color);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
}

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

.profile-stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
}

.profile-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 4px;
}

.settings-section,
.achievements-section {
    margin-bottom: 24px;
}

.settings-title,
.achievements-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-left: 8px;
    border-left: 3px solid var(--accent-color);
}

/* --- Search --- */
.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.menu-item:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.98);
}

.settings-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 14px;
    border-radius: 12px;
    color: white;
    margin-bottom: 16px;
    font-size: 16px;
    transition: border 0.3s;
}

.settings-input:focus {
    border-color: var(--accent-color);
}

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

.avatar-option {
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.avatar-option.selected {
    border-color: var(--accent-color);
    background: rgba(251, 191, 36, 0.1);
}

/* --- Rewards & Ships Grid --- */
.rewards-grid {
    display: grid;
    gap: 16px;
}

/* --- Rewards & Ships Grid --- */
.rewards-grid,
.ships-grid {
    display: grid;
    gap: 16px;
}

.rewards-grid {
    grid-template-columns: 1fr 1fr;
}

.reward-card,
.ship-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.reward-card:active,
.ship-card:active {
    transform: scale(0.96);
}

.ship-card.selected {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1), transparent);
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.2);
    transform: scale(1.02);
}

.reward-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.reward-points {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.reward-status {
    font-size: 11px;
    font-weight: 700;
    color: var(--success-color);
    background: rgba(52, 211, 153, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    display: inline-block;
}

.reward-locked {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Ships Specific Typography */
.ship-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.ship-icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ship-info-col {
    flex: 1;
}

.ship-name {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.ship-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.ship-stats {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    border-top: 1px solid var(--glass-border);
    padding-top: 16px;
}

.ship-stat {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 12px;
    text-align: center;
}

.ship-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
    display: block;
}

.ship-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 2px;
}

.ship-level {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--primary-light);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 700;
}

.reward-icon {
    font-size: 40px;
    margin-bottom: 12px;
    filter: grayscale(1);
    opacity: 0.5;
    transition: all 0.3s;
}

.reward-card.available .reward-icon,
.reward-card.collected .reward-icon {
    filter: grayscale(0);
    opacity: 1;
}

.reward-card.available {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.1);
}

/* --- Toast --- 
   NOTE: Toast styles are now in base.html inline for better control
   The styles below are disabled to prevent conflicts
*/
/*
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  padding: 16px 24px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  opacity: 0;
  transition: all 0.5s var(--ease-elastic);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
*/

/* --- Inventory --- */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.inventory-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 6px;
    text-align: center;
    transition: transform 0.2s;
}

.inventory-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.inventory-icon {
    font-size: 24px;
    margin-bottom: 4px;
    display: block;
}

.inventory-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.empty-inventory {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

/* --- Achievements --- */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.achievement-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    opacity: 0.5;
}

.achievement-badge.unlocked {
    opacity: 1;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), transparent);
    border-color: rgba(251, 191, 36, 0.3);
}

.achievement-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.achievement-name {
    font-size: 10px;
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Registration Page --- */
.register-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.register-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
    z-index: 10;
}

.register-logo {
    margin-bottom: 30px;
    animation: floatEmoji 3s ease-in-out infinite;
}

.register-logo .logo-emoji {
    font-size: 64px;
    margin-bottom: 10px;
    display: block;
}

.register-logo h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.register-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.register-form {
    text-align: left;
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    margin-left: 4px;
}

.form-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.1);
}

/* --- Premium Referral Lake --- */
.lake-page .nav-bottom {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(15, 23, 42, 1);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

/* --- Profile Menu --- */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hidden-section {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.back-btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.section-title-small {
    font-size: 18px;
    font-weight: 700;
}

.hidden-section {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.back-btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.section-title-small {
    font-size: 18px;
    font-weight: 700;
}

/* --- Order History --- */
.order-card {
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-card:active {
    transform: scale(0.98);
}

.order-card-header,
.order-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-card-header {
    margin-bottom: 8px;
    font-size: 13px;
    opacity: 0.7;
}

.order-status {
    color: var(--success-color);
    font-weight: 700;
}

.order-ship {
    font-weight: 600;
    font-size: 15px;
}

.order-total {
    color: var(--accent-color);
    font-weight: 700;
}

/* --- Order Modal --- */
.order-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.order-modal-content {
    width: 100%;
    max-width: 400px !important;
    position: relative;
    padding: 30px;
    animation: slideUp 0.3s ease;
    max-height: 490px !important;
    /* Max height for scrolling */
    overflow-y: auto;
    /* Enable vertical scroll */
    border-radius: var(--radius-lg);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
}

.order-info-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    font-size: 14px;
}

.order-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.order-item-icon {
    font-size: 20px;
}

.order-item-name {
    flex: 1;
    font-size: 14px;
}

.order-item-qty {
    font-size: 14px;
    font-weight: 600;
}

/* Lake Overlay (Blends with global theme) */
.lake-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 80%, rgba(2, 6, 23, 0.8) 0%, transparent 60%);
}

.moon-reflection {
    position: absolute;
    top: 100px;
    right: 30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fffbe6, #fbbf24, #d97706);
    box-shadow: 0 0 60px rgba(251, 191, 36, 0.6), inset -10px -10px 20px rgba(0, 0, 0, 0.1);
    opacity: 1;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.4));
    z-index: 10;
}

/* Water Effect with perspective */
.water-ripples {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 55%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(2, 6, 23, 1) 100%),
        repeating-radial-gradient(circle at 50% 100%,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 2px,
            transparent 3px,
            transparent 20px);
    transform-origin: 50% 100%;
    opacity: 0.6;
    mask-image: linear-gradient(to bottom, transparent, black 20%);
}

.lake-container {
    position: absolute;
    top: 60px;
    /* Below header */
    bottom: 80px;
    /* Above controls/nav */
    left: 0;
    width: 100%;
    z-index: 5;
    pointer-events: none;
    /* Allow clicks to pass through empty areas */
}

.lake-container>* {
    pointer-events: auto;
    /* Re-enable clicks for children (lotuses) */
}

.empty-lake-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    line-height: 1.6;
}

/* Floating Lotus Styles */
.referral-lotus {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: float 6s ease-in-out infinite;
    z-index: 10;
}

.referral-lotus:hover {
    transform: scale(1.15) translateY(-5px);
    z-index: 20;
}

.lotus-flower {
    font-size: 42px;
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.6));
    position: relative;
    z-index: 2;
}

/* Lotus Reflection on Water */
.lotus-flower::after {
    content: "🪷";
    position: absolute;
    top: 70%;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleY(-0.6) skewX(-10deg);
    opacity: 0.3;
    filter: blur(4px);
    pointer-events: none;
}

.lotus-name {
    margin-top: -10px;
    /* Overlap slightly */
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    opacity: 0.9;
    z-index: 3;
}

/* Glass Buttons used in Lake/Referrals */
.glass-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    width: 100%;
    /* Full width in container */
    max-width: 300px;
}

.glass-btn:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
}

.glass-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    /* Softer for secondary */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    /* Dimmer text for secondary */
}

.glass-btn-secondary:active {
    background: rgba(255, 255, 255, 0.1);
}

.lotus-timer {
    font-size: 9px;
    font-weight: 600;
    color: var(--accent-light);
    margin-top: 2px;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 8px;
}

.lake-controls {
    position: fixed;
    bottom: 120px;
    left: 20px;
    padding-bottom: 20px;
    right: 20px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: auto;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-8px) rotate(2deg);
    }

    75% {
        transform: translateY(4px) rotate(-2deg);
    }
}

/* --- Registration Page Specific Ship Design (Compact Horizontal) --- */
.register-form .ships-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin: 0 -10px;
    padding: 16px 10px 20px 10px;
}

.register-form .ship-card {
    min-width: 260px;
    flex: 0 0 auto;
    scroll-snap-align: center;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.register-form .ship-header {
    gap: 12px;
    margin-bottom: 8px;
}

.register-form .ship-icon-wrapper {
    width: 48px;
    height: 48px;
    font-size: 24px;
    border-radius: 12px;
}

.register-form .ship-name {
    font-size: 16px;
    margin-bottom: 2px;
}

.register-form .ship-desc {
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.register-form .ship-stats {
    gap: 8px;
    margin-top: auto;
    border-top: none;
    padding-top: 0;
}

.register-form .ship-stat {
    padding: 8px 6px;
    border-radius: 10px;
}

.register-form .ship-level {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 9px;
    padding: 3px 6px;
    border-radius: 6px;
    opacity: 0.8;
}