/* ===== GameInfo / Bullet ===== */

.bullet-page {
    padding: 0.75rem 0.5rem 2rem;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #e2e8f0;
}

/* ---------- Caliber Tabs ---------- */
.bullet-caliber-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.bullet-page .caliber-tab {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(100, 116, 139, 0.25);
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bullet-page .caliber-tab:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.35);
}

.bullet-page .caliber-tab.active {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.28), rgba(250, 204, 21, 0.16));
    color: #fef3c7;
    border-color: rgba(250, 204, 21, 0.4);
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.12);
}

/* ---------- Loading ---------- */
.bullet-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 4rem 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.bullet-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(148, 163, 184, 0.2);
    border-top-color: #facc15;
    border-radius: 50%;
    animation: bullet-spin 0.8s linear infinite;
}

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

/* ---------- Table Wrap ---------- */
.bullet-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 170px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.6);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* ---------- Table ---------- */
.bullet-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-size: 0.78rem;
}

.bullet-table th,
.bullet-table td {
    padding: 0.45rem 0.65rem;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

/* ---------- Sticky Header ---------- */
.bullet-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(180deg, #0f172a 0%, #131c2e 100%);
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: none;
    letter-spacing: 0.02em;
    border-bottom: 2px solid rgba(234, 179, 8, 0.25);
    user-select: none;
}

.bullet-table thead th.sortable {
    cursor: pointer;
    transition: color 0.15s ease;
}

.bullet-table thead th.sortable:hover {
    color: #facc15;
}

.bullet-table thead th.sort-asc::after {
    content: ' ▲';
    font-size: 0.6rem;
    color: #facc15;
}

.bullet-table thead th.sort-desc::after {
    content: ' ▼';
    font-size: 0.6rem;
    color: #facc15;
}

/* ---------- Tooltip header ---------- */
.bullet-table thead th[title] {
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    cursor: help;
}

.bullet-table thead th.has-tooltip {
    text-decoration: underline dotted rgba(148, 163, 184, 0.5);
    text-underline-offset: 3px;
    cursor: help;
}

/* Custom CSS Tooltip (Fast appearance) */
.bullet-table thead th.has-tooltip:hover::after {
    content: attr(data-title);
    position: absolute;
    top: calc(100% + 5px); /* show below header */
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: normal;
    min-width: 200px;
    max-width: 300px;
    text-align: left;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 1000;
    pointer-events: none;
    line-height: 1.4;
    animation: tooltipFadeIn 0.1s ease-out forwards;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translate(-50%, 5px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Sticky First Column (Bullet Name) ---------- */
.bullet-table th:first-child,
.bullet-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 200px;
    max-width: 300px;
}

.bullet-table thead th:first-child {
    z-index: 30;
}

.bullet-table td:first-child {
    background: #0f172a;
    font-weight: 600;
    color: #e2e8f0;
    border-right: 2px solid rgba(234, 179, 8, 0.18);
    text-align: center;
    vertical-align: middle;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.bullet-name-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    white-space: normal;
}

/* ---------- Bullet Icon ---------- */
.bullet-icon {
    width: 60px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
}

/* ---------- Body Rows ---------- */
.bullet-table tbody tr {
    background: rgba(15, 23, 42, 0.85);
}

.bullet-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.9);
}

.bullet-table tbody tr td {
    color: #e2e8f0;
}

.bullet-table tbody tr td {
    border-top: 1px solid rgba(234, 179, 8, 0.06);
}

/* ---------- Caliber badge ---------- */
.bullet-caliber-badge {
    display: inline-block;
    background: rgba(234, 179, 8, 0.15);
    color: #fde68a;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    vertical-align: middle;
}

/* ---------- Penetration level ---------- */
.pen-level {
    display: inline-block;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    min-width: 28px;
    text-align: center;
}

/* 0, 1, 2 = 白色背景 */
.pen-level-0, .pen-level-1, .pen-level-2 { background: rgba(255, 255, 255, 0.12); color: #f1f5f9; }

/* 3 = 紫色背景 */
.pen-level-3 { background: rgba(168, 85, 247, 0.2); color: #e879f9; }

/* 4, 5 = 金色背景 */
.pen-level-4, .pen-level-5 { background: rgba(234, 179, 8, 0.2); color: #facc15; }

/* 6, 7 = 紅色背景 */
.pen-level-6, .pen-level-7 { background: rgba(239, 68, 68, 0.22); color: #f87171; }

/* ---------- Bone tags ---------- */
.bone-tag {
    display: inline-block;
    background: rgba(100, 116, 139, 0.18);
    color: #94a3b8;
    font-size: 0.66rem;
    padding: 0.08rem 0.35rem;
    border-radius: 3px;
    margin: 0.05rem 0.1rem;
}

/* ---------- Positive / Negative value colors ---------- */
.val-positive {
    color: #4ade80;
}

.val-negative {
    color: #f87171;
}

/* ---------- Scrollbar ---------- */
.bullet-table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.bullet-table-wrap::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

.bullet-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 4px;
}

.bullet-table-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

.bullet-table-wrap::-webkit-scrollbar-corner {
    background: rgba(15, 23, 42, 0.5);
}
