/* Competition presentation uses the shared Smart Student brand tokens. */
.competition-entry-page,
.competition-dashboard {
    width: min(100%, 1160px);
    margin: 20px auto;
    padding-inline: 14px;
    color: var(--student-text);
}

.competition-entry-page {
    position: relative;
    isolation: isolate;
    max-width: 1280px;
    min-height: calc(100vh - 150px);
    padding-top: clamp(18px, 3vw, 36px);
    padding-bottom: clamp(30px, 5vw, 58px);
    background: radial-gradient(ellipse at 92% 4%, rgba(165, 28, 98, .055), transparent 31%),
                radial-gradient(ellipse at 5% 30%, rgba(46, 139, 87, .045), transparent 28%);
}

.competition-landing-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(18px, 3vw, 30px) 18px 24px;
    margin: 0 auto 20px;
    text-align: center;
}
.competition-entry-logos { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 30px); margin-bottom: 14px; }
.competition-entry-logos img { width: auto; height: 76px; max-width: 28%; object-fit: contain; }
.competition-entry-logos img.is-school { height: 96px; }
.competition-landing-hero > .competition-hero-mark { margin-bottom: 9px; }
.competition-welcome { margin: 0 0 4px; color: var(--student-muted); font-size: .95rem; font-weight: 800; }
.competition-landing-hero h1 { margin: 0; color: var(--student-text); font-size: clamp(1.55rem, 3.5vw, 2.25rem); font-weight: 950; line-height: 1.4; }
.competition-landing-copy { max-width: 620px; margin: 6px 0 0; color: var(--student-muted); font-size: clamp(.95rem, 1.5vw, 1.08rem); line-height: 1.8; }
.competition-entry-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.competition-entry-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: #fff; color: var(--student-muted); font-size: .83rem; font-weight: 800; box-shadow: 0 3px 12px rgba(50,38,53,.045); }
.competition-entry-meta i { color: var(--student-primary); }
.competition-landing-section { max-width: 1160px; margin: 0 auto; }
.competition-landing-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.competition-landing-section-heading h2 { margin: 2px 0 0; color: var(--student-text); font-size: clamp(1.2rem, 2.5vw, 1.55rem); font-weight: 950; }
.competition-section-kicker { color: var(--student-primary); font-size: .8rem; font-weight: 900; }
.competition-count { padding: 6px 11px; border-radius: 999px; background: var(--student-primary-soft); color: var(--student-primary); font-size: .78rem; font-weight: 850; white-space: nowrap; }
.competition-entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.competition-entry-card,
.competition-list-card,
.competition-panel {
    border: 1px solid var(--student-border) !important;
    border-radius: 22px !important;
    background: #fff !important;
    box-shadow: 0 10px 28px rgba(50, 38, 53, .055) !important;
}
.competition-entry-card { max-width: 600px; padding: clamp(20px, 4vw, 34px) !important; }
.competition-list-card { position: relative; height: 100%; overflow: hidden; border-radius: 24px !important; color: var(--student-text) !important; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.competition-list-card::before { position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--student-primary), var(--student-blue), var(--student-green)); content: ''; }
.competition-list-card:hover { transform: translateY(-3px); border-color: rgba(165, 28, 98, .25) !important; box-shadow: 0 14px 32px rgba(50, 38, 53, .09) !important; }
.competition-list-card .card-body { display: flex; flex-direction: column; padding: clamp(17px, 2vw, 23px); }
.competition-list-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.competition-card-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 16px; background: var(--student-primary-soft); color: var(--student-primary); font-size: 1.25rem; }
.competition-card-availability { color: var(--student-green); font-size: .75rem; font-weight: 850; }
.competition-card-availability i { font-size: .48rem; }
.competition-list-card h3 { margin: 0 0 7px; color: var(--student-text); font-size: 1.1rem; font-weight: 950; line-height: 1.55; overflow-wrap: anywhere; }
.competition-card-subject { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; color: var(--student-muted); font-size: .86rem; font-weight: 750; }
.competition-card-subject i { color: var(--student-blue); }
.competition-card-details { display: grid; gap: 8px; margin-top: 15px; }
.competition-card-details span { display: flex; min-width: 0; align-items: flex-start; gap: 7px; color: var(--student-muted); font-size: .81rem; line-height: 1.6; overflow-wrap: anywhere; }
.competition-card-details i { flex: 0 0 auto; margin-top: 3px; color: var(--student-warning); }
.competition-card-current-day { margin-top: 13px; color: var(--student-primary); font-size: .84rem; font-weight: 900; }
.competition-list-card .competition-cta { width: 100%; min-height: 48px; margin-top: 16px; }
.competition-empty-state { padding: clamp(25px, 5vw, 45px); border: 1px solid var(--student-border); border-radius: 24px; background: #fff; text-align: center; box-shadow: 0 8px 25px rgba(50,38,53,.045); }
.competition-empty-icon { display: grid; width: 56px; height: 56px; place-items: center; margin: 0 auto 12px; border-radius: 19px; background: var(--student-primary-soft); color: var(--student-primary); font-size: 1.5rem; }
.competition-empty-state h3 { margin: 0 0 5px; color: var(--student-text); font-size: 1.1rem; font-weight: 900; }
.competition-empty-state p { margin: 0; color: var(--student-muted); }
.competition-entry-card .form-control { min-height: 56px; border-color: var(--student-border); border-radius: 14px; }
.competition-entry-card .btn-success { min-height: 56px; font-weight: 900; }
.competition-restore-status { padding: 13px; border-radius: 14px; background: var(--student-blue-soft); color: var(--student-blue); text-align: center; font-weight: 800; }
.competition-entry-page .btn-primary,
.competition-entry-page .btn-success { background: var(--student-primary) !important; border-color: var(--student-primary) !important; color: #fff !important; }
.competition-entry-page .btn-primary:hover,
.competition-entry-page .btn-success:hover { background: #821548 !important; border-color: #821548 !important; }
.competition-entry-page .alert-success { background: var(--student-green-soft); border-color: rgba(46, 139, 87, .14); color: #236b43; }

.competition-dashboard { max-width: 1240px; padding-bottom: 24px; }
.competition-switcher { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.competition-switcher-label { color: var(--student-muted); font-weight: 850; }
.competition-switcher .btn { min-height: 42px; border-radius: 999px; font-weight: 800; }
.competition-switcher .btn-outline-secondary { color: var(--student-muted); border-color: var(--student-border); }
.competition-switcher .btn-outline-secondary:hover { color: var(--student-primary); border-color: var(--student-primary); background: var(--student-primary-soft); }

.competition-grade-filter {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(165, 28, 98, .12);
    border-radius: 18px;
    margin: 0 0 18px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(50, 38, 53, .045);
    text-align: right;
}
.competition-grade-filter label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--student-text); font-weight: 900; }
.competition-grade-filter label i { color: var(--student-primary); }
.competition-grade-filter-controls { display: flex; align-items: center; gap: 10px; }
.competition-grade-filter .form-select { min-height: 52px; border-color: var(--student-border); border-radius: 13px; color: var(--student-text); font-weight: 750; }
.competition-grade-filter .btn { min-height: 52px; flex: 0 0 auto; border-radius: 13px; font-weight: 900; }
.competition-grade-filter .competition-count { justify-self: start; }

.competition-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(165, 28, 98, .12);
    border-radius: 26px;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(50, 38, 53, .075);
}
.competition-hero::before { content: ''; position: absolute; inset: 0 0 0 auto; width: 6px; background: var(--student-primary); }
.competition-hero-inner { padding: clamp(20px, 3.5vw, 38px); }
.competition-hero-title-row { display: flex; align-items: flex-start; gap: 14px; }
.competition-hero-title-row > div { min-width: 0; }
.competition-hero-mark { display: grid; flex: 0 0 54px; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: var(--student-primary-soft); color: var(--student-primary); font-size: 1.55rem; }
.competition-hero h1 { margin: 0; color: var(--student-text); font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 950; line-height: 1.4; }
.competition-hero-description { margin: 8px 0 18px; color: var(--student-muted); line-height: 1.8; }
.competition-hero-supervisor { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 5px 14px; border-radius: 999px; background: var(--student-primary-soft); color: var(--student-primary); font-weight: 700; font-size: .95rem; }
.competition-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.competition-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 11px; border-radius: 999px; background: var(--student-primary-soft); color: var(--student-primary); font-size: .83rem; font-weight: 850; }
.competition-tag.is-green { background: var(--student-green-soft); color: var(--student-green); }
.competition-tag.is-blue { background: var(--student-blue-soft); color: var(--student-blue); }
.competition-tag.is-orange { background: var(--student-warning-soft); color: #a95311; }
.competition-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.competition-meta-item { min-width: 0; padding: 11px 13px; border: 1px solid var(--student-border); border-radius: 15px; background: #fff; }
.competition-meta-item span { display: block; color: var(--student-muted); font-size: .75rem; font-weight: 750; }
.competition-meta-item strong { display: block; margin-top: 3px; color: var(--student-text); font-size: .91rem; overflow-wrap: anywhere; }

.competition-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.competition-stat { min-width: 0; padding: 16px; border: 1px solid var(--student-border); border-radius: 19px; background: #fff; box-shadow: 0 6px 20px rgba(50, 38, 53, .045); }
.competition-stat-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 10px; border-radius: 13px; background: var(--student-primary-soft); color: var(--student-primary); font-size: 1.1rem; }
.competition-stat:nth-child(2) .competition-stat-icon { background: var(--student-green-soft); color: var(--student-green); }
.competition-stat:nth-child(3) .competition-stat-icon { background: var(--student-warning-soft); color: var(--student-warning); }
.competition-stat:nth-child(4) .competition-stat-icon { background: var(--student-blue-soft); color: var(--student-blue); }
.competition-stat-label { display: block; color: var(--student-muted); font-size: .78rem; font-weight: 800; line-height: 1.4; }
.competition-stat-value { display: block; margin-top: 3px; color: var(--student-text); font-size: 1.35rem; font-weight: 950; overflow-wrap: anywhere; }

.competition-today-card { margin-bottom: 20px; overflow: hidden; border: 1px solid rgba(165, 28, 98, .18); border-radius: 23px; background: linear-gradient(110deg, #fff 0%, #fff8fb 100%); box-shadow: 0 10px 28px rgba(165, 28, 98, .075); }
.competition-today-inner { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: clamp(20px, 3.4vw, 32px); }
.competition-today-content { min-width: 0; }
.competition-today-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--student-primary); font-size: .86rem; font-weight: 900; }
.competition-today-card h2 { margin: 0 0 9px; color: var(--student-text); font-size: clamp(1.12rem, 2.5vw, 1.55rem); font-weight: 950; line-height: 1.5; }
.competition-today-card p { margin: 0; color: var(--student-muted); line-height: 1.8; }
.competition-today-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: var(--student-muted); font-size: .85rem; font-weight: 750; }
.competition-cta { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 12px 21px; border: 0; border-radius: 15px; background: var(--student-primary); color: #fff !important; font-weight: 900; text-decoration: none; box-shadow: 0 8px 18px rgba(165, 28, 98, .18); transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.competition-cta:hover { transform: translateY(-2px); background: #821548; color: #fff; box-shadow: 0 11px 22px rgba(165, 28, 98, .22); }
.competition-cta.is-disabled { background: #f0edf1; color: var(--student-muted) !important; box-shadow: none; cursor: not-allowed; }
.competition-cta.is-disabled:hover { transform: none; background: #f0edf1; box-shadow: none; }
.competition-cta:focus-visible { outline: 3px solid rgba(165, 28, 98, .35); outline-offset: 3px; }
.competition-today-complete { display: flex; align-items: flex-start; gap: 13px; padding: 18px 20px; border: 1px solid rgba(46, 139, 87, .16); border-radius: 20px; margin-bottom: 20px; background: var(--student-green-soft); color: #236b43; }
.competition-today-complete h2 { margin: 0 0 4px; font-size: 1.08rem; font-weight: 900; }
.competition-today-complete p { margin: 0; line-height: 1.7; }

.competition-panel { padding: clamp(16px, 2.4vw, 25px) !important; margin-bottom: 20px; }
.competition-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.competition-panel-heading h2 { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--student-text); font-size: 1.15rem; font-weight: 950; }
.competition-panel-heading h2 i { color: var(--student-primary); }
.competition-panel-heading small { color: var(--student-muted); line-height: 1.6; }
.competition-day-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.competition-day-card { display: flex; min-width: 0; min-height: 190px; flex-direction: column; padding: 15px; border: 1px solid var(--student-border); border-radius: 18px; background: #fff; }
.competition-day-card.is-current { border-color: rgba(165, 28, 98, .3); background: #fff9fc; box-shadow: 0 7px 20px rgba(165, 28, 98, .08); }
.competition-day-card.is-completed { border-color: rgba(46, 139, 87, .16); background: #f7fcf8; }
.competition-day-card.is-missed { background: #faf8f9; }
.competition-day-card.is-locked { background: #f7f7f9; color: var(--student-muted); }
.competition-day-title { color: var(--student-text); font-size: 1rem; font-weight: 950; }
.competition-day-status { display: inline-flex; align-self: flex-start; align-items: center; gap: 5px; margin: 7px 0 9px; padding: 5px 9px; border-radius: 999px; background: #f0edf1; color: #635a65; font-size: .73rem; font-weight: 850; }
.is-current .competition-day-status { background: var(--student-primary-soft); color: var(--student-primary); }
.is-completed .competition-day-status { background: var(--student-green-soft); color: var(--student-green); }
.is-missed .competition-day-status { background: #f4eef1; color: #756d78; }
.competition-day-date { margin-bottom: 8px; color: var(--student-muted); font-size: .76rem; overflow-wrap: anywhere; }
.competition-day-exam { margin-bottom: 10px; color: var(--student-text); font-size: .82rem; font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; }
.competition-day-details { display: flex; flex-wrap: wrap; gap: 5px 10px; margin: 0 0 10px; color: var(--student-muted); font-size: .72rem; }
.competition-day-result { margin-top: auto; color: var(--student-green); font-size: .9rem; font-weight: 900; }
.competition-day-note { margin-top: auto; color: var(--student-muted); font-size: .78rem; }
.competition-day-card .competition-cta { width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 12px; font-size: .82rem; }

.competition-dashboard .bg-warning { background-color: var(--student-warning-soft) !important; color: #92500f !important; }
.competition-dashboard .text-warning { color: var(--student-warning) !important; }
.competition-dashboard .text-primary { color: var(--student-primary) !important; }
.competition-dashboard .alert-success { border-color: rgba(46, 139, 87, .16); background: var(--student-green-soft); color: #236b43; }
.competition-dashboard .alert-success .text-success-emphasis { color: #236b43 !important; }
.competition-dashboard .table { --bs-table-hover-bg: #fff7fb; --bs-table-striped-bg: #fcfafb; color: var(--student-text); }
.competition-dashboard .table thead th { background: #f8f5f8; color: var(--student-muted); font-size: .8rem; white-space: nowrap; }
.competition-dashboard .table td { vertical-align: middle; }
.competition-dashboard tr.table-primary { --bs-table-bg: #fff6fa; --bs-table-color: var(--student-text); }
.competition-dashboard .table-responsive { border-radius: 14px; }

@media (max-width: 991.98px) {
    .competition-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .competition-day-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .competition-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .competition-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .competition-day-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
    .competition-day-card { min-height: 182px; padding: 12px; }
    .competition-today-inner { align-items: stretch; flex-direction: column; }
    .competition-cta { width: 100%; }
    .competition-panel-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 575.98px) {
    .competition-entry-page, .competition-dashboard { margin-top: 12px; padding-inline: 10px; }
    .competition-hero-inner { padding: 18px; }
    .competition-hero-title-row { gap: 10px; }
    .competition-hero-mark { flex-basis: 44px; width: 44px; height: 44px; border-radius: 15px; }
    .competition-meta-grid { gap: 8px; }
    .competition-meta-item { padding: 9px 10px; }
    .competition-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .competition-stat { padding: 12px; }
    .competition-stat:last-child { grid-column: 1 / -1; }
    .competition-day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .competition-day-card { min-height: 180px; padding: 11px; }
    .competition-day-title { font-size: .92rem; }
    .competition-panel { padding: 14px !important; }
    .competition-panel-heading h2 { font-size: 1.02rem; }
    .competition-entry-logos { gap: 8px; margin-bottom: 11px; }
    .competition-entry-logos img { height: 58px; max-width: 29%; }
    .competition-entry-logos img.is-school { height: 68px; }
    .competition-landing-hero { padding: 12px 6px 18px; }
    .competition-entry-grid { grid-template-columns: 1fr; gap: 12px; }
    .competition-landing-section-heading { align-items: flex-start; }
    .competition-entry-meta { gap: 6px; }
    .competition-entry-meta span { font-size: .76rem; }
    .competition-grade-filter { padding: 13px; }
    .competition-grade-filter-controls { align-items: stretch; flex-direction: column; }
    .competition-grade-filter .btn { width: 100%; }
}
@media (max-width: 359.98px) {
    .competition-day-grid { grid-template-columns: 1fr; }
    .competition-day-card { min-height: 0; }
    .competition-meta-grid { grid-template-columns: 1fr 1fr; }
    .competition-switcher { align-items: stretch; }
    .competition-switcher .btn { max-width: 100%; white-space: normal; }
    .competition-count { white-space: normal; text-align: center; }
}
