:root {
    --bg-color: #0a0b1e;
    --card-bg: rgba(255, 255, 255, 0.1);
    --accent-color: #ffd700;
    --text-color: #ffffff;
    --secondary-text: #b0b0b0;
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-item {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-item:hover, .nav-item.active {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

#app {
    width: 100%;
    flex-grow: 1;
}

.view {
    animation: fadeIn 0.5s ease-out;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    margin-bottom: 2rem;
    
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Home Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.menu-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--glass-border);
}

.menu-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

.menu-card .icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.icon.grayscale {
    filter: grayscale(100%);
    opacity: 0.8;
}

/* Tarot 3D Flip */
.tarot-container {
    perspective: 1000px;
    width: 180px;
    height: 300px;
    margin: 2rem auto;
}

.tarot-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.tarot-card.flipped {
    transform: rotateY(180deg);
}

.tarot-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
}

.tarot-card-front, .tarot-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    border: 2px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.tarot-card-front {
    background: linear-gradient(135deg, #1a1a3a 0%, #2a2a5a 100%);
    color: var(--accent-color);
}

.card-pattern {
    font-size: 4rem;
    opacity: 0.5;
}

.tarot-card-back {
    background: #fdfbf7;
    color: #333;
    transform: rotateY(180deg);
    padding: 1rem;
}

.card-image {
    font-size: 5rem;
    margin-bottom: 1rem;
}

#tarot-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #1a1a3a;
    margin-bottom: 0.5rem;
}

.result-box {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.desc-box {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: #e0e0e0;
}

.const-icon, .zodiac-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.const-visual {
    width: 300px;
    height: 250px;
    margin: 0 auto 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 20px;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.const-visual svg {
    width: 100%;
    height: 100%;
    overflow: visible; /* 점이 잘리지 않도록 설정 */
}

.const-line {
    stroke: #ffffff;
    stroke-width: 1;
    stroke-opacity: 0.4;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2.5s forwards ease-in-out;
}

.const-dot {
    fill: #ffffff;
    filter: drop-shadow(0 0 3px #ffffff);
    opacity: 0;
    transform-origin: center; /* 중심을 기준으로 변형 */
    transform-box: fill-box;   /* SVG 요소 자체 박스 기준 */
    animation: fadeInDot 0.6s forwards ease-out;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeInDot {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

/* Oha-Asa */
.luck-items {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Stars Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-text);
}

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

@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    .nav-item { padding: 6px 12px; font-size: 0.9rem; }
    .menu-grid { grid-template-columns: 1fr 1fr; }
}
