:root {
    --bg-color: #05070a;
    --surface-color: #0f172a;
    --acc-primary: #8b5cf6;
    --acc-secondary: #06b6d4;
    --acc-vibrant: #f43f5e;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html,
body {
    width: 100%;
    overflow-x: hidden !important;
    position: relative;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 800;
}

.main-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    text-align: center;
    margin-top: 4rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.main-title span {
    background: linear-gradient(90deg, var(--acc-primary), var(--acc-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: var(--text-dim);
    font-size: 1.2rem;
    margin-top: 1rem;
    max-width: 600px;
    margin-inline: auto;
}

/* --- Navbar & Footer (Shared Styles) --- */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    display: block;
    max-width: 100%;
}

.logo span {
    color: var(--acc-secondary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--acc-secondary);
}

/* --- Hamburger Menu --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background-color: var(--acc-secondary);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background-color: var(--acc-secondary);
}

/* --- Dropdown Menu --- */
.dropdown {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: -20px;
}

.dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chevron {
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.dropdown:hover .chevron,
.dropdown.active .chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 20px;
    padding: 0.75rem;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-content li {
    margin-bottom: 2px;
}

.dropdown-header {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--acc-secondary);
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.dropdown-content li:last-child {
    margin-bottom: 0;
}

.dropdown-content a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--acc-secondary) !important;
}

/* --- Wheel Area --- */
.hero-section {
    padding-bottom: 5rem;
}

.wheel-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
    position: relative;
}

.wheel-outer {
    position: relative;
    width: 500px;
    height: 500px;
    max-width: 90vw;
    max-height: 90vw;
    background: radial-gradient(circle, #1e293b 0%, #05070a 100%);
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.2);
    border: 4px solid var(--glass-border);
}

.wheel-pointer {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 65px;
    background: linear-gradient(135deg, #fcd34d 0%, #b45309 100%);
    clip-path: polygon(50% 100%, 100% 25%, 85% 0%, 15% 0%, 0% 25%);
    z-index: 100;
    border: 3px solid #78350f;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.08s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top center;
}

/* Metallic Rivet */
.wheel-pointer::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: radial-gradient(circle at 30% 30%, #fff, #94a3b8);
    border-radius: 50%;
    border: 1px solid #475569;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

#spinBtn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--text-main);
    color: var(--bg-color);
    border: 8px solid var(--bg-color);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
}

#spinBtn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

#spinBtn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* --- UI Elements --- */
.result-display {
    text-align: center;
    margin-top: 3rem;
    min-height: 80px;
}

#resultText {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.5s ease;
}

.controls-panel {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.control-group {
    background: var(--glass-bg);
    padding: 0.75rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    border: none;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--acc-primary);
    color: white;
}

.btn-secondary {
    background: var(--glass-border);
    color: var(--text-main);
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

/* --- Features Grid --- */
.info-section {
    padding: 2rem 0 5rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(0deg, var(--bg-color) 0%, #0a0f1d 100%);
}

.info-section .main-title {
    margin-top: 0;
    margin-bottom: 30px;
    /* Spacing for desktop */
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    border-radius: 24px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--acc-secondary);
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--acc-secondary);
}

.card p {
    color: var(--text-dim);
}

/* --- New Sections --- */
.section-title {
    text-align: center;
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 4rem;
}

.section-title span {
    color: var(--acc-secondary);
}

.how-to-section,
.faq-section {
    padding: 8rem 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.step-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.step-num {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 4rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.04);
    line-height: 1;
    pointer-events: none;
}

.step-card h4 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.faq-grid {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 2rem;
    border-radius: 20px;
    border-left: 4px solid var(--acc-primary);
}

.faq-item h5 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

/* --- Footer --- */
footer {
    padding: 5rem 0 2rem;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.footer-nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--acc-secondary);
}

.copyright {
    color: var(--text-dim);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --- Responsive --- */
.no-scroll {
    overflow: hidden;
}

@media (max-width: 900px) {
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 100vw;
        height: 100vh;
        background: #0a0f1d;
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 0;
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s linear 0.5s;
        z-index: 1000;
        padding: 80px 1.5rem 2rem;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s linear 0s;
    }

    .hamburger {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links a {
        display: block;
        padding: 1.25rem 0;
        font-size: 1.1rem;
        color: var(--text-main);
        width: 100%;
    }

    .dropdown {
        width: 100%;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .dropdown-trigger {
        justify-content: space-between;
    }

    .dropdown-content {
        position: static;
        transform: none;
        opacity: 0;
        visibility: hidden;
        background: rgba(255, 255, 255, 0.02);
        margin-top: 0;
        max-height: 0;
        border: none;
        width: 100%;
        text-align: left;
        display: block;
        padding: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        border-radius: 0;
    }

    .dropdown.active .dropdown-content {
        opacity: 1;
        visibility: visible;
        max-height: 2000px;
        /* Large enough for all tools */
        padding: 0;
        margin-top: 0;
    }

    .dropdown-header {
        padding: 1.5rem 0 0.5rem 0;
    }

    .dropdown-content a {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        opacity: 0.8;
    }

    .nav-links a:hover {
        transform: none;
        background: transparent;
    }

    .dropdown-content a:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.05);
        padding-left: 1rem;
        /* Consistent padding */
        color: var(--acc-secondary) !important;
    }

    /* Fix specificity issue: Desktop hover style was shifting mobile dropdown left */
    .dropdown:hover .dropdown-content {
        transform: none;
    }

    .nav-btn:hover {
        transform: translateY(-2px);
        /* Vertical only */
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }

    /* Add spacing between title and content on Privacy/About pages */
    .info-section .main-title {
        margin-bottom: 15px;
        /* Spacing for mobile */
    }

    .wheel-outer {
        width: 350px;
        height: 350px;
    }

    #spinBtn {
        width: 80px;
        height: 80px;
        font-size: 1rem;
    }
}

/* --- History Section --- */
.history-container {
    margin: 3rem auto 0;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.history-container h3 {
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    text-align: center;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#historyList {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#historyList li {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
}

#historyList li:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

#historyList li span:first-child {
    font-weight: 800;
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 0.05em;
}

#historyList li .time {
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.7;
}

.empty-msg {
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
    padding: 1rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem;
    width: 90%;
    max-width: 500px;
    text-align: center;
    transform: scale(0.8) translateY(20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--acc-primary), var(--acc-secondary));
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.decision-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--acc-secondary);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body h2 {
    font-size: clamp(4rem, 15vw, 6rem);
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#fateMessage {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* --- Confetti --- */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2500;
}

/* --- Visual Polish --- */
.wheel-outer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    animation: glowPulse 4s infinite alternate;
}

@media (max-width: 768px) {
    .wheel-outer::after {
        width: 100%;
        height: 100%;
    }
}

@keyframes glowPulse {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 0.8;
    }
}

/* --- Tools Directory --- */

/* --- Tools Directory --- */
.tools-directory {
    padding: 6rem 0;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
}

.tool-card {
    text-decoration: none !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-card:hover {
    transform: translateY(-10px);
    border-color: var(--acc-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

@media (max-width: 900px) {
    .tool-card:hover {
        transform: none;
        /* Prevent shifting on tap/hover on mobile */
    }
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}