* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #161e30;
    color: #e2e8f0;
    font-family: -apple-system, sans-serif;
}

#SYMBOL_UPBIT {
    padding: 12px 8px 80px;
}

.Coin_Title {
    display: flex;
    background: #040b1b;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-bottom: 1px solid #5d6488;
}
.Coin_Img {
    display: flex;
    align-items: center;
    
}
.Coin_Img img {
    border-radius: 5px;
}
.Coin_Name {
    display: inline-block;
    font-size: 20px;
    font-weight: bold;
    margin-left: 10px;
}

/* ===== 헤더 ===== */
h1 {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 1px solid #5d6488;
    background: #09173a;
    padding: 10px;
}

h1 img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
h1 span {
    font-size: 16px;
    font-weight: bold;
}
h1 label {
    font-size: 13px;
    font-weight: normal;
    color: #94a3b8;
}

/* ===== 툴바 ===== */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.toolbar-left {
    width: 100%;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#searchInput {
    width: 100%;
    padding: 10px 12px;
    border-radius: 5px;
    border: 1px solid #5d6488;
    background: #040b1b;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
}
#searchInput::placeholder { color: #64748b; }
#searchInput:focus { border-color: #3b82f6; }

/* ===== 정렬 버튼 ===== */
.sort-btn {
    padding: 7px 10px;
    border-radius: 5px;
    border: 1px solid #5d6488;
    background: #040b1b;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.sort-btn:hover { border-color: #3b82f6; color: #e2e8f0; }
.sort-btn.active { border-color: #3b82f6; color: #fff; }
.sort-btn .arrow { font-size: 11px; min-width: 10px; text-align: center; }

/* ===== 버튼 ===== */
.button_right {
    display: flex;
    margin-left: auto;
    gap: 6px;
}
.btn_style {
    width: 35px;
    height: 35px;
    border-radius: 4px;
    border: 1px solid #5d6488;
    background: #040b1b;
    font-size: 12px;
    cursor: pointer;
}
.btn_style2 {
    width: 33px;
    height: 33px;
    border-radius: 4px;
    border: 1px solid #0033ac;
    background: #004cff;
}
.btn_style img {
    filter: grayscale(100%);
    margin-top: 2px;
}
.btn_style2 img {
    margin-top: 2px;
}
.btn_style:hover {
    border: 1px solid #0033ac;
    background: #004cff;
    transition: background-color 0.7s ease;
}
.btn_style:hover img {
    filter: grayscale(0%);
    transition: filter 0.7s ease;
}

/* ===== 그리드 — 3열 고정 ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card {
    background: #040b1b;
    border: 1px solid #5d6488;
    border-radius: 5px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s;
}
.card:active { border-color: #3b82f6; }

.card img {
    width: 80px;
    height: 80px;
    margin-bottom: 4px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.card .symbol {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card .korname {
    font-size: 10px;
    font-weight: normal;
    color: #94a3b8;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card .price {
    font-size: 12px;
    margin: 3px 0 2px;
    color: #e2e8f0;
}

.card .rate {
    font-size: 12px;
    font-weight: bold;
}

.up   { color: #00ff00; }
.down { color: #ff0000; }
.flat { color: #94a3b8; }

/* ===== 무한스크롤 감지 트리거 ===== */
#scroll-trigger {
    height: 1px;
    margin-top: 10px;
}

/* 로딩 표시 */
#load-more-indicator {
    text-align: center;
    padding: 12px 0;
    color: #64748b;
    font-size: 13px;
    display: none;
}

.no-result {
    text-align: center;
    color: #64748b;
    padding: 40px 0;
    grid-column: 1 / -1;
    font-size: 13px;
}

/* ===== 커스텀 스크롤바 ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #2a3458; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }
* { scrollbar-width: thin; scrollbar-color: #2a3458 #0f172a; }

/* ===== 플래시 애니메이션 ===== */
@keyframes flash-up {
    0%   { background-color: rgba(244, 63, 94, 0.35); }
    100% { background-color: transparent; }
}
@keyframes flash-down {
    0%   { background-color: rgba(59, 130, 246, 0.35); }
    100% { background-color: transparent; }
}
.flash-up   { animation: flash-up   0.8s ease-out; border-radius: 3px; }
.flash-down { animation: flash-down 0.8s ease-out; border-radius: 3px; }