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

:root {
    --primary-color: #f59e0b;
    --secondary-color: #ea580c;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.95);
    --bg-hover: rgba(51, 65, 85, 0.95);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: rgba(100, 116, 139, 0.3);
    --positive: #10b981;
    --negative: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-image: url('EvCBackground.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: visible;
}

/* Nick faces on banner */
header::before,
header::after {
    content: '';
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

header::before {
    background-image: url('nick2.png');
    width: 210px;
    height: 210px;
    left: 30px;
}

header::after {
    background-image: url('nick2.png');
    width: 210px;
    height: 210px;
    right: 30px;
    transform: translateY(-50%) scaleX(-1);
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #ffffff;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(245, 158, 11, 0.5),
        0 0 60px rgba(245, 158, 11, 0.3);
    font-family: 'Bebas Neue', 'Impact', sans-serif;
}

.challenge-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 1.2rem;
}

.timer-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.1));
    padding: 20px 35px;
    border-radius: 20px;
    border: 2px solid rgba(245, 158, 11, 0.3);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timer-section:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(245, 158, 11, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.timer-section .value {
    color: #10b981;
    font-weight: 900;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.timer-section .separator {
    color: #f59e0b;
    font-weight: 900;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0 5px;
}

.timer-section .total {
    color: #f59e0b;
    font-weight: 900;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.start-date {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.1));
    padding: 20px 35px;
    border-radius: 20px;
    border: 2px solid rgba(245, 158, 11, 0.3);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.start-date:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(245, 158, 11, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.start-date .value {
    color: #f59e0b;
    font-weight: 900;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.label {
    color: var(--text-secondary);
    margin-right: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolios-comparison {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    align-items: start;
}

.portfolio {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.portfolio-header {
    padding: 25px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(234, 88, 12, 0.08));
    border-bottom: 1px solid var(--border-color);
}

.portfolio-header h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.portfolio-icon {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.portfolio-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.stat-item .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-align: center;
}

.stat-item .value {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
}

.stat-item .value.positive {
    color: var(--positive);
}

.stat-item .value.negative {
    color: var(--negative);
}

/* Current Value specific colors */
.stat-item .value#easy-total.positive,
.stat-item .value#clemente-total.positive {
    color: #10b981;
    font-weight: 900;
}

.stat-item .value#easy-total.negative,
.stat-item .value#clemente-total.negative {
    color: #ef4444;
    font-weight: 900;
}

.token-list {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.token-item {
    background: var(--bg-hover);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
}

.token-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.token-logo {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.token-details {
    display: flex;
    flex-direction: column;
}

.token-symbol {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

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

.token-value {
    text-align: right;
}

.token-price {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.token-change {
    font-size: 0.9rem;
}

.token-change.positive {
    color: var(--positive);
}

.token-change.negative {
    color: var(--negative);
}

.vs-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.vs-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.performance-indicator {
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 140px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.performance-indicator span {
    display: block;
}

#leader-name {
    font-weight: 800;
    color: #f59e0b;
    margin-bottom: 5px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

#leader-percentage {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--positive);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Flying Easy Animation */
.flying-easy {
    position: fixed;
    top: 50%;
    left: -250px;
    width: 180px;
    height: auto;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
}

.flying-easy img {
    width: 100%;
    height: auto;
}

.flying-easy.animate {
    animation: flyAcross 4s ease-in-out;
}

@keyframes flyAcross {
    0% {
        left: -250px;
        transform: translateY(-50%) rotate(-10deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateY(-60%) rotate(5deg);
    }
    90% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 250px);
        transform: translateY(-50%) rotate(-5deg);
        opacity: 0;
    }
}

/* Flying Clemente Animation */
.flying-clemente {
    position: fixed;
    top: 65%;
    right: -250px;
    width: 180px;
    height: auto;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
}

.flying-clemente img {
    width: 100%;
    height: auto;
}

.flying-clemente.animate {
    animation: flyAcrossReverse 4s ease-in-out;
}

@keyframes flyAcrossReverse {
    0% {
        right: -250px;
        transform: translateY(-50%) rotate(10deg) scaleX(-1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateY(-40%) rotate(-5deg) scaleX(-1);
    }
    90% {
        opacity: 1;
    }
    100% {
        right: calc(100% + 250px);
        transform: translateY(-50%) rotate(5deg) scaleX(-1);
        opacity: 0;
    }
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    margin-left: 20px;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.status-indicator.winning {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: 2px solid #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    animation: winningPulse 1.5s infinite;
}

.status-indicator.winning::before {
    content: "🏆 ";
    font-size: 1.2rem;
}

.status-indicator.losing {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    border: 2px solid #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
    animation: losingShake 3s infinite;
}

.status-indicator.losing::before {
    content: "😤 ";
    font-size: 1.2rem;
}

.status-indicator.tied {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #ffffff;
    border: 2px solid #94a3b8;
    box-shadow: 0 0 10px rgba(148, 163, 184, 0.3);
}

.status-indicator.tied::before {
    content: "🤝 ";
    font-size: 1.2rem;
}

@keyframes winningPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
    }
}

@keyframes losingShake {
    0%, 100% {
        transform: translateX(0);
    }
    10% {
        transform: translateX(-2px);
    }
    20% {
        transform: translateX(2px);
    }
    30% {
        transform: translateX(-2px);
    }
    40% {
        transform: translateX(2px);
    }
    50% {
        transform: translateX(0);
    }
}

/* Voting Section */
.voting-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    margin-top: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.voting-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.voting-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.voting-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
}

.vote-option {
    text-align: center;
    padding: 30px;
    background: var(--bg-hover);
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.vote-option:hover {
    transform: translateY(-5px);
}

.vote-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.vote-option h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.vote-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.vote-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
}

.vote-count {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
}

.vote-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 200px;
}

.vote-bar-container {
    position: relative;
    height: 40px;
    background: var(--bg-hover);
    border-radius: 20px;
    overflow: hidden;
}

.vote-bar {
    height: 100%;
    transition: width 0.5s ease;
    min-width: 0;
}

.easy-bar {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    float: left;
}

.clemente-bar {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    float: right;
}

.vote-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.total-votes {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.modal h3 {
    margin-bottom: 25px;
    color: var(--text-primary);
}

.token-form {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.token-form input {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

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

#token-list-modal {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

#token-list-modal h4 {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

#current-tokens {
    max-height: 200px;
    overflow-y: auto;
}

.token-entry {
    background: var(--bg-hover);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.token-entry button {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .portfolios-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .vs-divider {
        flex-direction: row;
        padding: 20px 0;
    }
    
    .voting-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .vote-results {
        order: 3;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    header::before {
        width: 85px;
        height: 85px;
        left: 5px;
    }
    
    header::after {
        width: 85px;
        height: 85px;
        right: 5px;
        transform: translateY(-50%) scaleX(-1);
    }
    
    header h1 {
        font-size: 2rem;
        letter-spacing: 1px;
        margin-bottom: 15px;
    }
    
    .challenge-info {
        flex-direction: row;
        gap: 10px;
        font-size: 1rem;
    }
    
    .timer-section,
    .start-date {
        padding: 12px 15px;
        border-radius: 15px;
    }
    
    .timer-section .value,
    .timer-section .separator,
    .timer-section .total,
    .start-date .value {
        font-size: 1.2rem;
    }
    
    .label {
        font-size: 0.75rem;
        display: block;
        margin-bottom: 2px;
    }
    
    .portfolios-comparison {
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .portfolio {
        min-height: auto;
    }
    
    .portfolio-header {
        padding: 15px;
    }
    
    .portfolio-header h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
        justify-content: center;
    }
    
    .portfolio-icon {
        width: 50px;
        height: 50px;
    }
    
    .portfolio-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-item {
        padding: 8px;
    }
    
    .stat-item .label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }
    
    .stat-item .value {
        font-size: 0.95rem;
    }
    
    .token-list {
        padding: 10px;
    }
    
    .token-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .token-logo {
        width: 30px;
        height: 30px;
    }
    
    .token-symbol {
        font-size: 1rem;
    }
    
    .token-amount {
        font-size: 0.8rem;
    }
    
    .token-price {
        font-size: 1rem;
    }
    
    .token-change {
        font-size: 0.85rem;
    }
    
    .vs-divider {
        padding: 15px 0;
    }
    
    .vs-circle {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    .performance-indicator {
        padding: 10px 20px;
        min-width: 120px;
    }
    
    #leader-name {
        font-size: 0.85rem;
    }
    
    #leader-percentage {
        font-size: 1.2rem;
    }
    
    .controls {
        margin-bottom: 20px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .voting-section {
        padding: 20px;
        margin-top: 20px;
    }
    
    .voting-section h2 {
        font-size: 1.5rem;
    }
    
    .voting-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .voting-container {
        gap: 15px;
    }
    
    .vote-option {
        padding: 20px;
    }
    
    .vote-avatar {
        width: 70px;
        height: 70px;
    }
    
    .vote-option h3 {
        font-size: 1.3rem;
    }
    
    .vote-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .vote-count {
        font-size: 1rem;
    }
}