/* style-screens.css - VMO Board Game: Title, Lobby, and Char Select Layouts */

/* --- タイトル画面 --- */
#screen-title {
    justify-content: center;
    position: relative; /* オーバーレイ配置の基準点 */
    z-index: 1;

    background-image: url('img/title_bg.webp');
    background-size: cover;      /* 画面全体を覆う */
    background-position: center; /* 中央配置 */
    background-repeat: no-repeat;
}

/* 背景を暗くしてロゴを見やすくするオーバーレイ */
#screen-title::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* 50%の黒。必要に応じて0.3~0.7で調整 */
    z-index: -1; /* コンテンツの背面に配置 */
}

/* ロゴ画像のスタイル */
.title-logo-img {
    width: 85%;           /* 画面幅の85% */
    max-width: 360px;     /* PCでの最大幅制限 */
    height: auto;         /* アスペクト比維持 */
    object-fit: contain;
    margin-bottom: -50px;  /* ★修正: 40pxから-50pxに変更。ロゴと入力欄の間隔をマイナスにし、下のコンテンツ全体を上に引き上げる */
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.6)); /* 浮き上がらせる影 */
}

.menu-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* --- ロビー・部屋画面 --- */
.screen-header {
    font-family: 'Teko', sans-serif;
    font-size: 2.5rem;
    color: #f8fafc;
    margin: 0 0 20px 0;
}

.lobby-section {
    width: 100%;
    margin-bottom: 15px;
}

.section-label {
    font-family: 'Teko', sans-serif;
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 5px;
}

.separator-line {
    width: 100%;
    height: 1px;
    background: #334155;
    margin: 20px 0;
}

.mt-2 { margin-top: 10px; }

.room-header {
    text-align: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    padding: 15px;
    border-radius: 6px;
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.room-number {
    font-family: 'Teko', sans-serif;
    font-size: 3.5rem;
    color: #fff;
    line-height: 1;
    margin: 0;
}

.player-list-container {
    width: 100%;
    flex-grow: 1;
    overflow-y: auto;
}

.player-slot {
    background: #0f172a;
    border: 1px solid #1e293b;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    color: #475569;
    font-weight: bold;
    font-size: 0.9rem;
}

.player-slot.active {
    background: #172554;
    border-color: #3b82f6;
    color: #fff;
}

.room-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

/* --- キャラクター選択画面 --- */
#screen-char-select {
    justify-content: flex-start;
}

.screen-header-container {
    width: 100%;
    background: #020617;
    padding-bottom: 5px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 5px;
    z-index: 20;
    flex-shrink: 0;
}

.char-grid-container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 5px;
    flex-grow: 1;
    max-height: 230px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.4);
    box-sizing: border-box;
    flex-shrink: 0;
}

.char-select-card {
    aspect-ratio: 1/1;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.1s;
    position: relative;
    box-sizing: border-box;
    opacity: 0.6;
}

.char-select-card:hover {
    opacity: 1;
    background: #1e293b;
}

.char-select-card.selected {
    background: #172554;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    opacity: 1;
    transform: scale(1.05);
    z-index: 10;
}

.char-card-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.char-card-name, .char-card-type, .char-card-desc { display: none; }

.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #ef4444;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    pointer-events: none;
}

.locked-icon { font-size: 1.2rem; }

.locked-name {
    font-family: 'Teko', sans-serif;
    font-size: 0.6rem;
    color: #ef4444;
    background: #000;
    padding: 0 2px;
    margin-top: -5px;
}

.char-detail-box {
    width: 100%;
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.detail-placeholder {
    width: 100%;
    height: 100%;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-family: 'Teko', sans-serif;
    letter-spacing: 0.1em;
}

.detail-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #334155;
    padding-bottom: 2px;
    flex-shrink: 0;
}

.detail-icon { font-size: 1.5rem; }

.detail-name {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: bold;
    font-size: 1rem;
    color: #fff;
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-hp {
    font-family: 'Teko', sans-serif;
    color: #4ade80;
    font-size: 1rem;
}

.type-badge {
    font-size: 0.7rem;
    color: #fff;
    padding: 0px 5px;
    border-radius: 3px;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
    display: inline-block;
    line-height: 1.3;
}

.type-fire { background: linear-gradient(135deg, #ef4444, #991b1b); }
.type-water { background: linear-gradient(135deg, #3b82f6, #1e3a8a); }
.type-grass { background: linear-gradient(135deg, #22c55e, #14532d); }
.type-light { background: linear-gradient(135deg, #fbbf24, #b45309); }
.type-dark { background: linear-gradient(135deg, #a855f7, #581c87); }
.type-neutral { background: #64748b; }

.detail-desc {
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.3;
    margin: 2px 0;
}

/* スキル詳細エリアの修正 */
.detail-skill {
    background: #1e293b;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    flex-shrink: 0;
    border: 1px solid #334155;
}

.skill-header-row {
    display: flex;
    align-items: center;
    gap: 8px; /* ギャップを広めに */
    flex-wrap: wrap; /* 画面幅によって折り返し */
    line-height: 1;
    border-bottom: 1px dotted #334155; /* セクションの視覚的分離 */
    padding-bottom: 3px;
}

/* ★修正: 固有バッジのスタイル変更 (暗めの黄色背景に白字) */
.unique-badge {
    background: #92400e; /* 暗めのオレンジ/茶色 */
    color: #fff;
    font-family: 'Teko', sans-serif;
    font-size: 0.75rem;
    padding: 1px 4px;
    border-radius: 3px; /* 角を少し丸く */
    line-height: 1.1;
    flex-shrink: 0;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    border: 1px solid #fbbf24; /* 明るい枠線 */
}

.skill-name {
    font-weight: bold;
    font-size: 0.9rem; /* やや大きく */
    color: #fff;
    white-space: nowrap;
}

.skill-attr-badge {
    font-size: 0.65rem;
    color: #fff;
    padding: 0 4px;
    border-radius: 3px;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    line-height: 1.3;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
    display: inline-block;
}

.skill-req {
    font-family: 'Teko', sans-serif;
    font-size: 0.9rem;
    color: #e2e8f0;
    background: rgba(0, 0, 0, 0.4);
    padding: 0 5px;
    border-radius: 3px;
    line-height: 1.1;
    white-space: nowrap;
}

.skill-power {
    font-family: 'Teko', sans-serif;
    font-size: 0.9rem;
    color: #fbbf24;
    margin-left: auto; /* 右端に寄せる */
    white-space: nowrap;
    font-weight: bold;
}

.skill-desc {
    font-size: 0.75rem; /* やや大きく */
    color: #cbd5e1; /* 色を明るく */
    line-height: 1.3;
    /* border-top: 1px dashed #334155; // header-rowに移動したため削除 */
    padding-top: 3px;
}

.char-select-footer {
    width: 100%;
    background: #020617;
    z-index: 20;
    padding-bottom: 20px;
    flex-shrink: 0;
}