/* Mobile-first responsive styles */
body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #eafaf1 0%, #f9f9f9 100%);
    color: #222;
    min-height: 100vh;
}
header {
    background: #fff;
    color: #2ecc40;
    padding: 2rem 1rem 1rem 1rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(46,204,64,0.07);
    border-bottom: 3px solid #2ecc40;
    border-radius: 0 0 2rem 2rem;
}
header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #2ecc40;
}

.nav-toggle {
    display: none;
}
@media (max-width: 600px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #2ecc40;
        color: #fff;
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
        border-radius: 1rem 1rem 0 0;
        cursor: pointer;
        font-weight: bold;
        margin-bottom: 0.5rem;
        box-shadow: 0 2px 8px rgba(46,204,64,0.08);
    }
}
.stage-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    background: #eafaf1;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(46,204,64,0.08);
    padding: 0.5rem;
}
.tab-btn {
    flex: 1 1 0;
    min-width: 120px;
    max-width: 200px;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 2px solid #eafaf1;
    padding: 0.75rem 1.5rem 0.5rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 1rem;
    color: #2ecc40;
    transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(46,204,64,0.04);
    position: relative;
    padding-left: 2.5rem;
}
.tab-btn .lock-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tab-btn.active .lock-icon svg path {
    fill: #fff !important;
}
.tab-btn .lock-icon svg path {
    transition: fill 0.2s;
}
.tab-btn span {
    display: block;
    text-align: left;
    margin-left: 0.5rem;
}
.tab-btn.active {
    background: #2ecc40;
    color: #fff;
    border: 2px solid #2ecc40;
    box-shadow: 0 4px 16px rgba(46,204,64,0.12);
    font-weight: bold;
    z-index: 1;
}
.tab-btn:not(.active):hover {
    background: #d4f5e9;
    color: #218c3a;
    border: 2px solid #2ecc40;
}
.tab-btn.stage-done {
    position: relative;
    color: #2ecc40;
}
.tab-btn.stage-done::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    height: 3px;
    background: linear-gradient(90deg, #2ecc40 60%, #b2f2d7 100%);
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}
.tab-btn.stage-done.active {
    color: #fff;
}
.tab-btn.stage-done.active::after {
    background: linear-gradient(90deg, #fff 60%, #b2f2d7 100%);
}
@media (max-width: 600px) {
    .stage-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-radius: 1rem;
        overflow: hidden;
        margin: 1rem 0 0.5rem 0;
        padding: 0;
    }
    .tab-btn {
        border-radius: 0;
        border-bottom: 1px solid #d4f5e9;
        min-width: unset;
        max-width: unset;
        width: 100%;
        margin-bottom: 0;
        padding-left: 2.5rem;
    }
    .tab-btn:last-child {
        border-bottom: none;
    }
}
main {
    padding: 1.5rem 1rem 2rem 1rem;
    max-width: 700px;
    margin: 0 auto;
}
.grade-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    max-width: 400px;
    margin: 2rem auto 1rem auto;
}
.grade-btn {
    aspect-ratio: 1/1;
    width: 100%;
    min-width: 80px;
    min-height: 80px;
    background: #fff;
    border: 2px solid #2ecc40;
    color: #2ecc40;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(46,204,64,0.08);
    transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.grade-btn:hover, .grade-btn:focus {
    background: #2ecc40;
    color: #fff;
    border: 2px solid #2ecc40;
    box-shadow: 0 4px 16px rgba(46,204,64,0.12);
}
#rankers-list {
    max-width: 400px;
    margin: 2rem auto 1rem auto;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 4px 16px rgba(46,204,64,0.12);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    text-align: center;
    border: 3px solid #2ecc40;
    position: relative;
}
#rankers-list h3 {
    color: #2ecc40;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    letter-spacing: 1px;
    font-weight: bold;
}
#rankers-names {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    color: #222;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    counter-reset: rank;
}
#rankers-names li {
    background: linear-gradient(90deg, #eafaf1 60%, #d4f5e9 100%);
    border-left: 8px solid #2ecc40;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem 1rem 2.5rem;
    margin: 0;
    text-align: left;
    font-size: 1.15rem;
    font-weight: 500;
    position: relative;
    box-shadow: 0 2px 8px rgba(46,204,64,0.06);
}
#rankers-names li::before {
    content: counter(rank) ".";
    counter-increment: rank;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #2ecc40;
    font-size: 1.2rem;
    font-weight: bold;
}
.back-btn, #back-to-classes, #back-to-grades {
    display: inline-block;
    margin-bottom: 1.5rem;
    background: #eafaf1;
    color: #2ecc40;
    border: none;
    border-radius: 2rem;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(46,204,64,0.04);
}
.back-btn:hover, #back-to-classes:hover, #back-to-grades:hover {
    background: #2ecc40;
    color: #fff;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(46,204,64,0.05);
    margin: 1rem 0;
    border-radius: 1rem;
    overflow: hidden;
}
th, td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    text-align: center;
}
th {
    background: #eafaf1;
    color: #2ecc40;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}
tr:last-child td {
    border-bottom: none;
}
footer {
    text-align: center;
    padding: 1.5rem 1rem 1rem 1rem;
    background: #eafaf1;
    color: #2ecc40;
    font-size: 1rem;
    border-radius: 2rem 2rem 0 0;
    margin-top: 2rem;
    box-shadow: 0 -2px 8px rgba(46,204,64,0.04);
}
@media (max-width: 600px) {
    main {
        padding: 1rem 0.5rem 2rem 0.5rem;
    }
    .grade-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    #rankers-list {
        padding: 1.2rem 0.5rem 1rem 0.5rem;
    }
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        display: none;
    }
    tr {
        margin-bottom: 1rem;
        background: #fff;
        box-shadow: 0 1px 4px rgba(46,204,64,0.03);
        border-radius: 1rem;
    }
    td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: none;
        border-top: 1px solid #eafaf1;
    }
    td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        top: 0.75rem;
        font-weight: bold;
        text-align: left;
        color: #2ecc40;
    }
}
