/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Sans', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ナビゲーション */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h1 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* ヒーローセクション */
.hero {
    text-align: center;
    padding: 2rem 0 3rem 0;
}

.hero h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2.2rem;
}

.hero p {
    margin: 0;
    opacity: 0.9;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* メインコンテンツ */
main {
    padding: 3rem 0;
}

section {
    margin-bottom: 3rem;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #34495e;
}

/* キーボードカード */
.keyboard-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.keyboard-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.keyboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.keyboard-content {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

.keyboard-text {
    flex: 1;
    min-width: 0;
}

.keyboard-image {
    flex: 0 0 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keyboard-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.keyboard-info {
    margin: 1.5rem 0;
}

.keyboard-description {
    margin-bottom: 1rem;
    color: #666;
}

.keyboard-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.spec-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.keyboard-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: #e74c3c;
    color: white;
}

.btn-primary:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border-color: #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 情報セクション */
.info ul {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info li {
    margin: 1rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.info li:before {
    content: "⚠️";
    position: absolute;
    left: 0;
}

/* ビルドガイドページ */
.build-guide {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.step {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.step:last-child {
    border-bottom: none;
}

.step h3 {
    background: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.step-content {
    margin-left: 1rem;
}

.parts-list, .tools-list {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.parts-list h4, .tools-list h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.parts-list ul, .tools-list ul {
    list-style-type: disc;
    margin-left: 2rem;
}

.parts-list li, .tools-list li {
    margin: 0.5rem 0;
}

.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.warning:before {
    content: "⚠️ ";
    font-weight: bold;
}

/* 目次 */
.table-of-contents {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.toc-list li {
    margin: 0;
}

.toc-list a {
    display: block;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: #667eea;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid #e3f2fd;
}

.toc-list a:hover {
    background: #667eea;
    color: white;
    transform: translateX(5px);
}

/* PC用サイドバー目次 */
.sidebar-toc {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 100;
    max-height: 80vh;
    overflow-y: auto;
}

.sidebar-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #2c3e50;
    text-align: center;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 0.5rem;
}

.sidebar-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-toc-list li {
    margin: 0.3rem 0;
}

.sidebar-toc-list a {
    display: block;
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    color: #666;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    line-height: 1.3;
}

.sidebar-toc-list a:hover {
    background: #667eea;
    color: white;
}

/* 画像ギャラリーの横スクロール */
.image-gallery-scroll {
    overflow-x: auto;
    padding: 0;
}

.image-gallery-scroll::-webkit-scrollbar {
    height: 8px;
}

.image-gallery-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.image-gallery-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.image-gallery-scroll::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* フッター */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* キーボードテスター */
.tester-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: inline-block;
    font-weight: 600;
    color: #333;
    margin-right: 1rem;
    font-size: 1.05rem;
    vertical-align: middle;
}

.select-with-button {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.select-with-button select {
    flex: 1;
}

.custom-button {
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.custom-button:active {
    transform: translateY(0);
}

/* モーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.3rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-button:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.input-row {
    margin-bottom: 1.5rem;
}

.input-row label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.input-row input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.input-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-row input::placeholder {
    color: #999;
}

.input-row small {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.85rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #eee;
    justify-content: flex-end;
}

.cancel-button {
    padding: 0.75rem 1.5rem;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.cancel-button:hover {
    background: #e0e0e0;
}

.load-button {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.load-button:hover {
    background: #5568d3;
}

.load-button:active {
    transform: scale(0.98);
}

#keyboard-select {
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    vertical-align: middle;
}

#keyboard-select:hover {
    border-color: #667eea;
}

#keyboard-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.layer-controls {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.layer-controls label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.8rem;
}

.layer-buttons-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.layer-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.layer-button {
    min-width: 45px;
    padding: 0.6rem 1rem;
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.layer-button:hover {
    background: #e3f2fd;
    border-color: #667eea;
}

.layer-button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.current-layer-info {
    padding: 0.8rem;
    background: #e3f2fd;
    border-radius: 8px;
    font-weight: 600;
    color: #1976d2;
}

.loading-status {
    border-radius: 8px;
    font-weight: 500;
}

.loading-status:not(:empty) {
    margin-top: 1rem;
    padding: 0.8rem;
}

.loading-status.loading {
    background: #fff3cd;
    color: #856404;
}

.loading-status.success {
    background: #d4edda;
    color: #155724;
}

.loading-status.error {
    background: #f8d7da;
    color: #721c24;
}

.keyboard-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.keyboard-display {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.keyboard-visual {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.key-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.key {
    position: absolute;
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.key:hover {
    background: #e3f2fd;
    border-color: #667eea;
    transform: translateY(-2px);
    z-index: 10;
}

.key.tested {
    background: #b3e5fc;
    border-color: #ddd;
}

.key.pressed {
    background: #90ee90 !important;
    border-color: #0a4a0a !important;
    border-width: 4px;
    transform: scale(0.95);
    z-index: 10;
}

/* 上部ラベル（修飾キー） */
.key-top-label {
    font-size: 0.55rem;
    color: #666;
    font-weight: 500;
    text-align: center;
    line-height: 1;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* メインラベル（キー本体） */
.key-main-label {
    font-size: 0.85rem;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 下部ラベル（レイヤー情報） */
.key-bottom-label {
    font-size: 0.55rem;
    color: #667eea;
    font-weight: 700;
    text-align: center;
    line-height: 1;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.key-layer-info {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.65rem;
    color: #667eea;
    font-weight: 700;
}


.key-spacer {
    min-width: 50px;
    min-height: 50px;
}

.tester-info {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tester-info h3 {
    margin-top: 0;
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.tester-info ul {
    margin: 1rem 0 1.5rem 0;
    padding-left: 1.5rem;
}

.tester-info li {
    margin: 0.75rem 0;
    line-height: 1.6;
}

.tester-legend {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-key {
    width: 60px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key-default {
    background: #f8f9fa;
    border: 2px solid #ddd;
    color: #333;
}

.key-tested {
    background: #b3e5fc;
    border: 2px solid #ddd;
    color: #333;
}

.key-pressing {
    background: #90ee90;
    border: 4px solid #0a4a0a;
    color: #333;
}

.legend-item span {
    font-size: 0.95rem;
    color: #555;
}

/* レスポンシブ */
@media (max-width: 1200px) {
    .sidebar-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .keyboard-card {
        padding: 1.5rem;
    }
    
    .keyboard-content {
        flex-direction: column;
    }
    
    .keyboard-image {
        flex: none;
        align-self: center;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .toc-list {
        grid-template-columns: 1fr;
    }
    
    /* ステップ画像のモバイル対応 */
    .step-content img {
        height: 200px !important;
        width: auto !important;
        min-width: unset !important;
    }

    /* キーボードテスターのモバイル対応 */
    .key {
        min-width: 40px;
        min-height: 40px;
        font-size: 0.75rem;
        padding: 0.3rem;
    }

    .key-spacer {
        min-width: 40px;
        min-height: 40px;
    }

    .layer-buttons {
        gap: 0.3rem;
    }

    .layer-button {
        min-width: 40px;
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* トラックボールテストボタン */
.trackball-test-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.trackball-test-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.trackball-test-button svg {
    flex-shrink: 0;
}

/* トラックボールテストポップアップ */
.trackball-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.trackball-popup-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.trackball-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e9ecef;
}

.trackball-popup-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-popup-button {
    background: none;
    border: none;
    font-size: 2rem;
    color: #adb5bd;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-popup-button:hover {
    color: #667eea;
    background: #f8f9fa;
}

.trackball-popup-body {
    padding: 2rem;
}

.trackball-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.trackball-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trackball-section h4 {
    color: #34495e;
    margin-bottom: 0.5rem;
}

/* カーソルテストエリア */
.trackball-visual {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    border: 2px solid #667eea;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.center-marker {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #e74c3c;
    border-radius: 50%;
    pointer-events: none;
}

.cursor-indicator {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #667eea;
    border: 3px solid #764ba2;
    border-radius: 50%;
    transition: transform 0.1s ease-out;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* スクロールテストエリア */
.scroll-visual {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    border: 2px solid #667eea;
    border-radius: 8px;
}

.scroll-indicator-horizontal {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.scroll-indicator-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.scroll-arrow {
    font-size: 2rem;
    color: #bdc3c7;
    transition: all 0.2s ease;
    user-select: none;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-arrow.active {
    color: #667eea;
    transform: scale(1.3);
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.scroll-center {
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border-radius: 50%;
}

/* トラックボール統計 */
.trackball-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* リセットボタン */
.reset-button {
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.reset-button:active {
    transform: translateY(0);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .trackball-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .trackball-visual,
    .scroll-visual {
        height: 180px;
    }

    .trackball-popup-content {
        max-width: 100%;
        max-height: 95vh;
    }

    .trackball-popup-header {
        padding: 1rem 1.5rem;
    }

    .trackball-popup-body {
        padding: 1.5rem;
    }

    .layer-buttons-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .layer-buttons {
        width: 100%;
    }

    .trackball-test-button {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }
}