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

body {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    color: #fff;
    overflow-x: hidden;
}

/* 星空アニメーション */
.shooting-star {
    position: fixed;
    width: 140px;
    height: 1.5px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9));
    border-radius: 2px;
    pointer-events: none;
    z-index: 0;
    animation: shootingStar 0.75s ease-out forwards;
}

@keyframes shootingStar {
    0% {
        opacity: 1;
        transform: rotate(45deg) translateX(0);
    }
    100% {
        opacity: 0;
        transform: rotate(45deg) translateX(320px);
    }
}

#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle linear infinite;
}

.logo {
    margin: 5px;
    width: 50px;
    height: 50px;
}

#ad_top,
#ad_bottom {
    margin: 20px auto;
    width: 100%;
    text-align: center;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.4);
    }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

/* ヘッダー */
header {
    text-align: center;
    padding: 40px 0 30px;
}

header .title-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

header h1 {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    background: linear-gradient(90deg, #f7d1f7, #a78bfa, #67e8f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .subtitle {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #a5b4fc;
    letter-spacing: 0.08em;
}

.top-link {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    color: #fff;
    background: rgba(124, 58, 237, 0.25);
    border: 1px solid rgba(167, 139, 250, 0.45);
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.2);
    transition: all 0.25s ease;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.top-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.65);
}
/* 日付表示 */
#date-display {
    text-align: center;
    font-size: 0.9rem;
    color: #c4b5fd;
    margin-bottom: 28px;
    letter-spacing: 0.06em;
}
/* フッター */
footer {
    text-align: center;

}
footer a {
    color: white;
}

/* セクションタイトル */
.section-title {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    color: #818cf8;
    text-transform: uppercase;
    margin-bottom: 14px;
}

/* 星座確認ボタン */
.sign-check-wrap {
    text-align: center;
    margin-bottom: 14px;
}

#sign-check-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: 50px;
    color: #c4b5fd;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    padding: 7px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#sign-check-btn:hover {
    background: rgba(167, 139, 250, 0.2);
    border-color: rgba(167, 139, 250, 0.6);
}

/* モーダル */
#sign-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 100;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

#sign-modal-overlay.open {
    display: flex;
}

#sign-modal {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 20, 60, 0.97), rgba(20, 15, 50, 0.97));
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 20px;
    padding: 28px 24px 24px;
    width: min(90vw, 380px);
    max-height: 85vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease forwards;
}

#sign-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
}

#sign-modal-close:hover {
    color: #fff;
}

.modal-title {
    font-size: 1rem;
    font-weight: bold;
    color: #c4b5fd;
    text-align: center;
    margin-bottom: 18px;
    letter-spacing: 0.06em;
}

.sign-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.sign-table th {
    color: #818cf8;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    text-align: left;
}

.sign-table td {
    padding: 9px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: #e2e8f0;
}

.sign-table td:nth-child(2) {
    font-size: 1.1rem;
    text-align: center;
}

.sign-table tr:last-child td {
    border-bottom: none;
}

.sign-table tbody tr:hover td {
    background: rgba(167, 139, 250, 0.1);
}

/* 星座グリッド */
#sign-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 32px;
}

.sign-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 12px 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    color: #e2e8f0;
}

.sign-btn:hover {
    background: rgba(167, 139, 250, 0.25);
    border-color: rgba(167, 139, 250, 0.6);
    transform: translateY(-2px);
}

.sign-btn.selected {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.5), rgba(103, 232, 249, 0.3));
    border-color: #a78bfa;
    box-shadow: 0 0 16px rgba(167, 139, 250, 0.5);
    transform: translateY(-2px);
}

.sign-btn .symbol {
    font-size: 2rem;
    display: block;
}

.sign-btn .name {
    font-size: 1rem;
    display: block;
    margin-top: 3px;
    color: #c4b5fd;
}

/* 占うボタン */
#uranai-btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
    margin-bottom: 36px;
}

#uranai-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.7);
}

#uranai-btn:disabled {
    background: rgba(100, 100, 120, 0.4);
    cursor: not-allowed;
    box-shadow: none;
}

/* 結果カード */
#result-card {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 30px 24px;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.result-symbol {
    font-size: 3.5rem;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.8));
    animation: symbolPulse 2s ease-in-out infinite;
}

@keyframes symbolPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 24px rgba(103, 232, 249, 0.9));
    }
}

.result-sign-info h2 {
    font-size: 1.4rem;
    font-weight: bold;
}

.result-sign-info .period {
    font-size: 0.75rem;
    color: #a5b4fc;
    margin-top: 2px;
}

/* 総合運 */
.overall-section {
    text-align: center;
    margin-bottom: 22px;
}

.overall-label {
    font-size: 0.8rem;
    color: #818cf8;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.stars-display {
    font-size: 1.8rem;
    letter-spacing: 4px;
}

.star-filled {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.7);
}

.star-empty {
    color: rgba(255, 255, 255, 0.2);
}

/* 占い文 */
.fortune-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #a78bfa;
    border-radius: 0 10px 10px 0;
    padding: 14px 16px;
    margin-bottom: 24px;
}

/* 運勢バー */
.luck-bars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.luck-item {
    text-align: center;
}

.luck-label {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.luck-bar-wrap {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.luck-bar {
    height: 100%;
    border-radius: 10px;
    width: 0;
    transition: width 1s ease 0.3s;
}

.luck-bar.love {
    background: linear-gradient(90deg, #f472b6, #ec4899);
}

.luck-bar.work {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.luck-bar.money {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.luck-score {
    font-size: 0.75rem;
    color: #c4b5fd;
    margin-top: 4px;
}

/* ラッキーアイテム */
.lucky-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.lucky-item {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
}

.lucky-item .icon {
    font-size: 1.3rem;
    display: block;
    margin-bottom: 4px;
}

.lucky-item .label {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-bottom: 3px;
}

.lucky-item .value {
    font-size: 0.85rem;
    color: #e2e8f0;
    font-weight: bold;
}

/* 明日また占えるメッセージ */
.next-message {
    text-align: center;
    font-size: 0.9rem;
    color: #93a7c2;
    margin-top: 20px;
}

/* エラーメッセージ */
.error-message {
    color: #f87171;
    text-align: center;
    margin: 12px 0;
    font-size: 0.9rem;
}

/* すでに占い済みバナー */
#already-done {
    display: none;
    text-align: center;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #fde68a;
}

/* ローディング */
.loading-dots span {
    display: inline-block;
    animation: bounce 0.8s infinite;
    font-size: 1.5rem;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.30s;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* 運勢の見方セクション */
#explanation {
    margin-top: 48px;
    padding: 0 20px;
}

.explanation-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.explanation-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
}

.ex-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.explanation-list li strong {
    color: #c4b5fd;
}

.explanation-list li p,
.explanation-list li div {
    font-size: 0.88rem;
    line-height: 1.7;
    color: #cbd5e1;
}

/* 楽しみ方セクション */
#how-to-enjoy {
    margin-top: 40px;
}

.enjoy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.enjoy-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 14px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.enjoy-card:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.4);
}

.enjoy-icon {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 8px;
}

.enjoy-card h3 {
    font-size: 0.9rem;
    font-weight: bold;
    color: #c4b5fd;
    margin-bottom: 6px;
}

.enjoy-card p {
    font-size: 0.8rem;
    line-height: 1.75;
    color: #94a3b8;
}

/* レスポンシブ */
@media (max-width: 420px) {
    #sign-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .luck-bars,
    .lucky-section {
        grid-template-columns: 1fr 1fr;
    }

    .enjoy-grid {
        grid-template-columns: 1fr;
    }
}