/**
 * Gozigen Gokigenz 3D - 洗練されたボタンデザイン
 */

/* カラーパレット（統一感のあるデザイン） */
:root {
    --primary-blue: #5e72e4;
    --primary-green: #2dce89;
    --neutral-dark: #32325d;
    --neutral-light: #f4f5f7;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --shadow-soft: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* メニューコンテナの改善 */
#ggz3d-menu {
    background: linear-gradient(180deg, rgba(32, 32, 93, 0.05) 0%, transparent 100%);
    padding: 60px 20px;
}

/* ボタングリッドの改善 */
.ggz3d-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 40px auto 0;
}

/* 基本ボタンスタイル（洗練版） */
.ggz3d-btn {
    position: relative;
    padding: 18px 32px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    overflow: hidden;
    background: white;
    color: var(--neutral-dark);
    box-shadow: var(--shadow-soft);
    text-transform: none;
}

/* ボタンアイコン */
.ggz3d-btn span {
    font-size: 24px;
    transition: transform 0.3s ease;
}

/* ホバー効果 */
.ggz3d-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.ggz3d-btn:hover span {
    transform: scale(1.1);
}

/* アクティブ状態 */
.ggz3d-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(50, 50, 93, 0.1);
}

/* プライマリボタン（一人プレイ） */
.ggz3d-btn-primary,
#ggz3d-single-play {
    background: var(--gradient-1);
    color: white;
}

.ggz3d-btn-primary:hover,
#ggz3d-single-play:hover {
    background: linear-gradient(135deg, #7c8ff0 0%, #8655aa 100%);
}

/* 二人プレイボタン */
.ggz3d-btn-success,
#ggz3d-two-player {
    background: var(--gradient-4);
    color: white;
}

.ggz3d-btn-success:hover,
#ggz3d-two-player:hover {
    background: linear-gradient(135deg, #53ff8b 0%, #48ffe7 100%);
}

/* トーナメントボタン */
.ggz3d-btn-special,
#ggz3d-tournament {
    background: var(--gradient-2);
    color: white;
}

.ggz3d-btn-special:hover,
#ggz3d-tournament:hover {
    background: linear-gradient(135deg, #ffa3ff 0%, #ff677c 100%);
}

/* ランキングボタン */
.ggz3d-btn-info,
#ggz3d-ranking {
    background: var(--gradient-3);
    color: white;
}

.ggz3d-btn-info:hover,
#ggz3d-ranking:hover {
    background: linear-gradient(135deg, #5fbcff 0%, #10ffff 100%);
}

/* リプレイボタン */
.ggz3d-btn-secondary,
#ggz3d-replay {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    color: var(--neutral-dark);
}

.ggz3d-btn-secondary:hover,
#ggz3d-replay:hover {
    background: linear-gradient(135deg, #ead3ff 0%, #9ed5ff 100%);
}

/* ルール説明ボタン */
.ggz3d-btn-warning,
#ggz3d-rules {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.ggz3d-btn-warning:hover,
#ggz3d-rules:hover {
    background: linear-gradient(135deg, #ff80aa 0%, #fff150 100%);
}

/* 小さめのボタン */
.ggz3d-btn-small {
    padding: 12px 24px;
    font-size: 14px;
}

/* 難易度選択ボタン */
.ggz3d-btn-easy {
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
    color: white;
}

.ggz3d-btn-medium {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: var(--neutral-dark);
}

.ggz3d-btn-hard {
    background: linear-gradient(135deg, #fd79a8 0%, #e17055 100%);
    color: white;
}

/* 難易度ボタンコンテナ */
.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.difficulty-buttons .ggz3d-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 20px 24px;
}

/* モーダルスタイルの改善 */
.ggz3d-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ggz3d-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.ggz3d-modal-content h2 {
    margin: 0 0 24px 0;
    color: var(--neutral-dark);
    font-size: 28px;
    font-weight: 700;
}

.ggz3d-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ggz3d-close:hover {
    color: #333;
    transform: scale(1.1);
}

/* ゲーム内ボタン */
#ggz3d-controls {
    display: flex;
    gap: 12px;
}

#ggz3d-controls .ggz3d-btn {
    padding: 12px 20px;
    font-size: 14px;
}

#ggz3d-restart {
    background: linear-gradient(135deg, #fc6076 0%, #ff9a44 100%);
    color: white;
}

#ggz3d-back-menu {
    background: linear-gradient(135deg, #8e9eab 0%, #eef2f3 100%);
    color: var(--neutral-dark);
}

/* サウンドトグル */
#ggz3d-sound-toggle {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: var(--neutral-dark);
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
}

/* タブボタン */
.ggz3d-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-blue);
}

.tab-btn.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

/* ランキングテーブル */
.ggz3d-ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ggz3d-ranking-table th {
    background: var(--gradient-1);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.ggz3d-ranking-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.ggz3d-ranking-table tr:hover {
    background: #f8f9fa;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .ggz3d-buttons {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .ggz3d-btn {
        width: 100%;
        padding: 16px 24px;
    }
    
    .ggz3d-modal-content {
        padding: 24px;
        width: 95%;
    }
    
    #ggz3d-controls {
        flex-wrap: wrap;
    }
}

/* アニメーション */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.ggz3d-btn {
    animation: pulse 3s infinite subtle;
}

/* フォーカススタイル（アクセシビリティ） */
.ggz3d-btn:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ローディング状態 */
.ggz3d-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.ggz3d-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    right: 20px;
}

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