:root {
    --color-mystic-purple: #2a0845;
    --color-mystic-deep: #0b0114;
    --color-gold: #d4af37;
    --color-silver: #c0c0c0;
    --color-text: #f5f5f5;
}

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

body {
    background-color: var(--color-mystic-deep);
    color: var(--color-text);
    font-family: 'Noto Serif KR', serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 별 배경 애니메이션 */
@keyframes move-background {
    from { transform: translateY(0); }
    to { transform: translateY(-1000px); }
}

.stars, .twinkling {
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    width: 100%; height: 100%;
    display: block;
}

.stars {
    background: #000 url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123161/stars.png') repeat top center;
    z-index: -2;
}

.twinkling {
    background: transparent url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123161/twinkling.png') repeat top center;
    z-index: -1;
    animation: move-background 70s linear infinite;
}

.container {
    max-width: 800px;
    width: 90%;
    text-align: center;
    z-index: 10;
    padding: 2rem;
    background: rgba(42, 8, 69, 0.4);
    backdrop-filter: blur(5px);
    border-radius: 30px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.mystic-title {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: var(--color-gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--color-silver);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    letter-spacing: 1px;
}

.crystal-ball-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.crystal-ball {
    width: 120px; height: 120px;
    background: radial-gradient(circle at 30% 30%, #a8c0ff, #3f2b96);
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(168, 192, 255, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.4);
    animation: pulse 4s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 40px rgba(168, 192, 255, 0.4); }
    100% { transform: scale(1.1); box-shadow: 0 0 80px rgba(168, 192, 255, 0.8); }
}

.chat-box textarea {
    width: 100%;
    height: 120px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--color-gold);
    border-radius: 15px;
    color: white;
    padding: 1.5rem;
    font-family: inherit;
    font-size: 1.1rem;
    resize: none;
    margin-bottom: 1.5rem;
    outline: none;
    transition: 0.3s;
}

.chat-box textarea:focus {
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.mode-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.mode-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    transition: 0.3s;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.mode-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: var(--color-silver);
}

.mode-card.premium {
    border-color: rgba(212, 175, 55, 0.3);
}

.mode-card.premium:hover {
    border-color: var(--color-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.mode-icon {
    font-size: 2.5rem;
}

.mode-card h3 {
    font-size: 1.2rem;
    color: var(--color-text);
}

.mode-card p {
    font-size: 0.85rem;
    color: var(--color-silver);
    line-height: 1.4;
}

.premium-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--color-gold);
    color: var(--color-mystic-deep);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.mystic-button.mini {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
    margin-top: auto;
}

.mystic-button.gold {
    background: linear-gradient(45deg, #8a6d3b, var(--color-gold));
    color: #fff;
    border-color: #fff;
}

.mystic-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    background: linear-gradient(45deg, #4a00e0, var(--color-mystic-purple));
}

.cards-display {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.card-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 1000px;
}

.card-frame {
    width: 200px;
    height: 340px;
    border: 4px solid var(--color-gold);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
    margin-bottom: 1rem;
    background: #111;
    transition: transform 0.5s;
}

.card-frame:hover {
    transform: translateY(-10px) rotateY(10deg);
}

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

.card-name-label {
    font-size: 1.4rem;
    color: var(--color-gold);
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.response-container {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 150px;
}

.loading-spinner {
    font-style: italic;
    color: var(--color-silver);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.result-message h3 {
    color: var(--color-gold);
    margin-bottom: 1rem;
}

.result-message p {
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: left;
}
