/* 全体のリセットとベース設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Papyrus', 'Bradley Hand', cursive, fantasy;
    min-height: 100vh;
    color: #E0E0E0;
    margin: 0;
    padding: 0;
}

/* メインコンテナ：上下分割レイアウト */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 上部セクション：背景画像 + 入力パネル */
.top-section {
    flex: 1;
    background-image: url('../images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    min-height: calc(100vh - 120px);
}

/* 入力パネル：左上に配置 */
.input-panel {
    position: absolute;
    top: 25px;
    left: 20px;
    width: 450px;
    /* 半透明の暗い背景 */
    background: rgba(10, 5, 20, 0.7);
    
    /* 背景をぼかす（すりガラス効果） */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    
    border-radius: 4px; /* シャープな角丸 */
    
    /* 毒々しい紫の枠線と光彩 */
    border: 1px solid rgba(170, 0, 255, 0.3);
    box-shadow: 0 0 15px rgba(170, 0, 255, 0.2), 
                inset 0 0 10px rgba(170, 0, 255, 0.1);
    min-height: 490px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    z-index: 10;
}

/* 下部セクション：広告エリア */
.bottom-section {
    height: 120px;
    flex-shrink: 0;
}

/* ルーム選択エリア */
.select_rooms {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 20px 25px;
    gap: 20px;
}

/* 背景画像表示エリア - 削除（bodyの背景として表示） */

/* 広告エリア */
.ad-area {
    height: 100%;
    background-color: #f8f8f8;
    border-top: 2px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-placeholder {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* セクション共通スタイル */
.name-section,
.room-list-section,
.create-section {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #3498db;
}

.name-section input {
    width: 100%;
    height: 60px;
    background-color: rgba(141, 24, 12, 1) !important;
    color: white !important;
    font-size: 32px;
    border: none;
    padding: 15px;
    border-radius: 8px;
}

.name-section input::placeholder {
    color: white;
    font-size: 32px;
}

.name-section input:focus {
    outline: none;
    background-color: rgba(141, 24, 12, 1) !important;
    color: white !important;
}

.name-section input:hover {
    background-color: rgba(161, 34, 22, 1) !important;
    transition: background-color 0.2s ease;
}

/* 検索窓とルーム一覧表示ボタン */
.search-and-display {
    display: flex;
}

#searchInput {
    flex: 1;
    padding: 10px;
    background-color: white;
    color: black;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#searchInput::placeholder {
    color: #000000;
}

#searchInput:hover {
    background-color: #f8f8f8;
    border-color: #bbb;
    transition: all 0.2s ease;
}

.show-rooms-btn {
    padding: 10px 15px;
    background-color: white;
    color: black;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.show-rooms-btn:hover {
    background-color: #e8e8e8;
    border-color: #999;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.join-group {
    display: flex;
}

.join-group input {
    flex: 1;
    padding: 10px;
    background-color: white;
    color: black;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.join-group input::placeholder {
    color: #999;
}

/* ルームID入力欄を明確に白背景にする */
#roomIdInput {
    background-color: white !important;
    color: black !important;
}

#roomIdInput::placeholder {
    color: #999 !important;
}

#roomIdInput:hover {
    background-color: #f8f8f8 !important;
    border-color: #bbb;
    transition: all 0.2s ease;
}

.join-btn {
    padding: 10px 15px;
    background-color: white;
    color: black;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.join-btn:hover {
    background-color: #e8e8e8;
    border-color: #999;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}


.create-section {
    border-bottom: none; 
    padding-bottom: 0;
    margin-top: -10px; 
}

#name, #searchInput, #roomIdInput {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #4A0061; /* 暗い紫 */
    border-radius: 4px;
    padding: 12px 10px;
    /* color: #E0E0E0; */
    font-size: 1rem; /* フォントサイズを統一 */
    font-family: inherit;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box; /* パディングを含めて 100% */
}
/* 入力欄のフォーカス（ネオン光彩） */
#name:focus, #searchInput:focus, #roomIdInput:focus {
    outline: none;
    border-color: #AA00FF; /* 鮮やかな紫 */
    box-shadow: 0 0 10px #AA00FF, 
                inset 0 0 5px rgba(170, 0, 255, 0.5);
}

.create-btn {
    width: 100%;
    padding: 12px;
    background-color: rgba(141, 24, 12, 1);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.create-btn:hover {
    background-color: rgba(101, 15, 5, 1);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

/* 入力フィールド共通スタイル（名前入力欄以外） */
input[type="text"]:not(#name), 
input[type="number"], 
select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background-color: white;
    transition: border-color 0.3s ease;
}

input[type="text"]:not(#name):focus, 
input[type="number"]:focus, 
select:focus {
    outline: none;
    border-color: #3498db;
}

/* プレースホルダーのテキストカラー（名前入力欄以外は黒系） */
input[type="text"]:not(#name)::placeholder,
input[type="number"]::placeholder {
    color: #000000;
}

/* 名前入力欄専用スタイル */
#name {
    background-color: rgba(141, 24, 12, 1) !important;
    color: white !important;
    font-size: 32px !important;
    padding: 15px !important;
    border: none !important;
    border-radius: 8px !important;
}

#name:focus {
    background-color: rgba(141, 24, 12, 1) !important;
    color: white !important;
    outline: none !important;
}

#name:hover {
    background-color: rgba(161, 34, 22, 1) !important;
}

.search-and-display, .join-group {
    display: flex;
    gap: 10px; 
    margin-top: 15px;
}
.search-and-display input, .join-group input {
    flex-grow: 1; 
}
.search-and-display button, .join-group button {
    width: auto; 
    white-space: nowrap; 
}

#name::placeholder {
    font-size: 32px !important;
    color: white !important;
}

/* ルーム一覧 */
#rooms {
    height: 150px;
    overflow-y: auto;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 5px;
    background-color: #fafafa;
}

#rooms button {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 3px;
    background-color: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    font-weight: normal;
    transition: background-color 0.2s ease;
}

#rooms button:hover {
    background-color: #AA00FF;
    border-color: #AA00FF;
    color: #FFF;
    transform: translateY(0);
    box-shadow: 0 0 10px rgba(170, 0, 255, 0.7);
}



/* ゲーム説明リンク：右下固定位置 */
.info-section {
    position: fixed;
    bottom: 140px; /* 広告エリアの高さ（120px）+ マージン */
    right: 20px;
    z-index: 100;
}

.info-link {
    display: inline-block;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.info-link:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .input-panel {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        max-height: none;
        padding: 15px;
        backdrop-filter: none; 
        background: rgba(10, 5, 20, 0.9);
    }
    
    .top-section {
        min-height: calc(100vh - 100px);
    }
    
    .bottom-section {
        height: 100px;
    }
    
    .select_rooms {
        margin: 0;
    }
    
    /* モバイルでは少し調整 */
    .info-section {
        bottom: 110px; /* モバイルでは広告エリアが100px */
        right: 15px;
    }
    
    .info-link {
        font-size: 11px;
        padding: 6px 10px;
    }
}