/* 基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #1a0f0a;
    color: #f0e6d2;
    overflow: hidden;
    height: 100vh;
}

/* ホームコンテナ */
.home-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 背景 */
.home-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/haikei_ganban.png');
    background-size: 400px 400px;
    background-repeat: repeat;
    opacity: 0.3;
    z-index: 0;
}

/* タイトル */
.game-title {
    position: absolute;
    top: 10%;
    text-align: center;
    z-index: 10;
}

.game-title h1 {
    font-size: 4rem;
    color: #FFD700;
    text-shadow: 
        3px 3px 6px rgba(0, 0, 0, 0.8),
        -1px -1px 2px rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.5);
    letter-spacing: 0.1em;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.title-subtitle {
    font-size: 1.5rem;
    color: #d69e2e;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.2em;
}

/* メインメニュー */
.home-main {
    position: relative;
    z-index: 10;
}

.menu-container {
    display: grid;
    grid-template-columns: repeat(2, 200px);
    gap: 30px;
    padding: 20px;
}

/* メニューアイテム */
.menu-item {
    position: relative;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #3d2817 0%, #2a1a0f 100%);
    border: 3px solid #8B6914;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 215, 0, 0.2);
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
}

.menu-item:active {
    transform: translateY(-2px);
}

/* メニュー石のテクスチャ */
.menu-stone-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.1) 10px, rgba(0,0,0,0.1) 20px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(0,0,0,0.1) 10px, rgba(0,0,0,0.1) 20px);
    pointer-events: none;
}

.menu-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.menu-label {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f0e6d2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.1em;
}

/* サブメニュー */
.submenu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: linear-gradient(to bottom, #2a1a0f 0%, #1a0f0a 100%);
    transition: right 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.submenu.active {
    right: 0;
}

.submenu-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #8B6914;
}

.back-btn {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 2rem;
    cursor: pointer;
    margin-right: 20px;
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: translateX(-5px);
}

.submenu-header h2 {
    color: #FFD700;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.submenu-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* サブメニューアイテム */
.submenu-item {
    width: 100%;
    max-width: 600px;
    background: linear-gradient(135deg, #3d2817 0%, #2a1a0f 100%);
    border: 2px solid #8B6914;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submenu-item:hover {
    background: linear-gradient(135deg, #4d3827 0%, #3a2a1f 100%);
    border-color: #FFD700;
    transform: translateX(10px);
}

.submenu-icon {
    font-size: 3rem;
    margin-right: 20px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.submenu-info {
    flex: 1;
}

.submenu-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 5px;
}

.submenu-desc {
    font-size: 1rem;
    color: #d69e2e;
}

.submenu-arrow {
    font-size: 1.5rem;
    color: #8B6914;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #3d2817 0%, #2a1a0f 100%);
    border: 3px solid #8B6914;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #FFD700;
    font-size: 1.8rem;
}

.close-btn {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: rotate(90deg);
}

/* フレンドコード関連 */
.code-section {
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.code-section h3 {
    color: #d69e2e;
    margin-bottom: 15px;
}

.action-btn {
    background: linear-gradient(135deg, #8B6914 0%, #654321 100%);
    border: 2px solid #FFD700;
    color: #f0e6d2;
    padding: 10px 30px;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: linear-gradient(135deg, #9B7924 0%, #754331 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.room-code {
    margin-top: 20px;
    text-align: center;
}

.code-label {
    color: #d69e2e;
    margin-bottom: 10px;
}

.code-value {
    font-size: 2rem;
    font-weight: bold;
    color: #FFD700;
    letter-spacing: 0.3em;
    margin-bottom: 10px;
}

.copy-btn {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #FFD700;
    color: #FFD700;
    padding: 5px 20px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 215, 0, 0.3);
}

.code-input {
    width: 100%;
    padding: 10px;
    font-size: 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #8B6914;
    border-radius: 5px;
    color: #FFD700;
    margin-bottom: 15px;
    letter-spacing: 0.3em;
}

.code-input:focus {
    outline: none;
    border-color: #FFD700;
}

/* 設定画面 */
.settings-content {
    align-items: stretch;
}

.settings-section {
    width: 100%;
    max-width: 600px;
    margin-bottom: 30px;
}

.settings-section h3 {
    color: #FFD700;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    margin-bottom: 10px;
}

.settings-item span {
    color: #d69e2e;
    font-size: 1.2rem;
}

.volume-slider {
    width: 200px;
    height: 6px;
    background: #8B6914;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #FFD700;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.settings-select {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #8B6914;
    color: #FFD700;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
}

.settings-select:focus {
    outline: none;
    border-color: #FFD700;
}

/* ガチャプレースホルダー */
.gacha-placeholder {
    text-align: center;
    padding: 100px 20px;
    color: #d69e2e;
    font-size: 1.5rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .game-title h1 {
        font-size: 3rem;
    }
    
    .menu-container {
        grid-template-columns: repeat(2, 150px);
        gap: 20px;
    }
    
    .menu-item {
        width: 150px;
        height: 150px;
    }
    
    .menu-icon {
        font-size: 3rem;
    }
    
    .menu-label {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .game-title h1 {
        font-size: 2.5rem;
    }
    
    .title-subtitle {
        font-size: 1.2rem;
    }
    
    .submenu-content {
        padding: 20px;
    }
}