/* === Theme Variables (Dark - Default) === */
:root {
    --bg-primary: #0D1B2A;
    --bg-secondary: #1B2838;
    --bg-card: #1E2D3D;
    --bg-elevated: #253545;

    --accent-gold: #F5C518;
    --accent-gold-dark: #D4A017;
    --accent-gold-light: #FFE066;
    --accent-pink: #E91E63;
    --accent-cyan: #00BCD4;
    --accent-green: #4CAF50;

    --text-primary: #F0F0F0;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --glow-gold: rgba(245, 197, 24, 0.3);
    --glow-pink: rgba(233, 30, 99, 0.3);

    --font: 'Vazirmatn', system-ui, -apple-system, sans-serif;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 9999px;
    --transition: 0.3s ease;
}

/* === Light Theme === */
[data-theme="light"] {
    --bg-primary: #FFF9F0;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-elevated: #F0E8DA;

    --accent-gold: #C8960C;
    --accent-gold-dark: #9E7400;
    --accent-gold-light: #E8B830;
    --accent-pink: #C2185B;
    --accent-cyan: #00838F;
    --accent-green: #2E7D32;

    --text-primary: #1C1C1C;
    --text-secondary: #4A4A4A;
    --text-muted: #7A7A7A;

    --glow-gold: rgba(180, 130, 10, 0.2);
    --glow-pink: rgba(194, 24, 91, 0.15);
}

[data-theme="light"] .btn-primary {
    color: #FFFFFF;
}

[data-theme="light"] .btn-spin {
    box-shadow: 0 6px 24px rgba(194, 24, 91, 0.3);
}

[data-theme="light"] .wheel {
    box-shadow:
        0 0 0 5px var(--bg-primary),
        0 0 0 8px var(--accent-gold-dark),
        0 10px 30px rgba(0,0,0,0.12) !important;
}

[data-theme="light"] .wheel-outer-ring {
    border-color: var(--accent-gold-dark);
    box-shadow: 0 0 16px var(--glow-gold), inset 0 0 16px var(--glow-gold);
}

[data-theme="light"] .wheel-pointer {
    border-top-color: var(--accent-gold-dark);
}

[data-theme="light"] .wheel-center {
    background: linear-gradient(145deg, #FFFFFF, #F5F0E8);
    border-color: var(--accent-gold-dark);
    color: var(--accent-gold-dark);
}

[data-theme="light"] .result-overlay {
    background: rgba(255, 249, 240, 0.94);
}

[data-theme="light"] .result-card {
    background: #FFFFFF;
    border-color: rgba(200, 150, 12, 0.3);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), 0 0 40px var(--glow-gold);
}

[data-theme="light"] .amount-number {
    color: var(--accent-gold-dark);
    text-shadow: none;
}

[data-theme="light"] .settings-modal {
    background: rgba(255, 249, 240, 0.96);
}

[data-theme="light"] .settings-modal-card {
    background: #FFFFFF;
    border-color: var(--bg-elevated);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select {
    background: #FFFFFF;
    border-color: #D5CCBE;
}

[data-theme="light"] .radio-card-body {
    background: #FFFFFF;
    border-color: #D5CCBE;
}

[data-theme="light"] .radio-card input:checked + .radio-card-body {
    background: rgba(200, 150, 12, 0.08);
    border-color: var(--accent-gold);
}

[data-theme="light"] .history-row {
    background: #FFFFFF;
    border-color: #E8E0D4;
}

[data-theme="light"] .host-badge {
    background: var(--accent-gold-dark);
    color: #FFFFFF;
}

[data-theme="light"] .charge-bar-wrap {
    background: #E8E0D4;
}

[data-theme="light"] .stat-card {
    background: #FFFFFF;
    border-color: #E8E0D4;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(200, 150, 12, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(194, 24, 91, 0.03) 0%, transparent 50%);
}

/* === SAR Symbol === */
.sar-symbol {
    font-family: 'saudi_riyal', var(--font);
    font-style: normal;
}

/* === Wizard Page (centered card) === */
#wizard-root {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.wizard-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    min-height: 100dvh;
}

.wizard-card {
    background: var(--bg-secondary);
    border: 2px solid var(--bg-elevated);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .wizard-card {
    background: #FFFFFF;
    border-color: #E8E0D4;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
}

/* === Onboarding Popup (floats above everything) === */
#onboarding-popup {
    position: fixed;
    inset: 0;
    z-index: 200;
}

.onboarding-popup-bg {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 42, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

[data-theme="light"] .onboarding-popup-bg {
    background: rgba(245, 240, 232, 0.95);
}

.onboarding-card {
    background: var(--bg-secondary);
    border: 2px solid var(--bg-elevated);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .onboarding-card {
    background: #FFFFFF;
    border-color: #E8E0D4;
}

/* === Onboarding elements === */

.onboarding-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.onboarding-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
}

.onboarding-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-elevated);
    transition: all var(--transition);
}

.onboarding-dot.active {
    background: var(--accent-gold);
    width: 24px;
    border-radius: 5px;
}

/* === Theme Toggle === */
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    color: inherit;
}

.theme-toggle:hover {
    background: var(--bg-elevated);
}

/* === Budget Mode === */
.budget-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.budget-toggle-btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
    color: var(--text-muted);
}

.budget-toggle-btn.active {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.budget-preview {
    padding: 0.75rem 1rem;
    background: rgba(245, 197, 24, 0.08);
    border: 1px solid rgba(245, 197, 24, 0.2);
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--accent-gold);
    font-size: 0.95rem;
    min-height: 2.5rem;
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

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

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

/* === Typography === */
h1, h2, h3 {
    font-family: var(--font);
    font-weight: 800;
    line-height: 1.3;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: var(--bg-primary);
    box-shadow: 0 4px 20px var(--glow-gold);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--glow-gold);
}

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

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 2px solid rgba(245, 197, 24, 0.3);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--accent-gold);
}

.btn-lg {
    width: 100%;
    padding: 1.1rem;
    font-size: 1.25rem;
}

.btn-glow {
    animation: btnGlow 2s ease-in-out infinite;
}

.btn-spin {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-pink), #AD1457);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 6px 30px var(--glow-pink);
    transition: all var(--transition);
    touch-action: manipulation;
    min-height: 68px;
    animation: btnGlow2 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.btn-spin::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s linear infinite;
}

.btn-spin .spin-btn-text {
    position: relative;
    z-index: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.btn-spin:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px var(--glow-pink);
}

.btn-spin:active {
    transform: translateY(0) scale(0.98);
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent-gold);
}

.form-input, .form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1.1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition);
    min-height: 48px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--glow-gold);
    background: var(--bg-elevated);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === Radio Cards === */
.radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.radio-card {
    cursor: pointer;
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.875rem 0.5rem;
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: all 0.25s ease;
    text-align: center;
}

.radio-card-body:hover {
    border-color: var(--text-muted);
    background: var(--bg-elevated);
}

.radio-card input:checked + .radio-card-body {
    border-color: var(--accent-gold);
    background: rgba(245, 197, 24, 0.1);
    box-shadow: 0 0 16px var(--glow-gold);
}

.radio-card-icon {
    font-size: 1.75rem;
}

.radio-card-label {
    font-weight: 700;
    font-size: 0.9rem;
}

.radio-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === Wizard (legacy) === */
.wizard-step {
    width: 100%;
    max-width: 420px;
}

.wizard-icon {
    font-size: 6rem;
    text-align: center;
    margin-bottom: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

.wizard-stars {
    text-align: center;
    font-size: 2rem;
    animation: twinkle 2s ease-in-out infinite;
}

.wizard-stars2 {
    text-align: center;
    font-size: 2.5rem;
    animation: twinkle 2s ease-in-out infinite 0.5s;
    margin-bottom: 1rem;
}

.wizard-title {
    font-size: 3.5rem;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: titleShine 3s ease-in-out infinite;
    background-size: 200% 100%;
}

.wizard-subtitle {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.wizard-desc {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.wizard-start-area {
    margin-top: 1rem;
}

.wizard-step-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-gold);
    text-align: center;
    margin-bottom: 0.5rem;
}

.wizard-hint {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: rgba(233, 30, 99, 0.1);
    border: 1px solid rgba(233, 30, 99, 0.2);
    border-radius: var(--radius-sm);
}

/* === Step Indicator === */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
}

.step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--bg-elevated);
    color: var(--text-muted);
    transition: all var(--transition);
}

.step.active {
    background: var(--accent-gold);
    color: var(--bg-primary);
    box-shadow: 0 0 16px var(--glow-gold);
}

.step.done {
    background: var(--accent-green);
    color: white;
}

.step-line {
    width: 60px;
    height: 3px;
    background: var(--bg-elevated);
}

.step-line.filled {
    background: var(--accent-green);
}

/* === Wheel Page === */
.wheel-page {
    padding: 1.25rem 1.25rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100dvh;
}

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

.wheel-title {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wheel-title-decor {
    font-size: 1.1rem;
    letter-spacing: 0.5rem;
    opacity: 0.6;
    animation: twinkle 3s ease-in-out infinite;
}

.participant-name {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    animation: fadeInUp 0.5s ease;
}

.participant-name strong {
    color: var(--accent-gold);
}

.participant-name {
    word-break: break-word;
}

/* Body scroll lock when overlay is showing */
.body-locked {
    overflow: hidden !important;
}

/* === Host Bar === */
.host-bar {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 0.5rem;
}

.host-settings-btn {
    font-size: 1.5rem;
    text-decoration: none;
    padding: 0.5rem;
    transition: transform var(--transition);
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
}

.host-settings-btn:hover {
    transform: rotate(90deg);
}

.host-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: var(--bg-primary);
    border-radius: var(--radius-full);
}

/* === Burger Menu === */
.burger-wrap {
    position: relative;
}

.burger-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.burger-btn:hover {
    background: var(--bg-elevated);
}

.burger-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-elevated);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 0.35rem;
    z-index: 50;
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
    pointer-events: none;
    transition: all 0.2s ease;
}

.burger-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.burger-item {
    display: block;
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: none;
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    text-align: start;
    cursor: pointer;
    transition: background var(--transition);
}

.burger-item:hover {
    background: var(--bg-elevated);
}

/* === Host Share Section === */
.host-share-section {
    width: 100%;
    max-width: 380px;
    margin-top: 2rem;
    text-align: center;
}

.host-share-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* === Join Form === */
.join-form {
    width: 100%;
    max-width: 380px;
}

.join-prompt {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.join-inline {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.join-inline .form-input {
    flex: 1;
}

.form-input-lg {
    font-size: 1.25rem !important;
    padding: 1rem 1.25rem !important;
    min-height: 56px !important;
}

.btn-tall {
    min-height: 56px;
    padding: 1rem 1.5rem;
}

/* === Spin Area === */
#spin-area {
    width: 100%;
    max-width: 380px;
    margin-top: 1rem;
}

/* === Result Overlay === */
.result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.result-card {
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-card));
    border: 2px solid rgba(245, 197, 24, 0.3);
    border-radius: 28px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 380px;
    width: 92%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 60px var(--glow-gold);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-pink), var(--accent-gold));
    border-radius: 28px 28px 0 0;
}

.result-stars {
    font-size: 1.5rem;
    animation: twinkle 1s ease-in-out infinite;
}

.result-emoji {
    font-size: 4.5rem;
    margin-bottom: 0.25rem;
    animation: resultBounce 0.8s ease-in-out infinite alternate;
}

.result-label {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.result-remark {
    font-size: 1.1rem;
    color: var(--accent-cyan);
    margin-bottom: 0.75rem;
    font-weight: 600;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.result-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    animation: amountPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s both;
}

.amount-number {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--accent-gold);
    text-shadow: 0 0 30px var(--glow-gold);
}

.amount-currency {
    font-size: 1.75rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.result-name {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

/* === History === */
.history-section {
    width: 100%;
    max-width: 380px;
    margin-top: 2.5rem;
}

.history-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-elevated);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-elevated);
    transition: all var(--transition);
}

.history-row:hover {
    border-color: rgba(245, 197, 24, 0.2);
    background: var(--bg-elevated);
}

.history-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    flex: 1;
}

.btn-respin {
    background: none;
    border: 1px solid var(--bg-elevated);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all var(--transition);
    margin-right: 0.5rem;
}

.btn-respin:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: rgba(245, 197, 24, 0.1);
}

.history-amount {
    font-weight: 800;
    color: var(--accent-gold);
    font-size: 1.2rem;
}

.history-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    font-weight: 800;
    color: var(--accent-gold);
    border-top: 2px solid var(--accent-gold);
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 1.5rem;
    font-size: 1rem;
}

/* === Settings Page === */
.settings-page {
    padding: 1.5rem;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.settings-header h2 {
    color: var(--accent-gold);
    font-weight: 800;
}

.back-btn {
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--accent-gold);
    padding: 0.5rem;
    transition: transform var(--transition);
}

.back-btn:hover {
    transform: translateX(4px);
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.share-link {
    display: flex;
    gap: 0.5rem;
}

.share-link .form-input {
    flex: 1;
    font-size: 0.85rem;
}

/* === Toast === */
.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
    animation: fadeInUp 0.3s ease;
}

/* === Validation === */
.validation-msg {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(244, 67, 54, 0.15);
    color: #EF5350;
    border: 1px solid rgba(244, 67, 54, 0.3);
    animation: fadeInUp 0.3s ease;
}

.toast-success {
    background: rgba(76, 175, 80, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

/* === Animations === */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

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

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.08); }
    70% { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 4px 20px var(--glow-gold); }
    50% { box-shadow: 0 4px 40px var(--glow-gold), 0 0 60px var(--glow-gold); }
}

@keyframes btnGlow2 {
    0%, 100% { box-shadow: 0 6px 30px var(--glow-pink); }
    50% { box-shadow: 0 6px 50px var(--glow-pink), 0 0 80px var(--glow-pink); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

@keyframes titleShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmer {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes resultBounce {
    from { transform: scale(1) rotate(-3deg); }
    to { transform: scale(1.1) rotate(3deg); }
}

@keyframes amountPop {
    from { opacity: 0; transform: scale(0.3); }
    to { opacity: 1; transform: scale(1); }
}

.fade-in { animation: fadeIn 0.4s ease; }
.slide-in { animation: slideIn 0.3s ease; }
.bounce-in { animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); }

/* === Settings Modal === */
.settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 42, 0.92);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(12px);
    padding: 2rem 1rem;
    overflow-y: auto;
}

.settings-modal-card {
    background: var(--bg-secondary);
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.settings-modal-header h2 {
    color: var(--accent-gold);
    font-size: 1.3rem;
    font-weight: 800;
}

.settings-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.settings-close:hover {
    color: var(--accent-gold);
    background: var(--bg-elevated);
}

.settings-modal h3 {
    color: var(--accent-gold);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.settings-modal h3:first-of-type {
    margin-top: 0;
}

/* === Auth === */
.auth-form {
    margin-bottom: 1rem;
}

.auth-divider {
    text-align: center;
    color: var(--text-muted);
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--bg-elevated);
}

.auth-divider::before { right: 0; }
.auth-divider::after { left: 0; }

.auth-register-label {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.auth-skip {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-skip-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.auth-skip-link:hover {
    color: var(--accent-gold);
}

/* === Admin Panel === */
.admin-page {
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

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

.admin-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--accent-gold);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-elevated);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: rgba(245, 197, 24, 0.3);
    box-shadow: 0 0 16px var(--glow-gold);
}

.stat-card-live {
    border-color: var(--accent-green);
    animation: liveGlow 2s ease-in-out infinite;
}

@keyframes liveGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(76, 175, 80, 0.2); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.4); }
}

.stat-icon {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-gold);
}

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

.admin-section {
    margin-bottom: 2rem;
}

.admin-section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.admin-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.admin-row-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.admin-row-host {
    font-weight: 700;
    font-size: 0.95rem;
}

.admin-row-range {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.admin-row-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.admin-row-spins {
    font-size: 0.85rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

.admin-row-total {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.game-switch-form { width: 100%; }
.game-switch-form .admin-row {
    width: 100%;
    cursor: pointer;
    font-family: var(--font);
    font-size: inherit;
    color: inherit;
    text-align: start;
}
.admin-row-active {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 16px var(--glow-gold);
}

/* === Visitors Table === */
.visitors-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.visitors-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.visitors-table th {
    background: var(--bg-elevated);
    color: var(--accent-gold);
    font-weight: 700;
    padding: 0.6rem 0.5rem;
    text-align: start;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.visitors-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--bg-elevated);
    vertical-align: top;
}

.visitors-table tbody tr:hover {
    background: rgba(245, 197, 24, 0.04);
}

.cell-mono {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    word-break: break-all;
    max-width: 100px;
}

.cell-ua {
    font-size: 0.7rem;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-num {
    font-weight: 700;
    color: var(--accent-gold);
    text-align: center;
}

.cell-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    direction: ltr;
}

/* === Share Card (rendered to image) === */
.share-card {
    width: 540px;
    height: 960px;
    position: relative;
    overflow: hidden;
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
}

.share-card-bg {
    width: 100%;
    height: 100%;
    background: linear-gradient(165deg, #0D1B2A 0%, #1B2838 40%, #253545 100%);
    position: relative;
}

.share-card-pattern {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(245, 197, 24, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(233, 30, 99, 0.06) 0%, transparent 50%);
}

.share-card-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

.share-card-header {
    margin-bottom: 40px;
}

.share-card-title-svg {
    width: 300px;
    height: 80px;
    display: block;
    margin: 0 auto;
}

.share-card-label-svg {
    width: 300px;
    height: 40px;
    display: block;
    margin: 12px auto 0;
}

.share-card-subtitle {
    font-size: 36px;
    margin-top: 8px;
}

.share-card-stats {
    margin-bottom: 24px;
}

.share-card-amount {
    font-size: 80px;
    font-weight: 900;
    color: #F5C518;
    line-height: 1;
    text-shadow: 0 4px 24px rgba(245, 197, 24, 0.4);
}

.share-card-currency {
    font-size: 28px;
    color: #94A3B8;
    font-weight: 700;
    margin-top: 8px;
}

.share-card-label {
    font-size: 22px;
    color: #64748B;
    font-weight: 600;
    margin-top: 12px;
}

.share-card-count {
    font-size: 24px;
    color: #94A3B8;
    font-weight: 600;
    margin-bottom: 40px;
}

.share-card-qr {
    margin-bottom: 24px;
    padding: 16px;
    background: white;
    border-radius: 16px;
    display: inline-block;
}

.share-card-qr canvas,
.share-card-qr img {
    display: block;
}

.share-card-url {
    font-size: 20px;
    color: #F5C518;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
    direction: ltr;
}

.share-card-tagline {
    font-size: 18px;
    color: #64748B;
    font-weight: 500;
}

/* Border decoration */
.share-card-bg::before {
    content: '';
    position: absolute;
    inset: 16px;
    border: 2px solid rgba(245, 197, 24, 0.15);
    border-radius: 24px;
    pointer-events: none;
    z-index: 2;
}

.share-card-bg::after {
    content: '';
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(245, 197, 24, 0.08);
    border-radius: 20px;
    pointer-events: none;
    z-index: 2;
}

/* Share loading overlay */
.share-loading {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(4px);
}

.share-loading-text {
    color: var(--accent-gold);
    font-size: 1.2rem;
    font-weight: 700;
}

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    min-height: auto;
}

/* === Version === */
.app-version {
    position: fixed;
    bottom: 4px;
    left: 8px;
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
    font-family: monospace;
}

/* === Background === */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(245, 197, 24, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(233, 30, 99, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}
