/* タブデザイン */
.custom-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 10px;
}

.custom-tab-btn {
    color: var(--text-sub);
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s ease;
    cursor: pointer;
}

    .custom-tab-btn:hover {
        color: var(--accent-neon-red);
    }

    .custom-tab-btn::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: transparent;
        transform: scaleX(0);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease;
    }

    .custom-tab-btn:hover::after {
        background-color: var(--accent-neon-red);
        transform: scaleX(1);
        box-shadow: 0 0 8px rgba(255, 0, 60, 0.6);
    }

    .custom-tab-btn.active {
        color: var(--primary-color);
    }

        .custom-tab-btn.active::after {
            background-color: var(--primary-color);
            transform: scaleX(1);
            box-shadow: 0 0 8px rgba(0, 243, 255, 0.6);
        }

.custom-search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 600px;
}

    .custom-search-container .search-input {
        flex: 1;
    }

.table-container {
    background-color: var(--bg-panel);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    overflow-x: auto;
}

.custom-dark-table {
    width: 100%;
    color: var(--text-main);
    background-color: transparent;
    border-collapse: collapse;
    margin-bottom: 0;
    text-align: left;
}

    .custom-dark-table thead th {
        border-bottom: 1px solid var(--border-color);
        color: var(--text-sub);
        font-weight: normal;
        padding: 12px 20px;
        white-space: nowrap;
    }

    .custom-dark-table tbody td {
        padding: 16px 20px;
        border-bottom: none;
        color: var(--text-main);
        vertical-align: middle;
    }

    .custom-dark-table tbody tr {
        transition: all 0.2s ease;
        border-radius: 8px;
        border-left: 3px solid transparent;
        background-image: linear-gradient(to right, transparent 2%, rgba(255, 255, 255, 0.1) 2%, rgba(255, 255, 255, 0.1) 98%, transparent 98%);
        background-size: 100% 1px;
        background-position: bottom;
        background-repeat: no-repeat;
    }

        .custom-dark-table tbody tr:hover {
            background-color: rgba(255, 0, 60, 0.04);
            border-left-color: var(--accent-neon-red);
            box-shadow: inset 20px 0 20px -20px rgba(255, 0, 60, 0.3);
        }

.rank-col {
    font-weight: bold;
    width: 60px;
}

.name-col {
    font-weight: bold;
    font-size: 1.05rem;
}

.rate-col {
    font-weight: bold;
    letter-spacing: 0.5px;
}

.custom-dark-table tbody tr.highlight-row {
    background-color: rgba(14, 165, 233, 0.1);
}

.custom-dark-table .highlight-text {
    font-weight: bold;
    color: var(--primary-color) !important;
    text-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
}

.user-selection-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-neon-red);
    max-width: 700px;
}

.selection-label {
    font-weight: bold;
    color: var(--text-sub);
    white-space: nowrap;
}

.user-select-dropdown {
    flex: 1;
    background-color: var(--bg-base);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 1.1rem;
    border-radius: 4px;
    padding: 8px 12px;
}
    .user-select-dropdown:focus {
        border-color: var(--accent-neon-red);
        box-shadow: 0 0 15px rgba(255, 0, 60, 0.3);
        outline: none;
    }

.record-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    border-left: 4px solid;
    padding-left: 10px;
}

.best-record-theme {
    color: var(--accent-neon-red);
    border-color: var(--accent-neon-red);
}

.recent-record-theme {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.rate-change-positive {
    color: var(--primary-hover);
    font-weight: bold;
}

.rate-change-negative {
    color: var(--accent-neon-red);
    font-weight: bold;
}

/* MASTER (#ff003c) */
td.rate-col.rank-master {
    color: #ff003c;
    text-shadow: 0 0 8px rgba(255, 0, 60, 0.6);
}

/* EXPERT-A (#ff00b4) */
td.rate-col.rank-expert-a {
    color: #ff00b4;
    text-shadow: 0 0 8px rgba(255, 0, 180, 0.6);
}

/* EXPERT-B (#b026ff) */
td.rate-col.rank-expert-b {
    color: #b026ff;
    text-shadow: 0 0 8px rgba(176, 38, 255, 0.6);
}

/* ELITE-A (#0055ff) */
td.rate-col.rank-elite-a {
    color: #0055ff;
    text-shadow: 0 0 8px rgba(0, 85, 255, 0.6);
}

/* ELITE-B (#00aeff) */
td.rate-col.rank-elite-b {
    color: #00aeff;
    text-shadow: 0 0 8px rgba(0, 174, 255, 0.6);
}

/* VETERAN (#ffb800) */
td.rate-col.rank-veteran {
    color: #ffb800;
    text-shadow: 0 0 8px rgba(255, 184, 0, 0.6);
}

/* REGULAR (#00f3ff) */
td.rate-col.rank-regular {
    color: #00f3ff;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.6);
}

/* ROOKIE (#a0aeba) */
td.rate-col.rank-rookie {
    color: #a0aeba;
    text-shadow: none;
}

/* 順位用カラー */
.rank-gold {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.rank-silver {
    color: #e2e8f0;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(226, 232, 240, 0.5);
}

.rank-bronze {
    color: #d97706;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(217, 119, 6, 0.5);
}

/* プロフィールダッシュボード */
.profile-dashboard {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-panel);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* シェアメニュー全体（画像化の際は無視される） */
.share-menu-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
}

/* メインの共有アイコンボタン */
.share-trigger-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .share-trigger-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-main);
        border-color: var(--text-main);
    }

/* 展開されるドロップダウンメニュー */
.share-dropdown-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    min-width: 150px;
    animation: fadeInDown 0.2s ease forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* メニュー内の各ボタン */
.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-main);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s;
    text-align: left;
    width: 100%;
}

    .share-dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--primary-color);
    }

/* X用の黒丸アイコン */
.x-icon-circle {
    background-color: #000;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-top-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.profile-info-left {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-gauge-right {
    flex: 1;
    min-width: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* プロフィール情報のカードデザイン */
.profile-details {
    background-color: transparent;
    padding: 0;
    border: none;
}

.profile-item {
    display: flex;
    flex-direction: column;
}

.profile-label {
    color: var(--text-sub);
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.profile-rank {
    font-family: var(--font-title);
    font-size: 2.8rem;
    line-height: 1;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.profile-value {
    font-family: var(--font-cyber);
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: bold;
}

/* 直近5大会のセクション */
.recent-five-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
}

.recent-five-list {
    display: grid;
    /* 常に3列（上段3個、下段2個）になるように固定 */
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.recent-five-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.recent-t-name {
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.recent-t-rank {
    font-weight: bold;
}

/* RateGauge コンポーネントの上書き修正 */
.gauge-next {
    font-family: var(--font-base);
    background-color: var(--bg-base);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    position: absolute;
    bottom: 15px;
    z-index: 2;
}

.next-label {
    font-size: 0.65rem;
    color: var(--text-sub);
    font-weight: bold;
}

.next-diff {
    font-size: 0.75rem;
    color: var(--text-main);
}

    .next-diff span {
        color: var(--primary-color);
        font-family: var(--font-cyber);
        font-size: 0.95rem;
        font-weight: bold;
    }

.rate-gauge-container {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
}

.rate-gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(135deg);
    transform-origin: center;
}

.gauge-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 377 503;
}

.gauge-progress {
    fill: none;
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 377 503;
    stroke-dashoffset: 377;
    stroke-dashoffset: var(--target-offset, 0);
    animation: fillGauge 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fillGauge {
    0% {
        stroke-dashoffset: 377;
    }

    100% {
        stroke-dashoffset: var(--target-offset);
    }
}

.gauge-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.gauge-title {
    font-family: var(--font-title);
    font-size: 1.3rem;
    letter-spacing: 2px;
    margin-bottom: -5px;
}

.gauge-value {
    font-family: var(--font-title);
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.value-main {
    font-size: 3.8rem;
    font-weight: 700;
    line-height: 1;
}

.value-sub {
    font-size: 1.6rem;
    color: var(--text-sub);
    margin-left: 2px;
}
