/* 天織姫 おみくじアプリ - 和風スタイル */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;500;700&family=Shippori+Mincho:wght@400;500;700&display=swap');

:root {
    /* ベース／モノトーン */
    --onyx: #000000;
    --rock: #888888;
    --slate-gray: #6C7B82;
    --whisper: #E7E7E7;
    --mist: #EEEEEE;
    --beige: #E0DCD8;
    --pearl: #FFFFFF;

    /* ニュートラル／ウォーム系 */
    --champagne: #C9A782;
    --champagne-alt: #B7ACA1;
    --mustard-gold: #CFB064;
    --frosting: #F2948B;

    /* クール／ブルー系 */
    --ocean: #00ACC0;
    --mist-blue: #B4CADB;
    --patent-blue: #B6C7CC;
    --bermuda-gray: #647E97;
    --denim: #276280;
    --catalina: #1E3957;

    /* アクセント */
    --magenda: #A20559;

    /* 旧変数（互換性のため） */
    --primary-red: #A20559;
    --gold: #CFB064;
    --dark-gold: #C9A782;
    --cream: #E7E7E7;
    --dark-brown: #1E3957;
    --light-brown: #647E97;
    --paper: #E0DCD8;
    --ink: #000000;
}

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

body {
    font-family: 'Shippori Mincho', 'Noto Serif JP', serif;
    background: linear-gradient(150deg, #FFFFFF 0%, #EEEEEE 25%, #E7E7E7 50%, #EEEEEE 75%, #FFFFFF 100%);
    min-height: 100vh;
    color: var(--ink);
    line-height: 1.8;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/bg.png');
    background-repeat: repeat;
    background-size: 540px 960px;
    pointer-events: none;
    z-index: 0;
}


.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* 和紙風カード */
.card {
    background: var(--pearl);
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
    border-radius: 8px;
    padding: 0 30px 40px;
    margin: 20px 0;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.12),
        inset 0 0 100px rgba(255,255,255,0.8);
    border: 4px solid #e2687d;
    position: relative;
    overflow: hidden;
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 1.8rem;
    color: var(--magenda);
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.header .subtitle {
    font-size: 0.9rem;
    color: var(--champagne-alt);
    letter-spacing: 0.05em;
}

.header .year {
    font-size: 2.5rem;
    color: var(--gold);
    font-weight: 700;
    margin: 15px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* ロゴアイコン */
.logo-icon {
    width: 100px;
    height: auto;
    margin-bottom: 15px;
    mix-blend-mode: multiply;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 1.275rem;
    color: #8e797e;
    margin-bottom: 8px;
    font-weight: 700;
    font-family: 'Noto Serif JP', serif;
    text-align: center;
}

.form-group .required {
    color: var(--primary-red);
    font-size: 0.8rem;
    margin-left: 5px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row select,
.form-row input {
    flex: 1;
}

select, input[type="text"], input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.08rem;
    font-weight: 400;
    font-family: 'Shippori Mincho', 'Noto Serif JP', serif;
    border: 2px solid #e2687d;
    border-radius: 12px;
    background: #FFF;
    color: var(--ink);
    transition: border-color 0.3s, box-shadow 0.3s;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--mustard-gold);
    box-shadow: 0 0 0 3px rgba(207, 176, 100, 0.2);
}

/* ラジオボタン・選択肢 */
.options-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.option-item {
    flex: 1;
    min-width: calc(50% - 5px);
    max-width: calc(50% - 5px);
}

.option-item input[type="radio"] {
    display: none;
}

.option-item label {
    display: block;
    padding: 12px 15px;
    background: #FFF;
    border: 2px solid #e2687d;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.08rem;
}

.option-item input[type="radio"]:checked + label {
    background: #e2687d;
    color: var(--pearl);
    border-color: #e2687d;
}

.option-item label:hover {
    border-color: var(--mustard-gold);
    transform: translateY(-2px);
}

/* ボタン */
.btn {
    display: block;
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 0.1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--magenda), #7A0442);
    color: var(--pearl);
    box-shadow: 0 4px 15px rgba(162, 5, 89, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(162, 5, 89, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--denim), var(--catalina));
    color: var(--pearl);
    box-shadow: 0 4px 15px rgba(39, 98, 128, 0.4);
}

/* ステップインジケーター */
.steps {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--light-brown);
    opacity: 0.5;
}

.step.active {
    opacity: 1;
    color: var(--magenda);
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #DDD;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.step.active .step-number {
    background: var(--magenda);
    color: var(--pearl);
}

/* 結果画面 */
.result-box {
    text-align: center;
    padding: 30px;
    margin: 20px 0;
}

.fortune-result {
    font-size: 4rem;
    font-weight: 700;
    margin: 20px 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
    background-image: url('../img/result_bg.png');
    background-size: 100% auto;
    background-position: center;
    background-repeat: no-repeat;
    padding: 40px 20px;
}

.fortune-result.daikichi { color: var(--mustard-gold); }
.fortune-result.chukichi { color: var(--magenda); }
.fortune-result.shokichi { color: var(--frosting); }
.fortune-result.kichi { color: var(--ocean); }
.fortune-result.kyo { color: var(--bermuda-gray); }
.fortune-result.daikyo { color: var(--catalina); }

.fortune-label {
    font-size: 1.275rem;
    color: #8e797e;
    font-weight: 700;
    font-family: 'Noto Serif JP', serif;
    margin-bottom: 20px;
}

/* 運勢テキスト */
.fortune-text {
    background: #FFF;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    text-align: left;
    line-height: 2;
    border: 1px solid #EEE;
}

.fortune-text h3 {
    color: #8e797e;
    font-size: 1.275rem;
    font-weight: 700;
    font-family: 'Noto Serif JP', serif;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--mustard-gold);
    text-align: center;
}

.fortune-text p {
    font-size: 1.14rem;
    color: var(--slate-gray);
    font-family: 'Source Han Serif JP', 'Noto Serif JP', serif;
    font-weight: 500;
}

/* SNSシェアボタン */
.share-section {
    margin-top: 30px;
    text-align: center;
}

.share-section h4 {
    font-size: 1.275rem;
    color: #8e797e;
    font-weight: 700;
    font-family: 'Noto Serif JP', serif;
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 400px;
    margin: 0 auto;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #FFF;
    text-decoration: none;
    font-size: 1.3rem;
    transition: transform 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
}

.share-btn svg {
    width: 22px;
    height: 22px;
}

.share-break {
    display: none;
}

@media (min-width: 768px) {
    .share-break {
        display: block;
        flex-basis: 100%;
        height: 0;
        width: 0;
    }
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.twitter {
    background: #000000;
}

.share-btn.facebook {
    background: #4267B2;
}

.share-btn.line {
    background: #00B900;
}

.share-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border: none;
    cursor: pointer;
}

.share-btn.tiktok {
    background: #000000;
    border: none;
    cursor: pointer;
}

.share-btn.linkedin {
    background: #0077B5;
}

.share-btn.pinterest {
    background: #E60023;
}

/* 装飾 */
.decoration {
    text-align: center;
    margin: 20px 0;
    color: var(--mustard-gold);
    font-size: 1.5rem;
    letter-spacing: 0.5em;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .card {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header .year {
        font-size: 2rem;
    }

    .option-item {
        min-width: 100%;
    }

    .fortune-result {
        font-size: 3rem;
    }
}

/* ローディング */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--mist);
    border-top-color: var(--magenda);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--light-brown);
    font-size: 0.95rem;
}

/* エラーメッセージ */
.error-message {
    background: rgba(162, 5, 89, 0.08);
    color: var(--magenda);
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border-left: 4px solid var(--magenda);
}
