@charset "utf-8";

/* ==========================================
   オラクルカード専用スタイル（カード角丸めなし・全表示）
   ================================          */
body {
    font-size: 40px;
}

#game-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    padding: 25px 20px;
    background: url('images/oracle_bg.webp') no-repeat center center;
    background-size: cover;
    gap: 15px;
}

/* 画面切り替え用クラス */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
}

.screen.active {
    display: flex;
}

/* --- ホーム画面 --- */
#screen-home {
    justify-content: center;
    text-align: center;
    height: 100%;
}

.game-title {
    font-size: 56px;
    font-weight: bold;
    margin: 0 0 20px 0;
    color: #f8fafc;
    letter-spacing: 2px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.game-subtitle {
    font-size: 32px;
    color: #e2e8f0;
    margin-bottom: 80px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.menu-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* --- 結果画面 --- */
.result-header {
    text-align: center;
    width: 100%;
    height: 70px;
    flex-shrink: 0;
    margin-top: 15px;
    margin-bottom: 50px; /* 文字とカードの間隔をしっかり空けて重ならないようにする */
}

#step-indicator {
    font-size: 32px;
    color: #fde047;
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

.result-header h2 {
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* フェードアウト用全体コンテナ */
.card-fade-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.4s ease-in-out;
    flex-shrink: 0;
}
.card-fade-container.fade-out {
    opacity: 0;
}

/* カード表示エリア */
.card-display-area {
    position: relative;
    width: 600px;
    height: 900px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-top: 20px; /* ここを増やしてカードを下に下げました（元の0から30pxへ） */
}
.card-wrapper {
    width: 100%;
    height: 100%;
    perspective: 1500px;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.card-wrapper.slide-from-top {
    transform: translateY(-950px) scale(0.9);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

#card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
}

/* カード裏表共通（★border-radius と overflow: hidden を削除しました） */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    background-color: #0f172a;
}

/* 画像をそのまま全表示（比率を維持して収める） */
.card-face img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    background-color: transparent; 
}

/* 裏面 */
.card-back {
    transform: rotateY(0deg);
}

/* 表面 */
.card-front {
    transform: rotateY(180deg);
}

#card-inner.is-flipped {
    transform: rotateY(180deg);
}

/* --- 中央の黒半透明帯オーバーレイ --- */
.card-overlay-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 720px;
    height: 480px;
    background: rgba(15, 23, 42, 0.88);
    border-top: 2px solid rgba(250, 204, 21, 0.3);
    border-bottom: 2px solid rgba(250, 204, 21, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 40px;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    z-index: 10;
}

.card-overlay-box.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 長押し中（peek-mode付与時）にメッセージや枠を非表示にする */
#card-overlay-box.peek-mode {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease !important;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 640px;
    gap: 8px;
}

/* カード名 */
.card-name-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

#card-name-ja {
    margin: 0;
    color: #fde047;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

#card-name-en {
    font-size: 32px; 
    margin: 0;
    color: #cbd5e1;
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

/* メッセージ部分 */
.message-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.msg-cat {
    font-size: 32px;
    color: #38bdf8;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

#message-text {
    line-height: 1.4;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

/* ボタンエリア */
.action-footer {
    width: 600px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    margin-top: 16px;
}

.hidden {
    display: none !important;
}