/* 全体設定 */
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700&display=swap');

body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: #f0f8ff; /* AliceBlue */
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center; /* 中央揃え */
}

.screen {
    display: none;
    width: 100%;
    max-width: 800px;
    flex-grow: 1; /* 画面の高さを埋める */
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-direction: column;
    text-align: center;
    margin: 1em 0;
}

.screen.active {
    display: flex;
}

h1, h2, h3 {
    color: #0077c2; /* 知的なブルー */
}

button {
    background-color: #00aaff; /* 明るいブルー */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 20px;
}

button:hover {
    background-color: #0088cc;
    transform: scale(1.05);
}

button:disabled {
    background-color: #c0c0c0;
    cursor: not-allowed;
    transform: none;
}

/* タイトル画面 */
#title-screen {
    justify-content: center;
    align-items: center;
}

#title-screen h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.player-name-input {
    margin-top: 30px;
}

.player-name-input label {
    margin-right: 10px;
    color: #555;
}

#player-name {
    padding: 8px 12px;
    border-radius: 15px;
    border: 1px solid #ccc;
    font-size: 16px;
    text-align: center;
}


/* キャラクター選択画面 */
#character-selection-screen {
    justify-content: space-around;
    align-items: center;
}

#character-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    max-width: 90vw;
}

.character-card {
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.3s;
}

.character-card:hover {
    transform: translateY(-5px);
}

.character-card.selected {
    border-color: #00aaff;
    background-color: #e6f7ff;
}

.character-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

#character-profile {
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid #eee;
    min-height: 100px;
}

/* ゲーム画面 */
#game-screen {
    flex-direction: column;
    justify-content: space-between;
}

#game-header {
    padding: 10px 20px;
    background-color: #e6f7ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #0077c2;
}

#character-area {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

#character-image {
    max-width: 90%;
    max-height: 180px;
    object-fit: contain;
}

#dialogue-window {
    height: 220px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 10px;
    overflow-y: auto;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.player-message {
    background-color: #00aaff;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.character-message {
    background-color: #e5e5ea;
    color: #333;
    align-self: flex-start;
}

#input-area {
    display: flex;
    padding: 10px;
    gap: 10px;
}

#player-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
}

#input-area button {
    margin-top: 0;
}

/* エンディング画面 */
#ending-screen {
    justify-content: center;
    align-items: center;
    padding: 40px;
}

#ending-character-image {
    max-height: 300px;
    margin: 20px 0;
}

#ending-message {
    font-size: 18px;
    line-height: 1.6;
}

/* ヘッダーとフッター */
header, footer {
    width: 100%;
    background-color: #0077c2;
    color: white;
    text-align: center;
    padding: 10px 0;
}

header h1 {
    color: white;
    font-size: 24px;
    margin: 0;
}

footer {
    font-size: 14px;
}

footer p {
    margin: 5px 0;
}

/* 遊び方セクション */
.how-to-play {
    width: 100%;
    max-width: 800px;
    padding: 40px 20px;
    background-color: #e6f7ff;
    text-align: center;
    margin: 20px 0;
    border-radius: 15px;
}

.how-to-play h2 {
    font-size: 28px;
    color: #0077c2;
    margin-bottom: 30px;
}

.steps {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.step {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    width: 28%;
    min-width: 200px;
    position: relative;
}

.step-number {
    position: absolute;
    top: -15px;
    left: -15px;
    background-color: #00aaff;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    border: 3px solid #fff;
}

.step h3 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.step p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}
