/* ── Ended Banner ── */
.ms-ended-bar {
background: var(--accent);
color: #fff;
text-align: center;
padding: 10px 20px;
font-size: 13px;
font-weight: 600;
position: sticky;
top: 64px;
z-index: 30;
}

/* ── Breadcrumb ── */
.ms-breadcrumb {
background: var(--brand);
padding: 8px 20px;
position: sticky;
top: 64px;
z-index: 20;
}

.ms-breadcrumb__inner {
max-width: 1200px;
margin: 0 auto;
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
color: #9db8d8;
}

.ms-breadcrumb a { color: #c8d8f0; text-decoration: none; }
.ms-breadcrumb a:hover { color: #fff; }
.ms-breadcrumb i { font-size: 8px; color: #5a7a9a; }

/* ── Hero Banner ── */
.ms-hero-banner {
position: relative;
height: 50vh;
min-height: 320px;
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
background-position: center;
}

.ms-hero-banner::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(0deg, rgba(11,20,38,0.85) 0%, rgba(11,20,38,0.3) 100%);
z-index: 1;
}

.ms-hero-banner__content {
position: relative;
z-index: 2;
text-align: center;
color: #fff;
max-width: 700px;
padding: 0 20px;
}

.ms-hero-banner__title {
font-size: clamp(28px, 4vw, 44px);
font-weight: 700;
margin-bottom: 8px;
}

.ms-hero-banner__sub {
font-size: 15px;
color: #c8d8f0;
}

/* ── Layout ── */
.ms-layout {
max-width: 1200px;
margin: 0 auto;
padding: 32px 20px;
display: grid;
grid-template-columns: 1fr;
gap: 32px;
}

@media (min-width: 1024px) {
.ms-layout { grid-template-columns: 1fr 340px; }
}

/* ── Description Card ── */
.ms-content-card {
background: var(--white);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
}

.ms-content-card__img {
width: 100%;
max-height: 400px;
object-fit: cover;
object-position: top;
}

.ms-content-card__body {
padding: 24px;
}

.ms-content-card__body h2 { font-size: 18px; font-weight: 600; margin: 20px 0 10px; color: var(--text); }
.ms-content-card__body h2:first-child { margin-top: 0; }
.ms-content-card__body h3 { font-size: 16px; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
.ms-content-card__body ul, .ms-content-card__body ol { padding-left: 20px; margin-bottom: 12px; }
.ms-content-card__body li { margin-bottom: 4px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.ms-content-card__body p { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }

/* ── Registration Alert ── */
.ms-alert {
border-radius: var(--radius-lg);
padding: 20px 24px;
text-align: center;
margin-bottom: 24px;
border: 1px solid;
}

.ms-alert--warning {
background: #fffbeb;
border-color: #fde68a;
color: #92400e;
}

.ms-alert--success {
background: #f0fdf4;
border-color: #bbf7d0;
color: #166534;
}

.ms-alert__title { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.ms-alert__text { font-size: 14px; margin-bottom: 4px; }
.ms-alert__date { font-size: 13px; font-weight: 500; margin-top: 12px; }

.ms-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 24px;
border-radius: 100px;
font-family: 'Sora', sans-serif;
font-size: 14px;
font-weight: 600;
text-decoration: none;
transition: all 0.2s;
cursor: pointer;
border: none;
}

.ms-btn--accent { background: var(--accent); color: #fff; }
.ms-btn--accent:hover { background: #c73030; }
.ms-btn--brand { background: var(--brand); color: #fff; }
.ms-btn--brand:hover { background: #142f58; }

/* ── Search ── */
.ms-search-box {
background: var(--white);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 16px;
margin-bottom: 5px;
display: flex;
gap: 8px;
flex-wrap: wrap;
}

.ms-search-box__input-wrap {
flex: 1;
min-width: 200px;
position: relative;
}

.ms-search-box__input-wrap i {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: var(--muted);
font-size: 14px;
}

.ms-search-box__input {
width: 100%;
padding: 10px 12px 10px 36px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
font-family: 'DM Sans', sans-serif;
font-size: 14px;
color: var(--text);
outline: none;
}

.ms-search-box__input:focus { border-color: var(--brand); }

.ms-autocomplete {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: #fff;
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: 0 8px 24px rgba(0,0,0,0.1);
max-height: 240px;
overflow-y: auto;
z-index: 20;
display: none;
}

.ms-autocomplete.active { display: block; }

.ms-autocomplete__item {
padding: 10px 14px;
font-size: 13px;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--surface);
}

.ms-autocomplete__item:last-child { border-bottom: none; }
.ms-autocomplete__item:hover { background: var(--brand-light); }

.ms-autocomplete__name { font-weight: 500; color: var(--text); }
.ms-autocomplete__votes { font-size: 11px; color: var(--muted); }

/* ── Section Head ── */
.ms-section-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
margin-bottom: 20px;
gap: 12px;
flex-wrap: wrap;
}

.ms-section-head h2 { font-size: 22px; font-weight: 700; }

/* ── Contestants Grid ── */
.ms-contestants-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 16px;
}

/* ── Contestant Card ── */
.ms-contestant-card {
background: var(--white);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
transition: box-shadow 0.2s, transform 0.2s;
text-decoration: none;
color: inherit;
display: flex;
flex-direction: column;
}

.ms-contestant-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.10); transform: translateY(-2px); }

.ms-contestant-card__img-wrap {
position: relative;
aspect-ratio: 3/4;
max-height: 320px;
background: var(--surface);
overflow: hidden;
}

.ms-contestant-card__img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: top;
opacity: 0;
transition: opacity 0.35s ease;
cursor: pointer;
}

.ms-contestant-card__img.ms-loaded { opacity: 1; }

.ms-contestant-card__skeleton {
position: absolute;
inset: 0;
background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: ms-shimmer 1.4s infinite;
}

@keyframes ms-shimmer {
0%   { background-position: 200% 0; }
100% { background-position: -200% 0; }
}

.ms-contestant-card__position {
position: absolute;
top: 10px;
left: 10px;
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-family: 'Sora', sans-serif;
font-size: 15px;
font-weight: 700;
}

.ms-contestant-card__position--gold { background: var(--gold); color: #3a2a00; }
.ms-contestant-card__position--silver { background: #cbd5e1; color: #334155; }
.ms-contestant-card__position--bronze { background: #f59e0b; color: #78350f; }
.ms-contestant-card__position--default { background: var(--brand); color: #fff; }

.ms-contestant-card__votes {
position: absolute;
top: 10px;
right: 10px;
background: rgba(255,255,255,0.92);
color: var(--text);
font-size: 11px;
font-weight: 600;
padding: 3px 8px;
border-radius: 100px;
}

.ms-contestant-card__body {
padding: 14px;
flex: 1;
display: flex;
flex-direction: column;
gap: 6px;
}

.ms-contestant-card__name {
font-family: 'Sora', sans-serif;
font-size: 15px;
font-weight: 600;
}

.ms-contestant-card__progress-text {
font-size: 11px;
color: var(--muted);
display: flex;
align-items: center;
gap: 4px;
}

.ms-contestant-card__bar {
width: 100%;
height: 3px;
background: var(--surface);
border-radius: 2px;
overflow: hidden;
}

.ms-contestant-card__bar-fill {
height: 100%;
background: var(--brand);
border-radius: 2px;
transition: width 0.5s ease;
}

.ms-contestant-card__action {
margin-top: auto;
padding-top: 10px;
}

.ms-contestant-card__cta {
display: inline-flex;
align-items: center;
gap: 4px;
background: var(--accent);
color: #fff;
font-size: 12px;
font-weight: 600;
padding: 7px 16px;
border-radius: 100px;
text-decoration: none;
transition: background 0.15s;
width: 100%;
justify-content: center;
}

.ms-contestant-card__cta:hover { background: #c73030; }
.ms-contestant-card__cta--disabled {
background: #d1d5db;
color: #6b7280;
cursor: not-allowed;
pointer-events: none;
}

/* ── Sidebar ── */
.ms-sidebar-card {
background: var(--white);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 20px;
margin-bottom: 16px;
}

.ms-sidebar-card h2 {
font-family: 'Sora', sans-serif;
font-size: 18px;
font-weight: 700;
margin-bottom: 12px;
}

.ms-sidebar-stat {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid var(--surface);
font-size: 13px;
}

.ms-sidebar-stat:last-child { border-bottom: none; }
.ms-sidebar-stat__label { color: var(--muted); }
.ms-sidebar-stat__value { font-weight: 600; }

/* ── Modal ── */
.ms-modal {
display: none;
position: fixed;
inset: 0;
background: rgba(0,0,0,0.9);
z-index: 1000;
justify-content: center;
align-items: center;
backdrop-filter: blur(5px);
}

.ms-modal.active { display: flex; }

.ms-modal__img {
max-width: 90%;
max-height: 85vh;
border-radius: var(--radius-lg);
opacity: 0;
transition: opacity 0.3s ease;
}

.ms-modal__img.loaded { opacity: 1; }

.ms-modal__close {
position: absolute;
top: 16px;
right: 16px;
background: rgba(255,255,255,0.15);
color: #fff;
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 18px;
transition: background 0.2s;
border: none;
}

.ms-modal__close:hover { background: rgba(255,255,255,0.25); }

.ms-modal__caption {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
color: #fff;
text-align: center;
}

.ms-modal__caption h3 { font-family: 'Sora', sans-serif; font-size: 18px; margin-bottom: 2px; }
.ms-modal__caption p { font-size: 13px; opacity: 0.8; }

.ms-modal__spinner {
position: absolute;
color: #fff;
font-size: 40px;
animation: ms-spin 1s linear infinite;
}

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

/* ── View All CTA ── */
.ms-view-all-cta {
text-align: center;
margin-top: 24px;
}

.ms-empty {
grid-column: 1 / -1;
text-align: center;
padding: 48px 20px;
background: var(--surface);
border-radius: var(--radius-xl);
border: 1px dashed var(--border);
}

.ms-empty i { font-size: 40px; color: #cbd5e1; margin-bottom: 12px; display: block; }
.ms-empty h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.ms-empty p { color: var(--muted); font-size: 13px; }

@media (max-width: 768px) {
.ms-hero-banner { min-height: 240px; }
.ms-layout { padding: 20px 12px; }
.ms-contestants-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ms-contestant-card__body { padding: 10px; }
.ms-contestant-card__name { font-size: 13px; }
}