/* ============================================
   Crypto FOMO Calculator - Styles
   Dark theme with gold/green money accents
   ============================================ */

:root {
    --bg: #0a0a0f;
    --bg-card: #141420;
    --bg-card-hover: #1a1a2e;
    --border: #2a2a40;
    --text: #eeeef4;
    --text-dim: #8888a0;
    --text-muted: #555570;
    --gold: #ffd700;
    --gold-dim: rgba(255, 215, 0, 0.12);
    --green: #00e676;
    --green-dim: rgba(0, 230, 118, 0.12);
    --red: #ff4444;
    --btc: #f7931a;
    --eth: #627eea;
    --sol: #9945ff;
    --doge: #c3a634;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-heading);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 0%, rgba(255, 215, 0, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 100%, rgba(0, 230, 118, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

#app { max-width: 440px; margin: 0 auto; position: relative; z-index: 1; }

/* ---- Screens ---- */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px 20px 40px;
}
.screen.active { display: block; animation: fadeIn 0.4s ease; }

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

.hidden { display: none !important; }

/* ---- Header ---- */
.app-header {
    text-align: center;
    padding: 16px 0 28px;
}

.logo-icon {
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

.logo-emoji { font-size: 48px; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    background: linear-gradient(135deg, var(--gold), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle { color: var(--text-dim); font-size: 1rem; }

/* ---- Steps ---- */
.step { margin-bottom: 28px; animation: fadeIn 0.4s ease; }

.step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gold-dim);
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---- Crypto Grid ---- */
.crypto-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.crypto-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-heading);
    color: var(--text);
}

.crypto-card:active { transform: scale(0.96); }
.crypto-card:hover { background: var(--bg-card-hover); border-color: var(--gold); }
.crypto-card.selected {
    border-color: var(--gold);
    background: var(--gold-dim);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.crypto-icon {
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btc-icon { background: rgba(247, 147, 26, 0.15); color: var(--btc); }
.eth-icon { background: rgba(98, 126, 234, 0.15); color: var(--eth); }
.sol-icon { background: rgba(153, 69, 255, 0.15); color: var(--sol); }
.doge-icon { background: rgba(195, 166, 52, 0.15); }
.ada-icon { background: rgba(0, 51, 173, 0.15); color: #0033ad; }
.xrp-icon { background: rgba(0, 0, 0, 0.15); color: var(--text-dim); }
.shib-icon { background: rgba(255, 160, 0, 0.15); }
.dot-icon { background: rgba(230, 0, 122, 0.15); color: #e6007a; }

.crypto-name { font-size: 0.85rem; font-weight: 600; }
.crypto-ticker { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }

/* ---- Amount Presets ---- */
.amount-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.amount-btn {
    padding: 14px 8px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.amount-btn:active { transform: scale(0.96); }
.amount-btn:hover { border-color: var(--green); }
.amount-btn.selected {
    border-color: var(--green);
    background: var(--green-dim);
    color: var(--green);
}

.custom-btn {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-dim);
}

.custom-amount-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    margin-top: 10px;
    transition: border-color var(--transition);
}
.custom-amount-wrapper:focus-within { border-color: var(--green); }

.dollar-sign {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--green);
    font-weight: 700;
}

#custom-amount {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 1rem;
    padding: 14px 10px;
}
#custom-amount::placeholder { color: var(--text-muted); }

/* ---- Timeframe ---- */
.timeframe-list { display: flex; flex-direction: column; gap: 8px; }

.timeframe-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
}

.timeframe-btn:active { transform: scale(0.98); }
.timeframe-btn:hover { border-color: var(--gold); }
.timeframe-btn.selected { border-color: var(--gold); background: var(--gold-dim); }

.tf-label { font-weight: 600; }
.tf-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }

/* ---- Calculate Button ---- */
.calculate-wrapper { margin-top: 24px; }

.calculate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--gold), #ff9500);
    border: none;
    border-radius: var(--radius);
    color: #0a0a0f;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 24px rgba(255, 215, 0, 0.3);
}

.calculate-btn:active { transform: scale(0.97); }
.btn-icon { font-size: 1.2rem; }

/* ============================================
   RESULTS SCREEN
   ============================================ */
.results-container {
    position: relative;
    padding-top: 12px;
    overflow: hidden;
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.results-header {
    text-align: center;
    margin-bottom: 20px;
}

.coin-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.investment-recap {
    font-size: 0.88rem;
    color: var(--text-dim);
}

/* ---- Big Money Counter ---- */
.big-result {
    text-align: center;
    padding: 28px 0;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.money-counter {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
}

.dollar {
    background: linear-gradient(135deg, var(--gold), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#counter-value {
    background: linear-gradient(135deg, var(--gold), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profit-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--green-dim);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--green);
}

.profit-arrow { font-size: 0.7rem; }

/* ---- FOMO Rating ---- */
.fomo-rating {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
    animation: fadeIn 0.5s ease 0.3s both;
}

.fomo-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.fomo-level {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.fomo-emoji { font-size: 2rem; }

/* ---- Fun Stats ---- */
.fun-stats {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    animation: fadeIn 0.5s ease 0.5s both;
}

.fun-stats h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 42, 64, 0.5);
}
.stat-row:last-child { border-bottom: none; }

.stat-icon { font-size: 1.3rem; flex-shrink: 0; }
.stat-text { font-size: 0.9rem; color: var(--text); }

/* ---- Profit Chart ---- */
.profit-chart {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease 0.7s both;
}

.profit-chart h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.chart-bars { display: flex; flex-direction: column; gap: 12px; }

.chart-bar-group { display: flex; flex-direction: column; gap: 4px; }

.bar-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.bar-track {
    height: 28px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    min-width: 40px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.invested-bar {
    background: var(--border);
    width: 0;
}

.worth-bar {
    background: linear-gradient(90deg, var(--gold), var(--green));
    width: 0;
}

.bar-value {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

/* ---- Action Buttons ---- */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn 0.5s ease 0.9s both;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--gold), #ff9500);
    border: none;
    border-radius: var(--radius);
    color: #0a0a0f;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}
.share-btn:active { transform: scale(0.97); }

.retry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.retry-btn:hover { border-color: var(--text-dim); color: var(--text); }
.retry-btn:active { transform: scale(0.97); }

/* ---- Responsive ---- */
@media (max-width: 360px) {
    .app-header h1 { font-size: 1.7rem; }
    .money-counter { font-size: 2.4rem; }
    .crypto-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

@media (min-width: 420px) {
    .crypto-grid { grid-template-columns: repeat(4, 1fr); }
}
