/* ============================================================
   base.css — reset / typography / animations / utilities
   Split from static/style.css (move-only refactor 2026-07).
   ============================================================ */

/* ===== RESET & BASE STYLES ===== */
*  {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body  {
    font-family: var(--font-sans);
    background-color: var(--surface-canvas);
    color: var(--text-primary);
    line-height: var(--lh-normal);
    height: 100vh;
    overflow: hidden;
    font-size: var(--fs-14);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss01", "ss02";
}

::selection  {
    background: var(--accent-soft);
    color: var(--text-strong);
}

a  {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul  {
    list-style: none;
}

input,
button,
select  {
    font-family: inherit;
    font-size: inherit;
}

/* ===== UTILITIES ===== */
.text-gradient  {
    /* Kept for potential emphasis, but made monotone */
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fade-in  {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn  {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up  {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp  {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

input[type="text"],
input[type="search"],
input[type="number"],
select  {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    width: 100%;
    transition: border-color var(--transition-fast);
}

input:focus,
select:focus  {
    outline: none;
    border-color: var(--accent-primary);
    background-color: var(--bg-elevated);
}

/* Scrollbar */
::-webkit-scrollbar  {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track  {
    background: transparent;
}

::-webkit-scrollbar-thumb  {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover  {
    background: var(--border-active);
}

@media (max-width: 768px) {
    body  {
            overflow: auto;
            /* Allow scroll on mobile */
        }
}

.badge-main  {
    background: #5a96e6;
    color: white;
}

.badge-sub  {
    background: #e6b45a;
    color: white;
}

/* === Scrollable pages (index, leaderboard) === */
body.scrollable-page  {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* =========================================================
   Legacy class refit — 라이트 톤에 맞춰 미세 보정
   ========================================================= */

/* 헤더/타이틀은 강한 톤 */
h1, h2, h3, h4, h5  {
    color: var(--text-strong);
    letter-spacing: -0.01em;
}

/* 입력 필드 라이트 보정 */
input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea  {
    background-color: var(--surface-raised);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus  {
    outline: none;
    border-color: var(--border-focus);
    background-color: var(--surface-raised);
    box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.12);
}

/* 스크롤바 라이트 보정 */
::-webkit-scrollbar-thumb  {
    background: var(--border-default);
}

::-webkit-scrollbar-thumb:hover  {
    background: var(--border-strong);
}

.ds-scroll::-webkit-scrollbar  { width: 8px; height: 8px; }

.ds-scroll::-webkit-scrollbar-track  { background: transparent; }

.ds-scroll::-webkit-scrollbar-thumb  {
    background: var(--border-default);
    border-radius: var(--r-pill);
}

.ds-scroll::-webkit-scrollbar-thumb:hover  { background: var(--border-strong); }

/* scrollable-page 페이지에 글로벌 네비 + bottom-tab-bar 맞춰 패딩 보정 */
body.scrollable-page  {
    padding-bottom: 0;
}

@media (max-width: 768px) {
    body.scrollable-page  {
            padding-bottom: var(--tabbar-h);
        }
}

/* rank-num — 베이지 톤 위에서 가시성을 위해 1~3등은 메달 배지로, 4~5등은 진한 텍스트 */
.rank-num  {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: var(--fs-13);
    color: var(--text-strong);
    background: transparent;
    line-height: 1;
}

.rank-num--t1  {
    background: var(--accent);
    color: var(--accent-fg);
    box-shadow: var(--shadow-sm);
}

.rank-num--t2  {
    background: var(--camel);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

.rank-num--t3  {
    background: var(--warning);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.rank-num--t4,
.rank-num--t5  {
    background: var(--surface-sunken);
    color: var(--text-strong);
    border: 1px solid var(--border-subtle);
}

/* 스크린리더 전용 텍스트 (시각적으로 숨김) */
.sr-only  {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
