:root {
    --primary-color: #4CAF50;
    --primary-dark: #2E7D32;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --surface-color: rgba(255, 255, 255, 0.95);
    --text-color: #333;
    --text-secondary: #555;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #232526 0%, #414345 100%);
    --surface-color: rgba(40, 40, 40, 0.95);
    --text-color: #f0f0f0;
    --text-secondary: #bbb;
    --primary-color: #81C784;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Pretendard', 'Nunito', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: break-word;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: var(--surface-color);
    backdrop-filter: blur(10px);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    display: block;
}

.header-nav { height: 100%; display: flex; align-items: center; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; height: 100%; gap: 20px; }
.nav-item { position: relative; height: 100%; display: flex; align-items: center; }

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.nav-link:hover, .nav-item:hover > .nav-link, .nav-link.active {
    color: var(--primary-color);
    background: rgba(0,0,0,0.05);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--surface-color);
    min-width: 160px;
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-md);
    padding: 10px 0;
    display: none;
    flex-direction: column;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
}

@media (min-width: 901px) {
    .nav-item:hover .dropdown-menu {
        display: flex; opacity: 1; transform: translateX(-50%) translateY(0);
    }
}

.dropdown-item { padding: 10px 20px; color: var(--text-color); text-decoration: none; font-size: 0.95rem; display: block; }
.dropdown-item:hover { background: rgba(76, 175, 80, 0.1); color: var(--primary-color); }

/* Header Buttons */
.header-buttons { display: flex; gap: 10px; }
.header-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1);
    background: var(--surface-color); color: var(--text-color);
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    transition: all 0.2s; font-weight: bold;
}
.header-btn:hover { background: var(--primary-color); color: white; border-color: transparent; }

/* Layout */
.app-container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
}

/* Home Split Layout */
.home-split-layout {
    display: flex;
    gap: 40px;
    margin-bottom: 4rem;
    align-items: stretch;
    min-height: 500px;
    width: 100%;
}

.home-left-visual {
    flex: 1;
    background: url('main.jpg') center/cover no-repeat;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
    color: white;
    z-index: 0;
}
.home-left-visual::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 60%, rgba(0,0,0,0) 100%);
    z-index: -1;
}

.visual-content { position: relative; z-index: 1; }
.visual-title { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.2; text-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.visual-desc { font-size: 1.2rem; opacity: 0.9; text-shadow: 0 2px 5px rgba(0,0,0,0.3); }

/* Scroll Reveal */
.reveal { opacity: 1; transform: translateY(0); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

.home-right-menu {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    align-content: center;
}

.menu-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 180px;
}
.menu-card:hover { transform: translateY(-8px); border-color: var(--primary-color); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.menu-icon { font-size: 3rem; margin-bottom: 1rem; }
.menu-card h3 { margin: 0; font-size: 1.2rem; font-weight: 800; color: var(--text-color); }
.menu-card p { font-size: 0.9rem; color: var(--text-secondary); margin: 0.5rem 0 0 0; }

/* SEO Content */
.seo-content {
    background: var(--surface-color);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    line-height: 1.8;
    width: 100%;
}

/* Footer */
.app-footer {
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: var(--surface-color);
    margin-top: auto;
    flex-shrink: 0;
}

.footer-nav {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.contributors {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 15px;
    text-align: center;
}

@media (max-width: 768px) {
    .footer-nav {
        gap: 15px;
    }

    .footer-nav a {
        font-size: 0.85rem;
    }
}

/* Forms */
.input-form {
    background: var(--surface-color);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}
.form-group { margin-bottom: 1.5rem; width: 100%; }
.form-group label { font-weight: 700; margin-bottom: 0.8rem; display: block; color: var(--text-color); font-size: 1.1rem; }
input, select {
    width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 12px;
    font-size: 1rem; height: 52px; background: #fff; color: var(--text-color); margin-bottom: 0;
}
.date-row { display: flex; gap: 10px; width: 100%; flex-wrap: wrap; }
.date-row > div { flex: 1; min-width: 120px; }

.date-select-group {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 12px;
}

.date-select-group select {
    flex: 1;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    height: 52px;
    background: #fff;
    color: var(--text-color);
}

.date-select-group select:first-child {
    flex: 2;
}

.date-select-group select:nth-child(2),
.date-select-group select:nth-child(3) {
    flex: 1;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    align-items: center;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
}

.radio-group input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.primary-btn {
    width: 100%; padding: 16px; background: var(--primary-color); color: white; border: none;
    border-radius: 16px; font-size: 1.1rem; font-weight: 800; cursor: pointer; margin-top: 1rem;
}

/* Game Styles */
.game-tabs { display: flex; justify-content: center; gap: 15px; margin-bottom: 2rem; flex-wrap: wrap; }
.game-tab {
    padding: 12px 30px; background: var(--surface-color); border: 1px solid rgba(0,0,0,0.1);
    border-radius: 30px; cursor: pointer; font-weight: bold; color: var(--text-secondary);
    transition: all 0.2s; font-size: 1.1rem;
}
.game-tab.active { background: var(--primary-color); color: white; border-color: transparent; }
.game-content { width: 100%; }
.game-card {
    background: var(--surface-color); padding: 3rem; border-radius: var(--radius-lg);
    text-align: center; box-shadow: var(--shadow-soft); width: 100%; max-width: 900px; margin: 0 auto;
}

/* Cookie Game */
.cookie-stage { margin: 2rem 0; cursor: pointer; perspective: 1000px; display: inline-block; position: relative; width: 300px; height: 300px; }
.cookie-img { font-size: 8rem; transition: transform 0.5s; display: block; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); cursor: pointer; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2)); }
.cookie-open .cookie-img { transform: translate(-50%, -50%) scale(1.2) rotate(20deg); opacity: 0; }
.cookie-msg {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0);
    font-size: 1.3rem; color: var(--primary-dark); font-weight: bold;
    padding: 2rem; background: #fff; border-radius: 15px; border: 3px solid var(--primary-color);
    opacity: 0; transition: all 0.5s 0.2s; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10; pointer-events: none;
}
.cookie-open .cookie-msg { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }

/* Tarot Game */
.tarot-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px;
    justify-content: center; margin: 2rem auto; width: 100%;
}
.tarot-card {
    aspect-ratio: 2/3; background: #333; border-radius: 10px; cursor: pointer;
    position: relative; transform-style: preserve-3d; transition: transform 0.6s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.tarot-card:hover { transform: translateY(-10px); }
.tarot-card.flipped { transform: rotateY(180deg); }
.tarot-front, .tarot-back {
    position: absolute; inset: 0; backface-visibility: hidden; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    overflow: hidden;
}
.tarot-front {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: rgba(255,255,255,0.3); font-size: 2rem; border: 2px solid #ffd700;
}
.tarot-back {
    background: white; transform: rotateY(180deg); color: #333;
    padding: 5px; border: 2px solid var(--primary-color);
}
.tarot-img { font-size: 2rem; margin-bottom: 5px; }
.tarot-back h4 { font-size: 0.8rem; margin: 0; color: var(--primary-dark); }
.tarot-back p { font-size: 0.7rem; margin: 0; line-height: 1.2; word-break: keep-all; }

/* Mobile Responsive */
@media (max-width: 900px) {
    .app-container { padding: 1.5rem 1rem; }
    .app-header { padding: 0.5rem 1rem; height: auto; flex-wrap: wrap; }
    .header-nav { width: 100%; margin-top: 10px; order: 3; overflow-x: auto; padding-bottom: 5px; }
    .nav-list { width: max-content; gap: 10px; }
    
    .nav-item.active .dropdown-menu {
        display: flex; position: fixed; top: auto; left: 1rem; right: 1rem; width: auto; z-index: 2000;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }

    .home-split-layout { flex-direction: column; gap: 20px; }
    .home-left-visual { min-height: 300px; padding: 2rem 1.5rem; background-attachment: scroll; }
    .visual-title { font-size: 2rem; }
    .home-right-menu { grid-template-columns: repeat(2, 1fr); }
    
    .game-card { padding: 1.5rem; }
    .tarot-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

@media (max-width: 768px) {
    .contributors {
        position: static; margin-top: 15px; display: block; text-align: center;
    }
}

@media (max-width: 600px) {
    .tarot-grid { grid-template-columns: repeat(3, 1fr); }
    .cookie-stage { width: 250px; height: 250px; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }