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

:root {
    --primary-black: #000000;
    --primary-gold: #FFD700;
    --secondary-gold: #FFA500;
    --dark-gray: #1a1a1a;
    --medium-gray: #333333;
    --light-gray: #666666;
    --white: #ffffff;
    --gradient-gold: linear-gradient(135deg, #FFD700, #FFA500);
    --success-green: #00ff88;
    --error-red: #ff4444;
    --info-blue: #4488ff;
    --nav-height: 70px;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--primary-black);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: var(--nav-height);
}

/* Three.js Background Canvas */
.three-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--medium-gray);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-gold);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-gold);
    margin: 3px 0;
    transition: 0.3s;
}

.container {
    min-height: 100vh;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--dark-gray) 100%);
    position: relative;
    overflow: hidden;
}

.palindrome-display {
    text-align: center;
    animation: fadeInUp 1s ease-out;
    z-index: 2;
    position: relative;
}

.main-number {
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
    animation: glow 2s ease-in-out infinite alternate;
    cursor: pointer;
}

.reflection-line {
    width: 200px;
    height: 2px;
    background: var(--gradient-gold);
    margin: 0 auto 2rem;
    animation: expand 1.5s ease-out;
}

.subtitle {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--primary-gold);
    margin-bottom: 1rem;
    font-weight: 300;
}

.tagline {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--light-gray);
    font-weight: 300;
    margin-bottom: 3rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

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

.hero-stat .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}

.hero-stat .stat-label {
    color: var(--light-gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-palindromes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-word {
    position: absolute;
    color: var(--primary-gold);
    font-weight: 600;
    opacity: 0.3;
    animation: float 10s infinite linear;
}

.floating-word:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.floating-word:nth-child(2) { top: 30%; right: 15%; animation-delay: 2s; }
.floating-word:nth-child(3) { bottom: 25%; left: 20%; animation-delay: 4s; }
.floating-word:nth-child(4) { bottom: 35%; right: 25%; animation-delay: 6s; }
.floating-word:nth-child(5) { top: 60%; left: 50%; animation-delay: 8s; }

/* Palindrome of the Day */
.palindrome-daily {
    padding: 4rem 0;
    background-color: var(--dark-gray);
}

.palindrome-daily h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-gold);
}

.daily-card {
    background: var(--medium-gray);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.daily-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: var(--gradient-gold);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1;
}

.daily-palindrome {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-gold);
    margin-bottom: 2rem;
    font-style: italic;
}

.daily-explanation {
    font-size: 1.1rem;
    color: var(--light-gray);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.daily-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.daily-meta span {
    background: var(--dark-gray);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary-gold);
}

/* Content Wrapper */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* About Section */
.about {
    padding: 6rem 0;
    background-color: var(--primary-black);
}

.about h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
}

.about p {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--light-gray);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.palindrome-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.example-card {
    background: var(--medium-gray);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.example-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-gold);
    opacity: 0.1;
    transition: left 0.5s ease;
}

.example-card:hover::before {
    left: 0;
}

.example-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-5px);
}

.example-card .number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.example-card .description {
    color: var(--light-gray);
    font-size: 1rem;
}

/* Tools Suite */
.tools-suite {
    padding: 4rem 0;
    background-color: var(--dark-gray);
}

.tools-suite h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.tools-suite > .content-wrapper > p {
    text-align: center;
    color: var(--light-gray);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.tools-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tool-tab {
    background: var(--medium-gray);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.tool-tab:hover,
.tool-tab.active {
    background: var(--gradient-gold);
    color: var(--primary-black);
    transform: translateY(-2px);
}

.tool-panel {
    display: none;
    background: var(--medium-gray);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--light-gray);
}

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

.tool-panel h3 {
    color: var(--primary-gold);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Input Groups */
.input-group {
    margin-bottom: 2rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
    background: var(--dark-gray);
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    color: var(--white);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.input-options {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.input-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--light-gray);
    cursor: pointer;
}

.input-options input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Results */
.result {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: var(--dark-gray);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.status {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.message {
    font-size: 1.2rem;
    color: var(--light-gray);
    margin-bottom: 1rem;
}

.analysis {
    font-size: 0.9rem;
    color: var(--primary-gold);
    margin-top: 1rem;
}

/* Stats */
.palindrome-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat {
    text-align: center;
    padding: 2rem;
    background: var(--dark-gray);
    border-radius: 12px;
    border: 1px solid var(--medium-gray);
    transition: transform 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
    display: block;
}

.stat-label {
    color: var(--light-gray);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Generator Results */
.generator-results {
    margin-top: 2rem;
}

.generated-list {
    display: grid;
    gap: 1rem;
}

.generated-item {
    background: var(--dark-gray);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-gold);
}

.generated-palindrome {
    font-size: 1.3rem;
    color: var(--primary-gold);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.generation-method {
    color: var(--light-gray);
    font-size: 0.9rem;
}

/* Calendar Container */
.calendar-container {
    display: grid;
    gap: 2rem;
}

.date-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.palindromic-dates {
    display: grid;
    gap: 2rem;
}

.next-palindrome {
    background: var(--dark-gray);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--primary-gold);
}

.next-palindrome h4 {
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.next-date {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 1rem;
}

.countdown {
    color: var(--light-gray);
    font-size: 1.1rem;
}

.date-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.date-item {
    background: var(--dark-gray);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--light-gray);
    transition: all 0.3s ease;
}

.date-item:hover {
    border-color: var(--primary-gold);
    transform: translateY(-3px);
}

.date-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}

.date-info {
    color: var(--light-gray);
    font-size: 0.9rem;
}

/* Visualizer */
.visualizer-container {
    text-align: center;
}

.visualization {
    margin: 2rem 0;
    background: var(--dark-gray);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

#palindrome-canvas {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background: var(--primary-black);
}

.visual-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.visual-controls button {
    background: var(--medium-gray);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.visual-controls button:hover {
    background: var(--primary-gold);
    color: var(--primary-black);
}

/* Calculator */
.calculator-container {
    display: grid;
    gap: 2rem;
}

.calc-input {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.calc-input button {
    background: var(--gradient-gold);
    color: var(--primary-black);
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
}

.calc-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.calc-results {
    background: var(--dark-gray);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-gold);
}

.calc-result {
    font-size: 1.5rem;
    color: var(--primary-gold);
    font-weight: 700;
    margin-bottom: 1rem;
}

.math-explanation {
    background: var(--medium-gray);
    padding: 1.5rem;
    border-radius: 12px;
    color: var(--light-gray);
    line-height: 1.8;
}

/* Multi-language */
.multilang-container {
    display: grid;
    gap: 2rem;
}

.language-selector select {
    width: 300px;
    margin: 0 auto;
}

.multilang-result {
    background: var(--dark-gray);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    min-height: 100px;
}

.language-examples {
    background: var(--medium-gray);
    padding: 2rem;
    border-radius: 12px;
}

.language-examples h4 {
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.example-list {
    display: grid;
    gap: 1rem;
}

.lang-example {
    background: var(--dark-gray);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lang-palindrome {
    color: var(--primary-gold);
    font-weight: 600;
}

.lang-meaning {
    color: var(--light-gray);
    font-style: italic;
}

/* Academy Section */
.palindrome-academy {
    padding: 4rem 0;
    background-color: var(--primary-black);
}

.palindrome-academy h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.palindrome-academy > .content-wrapper > p {
    text-align: center;
    color: var(--light-gray);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.academy-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.academy-tab {
    background: var(--medium-gray);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.academy-tab:hover,
.academy-tab.active {
    background: var(--gradient-gold);
    color: var(--primary-black);
    transform: translateY(-2px);
}

.academy-section {
    display: none;
    background: var(--medium-gray);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--light-gray);
}

.academy-section.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force academy-history to always be visible on load */
#academy-history {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure academy sections are never affected by timeline filtering */
.academy-section.filtered-out {
    display: block !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    padding: 2rem !important;
    margin-bottom: initial !important;
    transform: none !important;
    pointer-events: auto !important;
}

.academy-section h3 {
    color: var(--primary-gold);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-gold);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 10px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-gold);
}

.timeline-date {
    color: var(--primary-gold);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    color: var(--white);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--light-gray);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.example {
    background: var(--dark-gray);
    padding: 1rem;
    border-radius: 8px;
    color: var(--primary-gold);
    font-style: italic;
    border-left: 3px solid var(--primary-gold);
}

/* Timeline Navigation */
.timeline-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 1rem;
    background: var(--dark-gray);
    border-radius: 12px;
    justify-content: center;
}

.timeline-period {
    padding: 0.8rem 1.5rem;
    background: var(--medium-gray);
    color: var(--white);
    border: 2px solid transparent;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.timeline-period:hover {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    transform: translateY(-2px);
}

.timeline-period.active {
    background: var(--gradient-gold);
    color: var(--primary-black);
    font-weight: 700;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* Enhanced Timeline Items with Period Classification */
.timeline-item.ancient::before {
    background: #8B4513; /* Bronze for ancient */
}

.timeline-item.medieval::before {
    background: #4169E1; /* Royal blue for medieval */
}

.timeline-item.modern::before {
    background: var(--primary-gold); /* Gold for modern */
}

/* Culture Notes */
.culture-note {
    background: var(--medium-gray);
    padding: 0.8rem;
    border-radius: 6px;
    color: var(--secondary-gold);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    border-left: 2px solid var(--secondary-gold);
}

/* Historical Figures Section */
.historical-figures {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--medium-gray);
}

.historical-figures h4 {
    color: var(--primary-gold);
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 2rem;
}

.figures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.figure-card {
    background: var(--dark-gray);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--light-gray);
    transition: all 0.3s ease;
    text-align: center;
}

.figure-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.2);
}

.figure-card h5 {
    color: var(--primary-gold);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.figure-card p {
    color: var(--light-gray);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Timeline Period Filtering */
#academy-history .timeline-item {
    transition: all 0.5s ease;
}

#academy-history .timeline-item.filtered-out {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    margin-bottom: 0;
    height: 0;
    overflow: hidden;
    padding: 0;
}

/* Defensive CSS - Ensure Academy Sections Are Never Affected by Filtering */
.academy-section.filtered-out {
    display: block !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    padding: 2rem !important;
    margin-bottom: auto !important;
    pointer-events: auto !important;
    transform: none !important;
}

/* Math Categories */
.math-categories {
    display: grid;
    gap: 3rem;
}

.math-category {
    background: var(--dark-gray);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--light-gray);
}

.math-category h4 {
    color: var(--primary-gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.math-category p {
    color: var(--light-gray);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.math-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.math-example {
    background: var(--medium-gray);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.math-example .number {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
    display: block;
}

.math-example .description {
    color: var(--light-gray);
    font-size: 0.9rem;
}

/* Lychrel Demo */
.lychrel-demo {
    background: var(--medium-gray);
    padding: 2rem;
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.process-step {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.process-step:hover {
    background: var(--dark-gray);
}

.step-number {
    color: var(--primary-gold);
    font-weight: 700;
    margin-right: 1rem;
    min-width: 30px;
}

.calculation {
    color: var(--white);
    font-family: monospace;
    font-size: 1.1rem;
}

.result-palindrome {
    color: var(--success-green) !important;
    font-weight: 700;
}

.palindrome-result {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--dark-gray);
    border-radius: 8px;
    color: var(--success-green);
    font-weight: 700;
}

/* Prime Examples */
.prime-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.prime-number {
    background: var(--medium-gray);
    color: var(--primary-gold);
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    font-weight: 700;
    border: 2px solid var(--primary-gold);
    transition: all 0.3s ease;
}

.prime-number:hover {
    background: var(--primary-gold);
    color: var(--primary-black);
    transform: scale(1.1);
}

/* Language Grid */
.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.language-card {
    background: var(--dark-gray);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--light-gray);
    transition: all 0.3s ease;
}

.language-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-5px);
}

.language-card h4 {
    color: var(--primary-gold);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.examples {
    display: grid;
    gap: 1rem;
}

.example-item {
    background: var(--medium-gray);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.palindrome-text {
    color: var(--primary-gold);
    font-weight: 700;
    font-size: 1.1rem;
}

.phonetic,
.meaning {
    color: var(--light-gray);
    font-style: italic;
    font-size: 0.9rem;
}

/* Nature Categories */
.nature-categories {
    display: grid;
    gap: 3rem;
}

.nature-category {
    background: var(--dark-gray);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--light-gray);
}

.nature-category h4 {
    color: var(--primary-gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.nature-category p {
    color: var(--light-gray);
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* DNA Example */
.dna-example {
    background: var(--medium-gray);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.dna-strand {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.base {
    background: var(--primary-gold);
    color: var(--primary-black);
    padding: 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.explanation {
    color: var(--light-gray);
    font-style: italic;
    margin-top: 1rem;
}

/* Fibonacci Visual */
.fibonacci-visual {
    display: grid;
    gap: 1rem;
}

.spiral-pattern,
.leaf-pattern,
.shell-pattern {
    background: var(--medium-gray);
    padding: 1rem;
    border-radius: 8px;
    color: var(--light-gray);
    border-left: 3px solid var(--primary-gold);
}

/* Crystal Examples */
.crystal-examples {
    display: grid;
    gap: 1rem;
}

.crystal {
    background: var(--medium-gray);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crystal-name {
    color: var(--primary-gold);
    font-weight: 700;
    font-size: 1.1rem;
}

.symmetry {
    color: var(--light-gray);
    font-style: italic;
}

/* Culture Grid */
.culture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.culture-item {
    background: var(--dark-gray);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--light-gray);
}

.culture-item h4 {
    color: var(--primary-gold);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.literary-examples,
.music-examples,
.architecture-examples,
.art-examples {
    display: grid;
    gap: 1.5rem;
}

.book-example,
.music-example,
.building-example,
.art-example {
    background: var(--medium-gray);
    padding: 1.5rem;
    border-radius: 8px;
}

.book-example h5,
.music-example h5,
.building-example h5,
.art-example h5 {
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}

.book-example p,
.music-example p,
.building-example p,
.art-example p {
    color: var(--light-gray);
    line-height: 1.6;
}

/* Games Section */
.palindrome-games {
    padding: 6rem 0;
    background-color: var(--dark-gray);
}

.palindrome-games h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.palindrome-games > .content-wrapper > p {
    text-align: center;
    color: var(--light-gray);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.game-card {
    background: var(--medium-gray);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.2);
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.game-card h3 {
    color: var(--primary-gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.game-card p {
    color: var(--light-gray);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-stats .stat {
    color: var(--light-gray);
    font-size: 0.9rem;
}

.play-btn {
    background: var(--gradient-gold);
    color: var(--primary-black);
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    width: 100%;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.3);
}

/* Game Modal */
.game-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.game-modal-content {
    background: var(--medium-gray);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.game-close {
    color: var(--light-gray);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.game-close:hover {
    color: var(--primary-gold);
}

/* Your Stats Section */
.your-stats {
    background: var(--medium-gray);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid var(--light-gray);
}

.your-stats h3 {
    color: var(--primary-gold);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--dark-gray);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-5px);
}

.stat-card h4 {
    color: var(--primary-gold);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.stat-desc {
    color: var(--light-gray);
    font-size: 0.9rem;
}

.play-to-improve {
    text-align: center;
    padding: 1rem;
    background: var(--dark-gray);
    border-radius: 12px;
    border: 2px dashed var(--light-gray);
}

.play-to-improve p {
    color: var(--primary-gold);
    font-size: 1.1rem;
    margin: 0;
    transition: all 0.3s ease;
    font-weight: 600;
}

/* Game Animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}


/* Community Section */
.palindrome-community {
    padding: 6rem 0;
    background-color: var(--primary-black);
}

.palindrome-community h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.palindrome-community > .content-wrapper > p {
    text-align: center;
    color: var(--light-gray);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.community-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.community-stat {
    text-align: center;
    padding: 2rem;
    background: var(--dark-gray);
    border-radius: 12px;
    border: 1px solid var(--medium-gray);
    transition: transform 0.3s ease;
}

.community-stat:hover {
    transform: translateY(-5px);
}

.community-stat .stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
    display: block;
}

.community-stat .stat-label {
    color: var(--light-gray);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.community-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: var(--medium-gray);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--light-gray);
}

.feature-card h3 {
    color: var(--primary-gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--light-gray);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Forms */
.submission-form {
    display: grid;
    gap: 1rem;
}

.submission-form input,
.submission-form select,
.submission-form textarea {
    padding: 1rem;
    background: var(--dark-gray);
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    color: var(--white);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.submission-form input:focus,
.submission-form select:focus,
.submission-form textarea:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.submission-form textarea {
    min-height: 100px;
    resize: vertical;
}

.submission-form button {
    background: var(--gradient-gold);
    color: var(--primary-black);
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
}

.submission-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* Recent Discoveries */
.recent-discoveries {
    display: grid;
    gap: 1.5rem;
}

.discovery-item {
    background: var(--dark-gray);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-gold);
    transition: all 0.3s ease;
}

.discovery-item:hover {
    transform: translateX(5px);
}

.discovery-item .palindrome {
    color: var(--primary-gold);
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.discovery-item .author {
    color: var(--light-gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.discovery-item .votes {
    color: var(--light-gray);
    font-size: 0.9rem;
}

/* Achievements */
.achievements {
    display: grid;
    gap: 1rem;
}

.achievement {
    background: var(--dark-gray);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.achievement.unlocked {
    border: 2px solid var(--primary-gold);
}

.achievement.locked {
    border: 2px solid var(--light-gray);
    opacity: 0.6;
}

.achievement:hover {
    transform: translateX(5px);
}

.badge {
    font-size: 2rem;
}

.achievement .title {
    color: var(--primary-gold);
    font-weight: 700;
    font-size: 1.1rem;
}

.achievement .description {
    color: var(--light-gray);
    font-size: 0.9rem;
}

/* Newsletter */
.newsletter-signup {
    background: var(--medium-gray);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--light-gray);
}

.newsletter-signup h3 {
    color: var(--primary-gold);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.newsletter-signup p {
    color: var(--light-gray);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem;
    background: var(--dark-gray);
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    color: var(--white);
    font-size: 1rem;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-gold);
}

.newsletter-form button {
    background: var(--gradient-gold);
    color: var(--primary-black);
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    transform: translateY(-2px);
}

.privacy-note {
    color: var(--light-gray);
    font-size: 0.8rem;
}

/* Footer */
.footer {
    padding: 4rem 0;
    background-color: var(--dark-gray);
    border-top: 1px solid var(--medium-gray);
}

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

.footer-palindrome {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.footer-text {
    color: var(--light-gray);
    font-size: 1.1rem;
}

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

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    to {
        text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.3);
    }
}

@keyframes expand {
    from {
        width: 0;
    }
    to {
        width: 200px;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(0px) rotate(360deg);
        opacity: 0.3;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .palindrome-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .tools-nav,
    .academy-nav {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .tool-tab,
    .academy-tab {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        width: 90%;
        text-align: center;
    }
    
    .academy-section.active {
        padding: 1rem !important;
        display: block !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .academy-section.active h3 {
        font-size: 1.5rem;
    }
    
    .content-wrapper {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .timeline {
        padding-left: 1rem;
    }
    
    .timeline-item {
        padding-left: 2rem;
    }
    
    .timeline-nav {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .timeline-period {
        width: 100%;
        text-align: center;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .language-grid,
    .culture-grid,
    .games-grid,
    .figures-grid {
        grid-template-columns: 1fr;
    }
    
    .figure-card {
        padding: 1.5rem;
    }
    
    .figure-card h5 {
        font-size: 1.1rem;
    }
    
    .daily-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .calc-input {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .about, 
    .tools-suite,
    .palindrome-academy,
    .palindrome-games,
    .palindrome-community {
        padding: 4rem 0;
    }
    
    .stat,
    .community-stat {
        padding: 1.5rem;
    }
    
    .tool-panel,
    .academy-section {
        padding: 2rem 1.5rem;
    }
    
    .daily-card {
        padding: 2rem;
    }
    
    .daily-palindrome {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}