/* Playful Geometric Design System */

:root {
    /* Colors */
    --c-background: #FFFDF5;
    --c-foreground: #1E293B;
    --c-muted: #F1F5F9;
    --c-muted-foreground: #64748B;
    --c-accent: #8B5CF6;
    --c-accent-foreground: #FFFFFF;
    --c-secondary: #F472B6;
    --c-tertiary: #FBBF24;
    --c-quaternary: #34D399;
    --c-border: #E2E8F0;
    --c-input: #FFFFFF;
    --c-card: #FFFFFF;
    --c-ring: #8B5CF6;
    --c-dark-border: #1E293B;

    /* Typography */
    --font-heading: 'Outfit', system-ui, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

    /* Spacing & Layout */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    --container-width: 1152px;
    /* max-w-6xl */
    --section-spacing: 96px;

    /* Shadows */
    --shadow-hard: 4px 4px 0px 0px var(--c-dark-border);
    --shadow-hard-hover: 6px 6px 0px 0px var(--c-dark-border);
    --shadow-hard-active: 2px 2px 0px 0px var(--c-dark-border);
    --shadow-card: 8px 8px 0px 0px #E2E8F0;

    /* Transitions */
    --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== ANIMATIONS (Bouncy, Elastic, Fun) ========== */

/* Pop-in Entrance Animation (Scale 0->1 with bounce) */
@keyframes pop-in {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    60% {
        opacity: 1;
        transform: scale(1.03);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-pop-in {
    animation: pop-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Staggered Animation Delays */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}

/* Fade In Right Animation */
@keyframes fade-in-right {
    0% {
        opacity: 0;
        transform: translateX(40px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-right {
    animation: fade-in-right 0.6s ease-out forwards;
}

/* Fade In Left Animation */
@keyframes fade-in-left {
    0% {
        opacity: 0;
        transform: translateX(-40px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-left {
    animation: fade-in-left 0.6s ease-out forwards;
}

/* Simple Fade In Animation (no movement) */
@keyframes fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fade-in 0.8s ease-out forwards;
}

/* Icon Wiggle Animation */
@keyframes wiggle {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(3deg);
    }

    50% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.card:hover .card-icon {
    animation: wiggle 0.4s ease-in-out;
}

/* Marquee Scroll Animation */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.marquee {
    display: flex;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: flex;
    gap: 3rem;
    animation: marquee 20s linear infinite;
}

.marquee-content span {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--c-muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

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

body {
    background-color: var(--c-background);
    color: var(--c-foreground);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    /* ExtraBold */
    line-height: 1.1;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.5rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    color: var(--c-foreground);
}

img {
    max-width: 100%;
    display: block;
}

/* Utility Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: 1rem;
}

.gap-8 {
    gap: 2rem;
}

.section {
    padding: var(--section-spacing) 0;
    position: relative;
}

/* Design System Components */

/* 1. Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-full);
    padding: 1rem 2rem;
    font-size: 1.125rem;
    transition: var(--transition-bounce);
}

.btn-primary {
    background-color: var(--c-accent);
    color: var(--c-accent-foreground);
    box-shadow: var(--shadow-hard);
}

.btn-primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hard-hover);
}

.btn-primary:active {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-hard-active);
}

.btn-secondary {
    background-color: transparent;
    color: var(--c-foreground);
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: var(--c-tertiary);
}

/* 2. Cards */
/* Old Card Styles Removed - See Features Redesign Section below */

/* Decoration Utilities */
.bg-blob {
    position: absolute;
    z-index: -1;
}

/* Hero Phone Mockup */
.hero-phone-container {
    position: relative;
    width: 320px;
    margin: 0 auto;
    filter: drop-shadow(12px 16px 0px var(--c-dark-border));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-phone-container:hover {
    transform: scale(1.02);
}

.hero-phone-container .phone-frame {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 10;
}

.hero-phone-container .phone-screen {
    position: absolute;
    top: 2.2%;
    left: 4.5%;
    width: 91%;
    height: 95.6%;
    object-fit: cover;
    z-index: 5;
    border-radius: 44px;
}

/* Next button overlay on phone mockup */
.phone-next-btn {
    position: absolute;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    height: 7%;
    z-index: 20;
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid rgba(59, 130, 246, 0.4);
    cursor: pointer;
    border-radius: 12px;
    animation: btn-pulse 2s ease-in-out infinite;
}

@keyframes btn-pulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        transform: translateX(-50%) scale(1.03);
        box-shadow: 0 0 12px 4px rgba(59, 130, 246, 0.3);
    }
}

/* Responsive - Following Design System */
@media (max-width: 768px) {

    /* Typography - Smaller on mobile */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Stack everything */
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .hero-content {
        text-align: center;
    }

    /* Hero buttons centered */
    .hero-content .flex {
        justify-content: center;
    }

    /* Buttons - Reset width for nav, keep tappable */
    .btn {
        width: auto;
        min-height: 48px;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    /* Reduce "pop" shadows to 2px to save space */
    .card {
        box-shadow: 2px 2px 0px #E2E8F0;
    }

    .card:hover {
        transform: scale(1.01);
        box-shadow: 4px 4px 0px 0px var(--c-secondary);
    }

    .card:nth-child(2):hover {
        box-shadow: 4px 4px 0px 0px var(--c-tertiary);
    }

    .card:nth-child(3):hover {
        box-shadow: 4px 4px 0px 0px var(--c-accent);
    }

    .card:nth-child(4):hover {
        box-shadow: 4px 4px 0px 0px var(--c-secondary);
    }

    .card:nth-child(5):hover {
        box-shadow: 4px 4px 0px 0px var(--c-tertiary);
    }

    .card:nth-child(6):hover {
        box-shadow: 4px 4px 0px 0px var(--c-accent);
    }

    /* Navigation - Responsive */
    .nav-links {
        display: none;
    }

    /* Logo - Prevent text wrap */
    .logo span {
        font-size: 0.875rem !important;
        white-space: nowrap;
    }

    .logo img {
        width: 32px !important;
        height: 32px !important;
    }

    /* Hero section adjustments */
    .hero-image {
        display: block;
        margin-top: 2rem;
        margin-bottom: 3rem;
        /* Gap before marquee */
    }

    /* Smaller phone mockup on mobile */
    .hero-image .hero-phone-container {
        width: 220px !important;
        /* height auto handled by aspect ratio */
        filter: none !important;
        /* Removed drop-shadow - iPhone PNG already has built-in shadow */
    }

    /* Hide decorative circles on mobile */
    .hero-image>div:first-child,
    .hero-image>div:nth-child(2) {
        display: none;
    }

    /* Section spacing reduced */
    .section {
        padding: 2.5rem 0;
    }

    /* Hero section - more top padding for gap from nav */
    header.section {
        padding-top: 3.5rem;
    }

    /* Container padding */
    .container {
        padding: 0 1rem;
    }

    /* Marquee slower on mobile */
    .marquee-content {
        animation-duration: 30s;
    }

    .marquee-content span {
        font-size: 1rem;
    }

    /* Hide download button, show hamburger */
    .nav-download-btn {
        display: none !important;
    }

    .hamburger-btn {
        display: flex !important;
    }
}

/* Hamburger Button - Hidden on desktop */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--c-tertiary);
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--c-dark-border);
    transition: var(--transition-bounce);
}

.hamburger-btn:hover {
    transform: scale(1.05);
}

.hamburger-btn:active {
    transform: scale(0.98);
    box-shadow: 1px 1px 0px var(--c-dark-border);
}

/* Mobile Menu Overlay */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--c-background);
    z-index: 1000;
    padding: 1rem;
    flex-direction: column;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--c-dark-border);
    margin-bottom: 2rem;
}

.close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--c-dark-border);
    transition: var(--transition-bounce);
}

.close-btn:hover {
    transform: scale(1.05);
}

.close-btn:active {
    transform: scale(0.98);
    box-shadow: 1px 1px 0px var(--c-dark-border);
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--c-foreground);
    text-decoration: none;
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition-bounce);
}

.mobile-nav-link:hover {
    background: var(--c-muted);
    color: var(--c-accent);
}

.nav-link {
    text-decoration: none;
    color: var(--c-foreground);
    font-weight: 700;
    position: relative;
    padding-bottom: 4px;
    display: inline-block;
}

.nav-link:hover,
.nav-link.active {
    color: var(--c-accent);
    outline: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    /* Adjusted to balance the increased height */
    width: 100%;
    height: 11px;
    /* Thicker wave requires more height */
    /* Stroke width 3.5px to match bold font weight */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='11' viewBox='0 0 28 11' fill='none'%3E%3Cpath d='M0 8C3.5 8 3.5 2 7 2C10.5 2 10.5 8 14 8C17.5 8 17.5 2 21 2C24.5 2 24.5 8 28 8' stroke='%238B5CF6' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 14px 11px;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    opacity: 1;
    transform: scaleX(1);
}

/* Dot Pattern Background */
#features {
    background-image: radial-gradient(var(--c-border) 2px, transparent 2px);
    background-size: 32px 32px;
    background-color: var(--c-background);
}

/* Card Reset & Style matching Screenshot */
.card {
    background-color: #FFF;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem 2rem;
    transition: var(--transition-bounce);
    /* Bouncy transition from design system */
    position: relative;
    z-index: 1;
    box-shadow: 8px 8px 0px #E2E8F0;
    /* Soft hard shadow from design system */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    overflow: hidden;
}

/* Corner Accent (Dog-ear style) */
.card::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 48px;
    height: 48px;
    background-color: var(--c-secondary);
    border: 2px solid var(--c-dark-border);
    border-radius: 0 var(--radius-md) 0 24px;
    /* Curved inner corner */
    z-index: 2;
}

/* Cycle Corner Colors */
.card:nth-child(2)::after {
    background-color: var(--c-tertiary);
}

.card:nth-child(3)::after {
    background-color: var(--c-accent);
}

.card:nth-child(4)::after {
    background-color: var(--c-secondary);
}

.card:nth-child(5)::after {
    background-color: var(--c-tertiary);
}

.card:nth-child(6)::after {
    background-color: var(--c-accent);
}

/* Hover State - "Wiggle" with Colored Shadow (from prompt.xml) */
.card:hover {
    transform: rotate(1deg) scale(1.02);
    box-shadow: 8px 8px 0px 0px var(--c-secondary);
}

.card:nth-child(2):hover {
    box-shadow: 8px 8px 0px 0px var(--c-tertiary);
}

.card:nth-child(3):hover {
    box-shadow: 8px 8px 0px 0px var(--c-accent);
}

.card:nth-child(4):hover {
    box-shadow: 8px 8px 0px 0px var(--c-secondary);
}

.card:nth-child(5):hover {
    box-shadow: 8px 8px 0px 0px var(--c-tertiary);
}

.card:nth-child(6):hover {
    box-shadow: 8px 8px 0px 0px var(--c-accent);
}

/* Icon Styling - Floating circle, half-in/half-out of top border */
.card-icon {
    width: 56px;
    height: 56px;
    background-color: var(--c-secondary);
    border: 2px solid var(--c-dark-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    margin-top: -1.75rem;
    /* Sit half out of the top border */
    color: white;
    box-shadow: 2px 2px 0px var(--c-dark-border);
    /* Small hard shadow per design system */
    z-index: 3;
    /* Above the corner accent */
}

.card:nth-child(2) .card-icon {
    background-color: var(--c-tertiary);
}

.card:nth-child(3) .card-icon {
    background-color: var(--c-accent);
}

.card:nth-child(4) .card-icon {
    background-color: var(--c-secondary);
}

.card:nth-child(5) .card-icon {
    background-color: var(--c-tertiary);
}

.card:nth-child(6) .card-icon {
    background-color: var(--c-accent);
}

/* Typography improvements for left-align */
.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.card p {
    font-size: 1rem;
    color: var(--c-muted-foreground);
    margin-bottom: 0;
    line-height: 1.5;
}

/* ========== HOW TO PLAY SECTION ========== */

.how-to-play-section {
    background: var(--c-background);
    position: relative;
    overflow: hidden;
}

/* Tab Navigation */
.variant-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.variant-tab {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--c-dark-border);
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 4px 4px 0px var(--c-dark-border);
    transition: var(--transition-bounce);
    color: var(--c-foreground);
}

.variant-tab:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--c-dark-border);
}

.variant-tab.active {
    background: var(--c-accent);
    color: white;
}

.variant-tab:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--c-dark-border);
}

/* Variant Panels */
.variant-panels {
    position: relative;
}

.variant-panel {
    display: none;
}

.variant-panel.active {
    display: block;
}

/* Variant Content Card */
.variant-content {
    background: white;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-lg);
    box-shadow: 8px 8px 0px var(--c-dark-border);
    padding: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

/* Grid Layout for Content */
.variant-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Left Side: Illustration */
.variant-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-demo {
    display: grid;
    border: 3px solid var(--c-dark-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 6px 6px 0px var(--c-dark-border);
}

.grid-demo-9x9 {
    grid-template-columns: repeat(9, 28px);
    grid-template-rows: repeat(9, 28px);
}

/* 3x3 box borders for 9x9 grid */
.grid-demo-9x9 .grid-cell:nth-child(3n) {
    border-right: 2px solid var(--c-dark-border);
}

.grid-demo-9x9 .grid-cell:nth-child(n+19):nth-child(-n+27),
.grid-demo-9x9 .grid-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--c-dark-border);
}

.grid-demo-4x4 {
    grid-template-columns: repeat(4, 48px);
    grid-template-rows: repeat(4, 48px);
}

.grid-cell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    background: white;
    border: 1px solid var(--c-border);
    color: var(--c-foreground);
}

.grid-cell.filled {
    background: var(--c-muted);
    color: var(--c-accent);
}

.grid-cell.highlight-pink {
    background: var(--c-secondary);
    color: white;
}

.grid-cell.highlight-yellow {
    background: var(--c-tertiary);
    color: var(--c-foreground);
}

.grid-cell.highlight-violet {
    background: var(--c-accent);
    color: white;
}

/* Killer Sudoku Cage Styling */
.killer-grid .grid-cell {
    position: relative;
    border: 1px dashed #999;
}

.killer-grid .cage-start::before {
    content: attr(data-sum);
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 0.5rem;
    font-weight: 600;
    color: #666;
    line-height: 1;
}

/* Grid Illustration Hover Effect - Show App Screenshot */
.grid-illustration-wrapper {
    position: relative;
    width: fit-content;
    /* Wrap the grid tightly */
    margin: 0 auto;
    /* Center if needed */
    perspective: 1000px;
    cursor: pointer;
}

.grid-illustration-wrapper .grid-demo {
    display: grid;
    /* Restore grid layout */
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.phone-mockup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 250px;
    /* Fixed width for consistency */
    height: auto;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-mockup-container .phone-frame {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 10;
    /* Frame behind screenshot for safety if solid screen, or check transparency */
}

.phone-mockup-container .app-screenshot {
    position: absolute;
    top: 3%;
    left: 4.5%;
    width: 91%;
    height: 94%;
    object-fit: cover;
    border-radius: 36px;
    z-index: 11;
    /* Place on top of frame to ensure visibility */
    background: #f0f0f0;
    /* Fallback color */
}

.grid-illustration-wrapper:hover .grid-demo {
    opacity: 0.1;
    transform: scale(0.85);
}

.grid-illustration-wrapper:hover .phone-mockup-container {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Hover hint text */
.grid-illustration-wrapper::after {
    content: '👆 Hover to see app';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: var(--c-muted-foreground);
    opacity: 0.8;
    animation: fadePulse 2s infinite;
    white-space: nowrap;
    pointer-events: none;
}

/* Right Side: Instructions */
.variant-info h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--c-foreground);
}

.variant-tagline {
    color: var(--c-muted-foreground);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.variant-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.variant-steps li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--c-secondary);
    color: white;
    border: 2px solid var(--c-dark-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 2px 2px 0px var(--c-dark-border);
}

.variant-steps li:nth-child(2) .step-number {
    background: var(--c-tertiary);
    color: var(--c-foreground);
}

.variant-steps li:nth-child(3) .step-number {
    background: var(--c-accent);
}

/* Decorative Elements */
.variant-content::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: var(--c-tertiary);
    border-radius: 50%;
    border: 2px solid var(--c-dark-border);
    z-index: -1;
}

.variant-content::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 60px;
    height: 60px;
    background: var(--c-secondary);
    border-radius: 50%;
    border: 2px solid var(--c-dark-border);
    z-index: -1;
}

/* ========== NEW HOW TO PLAY - RULE CARDS & MINI BOARDS ========== */

/* Rules Container - Grid Layout */
.rules-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* Rule Card - Match Features Card Style */
.rule-card {
    background-color: #FFF;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem 2rem;
    transition: var(--transition-bounce);
    position: relative;
    z-index: 1;
    box-shadow: 8px 8px 0px #E2E8F0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

/* Corner Accent (Dog-ear style) - matches badge color */
.rule-card::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 48px;
    height: 48px;
    background-color: var(--c-accent);
    border: 2px solid var(--c-dark-border);
    border-radius: 0 var(--radius-md) 0 24px;
    z-index: 2;
}

/* Cycle Corner Colors - match badge colors */
.rule-card:nth-child(2)::after {
    background-color: var(--c-tertiary);
}

.rule-card:nth-child(3)::after {
    background-color: var(--c-secondary);
}

.rule-card:nth-child(4)::after {
    background-color: var(--c-quaternary);
}

/* Hover State - Wiggle with Colored Shadow - matches badge color */
.rule-card:hover {
    transform: rotate(1deg) scale(1.02);
    box-shadow: 8px 8px 0px 0px var(--c-accent);
}

.rule-card:nth-child(2):hover {
    box-shadow: 8px 8px 0px 0px var(--c-tertiary);
}

.rule-card:nth-child(3):hover {
    box-shadow: 8px 8px 0px 0px var(--c-secondary);
}

.rule-card:nth-child(4):hover {
    box-shadow: 8px 8px 0px 0px var(--c-quaternary);
}

/* Rule Header */
.rule-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Rule Number Badge - Icon Style */
.rule-number {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: var(--c-accent);
    color: white;
    border: 2px solid var(--c-dark-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: 2px 2px 0px var(--c-dark-border);
    z-index: 3;
}

.rule-number-yellow {
    background: var(--c-tertiary);
    color: var(--c-foreground);
}

.rule-number-pink {
    background: var(--c-secondary);
    color: white;
}

.rule-number-green {
    background: var(--c-quaternary);
    color: white;
}

/* Rule Text */
.rule-text h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--c-foreground);
}

.rule-text p {
    font-size: 0.9rem;
    color: var(--c-muted-foreground);
    margin-bottom: 0;
    line-height: 1.4;
}

/* Mini Board Container */
.mini-board-container {
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
}

/* Mini Board - 9x9 Grid */
.mini-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    width: 180px;
    height: 180px;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--c-border);
    gap: 1px;
}

/* Mini Board Cell */
.mb-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.65rem;
    color: var(--c-foreground);
}

/* 3x3 Box Borders */
.mini-board .mb-cell:nth-child(3n) {
    border-right: 1.5px solid var(--c-dark-border);
}

.mini-board .mb-cell:nth-child(9n) {
    border-right: none;
}

.mini-board .mb-cell:nth-child(n+19):nth-child(-n+27),
.mini-board .mb-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 1.5px solid var(--c-dark-border);
}

/* Empty Cell */
.mb-cell.empty {
    background: var(--c-muted);
    color: transparent;
}

/* Dimmed Cell */
.mb-cell.dim {
    color: #CBD5E1;
    background: #FAFAFA;
}

/* Row Highlight - Yellow */
.mb-cell.hl-row {
    background: var(--c-tertiary);
    color: var(--c-foreground);
}

/* Column Highlight - Pink */
.mb-cell.hl-col {
    background: var(--c-secondary);
    color: white;
}

/* Box Highlight - Green */
.mb-cell.hl-box {
    background: var(--c-quaternary);
    color: white;
}

/* Cage Highlight - Purple Border */
.mb-cell.hl-cage {
    background: rgba(139, 92, 246, 0.15);
    color: var(--c-accent);
}

/* Error Highlight - Red */
.mb-cell.hl-error {
    background: #FEE2E2;
    color: #EF4444;
}

/* Diagonal Highlight - Main Diagonal (top-left to bottom-right) */
.mb-cell.hl-diag1 {
    background: linear-gradient(135deg, #C4B5FD, #A78BFA);
    color: white;
}

/* Diagonal Highlight - Anti-Diagonal (top-right to bottom-left) */
.mb-cell.hl-diag2 {
    background: linear-gradient(225deg, #FBCFE8, #F472B6);
    color: white;
}

/* Both diagonals (center cell) */
.mb-cell.hl-diag1.hl-diag2 {
    background: linear-gradient(135deg, #C4B5FD 50%, #FBCFE8 50%);
    color: var(--c-foreground);
}

/* ========== BASIC RULES DEMO ========== */

.basic-rules-demo {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.rule-tag {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    border: 2px solid var(--c-dark-border);
    box-shadow: 2px 2px 0px var(--c-dark-border);
}

.rule-tag.hl-row {
    background: var(--c-tertiary);
    color: var(--c-foreground);
}

.rule-tag.hl-col {
    background: var(--c-secondary);
    color: white;
}

.rule-tag.hl-box {
    background: var(--c-quaternary);
    color: white;
}

/* ========== KILLER SUDOKU CAGE DEMO ========== */

.mini-board-small {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cage-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.cage-label {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--c-accent);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 2px dashed var(--c-accent);
}

.cage-cells {
    display: flex;
    gap: 4px;
}

.cage-cell {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px dashed var(--c-accent);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--c-foreground);
}

.cage-sum {
    font-size: 0.9rem;
    color: var(--c-quaternary);
    font-weight: 600;
}

/* Cage Compare - Correct vs Wrong */
.cage-compare {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cage-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.cage-example .cage-cells {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
}

.cage-example .cage-cell {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.cage-result {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.cage-result.correct {
    color: var(--c-quaternary);
    background: rgba(52, 211, 153, 0.15);
}

.cage-result.wrong {
    color: #EF4444;
    background: #FEE2E2;
}

/* ========== KILLER SUDOKU BOARD ========== */

.killer-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    width: 180px;
    height: 180px;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: white;
}

.kb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.5rem;
    color: var(--c-foreground);
    position: relative;
    border: 1px dashed #999;
}

/* Sum label in top-left corner */
.kb[data-sum]::before {
    content: attr(data-sum);
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 0.4rem;
    font-weight: 700;
    color: var(--c-accent);
    line-height: 1;
}

/* Cage borders - right and bottom edges */
.kb.kb-r {
    border-right: 2px solid var(--c-dark-border);
}

.kb.kb-b {
    border-bottom: 2px solid var(--c-dark-border);
}

/* 3x3 Box Borders */
.killer-board .kb:nth-child(3n) {
    border-right: 2px solid var(--c-dark-border) !important;
}

.killer-board .kb:nth-child(9n) {
    border-right: none !important;
}

.killer-board .kb:nth-child(n+19):nth-child(-n+27),
.killer-board .kb:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--c-dark-border) !important;
}

/* ========== MEGA SUDOKU ========== */

/* 4x4 Mini Board */
.mini-board-4x4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: 160px;
    height: 160px;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--c-border);
    gap: 1px;
}

.mini-board-4x4 .mb-cell {
    font-size: 0.8rem;
}

/* Mega 16x16 Mini Grid */
.mega-mini-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(16, 1fr);
    width: 224px;
    height: 224px;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--c-border);
    gap: 1px;
}

.mg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.5rem;
    color: var(--c-foreground);
}

.mg:empty {
    background: #FAFAFA;
}

/* 4x4 Box Borders for Mega Grid */
.mega-mini-grid .mg:nth-child(4n) {
    border-right: 1.5px solid var(--c-dark-border);
}

.mega-mini-grid .mg:nth-child(16n) {
    border-right: none;
}

.mega-mini-grid .mg:nth-child(n+49):nth-child(-n+64),
.mega-mini-grid .mg:nth-child(n+113):nth-child(-n+128),
.mega-mini-grid .mg:nth-child(n+177):nth-child(-n+192) {
    border-bottom: 1.5px solid var(--c-dark-border);
}

/* Mega Stats Display */
.mega-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 200px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--c-muted);
    border-radius: var(--radius-sm);
    border: 2px solid var(--c-border);
}

.stat-number {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--c-accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--c-muted-foreground);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== SANDWICH SUDOKU ========== */

.sandwich-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.sandwich-clue {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--c-accent);
    background: white;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-sm);
    box-shadow: 2px 2px 0px var(--c-dark-border);
}

.sandwich-row {
    display: flex;
    gap: 3px;
}

.sw-cell {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1.5px solid var(--c-border);
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--c-foreground);
}

/* Bread Cells - Orange/Brown */
.sw-cell.hl-bread {
    background: #FED7AA;
    border-color: #F97316;
    color: #C2410C;
}

/* Filling Cells - Yellow/Green */
.sw-cell.hl-filling {
    background: #D9F99D;
    border-color: #84CC16;
    color: #3F6212;
}

/* Sandwich Legend */
.sandwich-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.legend-bread {
    background: #FED7AA;
    color: #C2410C;
}

.legend-filling {
    background: #D9F99D;
    color: #3F6212;
}

.sandwich-math {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--c-muted-foreground);
}

.bread-label {
    font-weight: 600;
    color: #F97316;
}

.filling-sum {
    background: #D9F99D;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #3F6212;
    font-weight: 600;
}

/* Bread Examples */
.bread-examples {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.bread-ex {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--c-muted);
    border-radius: var(--radius-sm);
}

.bread-clue {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--c-accent);
    background: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-sm);
    box-shadow: 2px 2px 0px var(--c-dark-border);
}

.bread-desc {
    font-size: 0.9rem;
    color: var(--c-muted-foreground);
}

.bread-ex.tip-highlight {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px dashed var(--c-accent);
}

.bread-clue.tip {
    background: var(--c-accent);
    color: white;
}

/* ========== SANDWICH BOARD LAYOUT ========== */

.sandwich-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sandwich-clues-row {
    display: flex;
    gap: 1px;
    padding: 0 20px;
}

.sandwich-clues-row .sw-clue {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.6rem;
    color: var(--c-muted-foreground);
    background: transparent;
}

.sandwich-grid-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sandwich-clues-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sandwich-clues-col .sw-clue {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.6rem;
    color: var(--c-muted-foreground);
}

.sandwich-mini-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    width: 162px;
    height: 162px;
    border: 2px solid var(--c-dark-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--c-border);
    gap: 1px;
}

.sw-g {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.6rem;
    color: var(--c-foreground);
}

.sw-g:empty {
    background: #FAFAFA;
}

/* 3x3 Box Borders for Sandwich Grid */
.sandwich-mini-grid .sw-g:nth-child(3n) {
    border-right: 1.5px solid var(--c-dark-border);
}

.sandwich-mini-grid .sw-g:nth-child(9n) {
    border-right: none;
}

.sandwich-mini-grid .sw-g:nth-child(n+19):nth-child(-n+27),
.sandwich-mini-grid .sw-g:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 1.5px solid var(--c-dark-border);
}

/* Mobile Responsive for How to Play */
@media (max-width: 768px) {
    .variant-tabs {
        gap: 0.5rem;
    }

    .variant-tab {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
        box-shadow: 2px 2px 0px var(--c-dark-border);
    }

    .rules-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .rule-card {
        padding: 1.25rem;
        box-shadow: 4px 4px 0px #E2E8F0;
    }

    .mini-board {
        width: 162px;
        height: 162px;
    }

    .mb-cell {
        font-size: 0.6rem;
    }

    .mini-board-4x4 {
        width: 140px;
        height: 140px;
    }

    .cage-compare {
        gap: 1rem;
    }

    .variant-content {
        padding: 1.5rem;
        box-shadow: 4px 4px 0px var(--c-dark-border);
    }

    .variant-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .variant-illustration {
        order: -1;
    }

    .grid-demo-9x9 {
        grid-template-columns: repeat(9, 28px);
        grid-template-rows: repeat(9, 28px);
    }

    .grid-demo-4x4 {
        grid-template-columns: repeat(4, 40px);
        grid-template-rows: repeat(4, 40px);
    }

    .grid-cell {
        font-size: 0.75rem;
    }

    .variant-info h3 {
        font-size: 1.5rem;
        text-align: center;
    }

    .variant-tagline {
        text-align: center;
    }
}