:root {
    --bg-color: #1a1a1a;
    --text-color: #fff;
    --container-bg: rgba(0, 0, 0, 0.2);
    --container-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --accent-color: #ff4757;
    --accent-hover: #ff6b81;
    --glow-color: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(0, 0, 0, 0.8);
}

.light-mode {
    --bg-color: #f0f2f5;
    --text-color: #2f3542;
    --container-bg: rgba(255, 255, 255, 0.8);
    --container-border: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(0, 0, 0, 0.05);
    --input-border: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --glow-color: rgba(0, 0, 0, 0.05);
    --nav-bg: rgba(255, 255, 255, 0.9);
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle at center, var(--glow-color) 0%, transparent 60%);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

#app {
    height: calc(100vh - 120px);
    width: 100%;
    position: relative;
    overflow-y: auto;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.page.active {
    display: flex;
    opacity: 1;
}

.description-text {
    max-width: 600px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    opacity: 0.8;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#themeBtn {
    background: var(--container-bg);
    border: 1px solid var(--container-border);
    color: var(--text-color);
    padding: 10px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* Legal Footer */
.legal-footer {
    position: fixed;
    bottom: 70px;
    left: 0;
    width: 100%;
    height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    font-size: 0.8rem;
    z-index: 999;
}

.legal-links button {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0 5px;
    font-size: 0.8rem;
    opacity: 0.7;
    text-decoration: underline;
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--container-border);
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-item.active {
    opacity: 1;
    color: var(--accent-color);
    transform: translateY(-5px);
}

/* Wheel Page Decorations */
.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin-bottom: 25px;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.3));
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--accent-color);
    z-index: 10;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

#result {
    margin-top: 15px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.result-badge {
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 8px;
    animation: bounce 0.5s ease;
}

.result-value {
    font-size: 2.2rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.spinning-text {
    font-style: italic;
    opacity: 0.7;
    animation: pulse 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* AI Result Decorations */
#ai-result-message {
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--container-bg);
    border-radius: 25px;
    border: 2px solid var(--accent-color);
    max-width: 450px;
    box-shadow: 0 15px 40px var(--shadow-color);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

#ai-result-message::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    opacity: 0.05;
    z-index: -1;
}

.result-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

#ai-result-message h4 {
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    color: var(--accent-color);
    font-weight: 800;
}

.result-desc {
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
    color: var(--text-color);
}

.result-sub-desc {
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 1.2rem;
    text-align: left;
    border-left: 4px solid var(--accent-color);
}

.share-hint {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Common Components */
button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
}

button:hover {
    transform: scale(1.05) translateY(-2px);
    background: var(--accent-hover);
}

input[type="text"] {
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 12px;
    padding: 12px 18px;
    color: var(--text-color);
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.2);
}

.hidden { display: none; }

@media (max-width: 600px) {
    .wheel-container { width: 300px; height: 300px; }
    .result-value { font-size: 1.8rem; }
}
