/* ============================================
   Cdhwia - Homepage Styles
   Doodle Comic Theme
   ============================================ */

/* --- Hero Banner --- */
.cd-hero {
    position: relative;
    background: var(--cd-surface);
    border: 3px solid var(--cd-border);
    border-radius: var(--cd-radius-lg);
    padding: 48px 40px;
    margin-bottom: 36px;
    overflow: hidden;
    box-shadow: var(--cd-shadow);
}

.cd-hero::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -20px;
    width: 160px;
    height: 160px;
    background: var(--cd-accent-dim);
    border-radius: 50%;
    z-index: 0;
    border: 2px dashed var(--cd-accent);
}

.cd-hero::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 20%;
    width: 100px;
    height: 100px;
    background: var(--cd-secondary-dim);
    border-radius: 50%;
    z-index: 0;
    border: 2px dashed var(--cd-secondary);
}

.cd-hero-content {
    position: relative;
    z-index: 1;
}

.cd-hero-badge {
    display: inline-block;
    font-family: var(--cd-font-hand);
    font-size: 15px;
    padding: 4px 18px;
    background: var(--cd-primary-dim);
    color: var(--cd-primary);
    border: 2px solid var(--cd-primary);
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 1.5px 1.5px 0 var(--cd-primary);
}

.cd-hero-title {
    font-family: var(--cd-font-heading);
    font-size: 48px;
    font-weight: 700;
    color: var(--cd-text);
    line-height: 1.15;
    margin-bottom: 14px;
}

.cd-hero-title span {
    color: var(--cd-primary);
}

.cd-hero-desc {
    font-family: var(--cd-font-hand);
    font-size: 18px;
    color: var(--cd-text-light);
    max-width: 540px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.cd-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cd-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--cd-font-hand);
    font-weight: 600;
    font-size: 17px;
    padding: 12px 28px;
    border-radius: var(--cd-radius);
    text-decoration: none;
    transition: all var(--cd-transition);
    cursor: pointer;
}

.cd-btn-primary {
    background: var(--cd-primary);
    color: #fff;
    border: 2.5px solid var(--cd-border);
    box-shadow: var(--cd-shadow);
}

.cd-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--cd-shadow-hover);
    color: #fff;
}

.cd-btn-outline {
    background: var(--cd-surface);
    color: var(--cd-text);
    border: 2.5px solid var(--cd-border);
    box-shadow: var(--cd-shadow-sm);
}

.cd-btn-outline:hover {
    border-color: var(--cd-secondary);
    color: var(--cd-secondary);
    background: var(--cd-secondary-dim);
}

/* --- Category Pills --- */
.cd-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.cd-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--cd-font-hand);
    font-weight: 500;
    font-size: 16px;
    padding: 8px 18px;
    background: var(--cd-surface);
    border: 2px solid var(--cd-border);
    border-radius: 24px;
    color: var(--cd-text);
    text-decoration: none;
    transition: all var(--cd-transition);
    box-shadow: var(--cd-shadow-sm);
}

.cd-cat-pill:hover {
    background: var(--cd-primary-dim);
    border-color: var(--cd-primary);
    color: var(--cd-primary);
    transform: translateY(-2px);
    box-shadow: var(--cd-shadow);
}

.cd-cat-pill-icon {
    font-size: 16px;
}

/* --- Section Header --- */
.cd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cd-section-more {
    font-family: var(--cd-font-hand);
    font-size: 16px;
    font-weight: 500;
    color: var(--cd-secondary);
    text-decoration: none;
    border: 2px solid var(--cd-border);
    border-radius: 20px;
    padding: 6px 18px;
    background: var(--cd-surface);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--cd-shadow-sm);
    position: relative;
}

.cd-section-more::after {
    content: '\2192';
    margin-left: 6px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.cd-section-more:hover {
    background: var(--cd-secondary-dim);
    border-color: var(--cd-secondary);
    transform: translateX(4px) rotate(-1deg);
}

.cd-section-more:hover::after {
    transform: translateX(4px);
}

/* --- Trending Row --- */
.cd-trending-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 36px;
}

.cd-trending-row::-webkit-scrollbar {
    height: 6px;
}

.cd-trending-row::-webkit-scrollbar-thumb {
    background: var(--cd-border-light);
    border-radius: 4px;
}

.cd-trending-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
}

/* --- Featured Row (Spotlight + Daily Pick) --- */
.cd-featured-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

/* --- Spotlight --- */
.cd-spotlight {
    background: var(--cd-surface);
    border: 2.5px solid var(--cd-border);
    border-radius: var(--cd-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--cd-transition);
    box-shadow: var(--cd-shadow);
}

.cd-spotlight:hover {
    border-color: var(--cd-primary);
    transform: translateY(-3px);
    box-shadow: var(--cd-shadow-hover);
}

.cd-spotlight-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.cd-spotlight-main-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 2.5px solid var(--cd-border);
    transition: transform 0.5s ease;
    position: relative;
    overflow: hidden;
}

.cd-spotlight:hover .cd-spotlight-main-img {
    transform: scale(1.04);
}

.cd-spotlight-main-body {
    padding: 22px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cd-spotlight-main-title {
    font-family: var(--cd-font-heading);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--cd-text);
}

.cd-spotlight-main-desc {
    font-size: 14px;
    color: var(--cd-text-muted);
    line-height: 1.65;
}

/* --- Daily Pick --- */
.cd-daily-pick {
    background: var(--cd-surface);
    border: 2.5px solid var(--cd-border);
    border-radius: var(--cd-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all var(--cd-transition);
    box-shadow: var(--cd-shadow);
}

.cd-daily-pick:hover {
    border-color: var(--cd-accent);
    transform: translateY(-3px);
    box-shadow: var(--cd-shadow-hover);
}

.cd-daily-pick-img {
    width: 100%;
    flex-shrink: 0;
    border-bottom: 2.5px solid var(--cd-border);
    overflow: hidden;
}

.cd-daily-pick-img img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.cd-daily-pick-info {
    padding: 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cd-daily-pick-label {
    font-family: var(--cd-font-hand);
    font-size: 14px;
    font-weight: 600;
    color: var(--cd-accent);
    margin-bottom: 6px;
}

.cd-daily-pick-name {
    font-family: var(--cd-font-heading);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.25;
    color: var(--cd-text);
}

.cd-daily-pick-desc {
    font-size: 13px;
    color: var(--cd-text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
    flex: 1;
}

/* --- Tag Cloud --- */
.cd-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
}

.cd-tag-item {
    font-family: var(--cd-font-hand);
    font-size: 15px;
    padding: 6px 16px;
    background: var(--cd-surface);
    border: 2px solid var(--cd-border);
    border-radius: 20px;
    color: var(--cd-text-muted);
    text-decoration: none;
    transition: all var(--cd-transition);
    box-shadow: 1px 1px 0 var(--cd-border-light);
}

.cd-tag-item:hover {
    border-color: var(--cd-primary);
    color: var(--cd-primary);
    background: var(--cd-primary-dim);
}

/* --- Stats Bar --- */
.cd-stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 22px;
    background: var(--cd-surface);
    border: 2.5px solid var(--cd-border);
    border-radius: var(--cd-radius-lg);
    margin-bottom: 36px;
    box-shadow: var(--cd-shadow);
}

.cd-stat-item {
    text-align: center;
}

.cd-stat-num {
    font-family: var(--cd-font-heading);
    font-size: 36px;
    font-weight: 700;
    color: var(--cd-primary);
    line-height: 1;
}

.cd-stat-label {
    font-family: var(--cd-font-hand);
    font-size: 15px;
    color: var(--cd-text-muted);
    margin-top: 4px;
}

/* --- Genre Blocks --- */
.cd-genre-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 36px;
}

.cd-genre-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--cd-surface);
    border: 2.5px solid var(--cd-border);
    border-radius: var(--cd-radius);
    text-decoration: none;
    color: var(--cd-text);
    transition: all var(--cd-transition);
    box-shadow: var(--cd-shadow-sm);
}

.cd-genre-block:hover {
    border-color: var(--cd-primary);
    transform: translateY(-3px) rotate(-0.5deg);
    box-shadow: var(--cd-shadow);
    color: var(--cd-text);
}

.cd-genre-block-icon {
    font-size: 24px;
}

.cd-genre-block-title {
    font-family: var(--cd-font-hand);
    font-weight: 600;
    font-size: 16px;
}

.cd-genre-block-count {
    font-family: var(--cd-font-hand);
    font-size: 13px;
    color: var(--cd-text-muted);
    margin-left: auto;
}

.cd-genre-block-arrow {
    color: var(--cd-text-muted);
    font-size: 18px;
}

/* --- Hero Doodle Decorations --- */
.cd-hero-doodle {
    position: absolute;
    font-size: 32px;
    z-index: 0;
    opacity: 0.7;
    pointer-events: none;
    animation: cd-float-doodle 4s ease-in-out infinite;
}

.cd-hero-doodle--1 { top: 12px; right: 40px; animation-delay: 0s; font-size: 28px; }
.cd-hero-doodle--2 { bottom: 16px; right: 80px; animation-delay: 1s; font-size: 24px; }
.cd-hero-doodle--3 { top: 50%; right: 20px; animation-delay: 2s; font-size: 26px; }
.cd-hero-doodle--4 { bottom: 30px; left: 10%; animation-delay: 0.5s; font-size: 22px; }
.cd-hero-doodle--5 { top: 20px; left: 60%; animation-delay: 1.5s; font-size: 20px; }

@keyframes cd-float-doodle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(5deg); }
    50% { transform: translateY(-6px) rotate(-3deg); }
    75% { transform: translateY(-12px) rotate(2deg); }
}

/* --- Badge Stamp Effect --- */
.cd-hero-badge {
    animation: cd-stamp-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes cd-stamp-in {
    0% { transform: scale(0) rotate(-15deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* --- Section Title Squiggly Underline --- */
.cd-section-title {
    position: relative;
}

.cd-section-title::after {
    background: none;
    border-bottom: 4px wavy var(--cd-primary);
    height: 0;
    bottom: -2px;
    transform: none;
    border-radius: 0;
}

/* --- Stats Bar Fun --- */
.cd-stat-num {
    transition: transform 0.3s ease;
}

.cd-stat-item:hover .cd-stat-num {
    transform: scale(1.15) rotate(-3deg);
}

/* --- Daily Pick Wiggle --- */
.cd-daily-pick-label {
    display: inline-block;
    animation: cd-wiggle 3s ease-in-out infinite;
}

@keyframes cd-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

/* --- Spotlight Shimmer --- */
.cd-spotlight-main-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: cd-shimmer 3s ease-in-out infinite;
}

@keyframes cd-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* --- Cat Pill Bounce --- */
.cd-cat-pill {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cd-cat-pill:hover {
    transform: translateY(-3px) scale(1.05);
}

/* --- Game Card Extra Fun --- */
.cd-game-card {
    position: relative;
}

.cd-game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--cd-radius);
    border: 2px dashed transparent;
    transition: border-color 0.3s ease;
    pointer-events: none;
}

.cd-game-card:hover::after {
    border-color: var(--cd-accent);
}

/* --- Roulette Box Special --- */
.cd-roulette-box {
    background: linear-gradient(135deg, var(--cd-surface) 0%, var(--cd-primary-dim) 100%);
    border-color: var(--cd-primary);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.cd-roulette-btn {
    animation: cd-pulse-btn 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes cd-pulse-btn {
    0%, 100% { box-shadow: var(--cd-shadow); }
    50% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0.2), var(--cd-shadow); }
}

.cd-roulette-btn:hover {
    animation: none;
    transform: scale(1.08) rotate(-2deg);
}

/* --- Tag Cloud Fun --- */
.cd-tag-item {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cd-tag-item:hover {
    transform: translateY(-2px) rotate(-2deg);
}

/* --- Genre Block Extra --- */
.cd-genre-block {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cd-genre-block:hover {
    transform: translateY(-4px) rotate(-1deg) scale(1.02);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .cd-featured-row {
        grid-template-columns: 1fr;
    }

    .cd-hero-title { font-size: 36px; }
}

@media (max-width: 768px) {
    .cd-hero { padding: 32px 22px; }
    .cd-hero-title { font-size: 30px; }
    .cd-hero-desc { font-size: 16px; }

    .cd-daily-pick-name { font-size: 22px; }
    .cd-spotlight-main-title { font-size: 24px; }

    .cd-stats-bar {
        flex-wrap: wrap;
        gap: 24px;
    }

    .cd-trending-card { flex: 0 0 160px; }

    .cd-genre-blocks {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 380px) {
    .cd-hero-title { font-size: 26px; }
    .cd-cat-pills { gap: 6px; }
    .cd-cat-pill { padding: 6px 12px; font-size: 14px; }
}
