/* Gozigen Gokigenz 3D - 5D Management Edition */

/* カラー定義 */
:root {
    --ggz-blue: #2f4169;
    --ggz-blue-light: #3d5378;
    --ggz-blue-dark: #1e2d4a;
    --ggz-green: #20bf6b;
    --ggz-green-light: #26d07c;
    --ggz-green-dark: #1a9e58;
    --ggz-purple: #b19cd9;
    --ggz-gold: #ffd700;
    --ggz-bg-dark: #1a1f36;
    --ggz-bg-light: #f5f7fa;
}

/* コンテナ */
#ggz3d-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, var(--ggz-blue-dark) 0%, var(--ggz-blue) 50%, var(--ggz-green-dark) 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* メニュー */
#ggz3d-menu {
    text-align: center;
    padding: 40px 20px;
}

#ggz3d-menu h2 {
    font-size: 2.5em;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.ggz3d-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* ボタンスタイル */
.ggz3d-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ggz3d-btn span {
    font-size: 1.5em;
}

.ggz3d-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ggz3d-btn-primary {
    background: linear-gradient(135deg, var(--ggz-blue) 0%, var(--ggz-blue-light) 100%);
    color: white;
}

.ggz3d-btn-primary:hover {
    background: linear-gradient(135deg, var(--ggz-blue-light) 0%, var(--ggz-blue) 100%);
}

.ggz3d-btn-success {
    background: linear-gradient(135deg, var(--ggz-green) 0%, var(--ggz-green-light) 100%);
    color: white;
}

.ggz3d-btn-success:hover {
    background: linear-gradient(135deg, var(--ggz-green-light) 0%, var(--ggz-green) 100%);
}

.ggz3d-btn-info {
    background: linear-gradient(135deg, var(--ggz-blue) 0%, var(--ggz-blue-light) 100%);
    color: white;
}

.ggz3d-btn-warning {
    background: linear-gradient(135deg, var(--ggz-green) 0%, var(--ggz-green-light) 100%);
    color: white;
}

.ggz3d-btn-danger {
    background: linear-gradient(135deg, var(--ggz-blue-dark) 0%, var(--ggz-blue) 100%);
    color: white;
}

.ggz3d-btn-secondary {
    background: linear-gradient(135deg, var(--ggz-green-dark) 0%, var(--ggz-green) 100%);
    color: white;
}

.ggz3d-btn-special {
    background: linear-gradient(135deg, var(--ggz-blue) 0%, var(--ggz-green) 100%);
    color: white;
}

/* ゲームエリア */
#ggz3d-game-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
}

/* ヘッダー */
#ggz3d-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

#ggz3d-player-info {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.player-card {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.player-card.active {
    border-color: #FFD700;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
}

.player-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    color: #333;
}

.player-blue h3 {
    color: var(--ggz-blue);
}

.player-green h3 {
    color: var(--ggz-green);
}

.pieces-count {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
}

.pieces-count span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.piece-large::before {
    content: '⭐';
    font-size: 1.5em;
}

.piece-medium::before {
    content: '⭐';
    font-size: 1.2em;
}

.piece-small::before {
    content: '⭐';
    font-size: 0.9em;
}

.player-blue .pieces-count span::before {
    color: var(--ggz-blue);
}

.player-green .pieces-count span::before {
    color: var(--ggz-green);
}

.turn-indicator {
    background: linear-gradient(135deg, var(--ggz-blue-dark) 0%, var(--ggz-blue) 50%, var(--ggz-green-dark) 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#current-turn {
    font-size: 1.3em;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

#timer {
    font-size: 1.1em;
    font-family: 'Courier New', monospace;
}

#ggz3d-controls {
    display: flex;
    gap: 10px;
}

/* キャンバスコンテナ */
#ggz3d-canvas-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 500px;
}

#ggz3d-canvas-container canvas {
    display: block;
    border-radius: 5px;
}

/* メッセージエリア */
#ggz3d-message-area {
    margin-top: 20px;
    text-align: center;
}

#ggz3d-message {
    display: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1em;
    display: inline-block;
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#ggz3d-message.info {
    background: linear-gradient(135deg, var(--ggz-blue-dark) 0%, var(--ggz-blue) 50%, var(--ggz-green-dark) 100%);
    color: white;
}

#ggz3d-message.success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: #333;
}

#ggz3d-message.error {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

#ggz3d-message.warning {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

/* モーダル */
.ggz3d-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ggz3d-modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.ggz3d-modal-content h2 {
    margin-top: 0;
    color: #333;
    font-size: 2em;
    border-bottom: 3px solid var(--ggz-green);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.ggz3d-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.ggz3d-close:hover {
    color: #333;
}

/* ランキングタブ */
.ggz3d-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 1em;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn.active {
    color: var(--ggz-green);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ggz-green);
}

/* ランキングテーブル */
.ggz3d-ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ggz3d-ranking-table thead {
    background: linear-gradient(135deg, var(--ggz-blue-dark) 0%, var(--ggz-blue) 50%, var(--ggz-green-dark) 100%);
    color: white;
}

.ggz3d-ranking-table th,
.ggz3d-ranking-table td {
    padding: 12px;
    text-align: center;
}

.ggz3d-ranking-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.ggz3d-ranking-table tbody tr:hover {
    background: #f5f5f5;
}

.ggz3d-ranking-table tbody tr:nth-child(1) td:first-child {
    font-size: 1.5em;
    color: #FFD700;
}

.ggz3d-ranking-table tbody tr:nth-child(2) td:first-child {
    font-size: 1.3em;
    color: #C0C0C0;
}

.ggz3d-ranking-table tbody tr:nth-child(3) td:first-child {
    font-size: 1.2em;
    color: #CD7F32;
}

/* ルール説明 */
.rules-content {
    line-height: 1.8;
}

.rules-content h3 {
    color: var(--ggz-green);
    margin-top: 20px;
    margin-bottom: 10px;
}

.rules-content ul {
    padding-left: 20px;
}

.rules-content li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.rules-content li::before {
    content: '🎮';
    position: absolute;
    left: 0;
}

/* ローディング */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #999;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid var(--ggz-green);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* フッター・バージョン情報 */
#ggz3d-footer {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.version-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #ggz3d-container {
        padding: 10px;
    }
    
    #ggz3d-menu h2 {
        font-size: 1.8em;
    }
    
    .ggz3d-buttons {
        grid-template-columns: 1fr;
    }
    
    #ggz3d-player-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .player-card {
        text-align: center;
    }
    
    #ggz3d-controls {
        flex-direction: column;
        width: 100%;
    }
    
    #ggz3d-canvas-container {
        min-height: 350px;
    }
    
    .ggz3d-modal-content {
        padding: 20px;
    }
}

/* タッチデバイス対応 */
@media (hover: none) {
    .ggz3d-btn:hover {
        transform: none;
    }
    
    .player-card.active {
        transform: scale(1.02);
    }
}

/* アクセシビリティ */
.ggz3d-btn:focus,
.tab-btn:focus {
    outline: 3px solid var(--ggz-green);
    outline-offset: 2px;
}

/* 印刷対応 */
@media print {
    #ggz3d-container {
        background: white;
        box-shadow: none;
    }
    
    .ggz3d-btn,
    #ggz3d-controls,
    .ggz3d-modal {
        display: none;
    }
}