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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --bg-elevated: #222222;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --accent: #00ff88;
    --accent-dark: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.2);
    --danger: #ff4444;
    --warning: #ffaa00;
    --versus: #ff6b6b;
    --versus-glow: rgba(255, 107, 107, 0.2);
    --border: #2a2a2a;
    --border-light: #333333;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Splash Screen */
.splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.splash.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    font-size: 64px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 12px;
    text-shadow: 0 0 40px var(--accent-glow);
    animation: pulse 2s infinite;
}

.splash-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-top: 12px;
}

.splash-loader {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 40px;
    overflow: hidden;
    position: relative;
}

.splash-loader::after {
    content: '';
    position: absolute;
    left: -50%;
    width: 50%;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    animation: loading 1s infinite;
}

@keyframes loading {
    0% { left: -50%; }
    100% { left: 100%; }
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-small {
    font-size: 24px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 4px;
}

.wallet-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid var(--border);
}

.wallet-icon {
    font-size: 16px;
}

#wallet-short {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 60px;
    z-index: 99;
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.nav-tab.active {
    color: var(--accent);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
}

.tab-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.tab-label {
    font-size: 11px;
    font-weight: 500;
}

/* Content Area */
.content {
    padding: 16px;
    padding-bottom: 100px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Section Header */
.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.next-draw {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 14px;
}

.next-draw .label {
    color: var(--text-secondary);
}

.next-draw .value {
    color: var(--accent);
    font-weight: 600;
}

/* Countdown */
.countdown {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.countdown-item {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.countdown-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

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

/* Lottery Cards */
.lottery-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lottery-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.lottery-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.lottery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.lottery-amount {
    font-size: 36px;
    font-weight: 900;
    color: var(--accent);
}

.lottery-badge {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.lottery-badge.hot {
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger);
}

.lottery-badge.premium {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
}

.lottery-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.lottery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.entry-fee {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-join {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-join:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* Versus Cards */
.versus-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.versus-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.versus-card:hover {
    border-color: var(--versus);
    box-shadow: 0 0 20px var(--versus-glow);
}

.versus-left {
    flex: 1;
}

.versus-amount {
    font-size: 28px;
    font-weight: 900;
    color: var(--versus);
}

.versus-prize {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.versus-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

.versus-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.versus-waiting {
    font-size: 12px;
    color: var(--text-muted);
}

.versus-right {
    flex: 0;
}

.btn-battle {
    background: var(--versus);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-battle:hover {
    background: #ff5252;
}

/* Active Slots */
.active-slots {
    margin-top: 24px;
}

.active-slots h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-slots, .no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
    font-size: 14px;
}

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

.no-winners {
    text-align: center;
    padding: 40px 20px;
}

.no-data-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-winners p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.no-winners .small {
    font-size: 12px;
    color: var(--text-muted);
}

/* Profile */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.profile-avatar {
    font-size: 48px;
    margin-bottom: 12px;
}

.profile-address {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.btn-connect {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 12px 32px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.profile-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

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

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-section {
    margin-bottom: 24px;
}

.profile-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.participations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Settings */
.settings-list {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-sheet {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 12px auto;
}

.modal-content {
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.modal-info {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row span:first-child {
    color: var(--text-secondary);
}

.info-row span:last-child {
    font-weight: 600;
}

.info-row.highlight {
    background: var(--accent-glow);
    margin: 8px -16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-bottom: none;
}

.info-row.highlight span:last-child {
    color: var(--accent);
}

.modal-notice {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 20px;
}

.modal-footer {
    padding-bottom: 20px;
}

.btn-confirm {
    width: 100%;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm:hover {
    background: var(--accent-dark);
}

/* Wallet Menu */
.wallet-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

.wallet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.wallet-sheet {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wallet-header h3 {
    font-size: 18px;
}

.wallet-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wallet-option {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-option:hover {
    border-color: var(--accent);
}

.wallet-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.toast-icon {
    font-size: 18px;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}
