
/* ======================================= */
/* --- PHASE 0: CSS SCAFFOLDING & AESTHETICS --- */
/* Aesthetic Vision: Maximalist Chaos, Bright Colors, Diagonal Flow */
/* ======================================= */

/* 1. Define Variables (Color & Theme Commitment) */
:root {
    --color-primary: #ff4e63;    /* Deep Magenta - Dominant */
    --color-secondary: #ffc857;  /* Molten Orange - Accent/CTA */
    --color-accent: #1d9b8a;     /* Electric Teal - Contrast */
    --color-background: #fefae0; /* Off-White, slightly warm tone */
    --color-text-dark: #2c3e50;  /* Deep Navy for readability */
    --font-display: 'Monoton', cursive;
    --font-body: 'Poppins', sans-serif;
    --spacing-unit: 1rem;
}

/* Global Reset and Base Typography */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-text-dark);
    /* NOTE: No body skew — it breaks layout and hides the wheel */
}

h1, h2, .tagline {
    font-family: var(--font-display);
}

body h1 {
    font-size: clamp(2rem, 6vw, 5rem);
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.15);
}

/* --- PHASE 1: Banner Styling --- */
#hero-banner {
    background:
        linear-gradient(45deg, rgba(255, 78, 99, 0.6), rgba(255, 140, 66, 0.7)),
        radial-gradient(circle at center, var(--color-accent) 0%, transparent 35%),
        linear-gradient(to bottom right, rgba(255, 199, 87, 0.4), rgba(29, 155, 138, 0.3));
    color: white;
    padding: 5rem calc(var(--spacing-unit) * 4);
    text-align: center;
    animation: fadeInScaleUp 1.2s ease-out forwards;
}

.tagline {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    margin-top: 1rem;
    opacity: 0.9;
}

/* --- CTA Button --- */
#spin-fate-btn {
    margin-top: 2rem;
    padding: 0.85rem 3rem;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-family: var(--font-display);
    background-color: var(--color-secondary);
    color: var(--color-text-dark);
    border: none;
    cursor: pointer;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

#spin-fate-btn:hover {
    background-color: var(--color-primary);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.35);
    color: white;
}

#spin-fate-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
}

#spin-fate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* --- Main Content --- */
#content-container {
    padding: 0 1rem;
}

/* --- Wheel Container --- */
#wheel-container {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 2rem auto;
    overflow: visible; /* allow pointer arrow to extend outside */
}

/* The actual spinning wheel element */
.wheel-graphic {
    width: 500px;
    height: 500px;
    border-radius: 50%;
    position: relative;
    transition: transform 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 0 0 0 6px rgba(255,255,255,0.3);
}

/* Pointer/arrow indicator — fixed on the TOP of the wheel, pointing DOWN */
.wheel-pointer {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    /* Triangle pointing DOWN into the wheel */
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 36px solid var(--color-primary);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    z-index: 20;
    transition: filter 0.1s ease;
}

/* Flash the pointer when it gets hit by a peg */
.wheel-pointer.tick-flash {
    filter: drop-shadow(0 0 8px var(--color-secondary)) drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Peg dots on the wheel rim */
.wheel-peg {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.3);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    pointer-events: none;
}

/* Wheel labels container */
.wheel-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
}

/* Center hub of the wheel */
.wheel-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    border: 4px solid var(--color-text-dark);
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* --- Result Display --- */
.result-display {
    text-align: center;
    margin: 2rem auto;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-family: var(--font-display);
    color: var(--color-primary);
    min-height: 3rem;
    padding: 1rem;
}

/* ═══════════════════════════════════════════════════════
   AD LAYOUT SYSTEM
   Standard Google AdSense sizes used:
     Leaderboard      728×90  — top, below-header, footer
     Medium Rectangle 300×250 — wheel left/right flanks (×4)
     Large Rectangle  336×280 — mid-content between wheels
═══════════════════════════════════════════════════════ */

/* Horizontal ad bars (top, below-header, footer) */
.ad-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: rgba(255, 200, 87, 0.12);
    border-top: 2px dashed var(--color-secondary);
    border-bottom: 2px dashed var(--color-secondary);
    padding: 0.5rem 0;
    min-height: 100px;
}

.ad-bar-top    { border-top: none; }
.ad-bar-footer { border-bottom: none; margin-bottom: 0; }

/* ── Wheel row: left-ad | wheel content | right-ad ── */
.wheel-row {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Ad cell on each side of a wheel */
.wheel-row-ad {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 200, 87, 0.12);
    border: 2px dashed var(--color-secondary);
    border-radius: 8px;
    padding: 0.75rem;
    min-height: 270px;
}

/* Center content cell */
.wheel-row-content {
    min-width: 0;
}

/* Inline mid-content ad block */
.ad-block {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem auto;
    max-width: 1400px;
    background: rgba(255, 200, 87, 0.12);
    border: 2px dashed var(--color-secondary);
    border-radius: 8px;
    padding: 0.75rem;
}

/* Fallback tint while AdSense loads */
.adsbygoogle {
    background: rgba(255, 200, 87, 0.08);
    border-radius: 4px;
}

/* Footer copy */
.footer-copy {
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-dark);
    opacity: 0.6;
}

/* ── Responsive: stack on smaller screens ── */
@media (max-width: 1200px) {
    .wheel-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "content"
            "left-ad"
            "right-ad";
    }

    .wheel-row-ad:first-child { grid-area: left-ad; }
    .wheel-row-ad:last-child  { grid-area: right-ad; }
    .wheel-row-content        { grid-area: content; }
}

@media (max-width: 768px) {
    .ad-leaderboard {
        width: 320px !important;
        height: 50px !important;
    }
}

/* --- Custom Wheel Section --- */
#custom-wheel-setup {
    margin-top: 4rem;
    text-align: center;
}

#custom-wheel-setup h2 {
    font-size: clamp(1.2rem, 3vw, 2rem);
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.custom-wheel-input-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#name-input {
    padding: 0.6rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--color-accent);
    border-radius: 8px;
    font-family: var(--font-body);
    min-width: 220px;
}

#name-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 78, 99, 0.2);
}

/* Tag list container */
.names-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem;
    margin: 0.5rem auto;
    max-width: 700px;
    min-height: 3rem;
    border: 2px dashed var(--color-primary);
    border-radius: 12px;
    background: rgba(255, 78, 99, 0.04);
}

/* Individual tag chip */
.name-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: var(--color-accent);
    color: white;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    animation: tagPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Delete × button inside each tag */
.tag-delete-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    font-size: 1rem;
    line-height: 1;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease;
}

.tag-delete-btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

@keyframes tagPop {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.cta-secondary {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    font-family: var(--font-body);
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

#wheel-container-custom {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 0 auto;
    overflow: visible;
}

/* --- SEO Content Section --- */
#seo-content {
    background: var(--color-background);
    border-top: 3px solid var(--color-secondary);
    padding: 3rem 2rem;
}

.seo-content-inner {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.seo-content-inner h2 {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.seo-content-inner > p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-dark);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.seo-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    text-align: left;
}

.seo-feature {
    background: white;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.seo-feature h3 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.seo-feature p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text-dark);
}

/* --- Footer --- */
footer {
    margin-top: 2rem;
    padding: 0;
    text-align: center;
}

/* --- Animations --- */
@keyframes fadeInScaleUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes resultPop {
    0%   { transform: scale(0.8); opacity: 0; }
    70%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

.result-pop {
    animation: resultPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
