/* ========================================
   タロット占いサイト - スタイルシート
   シャビーシック・北欧デザイン
   ======================================== */

/* ===== 基本設定 ===== */
:root {
    /* カラーパレット */
    --primary-color: #5e443a;      /* 濃いブラウン（ボタンテキスト） */
    --secondary-color: #a97b60;    /* 柔らかいブラウン（リトライボタンテキスト） */
    --background-beige: #ebe3dd;   /* ベージュ（背景・ボタン背景） */
    --white: #ffffff;
    --shadow: rgba(94, 68, 58, 0.15);
    
    /* フォント */
    --font-primary: 'Noto Sans JP', sans-serif;
    --font-decorative: 'Cinzel', serif;
    
    /* スペーシング */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--background-beige);
    color: var(--primary-color);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== コンテナ ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== ヘッダー ===== */
.header {
    text-align: center;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    border-bottom: 2px solid rgba(94, 68, 58, 0.1);
    margin-bottom: var(--spacing-xl);
}

.title {
    font-family: var(--font-decorative);
    font-size: 3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.05em;
}

.subtitle {
    font-family: var(--font-decorative);
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ===== メインコンテンツ ===== */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg) 0;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    animation: fadeIn 0.6s ease-in-out;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 初期画面 ===== */
.intro-text {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
}

.intro-text p {
    font-size: 1.1rem;
    line-height: 2;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

/* ===== ボタン ===== */
.btn {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 500;
    padding: 1rem 3rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
    letter-spacing: 0.05em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(94, 68, 58, 0.25);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--shadow);
}

.btn-primary {
    color: var(--primary-color);
    background-color: var(--background-beige);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-color);
    color: var(--background-beige);
}

.btn-secondary {
    color: var(--secondary-color);
    background-color: var(--background-beige);
    border: 2px solid var(--secondary-color);
    margin-top: var(--spacing-lg);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--background-beige);
}

/* ===== アニメーション画面 ===== */
.card-animation-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 400px;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-stack {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back {
    position: absolute;
    width: 250px;
    height: 350px;
    background: linear-gradient(135deg, #8b6f47 0%, #5e443a 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #4a3528;
}

.card-back::before {
    content: '';
    width: 80%;
    height: 90%;
    border: 2px solid rgba(235, 227, 221, 0.3);
    border-radius: 10px;
}

.card-spinning {
    animation: spinCard 5s ease-in-out;
}

@keyframes spinCard {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(0.95);
    }
    50% {
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        transform: rotate(270deg) scale(0.95);
    }
}

.animation-text {
    font-size: 1.3rem;
    color: var(--secondary-color);
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== 結果画面 ===== */
.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    width: 100%;
}

.selected-card {
    margin-bottom: var(--spacing-lg);
    animation: cardReveal 0.8s ease-out;
}

.selected-card img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.selected-card.reversed img {
    transform: rotate(180deg);
}

@keyframes cardReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(180deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.card-info {
    text-align: center;
    background-color: var(--white);
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    width: 100%;
}

.card-name {
    font-family: var(--font-decorative);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.05em;
}

.card-position {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
}

.card-meaning {
    text-align: left;
    line-height: 2;
}

.card-meaning h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.card-meaning p {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

/* ===== フッター ===== */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    border-top: 2px solid rgba(94, 68, 58, 0.1);
    margin-top: var(--spacing-xl);
}

.footer p {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* ===== レスポンシブデザイン ===== */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .intro-text p {
        font-size: 1rem;
    }
    
    .btn {
        font-size: 1rem;
        padding: 0.9rem 2rem;
    }
    
    .card-animation-container {
        height: 350px;
        max-width: 100%;
    }
    
    .card-back {
        width: 200px;
        height: 280px;
    }
    
    .selected-card img {
        max-width: 250px;
    }
    
    .card-name {
        font-size: 1.6rem;
    }
    
    .card-position {
        font-size: 1rem;
    }
    
    .card-info {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-sm);
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .intro-text p {
        font-size: 0.95rem;
        line-height: 1.8;
    }
    
    .card-animation-container {
        height: 300px;
    }
    
    .card-back {
        width: 180px;
        height: 250px;
    }
    
    .selected-card img {
        max-width: 220px;
    }
    
    .card-name {
        font-size: 1.4rem;
    }
    
    .card-meaning h3 {
        font-size: 1.1rem;
    }
    
    .card-meaning p {
        font-size: 0.95rem;
    }
}
