/* ================================
   실시간 채팅 스타일
   PC: 오른쪽 사이드바
   모바일: 플로팅 버튼 + 슬라이드업 패널
================================ */

/* ================================
   CSS 변수
================================ */
:root {
    --chat-width: 320px;
    --chat-header-height: 50px;
    --chat-bg: #0a0a0a;
    --chat-bg-light: #121212;
    --chat-border: rgba(255, 255, 255, 0.08);
    --chat-text: #ffffff;
    --chat-text-muted: rgba(255, 255, 255, 0.5);
    --chat-accent: var(--gold-primary, #d4af37);
    --chat-accent-hover: var(--gold-light, #f0d060);
    --chat-message-bg: rgba(255, 255, 255, 0.05);
    --chat-message-own: rgba(212, 175, 55, 0.15);
    --chat-online: #00ff88;
}

/* ================================
   PC 채팅 사이드바
================================ */
.chat-container {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--chat-width);
    height: 100vh;
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.chat-container.collapsed {
    width: 50px;
}

.chat-container.collapsed .chat-body {
    display: none;
}

.chat-container.collapsed .chat-header {
    flex-direction: column;
    padding: 12px 8px;
    height: 100%;
    justify-content: flex-start;
    gap: 16px;
}

.chat-container.collapsed .chat-title,
.chat-container.collapsed .chat-online {
    display: none;
}

.chat-container.collapsed .chat-header-right {
    flex-direction: column;
    gap: 12px;
}

.chat-container.collapsed .chat-toggle-btn {
    width: 36px;
    height: 36px;
}

/* 접힌 상태에서 채팅 아이콘 표시 */
.chat-container.collapsed .chat-header::before {
    content: '💬';
    font-size: 24px;
    margin-bottom: 8px;
}

.chat-container.collapsed .chat-sidebar {
    cursor: pointer;
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--chat-bg);
    border-left: 1px solid var(--chat-border);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

/* 채팅 헤더 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--chat-bg-light);
    border-bottom: 1px solid var(--chat-border);
    min-height: var(--chat-header-height);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--chat-text);
    font-size: 15px;
}

.chat-icon {
    font-size: 18px;
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-online-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--chat-text-muted);
    background: rgba(0, 210, 106, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-online-btn:hover {
    background: rgba(0, 210, 106, 0.3);
    color: var(--chat-text);
}

.online-dot {
    width: 8px;
    height: 8px;
    background: var(--chat-online);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-toggle-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--chat-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.chat-container.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* 접속자 목록 패널 */
.chat-users-panel {
    background: var(--chat-bg-light);
    border-bottom: 1px solid var(--chat-border);
    max-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.2s ease;
}

.chat-users-panel.hidden {
    display: none !important;
}

.chat-users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--chat-text);
    border-bottom: 1px solid var(--chat-border);
}

.chat-users-close {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--chat-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.chat-users-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--chat-text);
}

.chat-users-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-content: flex-start;
}

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    font-size: 12px;
    color: var(--chat-text);
}

.chat-user-item .user-dot {
    width: 6px;
    height: 6px;
    background: var(--chat-online);
    border-radius: 50%;
}

.chat-user-item.is-me {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.chat-users-empty {
    width: 100%;
    text-align: center;
    padding: 16px;
    color: var(--chat-text-muted);
    font-size: 12px;
}

/* 채팅 바디 */
.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 채팅 메시지 영역 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 환영 메시지 */
.chat-welcome {
    text-align: center;
    padding: 24px 16px;
    color: var(--chat-text-muted);
}

.chat-welcome p:first-child {
    font-size: 14px;
    margin-bottom: 8px;
}

.chat-welcome-sub {
    font-size: 12px;
    opacity: 0.7;
}

/* 채팅 메시지 아이템 */
.chat-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--chat-message-bg);
    border-radius: 12px;
    animation: messageIn 0.2s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    background: var(--chat-message-own);
    border: 1px solid rgba(227, 53, 13, 0.3);
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.chat-nickname {
    font-weight: 600;
    font-size: 13px;
    color: var(--chat-accent);
}

.chat-message.own .chat-nickname {
    color: #ff9f43;
}

.chat-time {
    font-size: 10px;
    color: var(--chat-text-muted);
}

.chat-text {
    font-size: 14px;
    color: var(--chat-text);
    line-height: 1.5;
    word-break: break-word;
}

/* 채팅 입력 영역 */
.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--chat-bg-light);
    border-top: 1px solid var(--chat-border);
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    color: var(--chat-text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input::placeholder {
    color: var(--chat-text-muted);
}

.chat-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--chat-accent);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--chat-accent), #ff8787);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* ================================
   모바일 플로팅 버튼
================================ */
.chat-floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chat-accent), #ff8787);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.5);
    z-index: 998;
    transition: all 0.3s ease;
}

.chat-floating-btn:hover {
    transform: scale(1.1);
}

.chat-floating-btn:active {
    transform: scale(0.95);
}

.floating-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* 알림 배지 */
.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    background: #ff3b30;
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    animation: badgePop 0.3s ease;
}

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

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* ================================
   모바일 채팅 오버레이
================================ */
.chat-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.chat-mobile-overlay.active {
    display: flex;
}

.chat-mobile-panel {
    width: 100%;
    max-height: 70vh;
    background: var(--chat-bg);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.chat-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--chat-bg-light);
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid var(--chat-border);
}

.chat-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--chat-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-mobile-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(70vh - 130px);
}

.chat-mobile-input-container {
    display: flex;
    gap: 8px;
    padding: 12px 16px 24px;
    background: var(--chat-bg-light);
    border-top: 1px solid var(--chat-border);
}

/* 모바일 접속자 목록 패널 */
.chat-mobile-panel .chat-users-panel {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 10;
    max-height: 250px;
    background: var(--chat-bg);
    border-bottom: 2px solid var(--chat-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chat-mobile-panel .chat-users-list {
    max-height: 180px;
    overflow-y: auto;
}

/* ================================
   PC 전용 스타일
================================ */
@media (min-width: 769px) {
    .chat-floating-btn {
        display: none !important;
    }
}

/* ================================
   반응형: 모바일 (768px 이하)
================================ */
@media (max-width: 768px) {

    /* PC 사이드바 숨김 */
    .chat-container {
        display: none !important;
    }

    /* 플로팅 버튼 표시 */
    .chat-floating-btn {
        display: flex !important;
    }

    .chat-floating-btn.hidden {
        display: none !important;
    }

    /* 모바일 오버레이 */
    .chat-mobile-overlay.active {
        display: flex;
    }

    .chat-mobile-panel {
        max-height: 75vh;
    }

    .chat-mobile-messages {
        max-height: calc(75vh - 140px);
    }

    /* 플로팅 버튼 위치 조정 */
    .chat-floating-btn {
        bottom: 80px;
        right: 16px;
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
}

/* ================================
   아주 작은 모바일 (360px 이하)
================================ */
@media (max-width: 360px) {
    .chat-mobile-panel {
        max-height: 80vh;
    }

    .chat-mobile-messages {
        max-height: calc(80vh - 140px);
        padding: 12px;
    }

    .chat-message {
        padding: 8px 10px;
    }

    .chat-text {
        font-size: 13px;
    }

    .chat-floating-btn {
        width: 50px;
        height: 50px;
        font-size: 22px;
        bottom: 70px;
        right: 12px;
    }
}

/* ================================
   다크/라이트 모드 지원
================================ */
@media (prefers-color-scheme: light) {
    :root {
        --chat-bg: #f8f9fa;
        --chat-bg-light: #ffffff;
        --chat-border: rgba(0, 0, 0, 0.1);
        --chat-text: #333333;
        --chat-text-muted: rgba(0, 0, 0, 0.5);
        --chat-message-bg: rgba(0, 0, 0, 0.05);
        --chat-message-own: rgba(227, 53, 13, 0.1);
    }

    .chat-sidebar {
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .chat-input {
        background: rgba(0, 0, 0, 0.05);
    }

    .chat-input:focus {
        background: rgba(0, 0, 0, 0.08);
    }
}

/* ================================
   유틸리티 클래스
================================ */
.chat-container.hidden,
.chat-floating-btn.hidden,
.chat-mobile-overlay.hidden,
.chat-badge.hidden {
    display: none !important;
}

/* 시스템 메시지 */
.chat-system {
    text-align: center;
    padding: 8px 12px;
    color: var(--chat-text-muted);
    font-size: 12px;
    font-style: italic;
}

/* 로딩 상태 */
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--chat-text-muted);
}

.chat-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--chat-border);
    border-top-color: var(--chat-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* ================================
   이미지 업로드 관련 스타일
================================ */

/* 이미지 업로드 버튼 */
.chat-image-btn {
    width: 15px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--chat-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-image-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.chat-image-btn:active {
    transform: scale(0.95);
}

/* 드래그 앤 드롭 영역 */
.chat-input-container.drag-over,
.chat-mobile-input-container.drag-over,
.chat-messages.drag-over,
.chat-mobile-messages.drag-over {
    background: rgba(255, 107, 107, 0.1);
    border: 2px dashed var(--chat-accent);
    border-radius: 12px;
    position: relative;
}

.chat-messages.drag-over::before,
.chat-mobile-messages.drag-over::before {
    content: '이미지를 여기에 놓으세요';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--chat-accent);
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
    background: rgba(26, 26, 46, 0.9);
    padding: 12px 24px;
    border-radius: 8px;
    border: 2px solid var(--chat-accent);
}

/* 채팅 이미지 컨테이너 */
.chat-image-container {
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.chat-image-thumbnail {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: block;
    object-fit: contain;
}

.chat-image-thumbnail:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.chat-image-thumbnail:active {
    transform: scale(0.98);
}

/* 이미지만 있는 메시지 */
.chat-message:has(.chat-image-container):not(:has(.chat-text)) {
    padding: 8px 12px;
}

/* ================================
   이미지 모달 (라이트박스)
================================ */
.chat-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat-image-modal.active {
    display: flex;
}

.chat-image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.chat-image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.chat-image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.chat-image-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chat-image-modal-close:active {
    transform: scale(0.95);
}

/* 모바일 이미지 모달 */
@media (max-width: 768px) {
    .chat-image-modal {
        padding: 10px;
    }

    .chat-image-modal-content {
        max-width: 95vw;
        max-height: 85vh;
    }

    .chat-image-modal-content img {
        max-height: 85vh;
    }

    .chat-image-modal-close {
        top: -35px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .chat-image-thumbnail {
        max-width: 250px;
        max-height: 250px;
    }
}

/* 입력 영역 레이아웃 조정 */
.chat-input-container,
.chat-mobile-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-container .chat-input,
.chat-mobile-input-container .chat-input {
    flex: 1;
}

/* 이미지가 있는 메시지 스타일 */
.chat-message:has(.chat-image-container) {
    padding: 10px 12px;
}

.chat-message:has(.chat-image-container) .chat-text {
    margin-top: 8px;
}

/* ================================
   포켓몬 공유 링크 및 툴팁 스타일 (V2)
   ================================ */

/* 채팅 내 포켓몬 링크 */
.poke-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1.5px solid transparent;
    margin: 2px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    letter-spacing: -0.2px;
}

.poke-link::before {
    content: '🐾';
    font-size: 10px;
    opacity: 0.8;
}

.poke-link:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    filter: brightness(1.2);
}

/* 등급별 링크 스타일 고도화 (검정색 글씨 및 밝은 배경 최적화) */
.poke-link.grade-normal {
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #000000 !important;
}

.poke-link.grade-rare {
    border-color: #3b82f6;
    background: #dbeafe;
    color: #000000 !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.poke-link.grade-epic {
    border-color: #a855f7;
    background: #f3e8ff;
    color: #000000 !important;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.poke-link.grade-unique {
    border-color: #f97316;
    background: #ffedd5;
    color: #000000 !important;
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.2);
}

.poke-link.grade-legendary {
    border-color: #eab308;
    background: linear-gradient(135deg, #fef9c3 0%, #fde047 100%);
    color: #000000 !important;
    font-weight: 950;
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.4);
    animation: legendaryShimmer 2s infinite ease-in-out;
}

@keyframes legendaryShimmer {
    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.2) contrast(1.1);
        box-shadow: 0 0 20px rgba(250, 204, 21, 0.5);
    }

    100% {
        filter: brightness(1);
    }
}

/* 프리미엄 툴팁 */
.poke-tooltip {
    position: absolute;
    z-index: 10000;
    width: 280px;
    pointer-events: none;
    transition: none;
}

.poke-tooltip.hidden {
    display: none;
}

.poke-tooltip-content {
    background: rgba(10, 10, 15, 0.96);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px;
    color: #eee;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    animation: tooltipScaleIn 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes tooltipScaleIn {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 등급별 글로우 효과 */
.poke-tooltip-content.grade-legendary {
    border-color: #ffe100;
    box-shadow: 0 0 30px rgba(255, 225, 0, 0.15), 0 20px 50px rgba(0, 0, 0, 0.7);
}

.poke-tooltip-content.grade-unique {
    border-color: #ff9d00;
    box-shadow: 0 0 25px rgba(255, 157, 0, 0.1), 0 20px 50px rgba(0, 0, 0, 0.7);
}

.poke-tooltip-content.grade-epic {
    border-color: #d491ff;
    box-shadow: 0 0 25px rgba(212, 145, 255, 0.1), 0 20px 50px rgba(0, 0, 0, 0.7);
}

.tooltip-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.tooltip-img-wrapper {
    width: 64px;
    height: 64px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 80%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tooltip-img-wrapper img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.tooltip-title-area {
    flex: 1;
}

.tooltip-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.tooltip-name {
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.3px;
}

.tooltip-stars {
    font-size: 11px;
    letter-spacing: -1.5px;
}

.tooltip-level-row {
    display: flex;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 8px;
    align-items: center;
}

.tooltip-nature-row {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.tooltip-level {
    color: #fbbf24;
    font-weight: 800;
}

.tooltip-grade {
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}

.tooltip-grade.S {
    background: rgba(255, 225, 0, 0.2);
    color: #ffe100;
}

.tooltip-grade.A {
    background: rgba(255, 157, 0, 0.2);
    color: #ff9d00;
}

.tooltip-grade.B {
    background: rgba(0, 210, 255, 0.2);
    color: #00d2ff;
}

.tooltip-grade.C {
    background: rgba(200, 200, 200, 0.15);
    color: #eee;
}

.tooltip-types {
    display: flex;
    gap: 4px;
}

/* 능력치 그리드 */
.combat-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.tooltip-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 12px;
}

.tooltip-stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 2px;
}

.tooltip-stat-item span:first-child {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

.tooltip-stat-item span:last-child {
    color: #fff;
    font-weight: 800;
    font-family: 'Roboto Mono', monospace;
}

/* 섹션 공통 */
.tooltip-section {
    margin-bottom: 12px;
}

.tooltip-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 10px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title .icon {
    font-size: 12px;
    opacity: 0.8;
}

.grade-label {
    margin-left: auto;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 900;
}

.grade-label.legendary {
    background: #ffe100;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 225, 0, 0.3);
}

.grade-label.unique {
    background: #ff9d00;
    color: #000;
}

.grade-label.epic {
    background: #d491ff;
    color: #000;
}

.potential-lines {
    background: rgba(255, 255, 255, 0.04);
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.potential-line {
    margin-bottom: 4px;
    font-weight: 700;
}

.potential-line:last-child {
    margin-bottom: 0;
}

/* 등급별 색상 (가이드 '등급별 옵션 수치 범위' potential-grade-badge와 동일) */
.potential-line.option-grade-normal {
    color: #888888;
}
.potential-line.option-grade-rare {
    color: #40a9ff;
}
.potential-line.option-grade-epic {
    color: #9254de;
}
.potential-line.option-grade-unique {
    color: #ffc53d;
}
.potential-line.option-grade-legendary {
    color: #52c41a;
}

.moves-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tooltip-move-item {
    background: rgba(255, 255, 255, 0.04);
    padding: 5px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.move-type {
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 950;
    min-width: 42px;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.move-name {
    flex: 1;
    font-weight: 800;
    color: #fff;
}

.move-power {
    color: rgba(255, 255, 255, 0.3);
    font-size: 9px;
    font-weight: 700;
}

.tooltip-footer {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.2);
    text-align: center;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tooltip-loading,
.tooltip-error {
    padding: 30px;
    text-align: center;
    background: rgba(5, 5, 10, 0.96);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}