/**
 * Gozigen Gokigenz 3D - レスポンシブ修正CSS
 * 画面表示の崩れを修正
 */

/* メインコンテナの修正 */
#ggz3d-container {
    position: relative;
    width: 100% !important;
    max-width: 100%;
    min-height: 600px;
    height: auto !important;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    overflow: visible;
    background: linear-gradient(135deg, #2f4169 0%, #20bf6b 100%);
    border-radius: 15px;
}

/* メニューエリアの修正 */
#ggz3d-menu {
    width: 100%;
    padding: 30px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
}

/* ロゴコンテナの修正 */
.game-logo-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
}

/* 3Dロゴの修正 */
.ggz3d-game-logo {
    transform: scale(0.8);
    margin: 0 auto;
}

/* タイトルテキストの修正 */
.ggz3d-title {
    text-align: center;
    margin: 20px 0;
}

.ggz3d-title-top,
.ggz3d-title-bottom {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 2px;
}

.ggz3d-title-top {
    color: #4169e1;
}

.ggz3d-title-bottom {
    color: #20bf6b;
}

.ggz3d-subtitle-jp {
    font-size: clamp(16px, 3vw, 24px);
    margin-top: 10px;
}

/* ボタンコンテナの修正 */
.ggz3d-buttons {
    width: 100%;
    max-width: 600px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
    box-sizing: border-box;
}

/* ボタンスタイルの修正 */
.ggz3d-btn {
    width: 100%;
    min-width: 200px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-transform: none;
    white-space: nowrap;
}

.ggz3d-btn span {
    font-size: 20px;
}

/* ボタンカラー */
.ggz3d-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ggz3d-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.ggz3d-btn-success {
    background: linear-gradient(135deg, #20bf6b 0%, #26de81 100%);
    color: white;
}

.ggz3d-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(32, 191, 107, 0.4);
}

.ggz3d-btn-special {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.ggz3d-btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.ggz3d-btn-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.ggz3d-btn-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

/* ゲームエリア */
#ggz3d-game-area {
    width: 100%;
    min-height: 600px;
    position: relative;
    box-sizing: border-box;
}

/* キャンバスコンテナ */
#ggz3d-canvas-container {
    width: 100% !important;
    height: 500px !important;
    position: relative;
    background: #1a1f36;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

#ggz3d-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* ヘッダー情報 */
#ggz3d-header {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 15px;
}

#ggz3d-player-info {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

.player-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.player-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: white;
}

.pieces-count {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pieces-count span {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    color: white;
}

.turn-indicator {
    text-align: center;
    color: white;
}

#current-turn {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

#timer {
    font-size: 24px;
    font-family: monospace;
}

/* コントロールボタン */
#ggz3d-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

#ggz3d-controls button {
    padding: 10px 20px;
    font-size: 14px;
}

/* モーダル修正 */
.ggz3d-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.ggz3d-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* タブレット対応 */
@media (max-width: 768px) {
    #ggz3d-container {
        border-radius: 0;
        min-height: 100vh;
    }
    
    .ggz3d-buttons {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    
    .ggz3d-btn {
        min-width: auto;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    #ggz3d-player-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .player-card {
        padding: 10px;
    }
    
    #ggz3d-canvas-container {
        height: 400px !important;
    }
    
    .ggz3d-game-logo {
        transform: scale(0.6);
    }
}

/* スマートフォン対応 */
@media (max-width: 480px) {
    #ggz3d-menu {
        padding: 20px 10px;
    }
    
    .ggz3d-title-top,
    .ggz3d-title-bottom {
        font-size: 24px;
    }
    
    .ggz3d-subtitle-jp {
        font-size: 14px;
    }
    
    .ggz3d-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .ggz3d-btn span {
        font-size: 16px;
    }
    
    #ggz3d-canvas-container {
        height: 300px !important;
        margin: 10px 0;
    }
    
    .ggz3d-game-logo {
        transform: scale(0.5);
    }
    
    .pieces-count {
        font-size: 11px;
    }
    
    #ggz3d-controls button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

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

.ggz3d-btn {
    animation: fadeIn 0.5s ease;
}

/* アクセシビリティ向上 */
.ggz3d-btn:focus {
    outline: 3px solid #4facfe;
    outline-offset: 2px;
}

.ggz3d-btn:active {
    transform: scale(0.98);
}

/* エラー防止 */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* WordPress埋め込み対応 */
.entry-content #ggz3d-container,
.page-content #ggz3d-container,
.post-content #ggz3d-container {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}