@charset "utf-8";

/* --- ゲーム全体の背景など（固有設定） --- */
#game-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 25px 20px;
    background: url('images/table.webp') no-repeat center center;
    background-size: cover;
}

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

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

.game-subtitle {
    font-size: var(--font-size);
    color: #cbd5e1;
    margin-bottom: 60px;
    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: 50px;
}

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

.result-header h2 {
    font-size: var(--font-size);
    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.5s ease-in-out;
}
.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;
}

.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(-900px);
}

#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);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    background-color: #1e293b;
}

.card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-front {
    transform: rotateY(180deg);
}

.card-face.is-reversed-img {
    transform: rotateY(180deg) rotate(180deg);
}

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

/* --- カード上のメッセージ（オーバーレイ） --- */
.card-overlay-box {
    position: absolute;
    bottom: 80px;   /* 帯の下位置 */
    left: -20px;
    width: calc(100% + 40px);
    height: 60%;    /* --- 帯の高さ */
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 30px;
    box-sizing: border-box;
    transition: opacity 0.6s ease-in-out;
    z-index: 10;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

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

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

#card-name {
    font-size: var(--font-size);
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.orientation-label {
    font-size: 32px;
    margin: 0;
    font-weight: bold;
    color: #facc15;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.orientation-label.reversed {
    color: #f87171;
}

.message-box {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    padding: 10px 14px;
    box-sizing: border-box;
}

.msg-cat {
    font-size: 22px;
    color: #38bdf8;
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
}

#message-text {
    font-size: var(--font-size);
    line-height: 1.35;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.action-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

/* --- エール画面 --- */
#screen-encouragement {
    position: relative;
    background-color: #000000 !important;
    background-image: none !important;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.encouragement-bg-card {
    position: absolute;
    width: 600px;
    height: 900px;
    opacity: 0.3;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-inner-static {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.9);
}
.card-inner-static.is-reversed {
    transform: rotate(180deg);
}

.card-inner-static img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.encouragement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-sizing: border-box;
}

.encouragement-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    gap: 24px;
    z-index: 2;
}

.enc-title {
    font-size: var(--font-size);
    color: #facc15;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

#encouragement-text {
    font-size: var(--font-size);
    line-height: 1.5;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}