body {
    font-family: 'Fira Code', 'Courier New', monospace;
    background: #0d0d0d;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Ensure proper icon display */
.info-icon, .btn-icon {
    font-family: 'Arial Unicode MS', 'Segoe UI Symbol', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

.container {
    max-width: 1000px;
    margin: 60px auto;
    background: rgba(15, 15, 15, 0.95);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.3), 0 0 100px rgba(0, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 255, 255, 0.03) 0,
        rgba(0, 255, 255, 0.03) 2px,
        transparent 2px,
        transparent 20px
    );
    animation: rotateBg 80s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg) translate(0,0);}
    100% { transform: rotate(360deg) translate(0,0);}
}

#stage-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 25px;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff, 0 0 12px #00ffff;
    animation: titleGlitch 1.5s infinite;
}

@keyframes titleGlitch {
    0%, 100% { text-shadow: 0 0 5px #00ffff, 0 0 12px #00ffff; }
    25% { text-shadow: -2px 0 #ff00ff, 2px 0 #00ffff; }
    50% { text-shadow: 2px 2px #ff00ff, -2px -2px #00ffff; }
    75% { text-shadow: -1px 2px #00ffcc, 1px -1px #ff00ff; }
}

textarea#stage-artifact {
    width: 100%;
    height: 300px;
    background: #111;
    color: #00ffcc;
    border: none;
    padding: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 15px;
    line-height: 1.6;
    border-radius: 12px;
    resize: none;
    margin-bottom: 25px;
    box-shadow: inset 0 0 12px rgba(0,255,255,0.2);
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

textarea#stage-artifact::selection {
    background: rgba(0,255,255,0.3);
}

.input-area {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

input#token-input {
    flex: 1;
    padding: 14px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    background: #111;
    color: #00ffcc;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.3) inset;
    transition: all 0.3s ease;
}

input#token-input:focus {
    outline: none;
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.7), 0 0 45px rgba(0, 255, 255, 0.4) inset;
}

button#submit-btn {
    padding: 14px 28px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    color: #111;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button#submit-btn:hover {
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    box-shadow: 0 0 25px #00ffff, 0 0 35px #ff00ff;
}

#feedback {
    margin-top: 18px;
    font-weight: bold;
    font-size: 16px;
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
}

#progress {
    margin-top: 18px;
    font-size: 14px;
    color: #00ffff;
}

textarea#stage-artifact::-webkit-scrollbar {
    width: 12px;
}
textarea#stage-artifact::-webkit-scrollbar-thumb {
    background: rgba(0,255,255,0.5);
    border-radius: 6px;
}
textarea#stage-artifact::-webkit-scrollbar-track {
    background: #111;
}

.vm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 25px 0;
    font-family: 'Fira Code', monospace;
    color: #00ffcc;
}

.vm-table th, .vm-table td {
    border: 1px solid #00ffff;
    padding: 8px 12px;
    text-align: center;
}

.vm-table th {
    background: rgba(0,255,255,0.1);
    color: #00ffff;
}

.vm-table tr:nth-child(even) {
    background: rgba(0,255,255,0.05);
}

.congrats-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: radial-gradient(circle at center, #111 0%, #000 100%);
    color: #00ffff;
    text-align: center;
    overflow: hidden;
}

.congrats-container {
    background: rgba(20, 20, 20, 0.9);
    padding: 60px;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0,255,255,0.5), 0 0 80px rgba(255,0,255,0.2);
    animation: fadeInUp 1.2s ease forwards;
}

.congrats-container h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #ff00ff;
    animation: pulse 2s infinite;
}

.congrats-container p {
    font-size: 1.2rem;
    margin: 15px 0;
}

.congrats-container .shine span {
    background: linear-gradient(90deg, #00ffff, #ff00ff, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shineMove 3s linear infinite;
    font-weight: bold;
}

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

.congrats-container button {
    margin-top: 30px;
    padding: 14px 32px;
    font-size: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    color: #111;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.congrats-container button:hover {
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    box-shadow: 0 0 25px #00ffff, 0 0 35px #ff00ff;
}

@keyframes pulse {
    0% { text-shadow: 0 0 8px #00ffff, 0 0 20px #ff00ff; }
    50% { text-shadow: 0 0 20px #00ffff, 0 0 40px #ff00ff; }
    100% { text-shadow: 0 0 8px #00ffff, 0 0 20px #ff00ff; }
}

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

/* Team Form Styles */
.team-form-container {
    text-align: center;
    padding: 60px 40px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.team-form-header {
    margin-bottom: 50px;
}

.team-form-container h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff;
    animation: titleGlitch 2s infinite;
    letter-spacing: 2px;
}

.subtitle {
    position: relative;
    margin-bottom: 25px;
}

.subtitle-text {
    font-size: 1.4rem;
    color: #ff00ff;
    text-shadow: 0 0 8px #ff00ff;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.subtitle-line {
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ffff, transparent);
    margin: 10px auto;
    animation: lineGlow 2s ease-in-out infinite alternate;
}

@keyframes lineGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.team-form-description {
    font-size: 1.1rem;
    color: #b0b0b0;
    line-height: 1.6;
    margin: 0;
    font-weight: 300;
}

.team-form-body {
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 30px;
    text-align: center;
}

.input-label {
    display: block;
    color: #00ffcc;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 500;
    text-shadow: 0 0 5px #00ffcc;
    text-align: center;
}

.input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

#team-name-input {
    padding: 18px 25px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    font-size: 18px;
    background: rgba(0, 0, 0, 0.7);
    color: #00ffcc;
    font-family: 'Fira Code', monospace;
    transition: all 0.4s ease;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1) inset;
    backdrop-filter: blur(10px);
}

#team-name-input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4), 0 0 60px rgba(0, 255, 255, 0.2) inset;
    transform: translateY(-2px);
}

#team-name-input::placeholder {
    color: rgba(0, 255, 204, 0.5);
    font-style: italic;
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#team-name-input:focus + .input-glow {
    opacity: 1;
    animation: inputPulse 2s ease-in-out infinite;
}

@keyframes inputPulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.3; }
}

.start-btn {
    position: relative;
    padding: 18px 40px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
    background-size: 200% 200%;
    color: #111;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.4s ease;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: gradientShift 3s ease-in-out infinite;
}

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

.start-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.4), 0 0 50px rgba(255, 0, 255, 0.3);
}

.start-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-text {
    position: relative;
    z-index: 2;
    margin-right: 10px;
}

.btn-icon {
    position: relative;
    z-index: 2;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.start-btn:hover .btn-glow {
    left: 100%;
}

.team-feedback {
    margin-top: 20px;
    font-weight: bold;
    font-size: 16px;
    color: #ff00ff;
    text-shadow: 0 0 8px #ff00ff;
    min-height: 24px;
    animation: feedbackPulse 0.5s ease-in-out;
}

@keyframes feedbackPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.team-form-footer {
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    padding-top: 30px;
}

.challenge-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00ffcc;
    font-size: 14px;
    font-weight: 500;
}

.info-icon {
    font-size: 18px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 8px #00ffcc, 0 0 15px #00ffcc;
    filter: drop-shadow(0 0 5px #00ffcc);
}

.info-text {
    text-shadow: 0 0 5px #00ffcc;
}

@media (max-width: 768px) {
    .team-form-container {
        padding: 40px 20px;
    }
    
    .team-form-container h1 {
        font-size: 2.8rem;
    }
    
    .challenge-info {
        gap: 20px;
    }
    
    .info-item {
        font-size: 12px;
    }
}

#team-display {
    font-size: 1.1rem;
    color: #00ffff;
    margin-bottom: 20px;
    text-shadow: 0 0 5px #00ffff;
}

#team-display span {
    font-weight: bold;
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
}

.leaderboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

#refresh-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    color: #111;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#refresh-btn:hover {
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    box-shadow: 0 0 15px #00ffff;
}

#last-updated {
    color: #00ffcc;
    font-size: 14px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: 'Fira Code', monospace;
    color: #00ffcc;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.leaderboard-table th {
    background: rgba(0, 255, 255, 0.2);
    color: #00ffff;
    padding: 15px 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #00ffff;
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.leaderboard-table tr:hover {
    background: rgba(0, 255, 255, 0.05);
}

.leaderboard-table tr.first-place {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
    border-left: 4px solid #ffd700;
}

.leaderboard-table tr.second-place {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
    border-left: 4px solid #c0c0c0;
}

.leaderboard-table tr.third-place {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
    border-left: 4px solid #cd7f32;
}

.rank {
    font-weight: bold;
    text-align: center;
    width: 60px;
}

.team-name {
    font-weight: bold;
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
}

.stage {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
    font-weight: bold;
}

.last-update, .start-time {
    color: #00ffcc;
    font-size: 14px;
}

.progress-log-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.progress-log-section h2 {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
    margin-bottom: 20px;
}

.log-entry {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin: 5px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid #00ffff;
    font-family: 'Fira Code', monospace;
    gap: 20px;
}

.log-time {
    color: #00ffcc;
    font-size: 12px;
    min-width: 150px;
}

.log-team {
    color: #ff00ff;
    font-weight: bold;
    min-width: 150px;
}

.log-action {
    color: #00ffff;
    flex: 1;
    text-align: right;
    margin-left: auto;
}

#loading, #progress-log-loading {
    text-align: center;
    color: #00ffff;
    font-size: 18px;
    padding: 40px;
}

#no-teams {
    text-align: center;
    color: #e0e0e0;
    font-size: 18px;
    padding: 40px;
}

.winner-row {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1)) !important;
    border-left: 6px solid #ffd700 !important;
    animation: winnerGlow 2s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
    0% { 
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
        border-left-color: #ffd700;
    }
    100% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
        border-left-color: #ffed4e;
    }
}

.winner-status {
    color: #ffd700 !important;
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700 !important;
    font-weight: bold !important;
    font-size: 18px !important;
    animation: winnerPulse 1.5s ease-in-out infinite alternate;
}

@keyframes winnerPulse {
    0% { 
        text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700;
        transform: scale(1);
    }
    100% { 
        text-shadow: 0 0 15px #ffd700, 0 0 30px #ffd700, 0 0 40px #ffd700;
        transform: scale(1.05);
    }
}

.winner-log-entry {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(0, 0, 0, 0.3)) !important;
    border-left: 4px solid #ffd700 !important;
    animation: winnerLogGlow 2s ease-in-out infinite alternate;
}

@keyframes winnerLogGlow {
    0% { 
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
    }
    100% { 
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
}

.winner-log-entry .log-action {
    color: #ffd700 !important;
    text-shadow: 0 0 5px #ffd700 !important;
    font-weight: bold !important;
}
