/* Character.AI Predictions - Charm Bets */
/* Inspired by Character.AI + Kalshi design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Character.AI brand colors */
    --cai-purple: #8B5CF6;
    --cai-purple-light: #A78BFA;
    --cai-purple-dark: #7C3AED;
    --cai-purple-glow: rgba(139, 92, 246, 0.3);

    /* Semantic colors */
    --yes-green: #10B981;
    --yes-green-light: #34D399;
    --yes-green-bg: rgba(16, 185, 129, 0.15);
    --no-red: #EF4444;
    --no-red-light: #F87171;
    --no-red-bg: rgba(239, 68, 68, 0.15);

    /* Neutral palette */
    --bg-primary: #0D0D0F;
    --bg-secondary: #18181B;
    --bg-tertiary: #27272A;
    --bg-card: #1C1C1F;
    --bg-card-hover: #242428;

    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-tertiary: #71717A;

    --border-color: #27272A;
    --border-light: #3F3F46;

    /* Spacing */
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

.hidden {
    display: none !important;
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse at top, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        var(--bg-primary);
}

.auth-container {
    width: 100%;
    max-width: 360px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-icon-large {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--cai-purple) 0%, var(--cai-purple-dark) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px var(--cai-purple-glow);
}

.logo-icon-large svg {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--cai-purple-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--cai-purple);
    box-shadow: 0 0 0 3px var(--cai-purple-glow);
}

.input-group input::placeholder {
    color: var(--text-tertiary);
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--cai-purple) 0%, var(--cai-purple-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--cai-purple-glow);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

.btn-large {
    padding: 1.125rem 1.5rem;
}

.btn-secondary {
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.auth-hint {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.charm-highlight {
    color: var(--cai-purple-light);
    font-weight: 600;
}

.auth-error {
    background: var(--no-red-bg);
    border: 1px solid var(--no-red);
    border-radius: 12px;
    padding: 1rem;
    color: var(--no-red-light);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.5rem;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem;
    padding-top: calc(1rem + var(--safe-top));
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--cai-purple) 0%, var(--cai-purple-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-mark svg {
    width: 20px;
    height: 20px;
    color: white;
}

.header-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.charm-pill {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--bg-tertiary);
    padding: 0.5rem 0.875rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.charm-icon {
    font-size: 0.875rem;
}

.charm-amount {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--cai-purple-light);
}

.avatar-btn {
    width: 36px;
    height: 36px;
    background: var(--cai-purple);
    border: none;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-btn:hover {
    transform: scale(1.05);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(70px + var(--safe-top));
    right: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dropdown-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.dropdown-username {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.dropdown-charms {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

/* ===== NAVIGATION TABS ===== */
.nav-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 0.5rem;
    position: sticky;
    top: calc(69px + var(--safe-top));
    z-index: 90;
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab svg {
    width: 20px;
    height: 20px;
}

.nav-tab.active {
    color: var(--cai-purple-light);
    border-bottom-color: var(--cai-purple);
}

.nav-tab:not(.active):hover {
    color: var(--text-secondary);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    padding-bottom: calc(2rem + var(--safe-bottom));
}

.tab-panel {
    display: none;
    padding: 1rem;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--yes-green);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--yes-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.house-fee-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Stats Banner */
.stats-banner {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--cai-purple-glow) 0%, rgba(6, 182, 212, 0.1) 100%);
    border: 1px solid var(--cai-purple);
    border-radius: 14px;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
}

.stat-item:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cai-purple-light);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex-shrink: 0;
    padding: 0.5rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--cai-purple);
    border-color: var(--cai-purple);
    color: white;
}

/* ===== MARKET CARDS (Kalshi Style) ===== */
.markets-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.market-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.market-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.market-card:active {
    transform: scale(0.99);
}

.market-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.market-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.market-info {
    flex: 1;
    min-width: 0;
}

.market-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.market-tag {
    display: inline-block;
    background: var(--cai-purple-glow);
    color: var(--cai-purple-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.market-sentiment {
    font-size: 1.25rem;
    opacity: 0.9;
}

.market-sentiment.bullish {
    animation: pulse-fire 1.5s infinite;
}

@keyframes pulse-fire {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.market-question {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Kalshi-style odds bar */
.market-odds {
    margin-bottom: 0.75rem;
}

.odds-track {
    height: 8px;
    background: var(--no-red-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.odds-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--yes-green) 0%, var(--yes-green-light) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.odds-values {
    display: flex;
    justify-content: space-between;
}

.odds-value {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
}

.odds-value.yes {
    color: var(--yes-green);
}

.odds-value.no {
    color: var(--no-red);
}

.odds-value span:first-child {
    font-weight: 600;
}

.odds-value span:last-child {
    font-weight: 700;
}

.market-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.market-volume,
.market-traders {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.market-volume strong,
.market-traders strong {
    color: var(--text-primary);
    font-weight: 600;
}

.volume-icon,
.traders-icon {
    font-size: 0.7rem;
}

.market-action {
    margin-left: auto;
    background: linear-gradient(135deg, var(--cai-purple) 0%, var(--cai-purple-dark) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s;
}

.market-card:hover .market-action {
    transform: scale(1.05);
    box-shadow: 0 2px 8px var(--cai-purple-glow);
}

/* ===== MY BETS ===== */
.bets-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bet-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
}

.bet-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.bet-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.bet-card-question {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
}

.bet-card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.bet-position {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.position-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.position-badge.yes {
    background: var(--yes-green-bg);
    color: var(--yes-green);
}

.position-badge.no {
    background: var(--no-red-bg);
    color: var(--no-red);
}

.bet-amount {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.bet-payout {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bet-payout.won {
    color: var(--yes-green);
    font-weight: 600;
}

.bet-payout.lost {
    color: var(--no-red);
}

/* ===== LEADERBOARD ===== */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.875rem 1rem;
}

.leaderboard-item.is-me {
    border-color: var(--cai-purple);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
}

.leaderboard-rank {
    width: 28px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.leaderboard-item:nth-child(1) .leaderboard-rank { color: #FFD700; font-size: 1.1rem; }
.leaderboard-item:nth-child(2) .leaderboard-rank { color: #C0C0C0; font-size: 1rem; }
.leaderboard-item:nth-child(3) .leaderboard-rank { color: #CD7F32; font-size: 1rem; }

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.leaderboard-stats {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.leaderboard-charms {
    text-align: right;
}

.leaderboard-charms-value {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--cai-purple-light);
}

.leaderboard-charms-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* ===== CREATE FORM ===== */
.create-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.625rem;
}

.character-option {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-tertiary);
    position: relative;
}

.character-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-option-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 1.5rem 0.375rem 0.375rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
}

.character-option-name {
    font-size: 0.6rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.character-option-chats {
    font-size: 0.5rem;
    color: var(--cai-purple-light);
    font-weight: 700;
}

.character-option:hover {
    border-color: var(--border-light);
    transform: scale(1.05);
}

.character-option.selected {
    border-color: var(--cai-purple);
    box-shadow: 0 0 0 2px var(--cai-purple-glow);
    transform: scale(1.05);
}

textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    transition: all 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--cai-purple);
    box-shadow: 0 0 0 3px var(--cai-purple-glow);
}

textarea::placeholder {
    color: var(--text-tertiary);
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: right;
}

.duration-options {
    display: flex;
    gap: 0.5rem;
}

.duration-option {
    flex: 1;
}

.duration-option input {
    display: none;
}

.duration-option span {
    display: block;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.duration-option input:checked + span {
    background: var(--cai-purple-glow);
    border-color: var(--cai-purple);
    color: var(--cai-purple-light);
}

.form-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    color: var(--yes-green);
    font-size: 0.8rem;
}

.form-info svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== BET MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary);
    border-radius: 24px 24px 0 0;
    padding: 1rem 1.25rem;
    padding-bottom: calc(1.5rem + var(--safe-bottom));
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: 0 auto 1rem;
}

.modal-market-info {
    display: flex;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

.modal-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--bg-tertiary);
}

.modal-market-details {
    flex: 1;
}

.modal-tag {
    display: inline-block;
    background: var(--cai-purple-glow);
    color: var(--cai-purple-light);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.modal-question {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

/* Odds Display */
.odds-display {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.odds-bar-container {
    margin-bottom: 0.75rem;
}

.odds-bar-track {
    height: 10px;
    background: var(--no-red);
    border-radius: 5px;
    overflow: hidden;
}

.odds-bar-yes {
    height: 100%;
    background: var(--yes-green);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.odds-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.odds-label {
    display: flex;
    flex-direction: column;
}

.odds-label.yes { align-items: flex-start; }
.odds-label.no { align-items: flex-end; }

.odds-label-text {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.odds-percent {
    font-size: 1.25rem;
    font-weight: 800;
}

.odds-label.yes .odds-percent { color: var(--yes-green); }
.odds-label.no .odds-percent { color: var(--no-red); }

.volume-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.volume-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.volume-amount {
    font-weight: 700;
    color: var(--text-primary);
}

/* Bet Amount Slider */
.bet-amount-section {
    margin-bottom: 1.25rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
}

.charm-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.charm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--cai-purple) 0%, var(--cai-purple-dark) 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--cai-purple-glow);
}

.slider-value {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
}

.slider-value input {
    width: 60px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
}

.slider-value input:focus {
    outline: none;
}

.quick-amounts {
    display: flex;
    gap: 0.5rem;
}

.quick-btn {
    flex: 1;
    padding: 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.quick-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Bet Option Buttons */
.bet-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.bet-option-btn {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-radius: 14px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.bet-option-btn.yes {
    background: var(--yes-green-bg);
    border-color: var(--yes-green);
}

.bet-option-btn.no {
    background: var(--no-red-bg);
    border-color: var(--no-red);
}

.bet-option-btn:hover {
    transform: translateY(-2px);
}

.bet-option-btn:active {
    transform: scale(0.98);
}

.bet-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bet-option-label {
    font-size: 1.1rem;
    font-weight: 800;
}

.bet-option-btn.yes .bet-option-label { color: var(--yes-green); }
.bet-option-btn.no .bet-option-label { color: var(--no-red); }

.bet-option-cost {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.bet-option-cost::before {
    content: '💎 ';
}

.bet-option-payout {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.payout-amount {
    font-weight: 700;
    color: var(--text-primary);
}

.payout-amount::before {
    content: '💎 ';
}

.fee-notice {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.modal-close-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-close-btn:hover {
    background: var(--bg-card-hover);
}

/* ===== CONFIRM MODAL ===== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.confirm-sheet {
    width: 100%;
    max-width: 340px;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 1.5rem;
    animation: popIn 0.2s ease;
}

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

.confirm-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.confirm-header svg {
    width: 48px;
    height: 48px;
    color: var(--cai-purple);
    margin-bottom: 0.75rem;
}

.confirm-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.confirm-details {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 0.25rem;
    margin-bottom: 1.25rem;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.confirm-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.confirm-row.highlight {
    background: var(--cai-purple-glow);
    border-radius: 10px;
}

.confirm-position {
    font-weight: 700;
}

.confirm-position.yes { color: var(--yes-green); }
.confirm-position.no { color: var(--no-red); }

.confirm-payout {
    font-weight: 700;
    color: var(--cai-purple-light);
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: calc(2rem + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 700;
    opacity: 0;
    transition: all 0.3s ease;
}

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

.toast-message {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.empty-state span {
    font-size: 0.85rem;
}

/* ===== LOADING SKELETON ===== */
.loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-card {
    height: 160px;
    background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-tertiary) 50%, var(--bg-card) 100%);
    background-size: 200% 100%;
    border-radius: 16px;
    animation: shimmer 1.5s infinite;
}

.skeleton-row {
    height: 64px;
    background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-tertiary) 50%, var(--bg-card) 100%);
    background-size: 200% 100%;
    border-radius: 12px;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
    .character-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .character-option-name {
        font-size: 0.55rem;
    }

    .character-option-chats {
        font-size: 0.45rem;
    }
}

@media (min-width: 450px) {
    .character-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}
