:root {
    --bg-color: #0b0f19;
    --container-bg: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    
    --primary: #00f0ff;
    --primary-glow: rgba(0, 240, 255, 0.4);
    --secondary: #ff0055;
    --secondary-glow: rgba(255, 0, 85, 0.4);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.4);
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(255, 0, 85, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 240, 255, 0.15) 0px, transparent 50%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ヘッダー */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-badge {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.school-info {
    font-size: 0.9rem;
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
    font-weight: 600;
}

/* メインレイアウト */
.main-container {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 1.5rem;
    padding: 1.5rem;
    flex: 1;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* パネル共通 */
.panel {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s;
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.panel-title span.icon {
    font-size: 1.2rem;
}

/* 左側：エディタ側 */
.editor-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 380px;
}

.editor-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    background: #1e1e1e;
    border-bottom: 1px solid var(--border-color);
}

#monacoEditor {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 350px;
}

/* フォールバック用テキストエリア */
#fallbackEditor {
    display: none;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 350px;
    background: #0d1117;
    color: #c9d1d9;
    font-family: 'JetBrains Mono', Courier New, monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 1rem;
    border: none;
    outline: none;
    resize: none;
    white-space: pre;
    overflow-x: auto;
    tab-size: 4;
}

.hack-hints {
    border-top: 1px solid var(--border-color);
    background: rgba(11, 15, 25, 0.78);
    padding: 0.9rem 1rem 1rem;
    max-height: 520px;
    overflow-y: auto;
}

.hack-hints-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.hack-hints-title {
    color: var(--success);
    font-weight: 800;
    font-size: 0.95rem;
}

.hack-hints-subtitle {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    margin-top: 0.15rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.recipe-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recipe-section {
    margin-top: 1rem;
}

.recipe-section:first-of-type {
    margin-top: 0;
}

.recipe-section-title {
    color: #f59e0b;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.recipe-card {
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    padding: 0.7rem;
    min-width: 0;
}

.recipe-name {
    color: var(--text-color);
    font-weight: 800;
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
}

.recipe-card code {
    display: block;
    color: #a7f3d0;
    font-family: 'JetBrains Mono', Courier New, monospace;
    font-size: 0.72rem;
    line-height: 1.45;
    white-space: normal;
}

.recipe-effect {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.45;
    margin: 0.55rem 0;
}

.hint-cheatsheet {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.hint-cheatsheet span {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 0.25rem 0.4rem;
}

.hint-cheatsheet code {
    color: #f59e0b;
    font-family: 'JetBrains Mono', Courier New, monospace;
}

@media (max-width: 900px) {
    .recipe-grid {
        grid-template-columns: 1fr;
    }
}

/* エディタ状態バッジ */
#editorStatusBadge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    transition: all 0.3s;
}

/* ボタン類 */
.action-bar {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
}

.btn {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    padding: 0.8rem 1.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00a2ff);
    color: #0b0f19;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 右側：ゲーム＆ミッション */
.preview-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ゲーム枠 */
.game-wrapper {
    position: relative;
    width: 100%;
    padding-top: 65%; /* 縦方向を少し広くして大きく見せる */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* エラー表示 */
.error-console {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 1rem;
    color: #fca5a5;
    font-family: monospace;
    font-size: 0.85rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.error-console.visible {
    display: block;
}

.error-console-title {
    color: #ef4444;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ミッションボード */
.mission-board {
    flex: 1;
}

.mission-list {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mission-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mission-item.clear {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
}

.mission-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mission-item.clear .mission-checkbox {
    background-color: var(--success);
    border-color: var(--success);
    color: #0b0f19;
    box-shadow: 0 0 10px var(--success-glow);
}

.mission-content {
    flex: 1;
}

.mission-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    transition: color 0.3s;
}

.mission-item.clear .mission-title {
    color: var(--success);
    text-decoration: line-through;
    opacity: 0.8;
}

.mission-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mission-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.mission-item.clear .mission-badge {
    background: var(--success);
    color: #0b0f19;
}

/* チュートリアルポップアップ */
.intro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.intro-card {
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-card h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.intro-steps {
    text-align: left;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.intro-step-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.intro-step-item:last-child {
    margin-bottom: 0;
}

.intro-step-num {
    background: var(--primary);
    color: #0b0f19;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.intro-step-text {
    font-size: 0.95rem;
    color: var(--text-color);
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 成功アニメーション */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--primary);
    z-index: 99;
    border-radius: 50%;
}

/* 認定証モーダル */
.complete-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 12, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1.5rem;
    display: none; /* 初期状態は非表示 */
}

.complete-card {
    background: linear-gradient(135deg, #111827 0%, #0b0f19 100%);
    border: 2px solid #f59e0b; /* ゴールド */
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.25), inset 0 0 20px rgba(245, 158, 11, 0.1);
    border-radius: 24px;
    max-width: 650px;
    width: 100%;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: scaleUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.complete-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 45%,
        rgba(0, 240, 255, 0.05) 48%,
        rgba(255, 0, 85, 0.05) 50%,
        rgba(0, 240, 255, 0.05) 52%,
        transparent 55%
    );
    transform: rotate(30deg);
    animation: holo-sweep 6s linear infinite;
    pointer-events: none;
}

@keyframes holo-sweep {
    0% { transform: translate(-20%, -20%) rotate(30deg); }
    100% { transform: translate(20%, 20%) rotate(30deg); }
}

.cert-header {
    margin-bottom: 1.25rem;
}

.cert-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #f59e0b;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    margin-bottom: 0.25rem;
}

.cert-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.cert-body {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(245, 158, 11, 0.15);
    padding: 1.75rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    position: relative;
}

.cert-recipient {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    display: inline-block;
    min-width: 200px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.cert-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-color);
    text-align: left;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cert-stamp {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 75px;
    height: 75px;
    border: 3px double #ef4444;
    border-radius: 50%;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    transform: rotate(-15deg);
    opacity: 0.8;
    background: rgba(239, 68, 68, 0.05);
    user-select: none;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
}

.name-input-area {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.input-cyber {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
    width: 220px;
}

.input-cyber:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.complete-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ライブハックログ */
.online-log-board {
    border-color: rgba(0, 240, 255, 0.15) !important;
}

.connection-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    transition: all 0.3s;
}

.connection-badge.offline {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.online-log-wrapper {
    height: 105px;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: rgba(5, 7, 12, 0.4);
    border-top: 1px solid var(--border-color);
}

.online-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.log-entry {
    animation: logFadeIn 0.3s ease-out forwards;
    border-left: 2px solid var(--primary);
    padding-left: 0.6rem;
    line-height: 1.4;
    color: var(--text-color);
}

.log-entry.damage {
    border-left-color: var(--secondary);
    color: #ffd2d2;
}

.log-entry.hack {
    border-left-color: var(--warning);
    color: #ffe875;
    font-weight: bold;
}

.log-entry.system {
    border-left-color: var(--success);
    color: #d2ffd2;
}

@keyframes logFadeIn {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ハックインジェクション時のグリッチエフェクト */
.hacked-glitch {
    animation: cyber-glitch 0.4s steps(2) infinite;
    border-color: var(--success) !important;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4) !important;
}

@keyframes cyber-glitch {
    0% { transform: translate(2px, 1px) rotate(0deg); filter: hue-rotate(90deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); filter: hue-rotate(0deg); }
}

/* HUDハック強調 */
.hacked-val {
    color: #10b981 !important; /* 明るい緑 */
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.8) !important;
    font-weight: 900 !important;
    position: relative;
    animation: neon-blink 1.5s infinite alternate;
}

.hacked-val::after {
    content: ' ⚡';
    font-size: 0.85em;
    color: #f59e0b;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
    display: inline-block;
    animation: bounce-quick 0.5s ease infinite alternate;
}

@keyframes neon-blink {
    0% { opacity: 0.95; }
    100% { opacity: 1; }
}
@keyframes bounce-quick {
    0% { transform: translateY(0); }
    100% { transform: translateY(-2px); }
}

/* 共闘レイドボスHPバー */
.raid-boss-area {
    background: rgba(17, 24, 39, 0.85);
    border: 2px solid var(--secondary);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.25);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    animation: fadeIn 0.4s ease;
}

.raid-boss-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.raid-title {
    color: #ff0055;
    text-shadow: 0 0 8px rgba(255, 0, 85, 0.5);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.active-players {
    font-size: 0.75rem;
    color: var(--primary);
    text-shadow: 0 0 6px var(--primary-glow);
    background: rgba(0, 240, 255, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.raid-hp-bar-container {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 22px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.raid-hp-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #ff0055, #ef4444);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.6);
    transition: width 0.3s ease;
}

.raid-hp-text {
    position: relative;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    z-index: 2;
}

/* 対戦マッチングステータスエリア */
.pvp-area {
    background: rgba(17, 24, 39, 0.85);
    border: 2px solid #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: fadeIn 0.4s ease;
}

.pvp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.pvp-eyebrow {
    color: #f59e0b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: 0.15rem;
}

.pvp-status-text {
    color: #10b981;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.35;
}

.pvp-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}

.pvp-small-btn {
    padding: 0.32rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 7px;
}

.pvp-meta-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
}

.pvp-meta-label {
    color: #6b7280;
    font-size: 0.68rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.pvp-room-info {
    color: #d1d5db;
    font-family: 'JetBrains Mono', Courier New, monospace;
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pvp-record-box {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 0.35rem;
    align-items: center;
    text-align: right;
}

.pvp-record-box .pvp-meta-label {
    grid-column: 1 / -1;
}

.pvp-record-text {
    color: #f59e0b;
    font-weight: 900;
    font-family: 'JetBrains Mono', Courier New, monospace;
    font-size: 0.86rem;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* VS画面スタイル拡張 */
#pvpVsContainer {
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.18);
    transition: all 0.3s ease;
}

#pvpVsContainer span {
    font-weight: bold;
}

.pvp-vs-container {
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 10px;
    padding: 0.75rem;
}

.pvp-vs-title {
    text-align: center;
    color: #f59e0b;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    margin-bottom: 0.65rem;
}

.pvp-vs-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.6rem;
    align-items: stretch;
}

.pvp-player-card {
    border-radius: 9px;
    padding: 0.7rem;
    min-width: 0;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pvp-player-me {
    border-color: rgba(0, 240, 255, 0.28);
}

.pvp-player-opponent {
    border-color: rgba(255, 0, 85, 0.32);
}

.pvp-player-label {
    color: #6b7280;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    margin-bottom: 0.2rem;
}

.pvp-player-name {
    font-weight: 900;
    font-size: 0.94rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.55rem;
}

.pvp-player-me .pvp-player-name {
    color: #00f0ff;
}

.pvp-player-opponent .pvp-player-name {
    color: #ff0055;
}

.pvp-stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.32rem;
}

.pvp-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.32rem 0.42rem;
    min-height: 1.85rem;
}

.pvp-stat span {
    color: #9ca3af;
    font-size: 0.7rem;
    font-weight: 800;
}

.pvp-stat strong {
    color: #f9fafb;
    font-family: 'JetBrains Mono', Courier New, monospace;
    font-size: 0.76rem;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pvp-vs-badge {
    align-self: center;
    color: #0b0f19;
    background: #f59e0b;
    border-radius: 999px;
    padding: 0.28rem 0.42rem;
    font-size: 0.72rem;
    font-weight: 900;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.38);
}

.pvp-vs-note {
    color: #9ca3af;
    font-size: 0.7rem;
    line-height: 1.45;
    margin-top: 0.55rem;
    text-align: center;
}

/* チート検出時の点滅アニメーション */
.cheat-active {
    animation: blink-red 1s infinite alternate;
}

@keyframes blink-red {
    0% { color: #f3f4f6; }
    100% { color: #ef4444; text-shadow: 0 0 8px rgba(239, 68, 68, 0.8); }
}

/* 戦績リセットボタン */
.pvp-reset-btn {
    font-size: 0.75rem;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 0.5rem;
    font-family: inherit;
    transition: color 0.2s;
}

.pvp-reset-btn:hover {
    color: #ef4444;
}

@media (max-width: 720px) {
    .pvp-header,
    .pvp-meta-row {
        grid-template-columns: 1fr;
    }

    .pvp-header {
        flex-direction: column;
    }

    .pvp-actions {
        width: 100%;
    }

    .pvp-small-btn {
        flex: 1;
        justify-content: center;
    }

    .pvp-meta-row {
        display: grid;
    }

    .pvp-record-box {
        text-align: left;
        justify-content: start;
    }

    .pvp-vs-grid {
        grid-template-columns: 1fr;
    }

    .pvp-vs-badge {
        justify-self: center;
    }
}

/* GUIセレクトボックスのスタイル */
.gui-select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
}
.gui-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* GUIパネル全体のレイアウト */
.gui-panel {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    overflow-y: auto;
}

.gui-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.75rem;
}

/* 各調整項目グループ */
.gui-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s;
}

.gui-group:hover:not(.locked) {
    border-color: rgba(0, 240, 255, 0.2);
    background: rgba(0, 240, 255, 0.01);
}

.gui-group label {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gui-group label span {
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary-glow);
}

.gui-limit {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: normal;
}

.gui-group input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
}

.gui-group input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.gui-group input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.gui-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
    transition: transform 0.1s;
}

.gui-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ロック状態のスタイル */
.gui-group.locked {
    overflow: hidden;
}

.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fca5a5;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 5;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    pointer-events: all;
}

/* checkbox (locked) */
.gui-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: not-allowed;
}
