body {
    font-family: "Yusei Magic", sans-serif;
    font-weight: 400;
    font-style: normal;

    margin: 0;
    padding: 0;
    background-color: transparent; 
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100vw;
    position: relative; 
}

/* 画面全体の背景カルーセルを定義 */
#global-background-carousel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-color: black; 
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.carousel-image.active {
    opacity: 1;
}

/* 各スクリーン（準備画面、面接画面）の共通スタイル */
.screen {
    width: 100%;
    max-width: none;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1; 
    display: none;
    position: relative;
}

/* 準備画面のスタイル - 初期表示のためdisplay: block; で上書き */
#preparation-screen {
    display: block;
    width: 90%;
    max-width: 900px;
    margin-top: 20px;
    margin-bottom: 20px;
    align-self: center;
    background-color: rgba(255, 255, 255, 0.85); 
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); 
    border-radius: 8px;
    text-align: center;
    padding-bottom: 20px; 
}

#preparation-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#preparation-screen h1 {
    text-align: center;
    color: #FF6699; 
    margin-bottom: 10px;
    font-size: 1.6em; 
    line-height: 1.4; 
}

#preparation-screen h2 {
    display: inline-block; 
    color: #336699; 
    font-size: 1.4em;
    margin-top: 10px;
    margin-bottom: -20px;
    position: relative;
    padding-bottom: 20px;
}

#preparation-screen h2::after {
    content: '';
    position: absolute;
    bottom: 19px;
    left: 50%;
    transform: translateX(-50%);
    width: var(--line-width, 0);
    height: 8px;
    background-color: rgba(255, 255, 0, 0.5);
    border-radius: 4px;
    z-index: -1;
    transition: width 0.5s ease-out;
}

#preparation-screen p {
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.6;
}

/* 水平線のスタイル */
hr {
    border: none;
    border-top: 2px dashed #ccc; 
    margin: 30px auto; 
    width: 80%; 
}

/* ハイライト文字のスタイル */
.highlight {
    font-weight: bold;
    color: #d9534f; 
    background-color: rgba(255, 255, 0, 0.3); 
    padding: 2px 5px;
    border-radius: 3px;
}

.question-item {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
    position: relative; 
    text-align: left; 
}

.question-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    text-align: left; 
}

/* テキストエリアのスタイル */
.question-item textarea {
    width: calc(100% - 20px); 
    padding: 10px;
    border: 1px solid #ccc; 
    border-radius: 4px; 
    min-height: 60px; 
    resize: vertical; 
    color: #2F4F4F; 
    font-size: 16px; 
    margin-bottom: 5px; 
}

/* プレースホルダーの文字色 */
.question-item textarea::placeholder {
    color: #ddd; 
    opacity: 1; 
}

/* 各question-item内のボタンをまとめるコンテナ */
.question-item-buttons {
    display: flex;
    justify-content: flex-end; 
    gap: 5px; 
    width: 100%; 
    margin-top: 5px; 
}

/* 模範回答・元に戻すボタンのスタイル */
.sample-action-button {
    padding: 5px 10px; 
    font-size: 12px;
    background-color: rgba(0, 123, 255, 0.7); 
    color: white;
    border: 1px solid rgb(0, 123, 255);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-family: inherit;
    white-space: nowrap; 
    width: auto; 
    margin: 0; 
}

.sample-action-button:hover {
    background-color: rgba(0, 123, 255, 0.9);
    border-color: rgb(0, 86, 179);
}

/* 「元に戻す」ボタンの色を少し変える */
.undo-button { 
    background-color: rgba(255, 99, 71, 0.7); 
    border-color: rgb(255, 99, 71);
}

.undo-button:hover {
    background-color: rgba(255, 99, 71, 0.9);
    border-color: rgb(205, 50, 30);
}


/* --- その他のボタン要素のスタイル --- */
/* 「次へ」ボタン (#next-button) のスタイルを明確に定義し、常に固定表示 */
#next-button { 
    position: fixed;
    bottom: 20px;
    right: 20px;
    
    display: flex;
    justify-content: center;
    align-items: center;

    width: 80px; 
    height: 80px; 
    padding: 0; 
    margin: 0; 

    border-radius: 50%; 

    background-color: rgba(0, 123, 255, 0.7); 
    color: white;
    border: 2px solid rgb(0, 123, 255); 
    
    font-size: 16px; 
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    z-index: 1001; 
    font-family: inherit; 
}

#next-button:hover {
    background-color: rgba(0, 123, 255, 0.9);
    border-color: rgb(0, 86, 179);
    transform: scale(1.05);
}

/* next-button以外の汎用的なbuttonタグのスタイル */
button { 
    display: block; 
    width: 150px; 
    padding: 10px 15px; 
    margin: 20px auto; 
    background-color: rgba(0, 123, 255, 0.7); 
    color: white;
    border: 2px solid rgb(0, 123, 255); 
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-family: inherit; 
}

button:hover {
    background-color: rgba(0, 123, 255, 0.9);
    border-color: rgb(0, 86, 179);
}

/* 面接画面全体 */
#interview-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    z-index: 1000;
}

#interview-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    max-width: 100px;
    height: auto;
    z-index: 1010;
}

/* 「入力画面」ボタン (#back-button) */
#back-button {
    position: absolute;
    top: 140px;
    left: 20px;
    width: auto;
    margin: 0;
    background-color: rgba(108, 117, 125, 0.7);
    color: white;
    border: 2px solid rgb(108, 117, 125);
    border-radius: 5px;
    z-index: 1010;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-family: inherit; 
}

#back-button:hover {
    background-color: rgba(108, 117, 125, 0.9);
    border-color: rgb(90, 98, 104);
}

.hidden {
    display: none !important; 
}

/* 「面接開始」ボタン (#start-interview-button) */
#start-interview-button {
    z-index: 10;
    width: 200px;
    height: 80px;
    font-size: 24px;
    letter-spacing: 2px;
    background-color: rgba(40, 167, 69, 0.7);
    color: white;
    border: 2px solid rgb(40, 167, 69);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-family: inherit; 
}

#start-interview-button:hover {
    background-color: rgba(40, 167, 69, 0.9);
    border-color: rgb(33, 136, 56);
}

/* 面接コントロール内のサイドボタン (.side-button) */
.side-button {
    position: absolute;
    width: 140px; 
    height: 60px;
    font-size: 18px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 123, 255, 0.7);
    color: white;
    border: 2px solid rgb(0, 123, 255);
    cursor: pointer;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-family: inherit; 
}

/* 「前の質問」ボタン (左側を丸く) */
#prev-question-button {
    left: 20px;
    border-top-left-radius: 50px;
    border-bottom-left-radius: 50px;
    border-top-right-radius: 5px; 
    border-bottom-right-radius: 5px; 
}

/* 「次の質問」ボタンと「最初に戻る」ボタン (右側を丸く) */
#next-question-button, #restart-button {
    right: 20px;
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    border-top-left-radius: 5px; 
    border-bottom-left-radius: 5px; 
}

.side-button:hover {
    background-color: rgba(0, 123, 255, 0.9);
    border-color: rgb(0, 86, 179);
}

/* 回答表示/非表示ボタンの親要素 */
#answer-display-buttons {
    position: absolute;
    bottom: calc(50vh + 20px + env(safe-area-inset-bottom)); /* <-- ここを修正 */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100; 
}

/* 回答表示/非表示ボタン (#answer-display-buttons 内の button) */
#show-answer-button {
    background-color: rgba(255, 193, 7, 0.7);
    color: #333;
    border: 2px solid rgb(255, 193, 7);
    width: auto;
    margin: 0;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease; 
    font-family: inherit;
}

#show-answer-button:hover {
    background-color: rgba(255, 193, 7, 0.9);
    border-color: rgb(224, 168, 0);
}

#hide-answer-button {
    background-color: rgba(220, 53, 69, 0.7);
    color: white;
    border: 2px solid rgb(220, 53, 69);
    width: auto;
    margin: 0;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease; 
    font-family: inherit;
}

#hide-answer-button:hover {
    background-color: rgba(220, 53, 69, 0.9);
    border-color: rgb(200, 35, 51);
}

/* 回答テキストのスタイル (#your-answer-text) */
#your-answer-text {
    position: absolute;
    bottom: 0; /* <-- 画面最下部から開始 */
    left: 0;
    width: 100%;
    height: 50vh; /* <-- 画面の高さの50%に設定 */
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    font-size: 1.2em;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.5;
    z-index: 90; 
}


/* Equalizer Styles */
#equalizer-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10px;
    z-index: 1010;
}

.equalizer-bar {
    background-color: #007bff;
    width: 8px;
    height: 20px;
    animation: equalize 0.5s infinite alternate;
}

.equalizer-bar:nth-child(1) {
    animation-delay: 0.1s;
}

.equalizer-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.equalizer-bar:nth-child(3) {
    animation-delay: 0.3s;
}

.equalizer-bar:nth-child(4) {
    animation-delay: 0.4s;
}

.equalizer-bar:nth-child(5) {
    animation-delay: 0.5s;
}


.logo_shikatakashi img{
    text-align: center;
    width:200px;
}

@keyframes equalize {
    0% {
        height: 20px;
    }
    100% {
        height: 60px;
    }
}