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

:root {
    --primary-color: #6366f1;
    --d-color: #ef4444;
    --e-color: #f59e0b;
    --s-color: #3b82f6;
    --t-color: #10b981;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
}

.page {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

/* Page 1: Welcome */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2rem;
    min-height: 100vh;
    padding: 2rem 0;
}

.main-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.ancient-text {
    font-size: 1rem;
    color: #b8860b;
    text-shadow: 0 0 10px rgba(184, 134, 11, 0.3);
    animation: mysticalGlow 3s ease-in-out infinite alternate;
}

@keyframes mysticalGlow {
    from {
        text-shadow: 0 0 10px rgba(184, 134, 11, 0.3);
    }
    to {
        text-shadow: 0 0 20px rgba(184, 134, 11, 0.6), 0 0 30px rgba(184, 134, 11, 0.4);
    }
}

.highlight {
    display: block;
    font-size: 3rem;
    margin-top: 0.5rem;
    position: relative;
}

.highlight::before {
    content: "✨";
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    animation: sparkle 2s ease-in-out infinite;
}

.highlight::after {
    content: "✨";
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    animation: sparkle 2s ease-in-out infinite 1s;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(-50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 90%;
    line-height: 1.5;
}

.mystery-text {
    color: #8b4513;
    font-weight: 600;
    font-style: italic;
    text-shadow: 0 0 5px rgba(139, 69, 19, 0.3);
}

.dest-logo {
    width: 200px;
    height: 200px;
    position: relative;
}

.logo-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.logo-circle span {
    position: absolute;
    font-size: 2rem;
    font-weight: bold;
}

.logo-d {
    color: var(--d-color);
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.logo-e {
    color: var(--e-color);
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.logo-s {
    color: var(--s-color);
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.logo-t {
    color: var(--t-color);
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.name-input {
    width: 100%;
    max-width: 300px;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s;
}

.name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 200px;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Page 2: DEST Cards */
.page-title {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dest-cards {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dest-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.dest-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
}

.d-card .card-header {
    background: var(--d-color);
}

.e-card .card-header {
    background: var(--e-color);
}

.s-card .card-header {
    background: var(--s-color);
}

.t-card .card-header {
    background: var(--t-color);
}

.dest-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.dest-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.dest-card ul {
    list-style: none;
    padding-left: 0;
}

.dest-card li {
    padding: 0.3rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dest-card li:before {
    content: "✓ ";
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Page 3: Quiz */
.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--bg-gradient);
    transition: width 0.3s ease;
    width: 8.33%;
}

.question-counter {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.question-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.question-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.option:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.option.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
}

.quiz-navigation {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.quiz-navigation button {
    min-width: auto;
    flex: 1;
}

/* Page 4: Results */
.result-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-intro {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.result-intro span {
    font-weight: bold;
    color: var(--primary-color);
}

.result-badge {
    margin: 2rem 0;
}

.badge-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    box-shadow: var(--shadow);
}

.badge-circle.d-type {
    background: var(--d-color);
}

.badge-circle.e-type {
    background: var(--e-color);
}

.badge-circle.s-type {
    background: var(--s-color);
}

.badge-circle.t-type {
    background: var(--t-color);
}

.result-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 1rem;
}

/* Page 5: Chart */
.chart-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.scores-detail {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.score-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.score-label {
    flex: 0 0 120px;
    font-weight: 600;
    font-size: 0.9rem;
}

.score-bar {
    flex: 1;
    height: 24px;
    background: #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    transition: width 1s ease;
    border-radius: 12px;
}

.d-score .score-fill {
    background: var(--d-color);
}

.e-score .score-fill {
    background: var(--e-color);
}

.s-score .score-fill {
    background: var(--s-color);
}

.t-score .score-fill {
    background: var(--t-color);
}

.score-value {
    flex: 0 0 50px;
    text-align: right;
    font-weight: bold;
}

/* Page 6: Advice */
.advice-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.advice-section {
    margin-bottom: 2rem;
}

.advice-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.advice-section ul {
    list-style: none;
}

.advice-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.advice-section li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Page 7: Conclusion */
.conclusion-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.action-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.action-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Ancient/Mystery styling */
.ancient-intro, .ancient-guidance, .quiz-intro {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(139, 69, 19, 0.1) 100%);
    border-radius: 8px;
    border-left: 4px solid #b8860b;
}

.ancient-title {
    color: #8b4513 !important;
    text-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
}

.ancient-btn {
    background: linear-gradient(135deg, #b8860b 0%, #8b4513 100%) !important;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.ancient-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.ancient-btn:hover::before {
    left: 100%;
}

.book-hint {
    color: #8b4513;
    font-weight: bold;
    text-decoration: underline;
    text-decoration-style: wavy;
    text-underline-offset: 3px;
}

.book-teaser {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(139, 69, 19, 0.1) 100%);
    padding: 1rem;
    border-radius: 8px;
    border: 2px dashed #b8860b;
    margin: 1rem 0;
    font-style: italic;
}

.book-discovery {
    background: rgba(184, 134, 11, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #b8860b;
}

.book-hint-text {
    color: #8b4513;
    font-size: 0.9rem;
    margin: 0;
}

/* Page 8: Ancient Wisdom */
.wisdom-container {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.05) 0%, rgba(139, 69, 19, 0.05) 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 2px solid rgba(184, 134, 11, 0.2);
}

.wisdom-intro {
    margin-bottom: 2rem;
}

.wisdom-text {
    font-size: 1.3rem;
    font-style: italic;
    color: #8b4513;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
    animation: mysticalGlow 3s ease-in-out infinite alternate;
}

.wisdom-intro p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.wisdom-lessons {
    margin: 2rem 0;
}

.wisdom-lessons h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #8b4513;
}

.lesson-card {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.2) 0%, rgba(139, 69, 19, 0.2) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid rgba(184, 134, 11, 0.3);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.1);
}

.wisdom-question {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    color: #8b4513;
    margin-top: 2rem;
    text-shadow: 0 0 5px rgba(139, 69, 19, 0.3);
}

/* Final page book revelation */
.book-final-call {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(139, 69, 19, 0.1) 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid rgba(184, 134, 11, 0.3);
    text-align: center;
}

.book-revelation h3 {
    color: #8b4513;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.book-final-hint {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.book-answer {
    color: #8b4513;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(139, 69, 19, 0.3);
}

.book-invitation {
    color: #8b4513;
    font-style: italic;
    font-weight: 600;
}

.btn-ancient {
    background: linear-gradient(135deg, #8b4513 0%, #654321 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-ancient::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-ancient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn-ancient:hover::before {
    left: 100%;
}

/* Page 9: Final Quote */
.quote-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.quote-mark {
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
    line-height: 1;
}

.quote-mark.closing {
    align-self: flex-end;
}

.final-quote {
    font-size: 1.5rem;
    font-style: italic;
    text-align: center;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 2rem 0;
    max-width: 90%;
}

.final-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .page-content {
        padding: 1.5rem 1rem;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .highlight {
        font-size: 2.5rem;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .dest-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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