* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: #2b2521;
    background:
        radial-gradient(1200px 520px at 50% -8%, #fff3da 0%, rgba(255, 243, 218, 0) 62%),
        linear-gradient(180deg, #fcf8f1 0%, #f6eee1 100%);
}

button,
input {
    font: inherit;
}

.header {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(252, 248, 241, .82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #efe6d6;
    min-height: 66px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-user {
    font-size: 13px;
    color: #8a7e72;
    font-weight: 700;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}

.brand-logo-wrap {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 13px;
    padding: 7px;
    background: linear-gradient(145deg, #12231f, #0b1215);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 10px 22px -10px rgba(10, 18, 21, .8);
}

.brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-text {
    font-weight: 800;
    font-size: 13px;
    line-height: 1.18;
    letter-spacing: .02em;
    background: linear-gradient(90deg, #0e7158, #2bb89b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    overflow-wrap: anywhere;
}

.btn {
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14.5px;
    color: #fff;
    background: linear-gradient(180deg, #13917b, #0e7158);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 22px -10px rgba(14, 113, 88, .7);
}

.btn.light {
    background: #f4ede0;
    color: #6e6358;
    box-shadow: none;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 30px 28px 80px;
}

.hero {
    background: #fff;
    border: 1px solid #efe6d6;
    border-radius: 24px;
    padding: 36px 40px;
    box-shadow: 0 24px 50px -36px rgba(60, 40, 10, .4);
}

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: .13em;
    text-transform: uppercase;
    font-weight: 800;
    color: #0e7158;
    background: #e3f3ee;
    padding: 6px 14px;
    border-radius: 99px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #17b26a;
    box-shadow: 0 0 0 5px rgba(23, 178, 106, .14);
}

.hero h1 {
    font-family: 'Newsreader', serif;
    font-weight: 600;
    font-size: 42px;
    line-height: 1.08;
    margin: 18px 0 0;
    color: #241f1b;
}

.tagline {
    font-family: 'Newsreader', serif;
    font-style: italic;
    font-weight: 500;
    font-size: 19px;
    color: #c97a3c;
    margin-top: 8px;
}

.hero p {
    font-size: 15.5px;
    line-height: 1.65;
    color: #6e6358;
    max-width: 690px;
    margin: 18px 0 0;
}

.tabs,
.search,
.notice {
    background: #fff;
    border: 1px solid #efe6d6;
    border-radius: 16px;
    box-shadow: 0 12px 30px -28px rgba(60, 40, 10, .5);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 7px;
    margin-top: 22px;
}

.tab {
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14.5px;
    padding: 11px 24px;
    border-radius: 11px;
    background: transparent;
    color: #8a7e72;
}

.tab.active {
    font-weight: 700;
    background: linear-gradient(180deg, #e7f5f0, #d7eee7);
    color: #0e7158;
    box-shadow: 0 4px 12px -6px rgba(14, 113, 88, .5);
}

.search {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px;
    margin-top: 14px;
}

.search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #2b2521;
    background: transparent;
}

.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    align-items: end;
    margin: 42px 0 30px;
}

.podium-card {
    position: relative;
    background: #fff;
    border: 1px solid #efe6d6;
    border-radius: 22px;
    padding: 34px 22px 26px;
    text-align: center;
    box-shadow: 0 18px 40px -30px rgba(60, 40, 10, .5);
}

.rank-card-1 {
    order: 2;
}

.rank-card-2 {
    order: 1;
}

.rank-card-3 {
    order: 3;
}

.podium-card.first {
    transform: translateY(-26px);
    border-color: #f3d9a8;
    box-shadow: 0 30px 60px -28px rgba(216, 131, 30, .55), 0 0 0 1px #f3d9a8;
}

.crown {
    position: absolute;
    top: -39px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #e1962e;
    filter: drop-shadow(0 6px 7px rgba(216, 131, 30, .35));
    z-index: 2;
}

.crown svg {
    width: 31px;
    height: 31px;
}

.rank-pill {
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border-radius: 99px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.rank-cell {
    display: flex;
    justify-content: center;
}

.head-rank {
    text-align: center;
}

.podium-card .rank-pill {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
}

.podium-card.first .rank-pill {
    z-index: 3;
}

.rank-1 {
    background: linear-gradient(135deg, #f4bc54, #dd8a1e);
}

.rank-2 {
    background: linear-gradient(135deg, #bfc8d2, #8b97a4);
}

.rank-3 {
    background: linear-gradient(135deg, #d89a63, #b06a30);
}

.rank-other {
    background: #f1e8d8;
    color: #6e6358;
}

.avatar {
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #2b2521;
}

.podium-card .avatar {
    width: 74px;
    height: 74px;
    margin: 8px auto 14px;
    border-radius: 50%;
    font-size: 23px;
    background: #fbefd6;
    box-shadow: inset 0 0 0 3px #e8a33d;
}

.podium-name {
    font-family: 'Newsreader', serif;
    font-weight: 600;
    font-size: 19px;
    color: #241f1b;
    line-height: 1.2;
}

.podium-school {
    font-size: 12.5px;
    color: #9a8e80;
    margin-top: 4px;
    min-height: 32px;
}

.score-pill {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 22px;
    border-radius: 99px;
    font-weight: 800;
    font-size: 21px;
    font-variant-numeric: tabular-nums;
    background: #fbefd6;
    color: #d9831e;
}

.next {
    font-size: 12px;
    color: #b08a52;
    margin-top: 12px;
    font-weight: 600;
}

.board {
    background: #fff;
    border: 1px solid #efe6d6;
    border-radius: 22px;
    box-shadow: 0 22px 46px -34px rgba(60, 40, 10, .42);
    overflow: hidden;
}

.board-offset {
    margin-top: 22px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.grid {
    display: grid;
    grid-template-columns: 60px minmax(0, 1.7fr) 110px 230px 140px;
    gap: 18px;
    align-items: center;
}

.grid.mock {
    grid-template-columns: 60px minmax(0, 1.9fr) 130px 140px 150px;
}

.head {
    padding: 18px 26px;
    border-bottom: 1px solid #f1e8d8;
    background: #fcf9f3;
    font-size: 11px;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #a2937f;
    font-weight: 700;
}

.rows {
    max-height: 540px;
    overflow-y: auto;
}

.row {
    padding: 16px 26px;
    border-bottom: 1px solid #f4eee2;
    background: #fff;
}

.row.own {
    background: #fff7e4;
}

.student {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.student-copy {
    min-width: 0;
}

.student .avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 11px;
    font-size: 13px;
    background: #f4ede0;
    box-shadow: inset 0 0 0 1.5px #e6dbc9;
}

.student-name {
    font-weight: 700;
    font-size: 15px;
    color: #241f1b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-toggle {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.student-toggle:hover,
.student-toggle[aria-expanded="true"] {
    color: #0e7158;
}

.student-school {
    font-size: 12.5px;
    color: #9a8e80;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.value {
    text-align: right;
    font-size: 15px;
    color: #6e6358;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.completed-value {
    color: #6e6358;
    font-variant-numeric: tabular-nums;
}

.next-value {
    color: #9a8e80;
    font-size: 12px;
}

.points {
    font-weight: 800;
    font-size: 18px;
    color: #241f1b;
}

.details-link {
    border: 0;
    background: #f1e8d8;
    color: #6e6358;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
}

.details-link:hover,
.details-link[aria-expanded="true"] {
    background: #0e7158;
    color: #fff;
}

.score-details {
    display: none;
    grid-column: 2 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    background: #fbf6ed;
    border: 1px solid #efe6d6;
    border-radius: 14px;
}

.score-details.active {
    display: grid;
}

.score-details div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #9a8e80;
    font-size: 12px;
}

.score-details strong {
    color: #241f1b;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.empty {
    padding: 44px;
    text-align: center;
    color: #9a8e80;
    font-size: 15px;
}

.notice {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fff6e6, #fdefe9);
    border-color: #f2e2cc;
    padding: 24px 30px;
}

.login-rank-notice {
    margin: 4px 0 22px;
    gap: 16px;
}

.notice-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #d17c17;
}

.notice-title {
    font-family: 'Newsreader', serif;
    font-weight: 600;
    font-size: 18px;
    color: #241f1b;
}

.notice-text {
    font-size: 14px;
    color: #8a7e72;
    margin-top: 3px;
    max-width: 590px;
    line-height: 1.5;
}

.scorecard {
    margin-top: 22px;
    background: #fff;
    border: 1px solid #efe6d6;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 22px 46px -34px rgba(60, 40, 10, .42);
}

.scorecard h2 {
    font-family: 'Newsreader', serif;
    font-size: 26px;
    margin: 0 0 14px;
}

.marks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.mark-card {
    border: 1px solid #f1e8d8;
    border-radius: 14px;
    padding: 14px;
    background: #fcf9f3;
}

.mark-card b {
    display: block;
    margin-bottom: 8px;
}

.inline-total {
    display: inline;
}

.mark-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #6e6358;
    font-size: 13px;
    margin-top: 5px;
}

.mark-line span:last-child {
    text-align: right;
    overflow-wrap: anywhere;
}

.pending-note {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #efe6d6;
    color: #9a8e80;
    font-size: 12px;
    line-height: 1.45;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(40, 30, 15, .45);
    backdrop-filter: blur(6px);
}

.modal.active {
    display: flex;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #efe6d6;
    border-radius: 24px;
    padding: 34px 32px;
    box-shadow: 0 40px 90px -30px rgba(60, 40, 10, .55);
}

.close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    background: #f4ede0;
    color: #8a7e72;
    font-size: 20px;
    line-height: 1;
    display: grid;
    place-items: center;
}

.whatsapp-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #37d279, #1ea94e);
    box-shadow: 0 12px 24px -10px rgba(30, 169, 78, .6);
}

.login-card h2 {
    font-family: 'Newsreader', serif;
    font-weight: 600;
    font-size: 26px;
    color: #241f1b;
    margin: 20px 0 0;
}

.login-card p {
    font-size: 14.5px;
    color: #8a7e72;
    line-height: 1.55;
    margin: 8px 0 0;
}

.label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #a2937f;
    margin: 24px 0 8px;
}

.phone-input {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid #e7dcc9;
    border-radius: 14px;
    padding: 0 6px 0 14px;
    background: #fcf9f3;
}

.phone-input span {
    font-weight: 700;
    font-size: 15px;
    color: #6e6358;
}

.phone-divider {
    width: 1px;
    height: 24px;
    background: #e7dcc9;
}

.phone-input input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #241f1b;
    padding: 13px 8px;
    letter-spacing: .02em;
}

.error {
    padding: 12px 14px;
    margin-top: 16px;
    border-radius: 12px;
    background: #fff0ed;
    border: 1px solid #f4c7bf;
    color: #a33a2b;
    font-size: 13px;
    line-height: 1.45;
}

.login-submit {
    width: 100%;
    margin-top: 18px;
    padding: 15px;
    border-radius: 14px;
}

.login-note {
    text-align: center;
    font-size: 13px;
    color: #a2937f;
    margin-top: 16px;
}

@media (max-width: 760px) {
    .container {
        padding: 20px 14px 60px;
    }

    .hero {
        padding: 28px 22px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .podium {
        grid-template-columns: 1fr;
        margin-top: 22px;
    }

    .rank-card-1 {
        order: 1;
    }

    .rank-card-2 {
        order: 2;
    }

    .rank-card-3 {
        order: 3;
    }

    .podium-card.first {
        transform: none;
    }

    .podium-card.first .crown {
        top: -28px;
    }

    .grid,
    .grid.mock {
        grid-template-columns: 42px minmax(0, 1fr) 74px 78px;
    }

    .grid:not(.mock) {
        grid-template-columns: 42px minmax(0, 1fr) 82px;
    }

    .grid:not(.mock).head > div:nth-child(3),
    .grid:not(.mock) .completed-value {
        display: none;
    }

    .student .avatar {
        display: none;
    }

    .student {
        gap: 0;
    }

    .hide-mobile {
        display: none;
    }

    .head,
    .row {
        padding-left: 14px;
        padding-right: 14px;
        gap: 8px;
    }

    .value,
    .points {
        font-size: 14px;
    }

    .score-details {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }

    .notice {
        padding: 20px;
    }

    .login-rank-notice {
        align-items: flex-start;
    }

    .login-rank-notice .btn {
        width: 100%;
    }

    .btn {
        padding: 11px 16px;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (min-width: 760px) {
    .header {
        gap: 16px;
        padding: 18px 40px;
    }

    .brand {
        gap: 14px;
    }

    .brand-logo-wrap {
        width: 42px;
        height: 42px;
    }

    .brand-text {
        font-size: 18px;
        letter-spacing: .04em;
        white-space: nowrap;
    }
}
