:root {
    --grass-green: #5d8c3e;
    --dirt-brown: #8b5a2b;
    --sky-blue: #87ceeb;
    --stone-gray: #7f7f7f;
    --diamond-blue: #4aedd9;
    --gold-yellow: #ffd700;
    --redstone-red: #ff3333;
    --obsidian-purple: #1d1d21;
    --enderman-purple: #cc00fa;
    --creeper-green: #0da70b;
    --pig-pink: #f0a5a2;
    --chicken-white: #f5f5f5;
    --ferret-cream: #f5deb3;
}

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

body {
    font-family: "Press Start 2P", cursive;
    background-color: var(--sky-blue);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Pixel art background pattern */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(
            90deg,
            transparent 95%,
            rgba(0, 0, 0, 0.03) 95%
        ),
        linear-gradient(transparent 95%, rgba(0, 0, 0, 0.03) 95%);
    background-size: 16px 16px;
    pointer-events: none;
    z-index: 1000;
}

/* Scanline effect */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.03),
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1001;
}

/* Floating pixel clouds */
.cloud {
    position: fixed;
    background: white;
    box-shadow:
        16px 0 0 white,
        32px 0 0 white,
        48px 0 0 white,
        8px -16px 0 white,
        24px -16px 0 white,
        40px -16px 0 white,
        16px -32px 0 white,
        32px -32px 0 white;
    width: 16px;
    height: 16px;
    animation: float-cloud 60s linear infinite;
    opacity: 0.8;
    z-index: -1;
}

.cloud:nth-child(1) {
    top: 10%;
    animation-delay: 0s;
}
.cloud:nth-child(2) {
    top: 25%;
    animation-delay: -20s;
}
.cloud:nth-child(3) {
    top: 40%;
    animation-delay: -40s;
}

@keyframes float-cloud {
    from {
        left: -100px;
    }
    to {
        left: 110%;
    }
}

/* Header */
.header {
    background: linear-gradient(
        180deg,
        var(--grass-green) 0%,
        #4a7a2e 100%
    );
    padding: 30px 20px;
    text-align: center;
    border-bottom: 8px solid var(--dirt-brown);
    position: relative;
    box-shadow:
        0 8px 0 #6b4423,
        0 16px 0 #5a3a1d;
}

.header h1 {
    color: white;
    font-size: clamp(16px, 4vw, 32px);
    text-shadow:
        4px 4px 0 var(--obsidian-purple),
        -2px -2px 0 var(--obsidian-purple),
        2px -2px 0 var(--obsidian-purple),
        -2px 2px 0 var(--obsidian-purple);
    animation: title-bounce 1s ease-in-out infinite;
    letter-spacing: 2px;
}

.header h1 a {
    color: inherit;
    text-decoration: none;
}

@keyframes title-bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.header p {
    color: var(--gold-yellow);
    font-size: 10px;
    margin-top: 15px;
    text-shadow: 2px 2px 0 var(--obsidian-purple);
}

/* Pixel art decorations */
.pixel-heart {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--redstone-red);
    box-shadow:
        12px 0 0 var(--redstone-red),
        -6px 6px 0 var(--redstone-red),
        6px 6px 0 var(--redstone-red),
        18px 6px 0 var(--redstone-red),
        0 12px 0 var(--redstone-red),
        12px 12px 0 var(--redstone-red),
        6px 18px 0 var(--redstone-red);
    margin: 0 20px;
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

/* Tab Navigation */
.tab-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 30px 20px;
    background: var(--dirt-brown);
    border-bottom: 8px solid #5a3a1d;
}

.tab-btn {
    font-family: "Press Start 2P", cursive;
    font-size: clamp(8px, 2vw, 12px);
    padding: 15px 20px;
    background: var(--stone-gray);
    color: white;
    border: none;
    cursor: pointer;
    position: relative;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    transition: all 0.1s;
    box-shadow:
        4px 4px 0 #5a5a5a,
        inset -4px -4px 0 rgba(0, 0, 0, 0.2),
        inset 4px 4px 0 rgba(255, 255, 255, 0.2);
    text-decoration: none;
    display: inline-block;
}

.tab-btn:hover {
    transform: translate(2px, 2px);
    box-shadow:
        2px 2px 0 #5a5a5a,
        inset -4px -4px 0 rgba(0, 0, 0, 0.2),
        inset 4px 4px 0 rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: var(--creeper-green);
    box-shadow:
        4px 4px 0 #097508,
        inset -4px -4px 0 rgba(0, 0, 0, 0.2),
        inset 4px 4px 0 rgba(255, 255, 255, 0.3);
}

.tab-btn[data-tab="minecraft"] {
    background: var(--grass-green);
}
.tab-btn[data-tab="minecraft"].active {
    background: var(--creeper-green);
}
.tab-btn[data-tab="chickens"] {
    background: #d4a017;
}
.tab-btn[data-tab="chickens"].active {
    background: var(--gold-yellow);
    color: #333;
}
.tab-btn[data-tab="ferrets"] {
    background: #b8860b;
}
.tab-btn[data-tab="ferrets"].active {
    background: var(--ferret-cream);
    color: #333;
}
.tab-btn[data-tab="toys"] {
    background: #ff6b6b;
}
.tab-btn[data-tab="toys"].active {
    background: #ff8e8e;
}
.tab-btn[data-tab="stuffies"] {
    background: #9b59b6;
}
.tab-btn[data-tab="stuffies"].active {
    background: #bb77d4;
}
.tab-btn[data-tab="books"] {
    background: #3498db;
}
.tab-btn[data-tab="books"].active {
    background: #5dade2;
}
.tab-btn[data-tab="random"] {
    background: var(--enderman-purple);
}
.tab-btn[data-tab="random"].active {
    background: #e040fb;
}
.tab-btn[data-tab="videos"] {
    background: var(--redstone-red);
}
.tab-btn[data-tab="videos"].active {
    background: #ff6666;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Cards */
.content-card {
    background: white;
    border: 8px solid var(--obsidian-purple);
    padding: 25px;
    margin-bottom: 25px;
    position: relative;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
}

.content-card::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
}

.content-card h2 {
    color: var(--obsidian-purple);
    font-size: clamp(12px, 3vw, 18px);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 4px dashed var(--stone-gray);
}

.content-card p {
    font-size: 10px;
    line-height: 2.5;
    color: #333;
    margin-bottom: 15px;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.pixel-image {
    aspect-ratio: 1;
    background: var(--stone-gray);
    border: 6px solid var(--obsidian-purple);
    overflow: hidden;
    position: relative;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.pixel-image:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
}

.pixel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
}

.pixel-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(
            90deg,
            transparent 95%,
            rgba(0, 0, 0, 0.1) 95%
        ),
        linear-gradient(transparent 95%, rgba(0, 0, 0, 0.1) 95%);
    background-size: 8px 8px;
    pointer-events: none;
}

/* Random Things Search */
.search-container {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    font-family: "Press Start 2P", cursive;
    font-size: 10px;
    padding: 15px;
    border: 6px solid var(--obsidian-purple);
    background: white;
    box-shadow:
        4px 4px 0 rgba(0, 0, 0, 0.3),
        inset 4px 4px 0 rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    outline: none;
    border-color: var(--diamond-blue);
}

.search-btn {
    font-family: "Press Start 2P", cursive;
    font-size: 10px;
    padding: 15px 25px;
    background: var(--diamond-blue);
    color: var(--obsidian-purple);
    border: 6px solid var(--obsidian-purple);
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.1s;
}

.search-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* Category Pills */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.category-pill {
    font-family: "Press Start 2P", cursive;
    font-size: 8px;
    padding: 10px 15px;
    background: var(--enderman-purple);
    color: white;
    border: 4px solid var(--obsidian-purple);
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.category-pill:hover,
.category-pill.active {
    background: var(--gold-yellow);
    color: var(--obsidian-purple);
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* Sub-sections in Random */
.random-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.random-section.active {
    display: block;
}

/* Fun Facts Boxes */
.fun-fact {
    background: linear-gradient(
        135deg,
        var(--gold-yellow) 0%,
        #ffa500 100%
    );
    border: 6px solid var(--obsidian-purple);
    padding: 20px;
    margin: 20px 0;
    position: relative;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.fun-fact::before {
    content: "!";
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--redstone-red);
    color: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 4px solid var(--obsidian-purple);
}

.fun-fact p {
    font-size: 9px;
    color: var(--obsidian-purple);
}

/* Stats Display */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.stat-box {
    flex: 1;
    min-width: 120px;
    background: var(--creeper-green);
    border: 4px solid var(--obsidian-purple);
    padding: 15px;
    text-align: center;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.stat-box .number {
    font-size: 20px;
    color: white;
    text-shadow: 2px 2px 0 var(--obsidian-purple);
}

.stat-box .label {
    font-size: 8px;
    color: white;
    margin-top: 8px;
}

/* Footer */
.footer {
    background: var(--dirt-brown);
    padding: 30px;
    text-align: center;
    border-top: 8px solid var(--grass-green);
    margin-top: 50px;
}

.footer p {
    font-size: 8px;
    color: white;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* Pixel Divider */
.pixel-divider {
    height: 16px;
    background: repeating-linear-gradient(
        90deg,
        var(--grass-green) 0px,
        var(--grass-green) 16px,
        var(--dirt-brown) 16px,
        var(--dirt-brown) 32px
    );
    margin: 20px 0;
    border: 4px solid var(--obsidian-purple);
}

/* Inline images in text */
.inline-img {
    width: 100px;
    height: 100px;
    float: right;
    margin: 0 0 15px 15px;
    border: 4px solid var(--obsidian-purple);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

.inline-img.left {
    float: left;
    margin: 0 15px 15px 0;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 40px;
    color: var(--stone-gray);
    font-size: 12px;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.video-card {
    background: var(--obsidian-purple);
    border: 6px solid var(--obsidian-purple);
    position: relative;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.video-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.4);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #1a1a1a;
    cursor: pointer;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.3s,
        filter 0.3s;
}

.video-wrapper:hover .video-thumbnail {
    transform: scale(1.05);
    filter: brightness(0.7);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: var(--redstone-red);
    border: 4px solid white;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
    transition:
        transform 0.2s,
        background 0.2s;
    z-index: 5;
}

.play-button::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 5px;
}

.video-wrapper:hover .play-button {
    background: var(--creeper-green);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
    padding: 15px;
    background: white;
}

.video-title {
    font-size: 10px;
    color: var(--obsidian-purple);
    margin-bottom: 8px;
    line-height: 1.8;
}

.video-desc {
    font-size: 8px;
    color: var(--stone-gray);
    line-height: 2;
}

/* AI Badge */
.ai-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff00ff, #00ffff);
    color: white;
    font-size: 8px;
    padding: 6px 10px;
    border: 3px solid white;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    z-index: 10;
    animation: ai-pulse 1.5s ease-in-out infinite;
}

@keyframes ai-pulse {
    0%,
    100% {
        box-shadow:
            2px 2px 0 rgba(0, 0, 0, 0.5),
            0 0 10px #ff00ff;
    }
    50% {
        box-shadow:
            2px 2px 0 rgba(0, 0, 0, 0.5),
            0 0 20px #00ffff;
    }
}

.video-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.video-pill {
    font-family: "Press Start 2P", cursive;
    font-size: 8px;
    padding: 10px 15px;
    background: var(--redstone-red);
    color: white;
    border: 4px solid var(--obsidian-purple);
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.video-pill:hover,
.video-pill.active {
    background: var(--gold-yellow);
    color: var(--obsidian-purple);
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* Sub-tabs (folder tabs inside pages) */
.sub-tab-container {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--dirt-brown);
    padding: 10px 10px 0 10px;
    border: 4px solid var(--obsidian-purple);
    border-bottom: none;
}

.sub-tab-btn {
    font-family: "Press Start 2P", cursive;
    font-size: 10px;
    padding: 12px 20px;
    background: var(--stone-gray);
    color: white;
    border: 4px solid var(--obsidian-purple);
    border-bottom: none;
    cursor: pointer;
    position: relative;
    top: 4px;
    transition: all 0.1s;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

.sub-tab-btn:hover {
    background: #8a8a8a;
}

.sub-tab-btn.active {
    background: white;
    color: var(--obsidian-purple);
    box-shadow: none;
    border-bottom: 4px solid white;
    margin-bottom: -4px;
}

/* Responsive */
@media (max-width: 600px) {
    .pixel-heart {
        display: none;
    }

    .tab-btn {
        padding: 12px 15px;
        font-size: 8px;
    }

    .content-card {
        padding: 15px;
    }

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