/* ============================================================
   Greycraft — Playful Builder Theme
   Shared CSS for all site pages
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Boogaloo&family=Nunito:wght@400;600;700&display=swap');

:root {
    --red: #E3000B;
    --yellow: #FFD700;
    --blue: #006CB7;
    --green: #4CAF50;
    --orange: #FF8C00;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --dark: #2D2D2D;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--white);
    color: var(--dark);
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Scattered brick background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(135deg, var(--red) 10px, transparent 10px) 50px 20px / 200px 200px,
        linear-gradient(225deg, var(--blue) 8px, transparent 8px) 300px 80px / 250px 250px,
        linear-gradient(315deg, var(--yellow) 12px, transparent 12px) 150px 300px / 180px 180px,
        linear-gradient(45deg, var(--green) 9px, transparent 9px) 400px 200px / 220px 220px,
        linear-gradient(135deg, var(--orange) 7px, transparent 7px) 20px 150px / 240px 240px,
        linear-gradient(225deg, var(--yellow) 6px, transparent 6px) 500px 350px / 190px 190px;
    opacity: 0.08;
    pointer-events: none;
}

/* === NAV BAR === */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 4px solid var(--red);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    font-family: 'Boogaloo', cursive;
    font-size: 28px;
    color: var(--red);
    text-decoration: none;
    text-shadow: 2px 2px 0 var(--yellow), 3px 3px 0 rgba(0,0,0,0.1);
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--dark);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
    background: var(--light-gray);
    color: var(--blue);
}

.nav-links a.active {
    color: var(--red);
    border-bottom: 3px solid var(--red);
    border-radius: 10px 10px 0 0;
}

/* Hamburger (CSS-only) */
.nav-toggle { display: none; }
.nav-toggle-label {
    display: none;
    cursor: pointer;
    width: 32px;
    height: 24px;
    position: relative;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    background: var(--dark);
    height: 3px;
    width: 100%;
    border-radius: 2px;
    position: absolute;
    transition: transform 0.2s;
}
.nav-toggle-label span { top: 50%; transform: translateY(-50%); }
.nav-toggle-label span::before { content: ''; top: -8px; }
.nav-toggle-label span::after { content: ''; top: 8px; }

/* === CONTAINER === */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
    position: relative;
    z-index: 1;
}

/* === HERO SECTION === */
.hero {
    text-align: center;
    padding: 48px 24px 32px;
    position: relative;
    z-index: 1;
}

.logo {
    font-family: 'Boogaloo', cursive;
    font-size: 72px;
    color: var(--red);
    text-shadow: 4px 4px 0 var(--yellow), 6px 6px 0 rgba(0,0,0,0.15);
    letter-spacing: 4px;
    display: inline-block;
}

.logo span { display: inline-block; }
.logo span:nth-child(1) { transform: rotate(-3deg); color: var(--red); }
.logo span:nth-child(2) { transform: rotate(1deg); color: var(--blue); }
.logo span:nth-child(3) { transform: rotate(-1deg); color: var(--green); }
.logo span:nth-child(4) { transform: rotate(2deg); color: var(--orange); }
.logo span:nth-child(5) { transform: rotate(-2deg); color: var(--red); }
.logo span:nth-child(6) { transform: rotate(1deg); color: var(--blue); }
.logo span:nth-child(7) { transform: rotate(-1deg); color: var(--yellow); }
.logo span:nth-child(8) { transform: rotate(2deg); color: var(--green); }
.logo span:nth-child(9) { transform: rotate(-1deg); color: var(--orange); }

.studs {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: -10px;
}
.stud {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: inset 0 -2px 3px rgba(0,0,0,0.2), 0 2px 0 #C9A800;
}
.stud:nth-child(2) { background: var(--red); box-shadow: inset 0 -2px 3px rgba(0,0,0,0.2), 0 2px 0 #B00009; }
.stud:nth-child(4) { background: var(--blue); box-shadow: inset 0 -2px 3px rgba(0,0,0,0.2), 0 2px 0 #004A80; }
.stud:nth-child(6) { background: var(--green); box-shadow: inset 0 -2px 3px rgba(0,0,0,0.2), 0 2px 0 #357A38; }

.tagline {
    font-family: 'Boogaloo', cursive;
    font-size: 28px;
    color: var(--orange);
    margin-top: 12px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.08);
}

/* CSS Cat Icon */
.cat-icon {
    display: inline-block;
    margin: 20px auto;
    position: relative;
    width: 60px;
    height: 50px;
}
.cat-icon .head {
    width: 40px; height: 32px;
    background: var(--orange);
    border-radius: 50%;
    position: absolute;
    left: 10px; top: 12px;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.12);
}
.cat-icon .ear-l, .cat-icon .ear-r {
    width: 0; height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid var(--orange);
    position: absolute; top: 2px;
}
.cat-icon .ear-l { left: 10px; transform: rotate(-10deg); }
.cat-icon .ear-r { right: 10px; transform: rotate(10deg); }
.cat-icon .eye-l, .cat-icon .eye-r {
    width: 6px; height: 6px;
    background: var(--dark);
    border-radius: 50%;
    position: absolute; top: 22px;
}
.cat-icon .eye-l { left: 19px; }
.cat-icon .eye-r { left: 35px; }
.cat-icon .nose {
    width: 5px; height: 4px;
    background: #E85D75;
    border-radius: 50%;
    position: absolute; left: 27px; top: 29px;
}

/* === SECTION TITLES === */
.section {
    margin-bottom: 48px;
}

.section-title {
    font-family: 'Boogaloo', cursive;
    font-size: 32px;
    color: var(--blue);
    margin-bottom: 16px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.06);
}

.section-title.red { color: var(--red); }
.section-title.green { color: var(--green); }
.section-title.orange { color: var(--orange); }

.section-intro {
    font-size: 1.05em;
    color: #555;
    margin-bottom: 16px;
}

/* === CARDS === */
.card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.08);
    border: 3px solid var(--light-gray);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0,0,0,0.04) 4px, transparent 4px);
    background-size: 20px 20px;
    pointer-events: none;
}

.card h3 {
    font-family: 'Boogaloo', cursive;
    font-size: 22px;
    color: var(--blue);
    margin-bottom: 8px;
    position: relative;
}

.card p {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    position: relative;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    position: relative;
}

.card-header canvas { flex-shrink: 0; }

.card-title {
    font-family: 'Boogaloo', cursive;
    font-size: 18px;
    color: var(--dark);
}

.card-stat {
    font-size: 0.85em;
    color: #888;
}

.card-desc {
    font-size: 0.9em;
    color: #666;
    position: relative;
}

/* === BUTTONS === */
.btn {
    font-family: 'Boogaloo', cursive;
    font-size: 20px;
    padding: 12px 32px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    color: var(--white);
    box-shadow: 0 4px 0 rgba(0,0,0,0.25);
    transform: translateY(0);
    transition: transform 0.1s, box-shadow 0.1s;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0,0,0,0.25);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}

.btn-red { background: var(--red); }
.btn-blue { background: var(--blue); }
.btn-green { background: var(--green); }
.btn-orange { background: var(--orange); }

.btn-large {
    font-size: 24px;
    padding: 16px 48px;
}

/* === KEY BADGES === */
.key {
    display: inline-block;
    background: var(--light-gray);
    color: var(--dark);
    border: 2px solid #DDD;
    border-bottom: 4px solid #CCC;
    border-radius: 6px;
    padding: 2px 10px;
    font-family: monospace;
    font-size: 0.9em;
    min-width: 28px;
    text-align: center;
    white-space: nowrap;
    font-weight: 700;
}

/* === ICON ROWS === */
.icon-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.icon-row canvas { border-radius: 4px; }

/* === CONTROLS GRID === */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.control-label { color: #666; font-size: 0.95em; }

/* === PLANET CARDS === */
.planet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.planet-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid var(--light-gray);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.08);
}

.planet-sky { height: 50px; position: relative; }
.planet-sky canvas { border-radius: 13px 13px 0 0; }
.planet-sky .planet-name {
    position: absolute;
    bottom: 6px;
    left: 12px;
    font-family: 'Boogaloo', cursive;
    font-size: 1.2em;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.planet-body { padding: 12px 16px 16px; }

.gravity-badge {
    display: inline-block;
    background: var(--light-gray);
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    padding: 2px 12px;
    font-size: 0.8em;
    color: var(--blue);
    font-weight: 700;
    margin-bottom: 8px;
}

.planet-info {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 6px;
}

.planet-blocks {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* === PET CARDS === */
.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.pet-card {
    background: var(--white);
    border-radius: 12px;
    padding: 12px 14px;
    border: 3px solid var(--light-gray);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pet-info .pet-name {
    font-family: 'Boogaloo', cursive;
    font-size: 1em;
    color: var(--dark);
}

.pet-info .pet-planet { font-size: 0.78em; color: #999; }
.pet-info .pet-bonus { font-size: 0.85em; color: var(--green); font-weight: 600; }

/* === RECIPE ROWS === */
.recipe-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--light-gray);
    border-radius: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    border: 2px solid #EEE;
}

.recipe-arrow {
    color: var(--orange);
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 4px;
}

.recipe-name {
    color: var(--dark);
    font-weight: bold;
    font-size: 0.9em;
    margin-left: auto;
}

.recipe-note {
    font-size: 0.75em;
    color: var(--orange);
    background: rgba(255,140,0,0.12);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
}

.ingredient-label {
    font-size: 0.75em;
    color: #888;
}

/* === CHARACTER ROW === */
.char-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 16px 0;
}

.char-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: var(--white);
    border-radius: 12px;
    padding: 12px 16px 10px;
    border: 3px solid var(--light-gray);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.06);
    min-width: 72px;
}

.char-card canvas { display: block; }

.char-label {
    font-family: 'Boogaloo', cursive;
    font-size: 0.9em;
    color: var(--dark);
}

/* === NPC GRID === */
.npc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.npc-card {
    background: var(--white);
    border-radius: 12px;
    padding: 12px 14px;
    border: 3px solid var(--light-gray);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.npc-card.enemy { border-color: #FFCDD2; }

.npc-info .npc-name {
    font-family: 'Boogaloo', cursive;
    font-size: 1em;
    color: var(--dark);
}

.npc-info .npc-location { font-size: 0.78em; color: #999; }
.npc-info .npc-desc { font-size: 0.85em; color: #666; }

/* === TIPS LIST === */
.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    padding: 10px 0 10px 32px;
    position: relative;
    border-bottom: 1px solid #EEE;
    color: #555;
}

.tips-list li::before {
    content: '\2B50';
    position: absolute;
    left: 0;
    top: 10px;
    font-size: 0.9em;
}

/* === FUEL BAR === */
.fuel-bar-outer {
    width: 80px; height: 8px;
    background: #E0E0E0;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    margin: 0 6px;
}

.fuel-bar-inner {
    height: 100%;
    border-radius: 4px;
    background: var(--blue);
}

/* === BOUNCING BRICKS === */
@keyframes bounce-brick {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    30% { transform: translateY(-20px) rotate(-5deg); }
    50% { transform: translateY(-24px) rotate(3deg); }
    70% { transform: translateY(-10px) rotate(-2deg); }
}

.bouncing-brick {
    display: inline-block;
    width: 48px;
    height: 28px;
    background: var(--red);
    border-radius: 4px;
    position: relative;
    animation: bounce-brick 2s ease-in-out infinite;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}

.bouncing-brick::before, .bouncing-brick::after {
    content: '';
    position: absolute;
    width: 10px; height: 10px;
    background: inherit;
    filter: brightness(1.15);
    border-radius: 50%;
    top: -5px;
    box-shadow: inset 0 -2px 2px rgba(0,0,0,0.15);
}

.bouncing-brick::before { left: 8px; }
.bouncing-brick::after { right: 8px; }

.brick-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    justify-content: center;
    margin-top: 16px;
}

.brick-row .bouncing-brick:nth-child(2) { background: var(--blue); animation-delay: 0.3s; }
.brick-row .bouncing-brick:nth-child(3) { background: var(--yellow); animation-delay: 0.6s; }
.brick-row .bouncing-brick:nth-child(4) { background: var(--green); animation-delay: 0.9s; }

/* === TAB BUTTONS (explore page) === */
.tab-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.tab-btn {
    font-family: 'Boogaloo', cursive;
    font-size: 18px;
    padding: 10px 28px;
    border: 3px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    color: #888;
    background: var(--light-gray);
    transition: all 0.15s;
    letter-spacing: 0.5px;
}

.tab-btn:hover { color: var(--dark); }

.tab-btn.active-blue { background: var(--blue); color: var(--white); border-color: var(--blue); }
.tab-btn.active-green { background: var(--green); color: var(--white); border-color: var(--green); }
.tab-btn.active-orange { background: var(--orange); color: var(--white); border-color: var(--orange); }

.tab-section { display: none; }
.tab-section.active { display: block; }

/* === FEATURE CARDS (home page) === */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.feature-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    border: 3px solid var(--light-gray);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0,0,0,0.03) 4px, transparent 4px);
    background-size: 20px 20px;
    pointer-events: none;
}

.feature-number {
    font-family: 'Boogaloo', cursive;
    font-size: 42px;
    line-height: 1;
    position: relative;
}

.feature-label {
    font-family: 'Boogaloo', cursive;
    font-size: 18px;
    color: var(--dark);
    margin-top: 4px;
    position: relative;
}

/* === QUICK LINKS === */
.quick-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 32px 0;
}

/* === CALLOUT BOX === */
.callout {
    background: linear-gradient(135deg, #FFF9E6, #FFF0F0);
    border-radius: 16px;
    padding: 20px 24px;
    border-left: 6px solid var(--orange);
    margin: 16px 0;
}

.callout p {
    color: #555;
    font-size: 0.95em;
}

.callout strong { color: var(--dark); }

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 32px 24px;
    color: #999;
    font-size: 0.85em;
    position: relative;
    z-index: 1;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav-toggle-label { display: block; }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 16px 24px;
        border-bottom: 4px solid var(--red);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .nav-toggle:checked ~ .nav-links { display: flex; }

    .logo { font-size: 48px; }
    .tagline { font-size: 22px; }
    .controls-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .logo { font-size: 40px; letter-spacing: 2px; }
    .tagline { font-size: 18px; }
    .card-grid, .planet-grid { grid-template-columns: 1fr; }
    .pet-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .btn-large { font-size: 20px; padding: 14px 32px; }
    .quick-links { flex-direction: column; align-items: center; }
}
