/* =========================================
   VARIABLES & RESET
   ========================================= */
:root {
    --bg-body: #09090b;
    --bg-card: #18181b;
    --bg-card-hover: #27272a;
    --bg-surface: #121214;
    --bg-surface-hover: #1c1c1f;
    --color-border: #27272a;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;

    --primary: #bef264;
    /* Lime Green */
    --primary-dim: rgba(190, 242, 100, 0.15);
    --primary-glow: rgba(190, 242, 100, 0.6);

    --font-ui: 'Inter', 'Noto Sans JP', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Scanner Page Override */
#page-scanner {
    --text-main: #f4f4f5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--bg-body);
}

body {
    background-color: transparent;
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* =========================================
   COMMON COMPONENTS
   ========================================= */

/* --- Pixel Transition Animation --- */
#pixel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    flex-wrap: wrap;
    pointer-events: none;
}

.pixel-block {
    background: var(--primary);
    transform: scaleY(0);
    transform-origin: bottom;
}

.pixel-block.anim-rise {
    animation: blockRise 0.4s steps(5, end) forwards;
}

.pixel-block.anim-fade {
    transform-origin: top;
    animation: blockFade 0.4s steps(5, end) forwards;
    background: #000;
}

@keyframes blockRise {
    0% {
        transform: scaleY(0);
    }

    100% {
        transform: scaleY(1);
    }
}

@keyframes blockFade {
    0% {
        transform: scaleY(1);
    }

    100% {
        transform: scaleY(0);
    }
}

/* --- Header & Navigation --- */
header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #27272a;
    backdrop-filter: blur(10px);
    background: rgba(9, 9, 11, 0.8);
    position: sticky;
    top: 0;
    z-index: 50;
}

.logo,
.header-logo-link {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: 24px;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 51;
    display: flex;
    align-items: center;
}

.logo span,
.header-logo-link span,
.header-logo-link h1 span {
    color: #ffffff;
}

.logo img {
    height: 28px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    position: relative;
    z-index: 51;
}

.social-link:hover {
    opacity: 0.8;
}

.social-link img {
    display: block;
    width: auto;
    height: 20px;
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    z-index: 60;
}

.menu-btn span {
    display: block;
    background: #fff;
    height: 2px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-btn span:nth-child(1) {
    width: 30px;
}

.menu-btn span:nth-child(2) {
    width: 24px;
}

.menu-btn span:nth-child(3) {
    width: 30px;
}

.menu-btn:hover span {
    width: 30px;
    background: var(--primary);
}

.nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #18181b;
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 55;
    padding: 100px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.nav-overlay.active {
    transform: translateX(0);
}

.nav-overlay a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    transition: color 0.2s;
}

.nav-overlay a:hover {
    color: var(--primary);
}

.nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 54;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.nav-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-mono);
    opacity: 0.6;
    margin-top: auto;
}

/* =========================================
   PAGE: HOME (#page-home)
   ========================================= */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-body);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
}

#loading-screen.hidden {
    display: none;
}

.loader-title {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    text-shadow: 0 0 10px var(--primary-glow);
}

.progress-bar-bg {
    width: 300px;
    height: 4px;
    background: #27272a;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    box-shadow: 0 0 15px var(--primary-glow);
    transition: width 0.2s ease;
}

.loader-status {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    height: 1.5em;
}

.main-wrapper {
    opacity: 0;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s;
}

.main-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

#page-about .main-wrapper,
#page-blog .main-wrapper,
#page-contact .main-wrapper,
#page-scanner .main-wrapper {
    opacity: 1;
    transform: translateY(0);
}

#page-home .hero {
    text-align: center;
    padding: 80px 20px 60px 20px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#page-home .hero h1 {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 64px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
    color: #fff;
    letter-spacing: 0.05em;
}

#page-home .hero h1,
#page-home .hero p {
    max-width: 800px;
    width: 100%;
}

.hero-sub {
    font-family: var(--font-mono);
    font-size: 0.4em;
    color: var(--primary);
    font-weight: 400;
    display: block;
    margin-top: 10px;
    letter-spacing: 0.1em;
}

#page-home .hero p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
}

.home-search-container {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.home-search-box {
    position: relative;
    width: 100%;
    max-width: 1000px;
    display: flex;
    align-items: center;
}

.home-search-input {
    width: 100%;
    padding: 24px 32px;
    padding-right: 70px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 50px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    font-family: 'Inter', sans-serif;
}

.home-search-input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 20px var(--primary-glow);
}

.home-search-btn {
    position: absolute;
    right: 12px;
    background: var(--primary);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-body);
    transition: transform 0.2s;
}

.home-search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Cards (Home) */
.card {
    background: var(--bg-card);
    border: 1px solid #27272a;
    border-radius: 16px;
    padding: 30px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 240px;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-8px);
    background: var(--bg-card-hover);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.card:hover::before {
    opacity: 1;
}

.card-logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.card-logo img {
    max-height: 100%;
    max-width: 100px;
    object-fit: contain;
}

.card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.card p {
    color: var(--text-muted);
    font-size: 14px;
}

.card-arrow {
    margin-top: auto;
    align-self: flex-end;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s;
}

.card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.featured-container {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
    width: 100%;
}

.featured-card {
    width: 100%;
    height: auto;
    min-height: 160px;
    flex-direction: row;
    align-items: center;
}

.featured-content {
    flex: 1;
}

.featured-arrow {
    margin-left: 20px;
    margin-top: 0;
    align-self: center;
}

.card-icon {
    font-size: 40px;
    margin-bottom: 20px;
    color: var(--primary);
}

.section-title {
    max-width: 1200px;
    margin: 40px auto 24px;
    padding: 0 20px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 32px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 20px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #27272a;
}

.grid-container {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    width: 100%;
}

.grid-card {
    height: 240px;
}

.grid-card .card-arrow {
    margin-top: auto;
    align-self: flex-end;
}

@media (max-width: 768px) {
    #page-home .hero h1 {
        font-size: 42px;
    }

    .home-search-input {
        padding: 18px 24px;
        font-size: 16px;
    }

    .featured-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }

    .featured-arrow {
        margin-left: 0;
        margin-top: 20px;
        align-self: flex-end;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   PAGE: ABOUT (#page-about)
   ========================================= */
.content-wrapper {
    max-width: 800px;
    margin: 0 auto 60px;
    padding: 0 20px;
    width: 100%;
}

#page-about .hero,
#page-blog .hero,
#page-contact .hero {
    text-align: center;
    padding: 80px 0 60px;
}

#page-about .hero h1,
#page-blog .hero h1,
#page-contact .hero h1 {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

#page-about .hero p,
#page-blog .hero p,
#page-contact .hero p {
    color: var(--text-muted);
    font-size: 16px;
}

.section {
    margin-bottom: 60px;
}

.section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    font-family: 'Noto Sans JP', sans-serif;
}

.section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-top: 40px;
    margin-bottom: 16px;
    font-family: 'Noto Sans JP', sans-serif;
}

.section p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 16px;
    font-size: 15px;
}

.section strong {
    color: #fff;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    text-align: center;
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.feature-title {
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* =========================================
   PAGE: SCANNER (#page-scanner)
   ========================================= */
#page-scanner .main-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    flex: 1;
}

#page-scanner header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    padding-top: 20px;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(8px);
}

#page-scanner .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

#page-scanner h1 {
    margin: 0;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.05em;
}

.header-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-ui);
    letter-spacing: 0.05em;
}

.stats-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--primary);
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    border-radius: 4px;
    background: var(--primary-dim);
    white-space: nowrap;
}

.date-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.scanner-info {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.controls {
    background: rgba(18, 18, 20, 0.6);
    border: 1px solid var(--color-border);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    position: static;
    z-index: 1;
    box-shadow: none;
}

.search-wrapper {
    position: relative;
    flex: 0 0 100%;
    display: flex;
    align-items: center;
}

.help-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 5;
}

.help-btn:hover {
    background: var(--primary);
    color: var(--bg-body);
}

/* クリアボタン(x)の位置を左にずらして、[x] [?] の順序に見せる */
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: searchfield-cancel-button;
    margin-right: 32px;
    cursor: pointer;
}

#page-scanner input,
#page-scanner select {
    background: var(--bg-body);
    border: 1px solid var(--color-border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    width: 100%;
    height: 48px;
}

#page-scanner select {
    flex: 1;
    width: auto;
}

.search-wrapper input {
    padding-right: 80px;
}

#page-scanner input:focus,
#page-scanner select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

/* --- 新しいトップページレイアウト --- */
.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1000px;
    margin: 40px auto 240px;
    width: 100%;
}

/* ポップアップのためのラッパー */
.team-wrapper {
    position: relative;
    /* Gridの子要素として振る舞うため特に追加スタイル不要だが、
       ポップアップの基準位置となる */
}

.nav-card {
    position: relative;
    /* 内部要素の絶対配置用 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    height: 140px;
    /* 少し高さを抑制 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    /* はみ出し防止（ポップアップは親の外に出す必要があるため注意） */
}

/* チームラッパー内のカードはoverflowを許可しないとポップアップが出ない？
   いや、ポップアップはwrapperの子なので、cardの子ではない。
   card自体はoverflow:hiddenであってもよい。
*/

.nav-content {
    transition: all 0.3s ease;
    width: 100%;
}

.nav-hover-text {
    position: absolute;
    top: 50%;
    right: 30px;
    /* 右側に配置 */
    left: auto;
    /* 中央配置を解除 */
    transform: translateY(-50%) translateX(20px);
    /* 初期位置：少し右にずらす */
    opacity: 0;
    font-size: 14px;
    /* 少し小さめに */
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
    width: auto;
    /* 幅制限解除 */
    transition: all 0.3s ease;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    /* 視認性確保 */
}

/* ホバー時の挙動 */
.nav-card:hover .nav-content {
    /* テキストは消さない */
    opacity: 1;
    transform: translateX(-15px);
    /* 少し左にずらしてスペースを作る */
}

.nav-card:hover .nav-hover-text {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    /* 定位置へ */
}

.nav-card h2 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
}

.nav-card p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* 指定のシアン系カラー */
.cyan-card {
    background-color: #98c8cd;
    background: linear-gradient(135deg, #aadde2 0%, #90c0c5 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cyan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(152, 200, 205, 0.4);
    filter: brightness(1.05);
}

.cyan-card h2,
.cyan-card p {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.full-width {
    grid-column: 1 / -1;
    height: 100px;
}

/* --- チームポップアップ --- */
.team-popup {
    position: absolute;
    /* デスクトップ: TEAMSカードの下に隙間なく配置 */
    top: 100%;
    left: 50%;
    right: auto;
    
    /* 初期状態: 中央揃え + 少し上にずれて縮小 */
    transform: translate(-50%, -10px) scale(0.95);
    transform-origin: top center;

    width: 1000px;
    height: auto;
    max-height: 600px;

    background: rgba(9, 9, 11, 0.95);
    border: 1px solid #89ed54;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(137, 237, 84, 0.1);
    padding: 24px;
    backdrop-filter: blur(10px);

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;

    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;

    overflow-y: auto;
    
    /* Firefox Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #89ed54 #09090b;
}

/* Webkit Scrollbar for Team Popup */
.team-popup::-webkit-scrollbar {
    width: 6px;
}

.team-popup::-webkit-scrollbar-track {
    background: #09090b;
    border-radius: 3px;
}

.team-popup::-webkit-scrollbar-thumb {
    background: #89ed54;
    border-radius: 3px;
    transition: background 0.3s, box-shadow 0.3s;
}

.team-popup::-webkit-scrollbar-thumb:hover {
    background: #a3f576;
    box-shadow: 0 0 8px rgba(137, 237, 84, 0.8);
}

/* 矢印は不要なので削除 */
.team-popup::before {
    display: none;
}

/* チームボタン自体のホバーで表示（デスクトップ） */
.team-wrapper:hover .team-popup,
.team-wrapper.active .team-popup,
.team-popup:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}

/* ポップアップ初期状態（デスクトップ） */
.team-wrapper .team-popup {
    /* 上記の .team-popup 定義で初期状態を設定済みのため削除 */
    /* transform: translateX(-20px) scale(0.95); */
}


.team-mini-card {
    /* .nav-card のスタイルを継承しつつ上書き */
    height: 120px;
    flex-direction: row;
    /* 横並び */
    gap: 16px;
    padding: 0 20px;
    transition: all 0.2s ease;
}

.team-mini-card:hover {
    transform: translateY(-2px);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(137, 237, 84, 0.5) !important;
}

.team-mini-card:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 2px 5px rgba(137, 237, 84, 0.1) !important;
    transition: all 0.05s ease-out;
}

/* ミニカード内のホバーテキスト調整 */
.team-mini-card .nav-hover-text {
    font-size: 12px;
    right: 16px;
}

.team-mini-card .nav-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

.team-name {
    color: #89ed54;
    font-weight: 700;
    font-size: 16px;
}

@media (max-width: 960px) {
    .nav-grid {
        grid-template-columns: 1fr;
    }

    .team-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        right: auto;
        width: 90vw;
        max-width: 400px;
        height: auto;
        max-height: 80vh;
        
        /* モバイル初期状態 */
        transform: translate(-50%, -45%) scale(0.95);
        transform-origin: center center;
        
        grid-template-columns: 1fr;
        box-shadow: 0 0 0 100vmax rgba(0,0,0,0.7); /* 背景暗転 */
    }

    .team-wrapper:hover .team-popup,
    .team-wrapper.active .team-popup,
    .team-popup:hover {
        transform: translate(-50%, -50%) scale(1);
    }
}

.list-header {
    display: grid;
    grid-template-columns: 180px 140px 2fr 1.5fr 0.8fr 100px 70px;
    padding: 12px 20px;
    font-size: 13px;
    text-transform: uppercase;
    color: #52525b;
    font-weight: 600;
    letter-spacing: 0.05em;
    position: sticky;
    top: 85px;
    z-index: 30;
    gap: 16px;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 8px;
}

.list-header div {
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.list-header div:hover {
    color: var(--primary);
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
}

.data-row {
    display: grid;
    grid-template-columns: 180px 140px 2fr 1.5fr 0.8fr 100px 70px;
    align-items: center;
    gap: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px 20px;
    transition: all 0.2s ease;
}

.data-row:hover {
    background: var(--bg-surface-hover);
    border-color: #3f3f46;
    transform: translateX(4px);
}

.col-player {
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.field-badge {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    background: #27272a;
    padding: 4px 8px;
    border-radius: 4px;
}

.col-value {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 14px;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 8px;
}

.col-command {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #71717a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-message {
    font-size: 12px;
    color: #71717a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    cursor: pointer;
    transition: color 0.2s;
    word-break: break-all;
}

.col-message:hover {
    color: var(--text-muted);
}

.col-message.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.col-source {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 4px;
}

.col-action {
    text-align: center;
    display: flex;
    justify-content: center;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-link {
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    color: var(--bg-body);
    background: var(--text-muted);
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-link:hover {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.no-results {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.copied {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #18181b;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #18181b;
    z-index: 10;
}

.modal-header h2 {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--primary);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
}

.guide-section {
    margin-bottom: 24px;
}

.guide-section:last-child {
    margin-bottom: 0;
}

.guide-section h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-section ul {
    padding-left: 20px;
    color: #d4d4d8;
    font-size: 13px;
    line-height: 1.6;
}

.guide-section li {
    margin-bottom: 8px;
}

.guide-section code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--primary);
    margin: 0 4px;
}

@media (max-width: 900px) {
    .list-header {
        display: none;
    }

    .data-row {
        grid-template-columns: 1fr auto;
        /* モバイルレイアウト調整: ソースも表示に含める */
        grid-template-areas: "player action" "value value" "field source" "command command" "message message";
        gap: 12px;
    }

    .col-player {
        grid-area: player;
        font-size: 16px;
    }

    .col-action {
        grid-area: action;
    }

    .col-value {
        grid-area: value;
        border-bottom: 1px solid #27272a;
        padding-bottom: 8px;
    }

    .col-field {
        grid-area: field;
    }

    .col-source {
        grid-area: source;
        text-align: right;
    }

    /* モバイルでは右寄せ */
    .col-command {
        grid-area: command;
        font-size: 10px;
        color: #555;
    }

    .col-message {
        grid-area: message;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }

    .search-wrapper {
        min-width: 100%;
    }

    #page-scanner header {
        position: static;
        padding-top: 0;
        flex-wrap: wrap;
        gap: 10px;
    }

    #page-scanner .header-right {
        margin-left: auto;
    }

    .stats-badge {
        display: none;
    }

    .date-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* =========================================
   PAGE: BLOG (#page-blog)
   ========================================= */
#page-blog .hero {
    padding: 80px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

#page-blog .hero h1 {
    font-size: 36px;
}

.coming-soon-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.coming-soon-text {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.1em;
    opacity: 0.8;
    text-shadow: 0 0 20px var(--primary-glow);
    text-align: center;
    border: 1px dashed var(--color-border);
    padding: 40px 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 768px) {
    #page-blog .hero h1 {
        font-size: 36px;
    }

    .coming-soon-text {
        font-size: 24px;
        padding: 30px 20px;
    }
}

/* =========================================
   PAGE: CONTACT (#page-contact)
   ========================================= */
#page-contact .hero {
    padding: 80px 20px 40px;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto 60px;
    padding: 0 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.email-card {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.email-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.email-icon {
    font-size: 40px;
    margin-bottom: 20px;
    color: var(--primary);
    display: block;
}

.email-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    font-weight: 700;
}

.email-address {
    font-family: var(--font-mono);
    font-size: 18px;
    color: #fff;
    word-break: break-all;
    margin-bottom: 24px;
    display: block;
}

.btn-mail {
    display: inline-block;
    background: var(--primary);
    color: #000;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-mail:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--primary-glow);
}

.form-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    padding: 16px;
    border-radius: 8px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--text-muted);
    padding: 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: not-allowed;
    text-align: center;
}

/* =========================================
   GLITCH EFFECT STYLES
   ========================================= */

/* グリッチを適用する基本クラス */
.glitch-effect {
    position: relative;
    display: inline-block;
    filter: url(#glitch-filter);
    transform: translateZ(0);
    /* GPUアクセラレーション */
}

/* メインタイトルの色指定 */
h1>.glitch-effect:not(.hero-sub) {
    color: #ffffff;
}

/* 走査線（スキャンライン）の追加 */
.glitch-effect::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 2pxごとの細かい横縞 */
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.2) 2px, rgba(0, 0, 0, 0.2) 4px);
    pointer-events: none;
    z-index: 10;
}


/* =========================================
   SEARCH TOGGLE STYLES (MODERN SLIDE)
   ========================================= */

/* 検索モード切り替えトグル（スライド式） */
.search-toggle-wrapper {
    position: absolute;
    top: -42px;
    right: 0;
    display: flex;
    background: rgba(24, 24, 27, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    /* Pill shape */
    padding: 4px;
    height: 36px;
    width: 200px;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
}

.toggle-slide {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #5eead4;
    /* Cyan Accent */
    border-radius: 9999px;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
}

.toggle-item {
    flex: 1;
    z-index: 2;
    text-align: center;
    line-height: 26px;
    /* height - padding*2 */
    font-size: 11px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s;
    user-select: none;
}

/* アクティブ時のテキスト色（スライダーの上に来る文字） */
.search-toggle-wrapper[data-mode="pro"] .toggle-item:nth-child(2),
/* 1st item (PRO) is 2nd child because slide is 1st */
.search-toggle-wrapper[data-mode="streamer"] .toggle-item:nth-child(3) {
    color: #111;
    /* 黒文字 */
}

/* ストリーマーモード時のスライダー移動 */
.search-toggle-wrapper[data-mode="streamer"] .toggle-slide {
    transform: translateX(100%);
    /* 右へ移動 */
}

/* =========================================
   CYBERPUNK GRID BACKGROUND
   ========================================= */
.cyber-grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    background-color: var(--bg-body);
    overflow: hidden;
    pointer-events: none;
}

.grid-lines {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(to right, rgba(137, 237, 84, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(137, 237, 84, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    animation: cyberGridMove 4s linear infinite;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 100%);
}

@keyframes cyberGridMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 50px;
    }
}

/* =========================================
   BACK TO TOP BUTTON
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(9, 9, 11, 0.8);
    border: 1px solid var(--primary);
    border-radius: 50%;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-5px);
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes blink-text {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(137, 237, 84, 0.8); }
    50% { opacity: 0.3; text-shadow: none; }
}

.blink-text {
    animation: blink-text 2s infinite ease-in-out;
}