/* Core Variables & Resets */
:root {
    --primary: #2b7cee;
    --primary-dark: #1e66c9;
    --bg-light: #f6f7f8;
    --bg-dark: #101822;
    /* Removed unused dark mode rules for simplicity but kept vars */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-light: #e2e8f0;
    --white: #ffffff;

    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;

    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-500: #ef4444;
    --red-700: #b91c1c;
    --red-800: #991b1b;

    --green-50: #ecfdf5;
    --green-100: #d1fae5;
    --green-200: #a7f3d0;
    --green-500: #10b981;
    --green-800: #065f46;

    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-800: #9a3412;

    --yellow: #eab308;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: 'Public Sans', 'Noto Sans JP', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.text-primary {
    color: var(--primary);
}

.text-yellow {
    color: var(--yellow);
}

.hidden {
    display: none !important;
}

.mt-10 {
    margin-top: 2.5rem;
}

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

.text-right {
    text-align: right;
}

.no-margin {
    margin: 0 !important;
}

/* Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 1rem;
    z-index: 50;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .top-header {
        padding: 1rem 5rem;
    }
}

@media (min-width: 1024px) {
    .top-header {
        padding: 1rem 10rem;
    }
}

.site-title {
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

@media (min-width: 768px) {
    .site-title {
        font-size: 1.25rem;
    }
}

.header-right {
    display: flex;
    margin-left: auto;
    gap: 0.25rem;
    align-items: center;
    justify-content: flex-end;
}

@media (min-width: 640px) {
    .header-right {
        gap: 1rem;
    }
}

.score-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .score-container {
        gap: 0.5rem;
        margin-right: 1rem;
    }
}

.score-label {
    display: inline;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: -0.05em;
}

@media (min-width: 640px) {
    .score-label {
        font-size: 0.875rem;
        letter-spacing: -0.025em;
    }
}

@media (min-width: 768px) {
    .score-label {
        font-size: 1rem;
    }
}

.score-value {
    font-size: 1.125rem;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: baseline;
}

@media (min-width: 768px) {
    .score-value {
        font-size: 1.5rem;
    }
}

.score-unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

@media (min-width: 768px) {
    .score-unit {
        font-size: 0.875rem;
    }
}

.btn-save {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 0.5rem;
    padding: 0 0.5rem;
    height: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    animation: pulseBorder 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

@media (min-width: 640px) {
    .btn-save {
        padding: 0 1rem;
        height: 2.5rem;
        font-size: 0.875rem;
    }
}

.btn-save:hover {
    background: var(--primary-dark);
}

/* Layout Wrapper */
.layout-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 100vh;
}

.main-content {
    display: flex;
    justify-content: center;
    padding: 6rem 1.5rem 1rem;
    flex: 1;
}

@media (max-width: 767px) {
    .main-content {
        padding: 5rem 1.3rem 2rem;
    }
}

@media (min-width: 768px) {
    .main-content {
        padding-left: 5rem;
        padding-right: 5rem;
        padding-top: 7rem;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding-left: 10rem;
        padding-right: 10rem;
    }
}

.main-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    width: 100%;
    max-width: 800px;
    flex: 1;
}

.screen-flow {
    display: flex;
    flex-direction: column;
}

/* Global components */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-header span {
    font-size: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

@media (min-width: 768px) {
    .section-header h2 {
        font-size: 1.5rem;
    }
}

/* Selection Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .category-grid {
        gap: 1rem;
    }
}

.radio-input {
    position: absolute;
    opacity: 0;
}

.category-label {
    position: relative;
    cursor: pointer;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 0.75rem;
    text-align: center;
    height: 100%;
    transition: all 0.2s;
}

@media (min-width: 768px) {
    .category-card {
        padding: 1.5rem;
    }
}

.radio-input:checked+.category-card {
    border-color: var(--primary);
    background: rgba(43, 124, 238, 0.05);
}

.category-card:hover {
    border-color: rgba(43, 124, 238, 0.5);
}

.category-card .icon {
    font-size: 1.5rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
    transition: color 0.1s;
}

.radio-input:checked+.category-card .icon {
    color: var(--primary);
}

@media (min-width: 768px) {
    .category-card .icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
}

.category-card .title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

@media (min-width: 768px) {
    .category-card .title {
        font-size: 1.125rem;
    }

    .mobile-br {
        display: none;
    }
}

.category-card .desc {
    display: none;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .category-card .desc {
        display: block;
    }
}

/* Level Selector */
.level-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

@media (min-width: 768px) {
    .level-selector {
        gap: 0.75rem;
    }
}

.level-label {
    flex: 1;
    min-width: 70px;
    position: relative;
    cursor: pointer;
}

.level-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    border: 2px solid var(--border-light);
    border-radius: 0.75rem;
    background: var(--white);
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .level-card {
        padding: 1.25rem 0;
        font-size: 1rem;
    }
}

.level-card:hover {
    border-color: rgba(43, 124, 238, 0.5);
}

.radio-input:checked+.level-card {
    background: rgba(43, 124, 238, 0.05);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Scoring Info Panel */
.scoring-info-panel {
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .scoring-info-panel {
        padding: 1.25rem;
    }
}

.scoring-info-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--blue-900);
}

@media (min-width: 768px) {
    .scoring-info-title {
        font-size: 1rem;
    }
}

.icon-small {
    font-size: 1.25rem;
}

.scoring-table-wrap {
    overflow-x: auto;
}

.scoring-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    text-align: center;
    background: var(--white);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
    .scoring-table {
        font-size: 0.875rem;
    }
}

.scoring-table th,
.scoring-table td {
    padding: 0.5rem 0.25rem;
    border: 1px solid var(--border-light);
}

@media (min-width: 768px) {

    .scoring-table th,
    .scoring-table td {
        padding: 0.75rem 0.5rem;
    }
}

.scoring-table th {
    background: var(--bg-light);
    color: var(--text-secondary);
    font-weight: 600;
}

.scoring-table td.cat-name {
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-light);
    text-align: left;
    padding-left: 0.5rem;
}

@media (min-width: 768px) {
    .scoring-table td.cat-name {
        padding-left: 1rem;
    }
}

.score-up {
    color: var(--primary);
    font-weight: 700;
}

.score-down {
    color: var(--red-500);
    font-weight: 700;
}

.score-slash {
    color: var(--text-secondary);
    margin: 0 0.125rem;
    font-size: 0.75rem;
}

.scoring-info-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    text-align: right;
    font-weight: 500;
}

/* Start Button */
.start-section {
    padding-bottom: 2rem;
}

@media (max-width: 767px) {
    .start-section {
        padding-bottom: 1rem;
    }
}

.btn-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    background: var(--primary);
    color: var(--white);
    padding: 1.25rem;
    border-radius: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(43, 124, 238, 0.2);
    transition: all 0.2s;
}

@media (min-width: 768px) {
    .btn-start {
        padding: 1.5rem;
        font-size: 1.25rem;
    }
}

.btn-start:hover {
    background: var(--primary-dark);
    transform: scale(1.01);
}

.btn-start:active {
    transform: scale(0.99);
}

/* Loading */
.loading-screen {
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
    gap: 1rem;
}

.icon-spin {
    animation: spin 1s linear infinite;
    font-size: 3rem;
    color: var(--primary);
}

@media (min-width: 768px) {
    .icon-spin {
        font-size: 3.75rem;
    }
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.loading-screen p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
}

@media (min-width: 768px) {
    .loading-screen p {
        font-size: 1.125rem;
    }
}

/* Quiz Flow */
.quiz-flow {
    gap: 1.5rem;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
}

.quiz-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .quiz-progress-wrap {
        gap: 0.75rem;
        font-size: 1.125rem;
    }
}

.level-badge {
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.75rem;
    border: 1px solid;
}

@media (min-width: 768px) {
    .level-badge {
        font-size: 0.875rem;
    }
}

.active-beginner {
    background: var(--green-100);
    color: var(--green-800);
    border-color: var(--green-200);
}

.active-intermediate {
    background: var(--orange-100);
    color: var(--orange-800);
    border-color: var(--orange-200);
}

.active-advanced {
    background: var(--red-100);
    color: var(--red-800);
    border-color: var(--red-200);
}

/* Question Box */
.question-box {
    background: var(--blue-50);
    border: 2px solid var(--blue-100);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

@media (min-width: 768px) {
    .question-box {
        padding: 3rem;
    }
}

.question-left {
    align-items: flex-start;
    text-align: left;
}

.question-center {
    align-items: center;
    text-align: center;
}

.question-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    background: var(--blue-100);
    color: var(--blue-800);
    font-weight: 700;
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    .question-badge {
        margin-bottom: 1.5rem;
        font-size: 0.875rem;
    }
}

.question-badge .material-symbols-outlined {
    font-size: 1rem;
}

#question-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--blue-900);
    line-height: 1.6;
    word-break: break-all;
    width: 100%;
}

@media (min-width: 768px) {
    #question-text {
        font-size: 1.75rem;
    }
}

.instruction-text {
    text-align: center;
    margin: 1rem 0;
}

@media (min-width: 768px) {
    .instruction-text {
        margin: 1.5rem 0 1rem;
    }
}

.instruction-text p {
    color: #334155;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .instruction-text p {
        font-size: 1.25rem;
    }
}

/* Choices */
.choices-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .choices-container {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

.choice-large-btn {
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    word-wrap: break-word;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .choice-large-btn {
        padding: 1.5rem 1.25rem;
        font-size: 1.25rem;
    }
}

@media (hover: hover) {
    .choice-large-btn:hover:not(:disabled) {
        border-color: var(--primary);
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        background: var(--blue-50);
    }
}

.choice-large-btn:disabled {
    cursor: default;
}

.correct-state {
    background: var(--green-50);
    border-color: var(--green-500);
    color: var(--green-800);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.wrong-state {
    background: var(--red-50);
    border-color: var(--red-500);
    color: var(--red-800);
}

.dim-state {
    opacity: 0.5;
}

/* Feedback */
.feedback-panel {
    margin-top: 1rem;
    background: var(--red-50);
    border: 1px solid var(--red-200);
    border-radius: 1rem;
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .feedback-panel {
        padding: 1.5rem;
    }
}

.feedback-title {
    color: var(--red-700);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .feedback-title {
        font-size: 1.125rem;
    }
}

.feedback-desc {
    color: var(--red-800);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .feedback-desc {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

.btn-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(43, 124, 238, 0.2);
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

@media (min-width: 768px) {
    .btn-next {
        font-size: 1.125rem;
    }
}

.btn-next:hover {
    background: var(--primary-dark);
    transform: scale(1.01);
}

/* Animation Overlay */
.animation-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.anim-mark {
    opacity: 0;
    font-size: 80px;
    position: absolute;
    transform: scale(2);
}

@media (min-width: 768px) {
    .anim-mark {
        font-size: 100px;
    }
}

.anim-correct {
    color: var(--green-500);
}

.anim-wrong {
    color: var(--red-500);
}

.anim-mark.active {
    animation: markPop 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes markPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    80% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0px);
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
        filter: blur(10px);
    }
}

@keyframes pulseBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(43, 124, 238, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(43, 124, 238, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(43, 124, 238, 0);
    }
}

@keyframes centerFloat {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    15% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
        filter: blur(0);
    }

    40% {
        transform: translate(-50%, -80px) scale(1.2);
        opacity: 1;
        filter: blur(0);
    }

    100% {
        transform: translate(-50%, -300px) scale(1);
        opacity: 0;
        filter: blur(2px);
    }
}

.center-float {
    position: fixed;
    top: 50%;
    left: 50%;
    font-size: 4rem;
    font-weight: 900;
    pointer-events: none;
    z-index: 9999;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 10px 25px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .center-float {
        font-size: 6rem;
    }
}

.center-float.plus {
    color: var(--green-500);
    animation: centerFloat 2s ease-in-out forwards;
}

.center-float.minus {
    color: var(--red-500);
    animation: centerFloat 2s ease-in-out forwards;
}


/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 28rem;
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-content {
        padding: 2rem;
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.5rem;
}

.close-modal:hover {
    color: #1e293b;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

@media (min-width: 768px) {
    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .modal-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

.score-display-box {
    background: rgba(43, 124, 238, 0.05);
    border: 1px solid rgba(43, 124, 238, 0.2);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .score-display-box {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.score-title {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.25rem;
}

.score-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

@media (min-width: 768px) {
    .score-number {
        font-size: 2.25rem;
    }
}

.modal-warning {
    font-size: 0.75rem;
    color: var(--red-500);
    background: var(--red-50);
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: left;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .modal-warning {
        margin-bottom: 1.5rem;
    }
}

.input-nickname {
    width: 100%;
    border: 2px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 0.875rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .input-nickname {
        font-size: 1.125rem;
        padding: 1rem;
    }
}

.input-nickname:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(43, 124, 238, 0.1);
}

.input-nickname::placeholder {
    color: #cbd5e1;
    font-weight: 500;
}

.btn-submit-ranking {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    padding: 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .btn-submit-ranking {
        font-size: 1.125rem;
    }
}

.btn-submit-ranking:hover {
    background: var(--primary-dark);
}

.error-text {
    color: var(--red-500);
    text-align: center;
    font-size: 0.875rem;
    font-weight: 700;
    margin-top: 0.75rem;
}

/* Ranking Modal Table */
.ranking-content {
    max-width: 32rem;
    max-height: 80vh;
}

.modal-header-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .modal-header-icon {
        margin-bottom: 1.5rem;
    }
}

.text-3xl {
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .text-3xl {
        font-size: 1.875rem;
    }
}

.ranking-table-container {
    overflow-y: auto;
    flex: 1;
    padding-right: 0.5rem;
}

.ranking-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.ranking-table th {
    padding: 0.75rem 0.25rem;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

.ranking-table td {
    padding: 1rem 0.25rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .ranking-table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .ranking-table td {
        padding: 1rem 0.5rem;
        font-size: 1rem;
    }
}

tr.rank-1 td {
    color: #d97706;
    font-weight: 800;
    background: #fffbeb;
}

tr.rank-2 td {
    color: #475569;
    font-weight: 800;
    background: #f8fafc;
}

tr.rank-3 td {
    color: #9a3412;
    font-weight: 800;
    background: #fff7ed;
}

.loader-container {
    display: flex;
    justify-content: center;
    padding: 2.5rem 0;
}

.footer-section {
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding-top: 2rem;
    padding-bottom: 1rem;
    border-top: 1px solid var(--border-light);
    margin-top: 1rem;
    margin-top: auto;
}

.btn-view-ranking {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    font-size: 0.875rem;
    justify-content: center;
}

.btn-view-ranking:hover {
    color: var(--primary);
}

/* Results Screen */
.results-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.result-content {
    background: var(--white);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
}

.result-icon-wrap {
    width: 80px;
    height: 80px;
    background: var(--blue-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.result-icon {
    font-size: 3rem;
    color: var(--primary);
}

.result-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.result-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 500;
}