@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #8b5cf6;
    --accent-hover: #7c3aed;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --card-bg: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 70%);
}

/* Header / Navigation */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Ad Styles */
.ad-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem auto;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    overflow: hidden;
}

.ad-leaderboard {
    width: 728px;
    height: 90px;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.ad-rectangle-modal {
    width: 300px;
    height: 250px;
    margin: 1.5rem auto;
}

/* SEO Content Section */
.content-section {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid var(--glass-border);
    padding: 4rem 2rem;
    margin-top: 4rem;
}

.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

.content-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: white;
    text-align: center;
}

.content-section h3 {
    font-size: 1.25rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.content-section p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.step-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.step-number {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03);
    z-index: 0;
}

.faq-section {
    background: rgba(30, 41, 59, 0.4);
    border-radius: 24px;
    padding: 3rem;
}

.faq-item {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.faq-item h4 {
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

@media (max-width: 768px) {
    .ad-leaderboard {
        width: 320px;
        height: 50px;
    }
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c4b5fd 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

/* Main Layout */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: white;
}

.page-subtitle {
    text-align: center;
    color: #94a3b8;
    margin-bottom: 3rem;
}

/* Tool Grid (Landing Page) */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s, background 0.3s;
    text-decoration: none;
    color: var(--text-color);
}

.tool-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: rgba(139, 92, 246, 0.2);
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: var(--accent-color);
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.tool-desc {
    font-size: 0.9rem;
    color: #94a3b8;
}

/* Common Tool Logic Layout */
.tool-container {
    display: flex;
    gap: 3rem;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
}

.controls-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.display-area {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

/* Buttons & Inputs */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    width: 100%;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

input,
select {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Coin Flipper */
.coin {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 3s ease-out;
}

.coin div {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    color: #fff;
    border: 10px solid #f59e0b;
    background: linear-gradient(135deg, #fcd34d 0%, #d97706 100%);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.tails {
    transform: rotateY(180deg);
}

.heads {
    transform: rotateY(0deg);
}

/* Dice Roller */
.dice-scene {
    width: 200px;
    height: 200px;
    perspective: 600px;
}

.dice {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(-100px) rotateX(0deg) rotateY(0deg);
    transition: transform 1s ease-out;
}

.face {
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ccc;
    font-size: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.face span {
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 50%;
    display: block;
    position: absolute;
}

/* Dice Dots Positioning (Simplified for brevity, using flex/grid in implementation) */
/* Detailed dot positioning will be in specific CSS block if needed, or using flex classes */

.front {
    transform: rotateY(0deg) translateZ(100px);
}

.right {
    transform: rotateY(90deg) translateZ(100px);
}

.back {
    transform: rotateY(180deg) translateZ(100px);
}

.left {
    transform: rotateY(-90deg) translateZ(100px);
}

.top {
    transform: rotateX(90deg) translateZ(100px);
}

.bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

/* Result Display (RNG / Oracle) */
.result-display {
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    min-height: 1.2em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Mobile menu implementation later if needed */
    }

    .tool-container {
        flex-direction: column;
    }

    .controls-panel {
        order: 2;
        max-width: 100%;
    }

    .display-area {
        order: 1;
        margin-bottom: 2rem;
        min-height: 300px;
    }
}