* {
    box-sizing: border-box;
}

body {
    background: url("/images/pattern.svg") #E7E8F0;
    background-size: 200px;
    background-position: center center;
    color: #333;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 50px 0 0;
}

iframe {
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    display: block;
    border: none;
}

#container {
    margin: auto;
    left: 0;
    right: 0;
    position: relative;
    display: inline-block;
}

#rules {
    text-align: left;
}

a {
    text-decoration: none;
    color: #ef3257;
}

a:hover {
    border-bottom: solid #ef3257 1px;
}

#wrapper {
    width: 100%;
    max-width: 800px;
    margin: auto;
    left: 0;
    right: 0;
}

.card-header {
    background-color: #fff;
    margin: 0;
    border-bottom: 1px solid #999;
    color: #444;
    font-weight: bold;
    text-align: center;
    font-size: 22px;
    padding: 60px 20px 14px 14px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.card-header-small {
    background-color: #fff;
    margin: 0;
    border-bottom: 1px solid #999;
    color: #444;
    padding: 14px 20px 14px 14px;
    font-weight: bold;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.card-content {
    background-color: #fff;
    color: #333;
    margin: 0;
    padding: 16px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.card-container.error .card-content {
    margin-bottom: 80px;
    background-color: #F8E4E8;
    color: #F03157;
}

.card-container {
    background-color: #fff;
    border-radius: 10px;
    margin: 10px;
    position: relative;
    top: 10px;
    padding-bottom: 0px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

.card-avatar {
    width: 100px;
    border-radius: 100%;
    border: 5px solid #fff;
    display: block;
    margin: auto;
    left: 0;
    right: 0;
    position: absolute;
    top: -50px;
}

footer {
    background-color: #fff;
    color: #333;
    padding: 10px 0;
    text-align: center;
    margin-top: 20px;
    clear: both;
    position: relative;
    z-index: 10;
    border-top: 1px solid #ddd;
}

.footer-content {
    max-width: 800px;
    margin: auto;
    padding: 5px;
}

/* Challenge Timeline Progress Bar */

#challenge-progress-section {
    background-color: #fff;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 20px 24px 24px;
}

.challenge-status-banner {
    background-color: #fef0f3;
    border: 1px solid #ef3257;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #ef3257;
    text-align: center;
    line-height: 1.5;
}

/* padding-top centres the 16px dots vertically on the 6px track:
   (16 - 6) / 2 = 5px. Milestones use top:0 which lands in this zone. */
.challenge-timeline {
    position: relative;
    padding-top: 5px;
    padding-bottom: 28px;
}

.timeline-track {
    height: 6px;
    background-color: #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.timeline-fill {
    height: 100%;
    width: 0%;
    background-color: #ef3257;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* All three milestones are absolutely positioned within .challenge-timeline.
   margin-left centres each 16px dot exactly on its tick point:
     start    →  0%  , no offset (flush left)
     end      → 80%  , shift left 8px (half dot)
     selection → 100%, shift left 16px (full dot, flush right) */
.timeline-milestone {
    position: absolute;
    top: 0;
    width: 16px;
}

#milestone-start {
    left: 0%;
    margin-left: 0;
}

#milestone-end {
    left: 80%;
    margin-left: -8px;
}

#milestone-selection {
    left: 100%;
    margin-left: -16px;
}

.milestone-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #fff;
    border: 3px solid #ef3257;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.milestone-label {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    color: #999;
    text-align: center;
}

#milestone-start .milestone-label {
    left: 0;
    transform: none;
}

#milestone-selection .milestone-label {
    left: auto;
    right: 0;
    transform: none;
}