/* ================================================================
   開運つきよみ AI占い — WordPress Widget Styles
   ================================================================ */

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

/* ---- Reset & Container ---- */
#tsukiyomi-fortune-app {
    --tk-gold: #F5E6B8;
    --tk-gold-dim: rgba(255, 215, 100, 0.7);
    --tk-bg-deep: #070A14;
    --tk-bg-card: rgba(15, 18, 35, 0.95);
    --tk-bg-card-alt: rgba(15, 18, 35, 0.8);
    --tk-accent: #1B3A5C;
    --tk-text: rgba(255, 255, 255, 0.85);
    --tk-text-dim: rgba(255, 255, 255, 0.45);
    --tk-border: rgba(255, 215, 100, 0.12);

    font-family: 'Noto Serif JP', serif;
    color: #fff;
    background: linear-gradient(170deg, #070A14 0%, #0B0E1A 30%, #111630 60%, #0D1020 100%);
    border-radius: 20px;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
    max-width: 640px;
    margin: 32px auto;
    box-sizing: border-box;
}

#tsukiyomi-fortune-app *, #tsukiyomi-fortune-app *::before, #tsukiyomi-fortune-app *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---- Stars background ---- */
.tk-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.tk-star {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    animation: tk-twinkle var(--dur) var(--delay) infinite ease-in-out;
}

/* ---- Ambient glow ---- */
.tk-glow {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(100, 80, 180, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ---- Layout ---- */
.tk-content {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 0 auto;
}

/* ---- Header ---- */
.tk-header {
    text-align: center;
    margin-bottom: 28px;
}

.tk-moon {
    animation: tk-float 4s ease-in-out infinite;
    margin-bottom: 12px;
    display: inline-block;
}

.tk-title {
    font-size: 26px;
    font-weight: 700;
    font-family: 'Shippori Mincho', serif;
    letter-spacing: 6px;
    color: var(--tk-gold);
    text-shadow: 0 0 30px rgba(255, 215, 100, 0.2);
    margin-bottom: 4px;
}

.tk-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 3px;
}

.tk-tagline {
    font-size: 13px;
    color: var(--tk-text-dim);
    margin-top: 10px;
    line-height: 1.7;
    font-weight: 300;
}

/* ---- Zodiac Wheel ---- */
.tk-wheel {
    display: block;
    margin: 0 auto 20px;
}

.tk-wheel-sign {
    cursor: pointer;
    transition: all 0.3s ease;
}

.tk-wheel-sign:hover text {
    opacity: 0.9;
}

/* ---- Form Card ---- */
.tk-form-card {
    background: var(--tk-bg-card-alt);
    border: 1px solid var(--tk-border);
    border-radius: 16px;
    padding: 28px 24px;
    backdrop-filter: blur(10px);
}

.tk-section-label {
    font-size: 14px;
    color: var(--tk-gold-dim);
    margin-bottom: 14px;
    letter-spacing: 2px;
    text-align: center;
}

/* ---- Date inputs ---- */
.tk-date-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 22px;
}

.tk-date-field {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tk-date-input {
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 215, 100, 0.15);
    border-radius: 8px;
    color: var(--tk-gold);
    font-size: 16px;
    text-align: center;
    outline: none;
    font-family: 'Noto Serif JP', serif;
    transition: border-color 0.3s ease;
    -moz-appearance: textfield;
}

.tk-date-input::-webkit-inner-spin-button,
.tk-date-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tk-date-input:focus {
    border-color: rgba(255, 215, 100, 0.4);
    box-shadow: 0 0 12px rgba(255, 215, 100, 0.1);
}

.tk-date-input--year { width: 80px; }
.tk-date-input--month,
.tk-date-input--day { width: 60px; }

.tk-date-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* ---- Concern chips ---- */
.tk-concern-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.tk-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Serif JP', serif;
    line-height: 1;
}

.tk-chip:hover {
    border-color: rgba(255, 215, 100, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

.tk-chip--active {
    border-color: rgba(255, 215, 100, 0.5);
    background: rgba(255, 215, 100, 0.1);
    color: var(--tk-gold);
}

/* ---- CTA button ---- */
.tk-btn-primary {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Shippori Mincho', serif;
    letter-spacing: 4px;
    transition: all 0.3s ease;
}

.tk-btn-primary--active {
    background: linear-gradient(135deg, #C9A84C, #F5D778, #C9A84C);
    background-size: 200% 100%;
    animation: tk-shimmer 3s linear infinite;
    color: #0B0E1A;
}

.tk-btn-primary--active:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 215, 100, 0.3);
}

.tk-btn-primary--disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    cursor: default;
}

/* ---- Sign preview ---- */
.tk-sign-preview {
    text-align: center;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    animation: tk-fadeInUp 0.3s ease-out;
}

.tk-sign-preview__symbol {
    font-size: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.tk-sign-preview__name {
    font-size: 15px;
    font-weight: 600;
}

.tk-sign-preview__meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 8px;
}

/* ---- Reading Card ---- */
.tk-reading-card {
    background: linear-gradient(135deg, rgba(15, 18, 35, 0.95), rgba(25, 30, 55, 0.9));
    border-radius: 16px;
    padding: 28px 24px;
    margin-top: 24px;
    animation: tk-fadeInUp 0.6s ease-out;
}

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

.tk-reading-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.tk-reading-sign-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--tk-gold);
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 2px;
}

.tk-reading-sign-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    margin-top: 2px;
}

.tk-reading-body {
    color: var(--tk-text);
    line-height: 2;
    font-size: 14.5px;
    font-family: 'Noto Serif JP', serif;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 8px;
    white-space: pre-wrap;
}

.tk-reading-body::-webkit-scrollbar { width: 4px; }
.tk-reading-body::-webkit-scrollbar-track { background: transparent; }
.tk-reading-body::-webkit-scrollbar-thumb { background: rgba(255, 215, 100, 0.2); border-radius: 2px; }

.tk-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    margin-left: 2px;
    animation: tk-blink 1s infinite;
    vertical-align: middle;
}

/* ---- Loading spinner ---- */
.tk-loading {
    text-align: center;
    padding: 40px 0;
    animation: tk-fadeInUp 0.4s ease-out;
}

.tk-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 215, 100, 0.15);
    border-top-color: var(--tk-gold);
    border-radius: 50%;
    animation: tk-spin 1s linear infinite;
}

.tk-loading-text {
    color: var(--tk-gold-dim);
    font-size: 14px;
    margin-top: 12px;
    letter-spacing: 2px;
}

/* ---- CTA Section ---- */
.tk-cta-box {
    margin-top: 20px;
    padding: 16px 18px;
    background: rgba(255, 215, 100, 0.05);
    border: 1px solid rgba(255, 215, 100, 0.15);
    border-radius: 10px;
    text-align: center;
}

.tk-cta-title {
    color: var(--tk-gold-dim);
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.tk-cta-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.tk-cta-link {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.6;
}

.tk-cta-link:hover {
    color: var(--tk-gold);
}

.tk-cta-footer {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 10px;
}

/* ---- Retry & Footer ---- */
.tk-actions {
    text-align: center;
    margin-top: 24px;
}

.tk-btn-retry {
    padding: 12px 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 100, 0.2);
    background: transparent;
    color: var(--tk-gold-dim);
    font-size: 14px;
    cursor: pointer;
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.tk-btn-retry:hover {
    border-color: rgba(255, 215, 100, 0.4);
    background: rgba(255, 215, 100, 0.05);
}

.tk-footer {
    text-align: center;
    margin-top: 36px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 1px;
}

/* ---- Error ---- */
.tk-error {
    text-align: center;
    padding: 20px;
    color: #E84545;
    font-size: 14px;
    animation: tk-fadeInUp 0.3s ease-out;
}

/* ---- Animations ---- */
@keyframes tk-twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.9; }
}

@keyframes tk-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes tk-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

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

@keyframes tk-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

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

/* ---- Responsive ---- */
@media (max-width: 480px) {
    #tsukiyomi-fortune-app {
        padding: 28px 14px;
        border-radius: 12px;
        margin: 16px 8px;
    }
    .tk-title { font-size: 22px; letter-spacing: 4px; }
    .tk-date-input--year { width: 70px; }
    .tk-date-input--month, .tk-date-input--day { width: 52px; }
    .tk-reading-card { padding: 20px 16px; }
    .tk-chip { padding: 7px 12px; font-size: 12px; }
}
