﻿/**
 * DKK Publishing Frontend Stylesheet.
 *
 * @package DKK
 */

:root {
    --dkk-primary: #C4162A;
    --dkk-primary-light: #FCE8EB;
    --dkk-secondary: #1A6B1A;
    --dkk-pink: #E85050;
    --dkk-mint: #2D8F5E;
    --dkk-coral: #E87050;
    --dkk-sky: #5A90B0;
    --dkk-bg: #FFFAF0;
    --dkk-text: #011A40;
    --dkk-text-light: #5B6080;
    --dkk-border: #E8DFC8;
    --dkk-success: #1A6B1A;
    --dkk-error: #C4162A;
    --dkk-radius: 18px;
    --dkk-shadow: 0 6px 20px rgba(196, 22, 42, 0.12);
    --dkk-fun-font: "Comic Neue", "Comic Sans MS", "Chalkboard SE", "Marker Felt", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ===== PLUGIN-OWNED LAYOUT CLASSES ===== */
.dkk-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.dkk-content-area {
    padding: 2rem 0;
}

.dkk-hero {
    position: relative;
    background: linear-gradient(135deg, var(--dkk-primary, #C4162A) 0%, var(--dkk-primary-dark, #9A1020) 100%);
    color: #fff;
    padding: 3rem 1.5rem;
    text-align: center;
    border-radius: var(--dkk-radius, 18px);
    margin: 0 1.5rem 2rem;
    overflow: hidden;
}
.dkk-hero h1 { color: #fff; margin: 0 0 0.5rem; font-size: 2rem; }
.dkk-hero p { color: rgba(255,255,255,0.9); margin: 0; font-size: 1.1rem; }

/* Professional auth (login/register) hero — light, matches the auth card
   and the theme's design tokens instead of a red-gradient white-text band. */
.dkk-auth-hero {
    max-width: 720px;
    margin: 0 auto 1.75rem;
    padding: 2rem 2.25rem;
    text-align: center;
    background: linear-gradient(180deg, var(--dkk-surface, #FFFFFF) 0%, var(--dkk-bg, #FFFAF0) 100%);
    border: 1px solid var(--dkk-border, #E8DFC8);
    border-radius: var(--dkk-radius, 18px);
}
.dkk-auth-hero h1 {
    color: var(--dkk-navy, var(--dkk-text, #011A40));
    margin: 0 0 0.5rem;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.2;
}
.dkk-auth-hero p {
    color: var(--dkk-text-light, var(--dkk-text-muted, #5B6080));
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.dkk-card {
    background: #fff;
    border: 2px solid var(--dkk-border, #E8DFC8);
    border-radius: var(--dkk-radius, 18px);
    padding: 2rem;
    box-shadow: var(--dkk-shadow, 0 6px 20px rgba(0,0,0,0.08));
}

.dkk-btn-danger {
    background: var(--dkk-error, #C4162A);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--dkk-radius, 18px);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: var(--dkk-fun-font);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.dkk-btn-danger:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(196,22,42,0.3); }

.dkk-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--dkk-border, #E8DFC8);
}
.dkk-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    color: var(--dkk-text-light, #5B6080);
    border-bottom: 3px solid transparent;
    font-family: var(--dkk-fun-font);
    transition: all 0.2s;
}
.dkk-tab.active {
    color: var(--dkk-primary, #C4162A);
    border-bottom-color: var(--dkk-primary, #C4162A);
    font-weight: 700;
}
/* ===== END LAYOUT CLASSES ===== */

/* Page background removed — theme controls all page backgrounds. */

.dkk-wizard-flow::before {
    content: "✨";
    position: fixed;
    top: 8%;
    left: 4%;
    font-size: 40px;
    opacity: 0.4;
    pointer-events: none;
    animation: dkk-float 6s ease-in-out infinite;
}
.dkk-wizard-flow::after {
    content: "⭐";
    position: fixed;
    bottom: 10%;
    right: 4%;
    font-size: 36px;
    opacity: 0.4;
    pointer-events: none;
    animation: dkk-float 5s ease-in-out infinite reverse;
}
@keyframes dkk-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-20px) rotate(15deg); }
}

.dkk-frontend-wrap {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
    font-family: var(--dkk-fun-font);
    line-height: 1.6;
    color: var(--dkk-text);
}

.dkk-loading {
    text-align: center;
    padding: 48px 16px;
    color: var(--dkk-text-light);
    font-size: 16px;
}

/* Login prompt */
.dkk-login-prompt {
    text-align: center;
    padding: 48px 16px;
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius);
}

.dkk-login-prompt p {
    margin: 8px 0;
}

/* Stats */
.dkk-dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.dkk-stat {
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius);
    padding: 24px;
    text-align: center;
}

.dkk-stat-num {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--dkk-primary);
}

.dkk-stat-label {
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dkk-text-light);
    margin-top: 4px;
}

/* Book cards */
.dkk-books-grid,
.dkk-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.dkk-book-card,
.dkk-catalog-card {
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius);
    padding: 16px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.dkk-book-card:hover,
.dkk-catalog-card:hover {
    box-shadow: var(--dkk-shadow);
}

.dkk-book-card img,
.dkk-catalog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 12px;
}

.dkk-book-cover-placeholder,
.dkk-cover-placeholder {
    width: 100%;
    height: 200px;
    background: #F1F5F9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.dkk-book-cover-placeholder .dashicons,
.dkk-cover-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #94A3B8;
}

.dkk-book-card h3,
.dkk-catalog-card h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.dkk-book-meta {
    font-size: 13px;
    color: var(--dkk-text-light);
    margin: 4px 0;
}

.dkk-book-date {
    font-size: 12px;
    color: var(--dkk-text-light);
    margin: 4px 0 12px;
}

.dkk-author {
    font-size: 13px;
    color: var(--dkk-text-light);
    margin: 4px 0;
}

.dkk-pages {
    font-size: 12px;
    color: var(--dkk-text-light);
    margin: 0 0 12px;
}

/* Status badges */
.dkk-status {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.dkk-status-draft       { background: #F1F5F9; color: #64748B; }
.dkk-status-in_progress { background: #DBEAFE; color: #2563EB; }
.dkk-status-published   { background: #C7D2FE; color: #4F46E5; }

/* Profile */
.dkk-profile-header {
    text-align: center;
    padding: 32px 16px;
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius);
    margin-bottom: 24px;
}

.dkk-profile-header img {
    border-radius: 50%;
    margin-bottom: 12px;
}

.dkk-profile-header h2 {
    margin: 0;
    font-size: 24px;
}

.dkk-profile-role {
    color: var(--dkk-text-light);
    margin: 4px 0 0;
}

/* Pagination */
.dkk-pagination {
    text-align: center;
    margin: 24px 0;
}

.dkk-pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--dkk-text);
}

.dkk-pagination a.current {
    background: var(--dkk-primary);
    color: #fff;
    border-color: var(--dkk-primary);
}

/* Book list */
.dkk-book-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.dkk-book-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--dkk-border);
}

.dkk-book-list li:last-child {
    border-bottom: 0;
}

.dkk-dash-section {
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius);
    padding: 24px;
    margin-top: 24px;
}

/* Activity cards */
.dkk-section-desc {
    color: var(--dkk-text-light);
    margin: 0 0 20px;
}

.dkk-activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.dkk-activity-card {
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.dkk-activity-card:hover {
    box-shadow: var(--dkk-shadow);
}

.dkk-activity-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.dkk-activity-body {
    padding: 16px;
}

.dkk-activity-body h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.dkk-activity-body p {
    font-size: 13px;
    color: var(--dkk-text-light);
    margin: 0 0 12px;
}

.dkk-activity-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.dkk-badge-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #DBEAFE;
    color: #2563EB;
}

.dkk-badge-diff {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.dkk-diff-easy { background: #D1FAE5; color: #059669; }
.dkk-diff-medium { background: #FEF3C7; color: #D97706; }
.dkk-diff-hard { background: #FEE2E2; color: #DC2626; }

.dkk-activity-rewards {
    display: flex;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dkk-primary);
}

/* Rewards & Achievements */
.dkk-rewards-section {
    margin-bottom: 32px;
}

.dkk-rewards-grid,
.dkk-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.dkk-reward-card,
.dkk-achievement-card {
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius);
    padding: 20px;
    text-align: center;
}

.dkk-reward-icon,
.dkk-achievement-badge {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 12px;
}

.dkk-reward-card h4,
.dkk-achievement-card h4 {
    margin: 0 0 4px;
    font-size: 15px;
}

.dkk-reward-card p,
.dkk-achievement-card p {
    font-size: 12px;
    color: var(--dkk-text-light);
    margin: 0 0 8px;
}

.dkk-reward-card small,
.dkk-achievement-card small {
    font-size: 11px;
    color: #94A3B8;
}

/* ==========================================================================
   LOGIN / REGISTER PAGE
   ========================================================================== */

.dkk-auth-card {
    max-width: 640px;
    margin: -2rem auto 2rem;
    position: relative;
    z-index: 2;
}

.dkk-auth-card .dkk-card {
    padding: 2rem;
}

/* Tabs */
.dkk-auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--dkk-border);
}

.dkk-auth-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    color: var(--dkk-text-light);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.dkk-auth-tab:hover {
    color: var(--dkk-text);
}

.dkk-auth-tab.active {
    font-weight: 700;
    color: var(--dkk-primary);
    border-bottom-color: var(--dkk-primary);
}

/* Form elements */
.dkk-auth-card label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dkk-text);
}

.dkk-auth-card input[type="text"],
.dkk-auth-card input[type="email"],
.dkk-auth-card input[type="password"],
.dkk-auth-card input[type="number"],
.dkk-auth-card input[type="tel"],
.dkk-auth-card select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius-sm, 8px);
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 1rem;
    background: var(--dkk-surface, #fff);
    color: var(--dkk-text);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.dkk-auth-card input:focus,
.dkk-auth-card select:focus {
    outline: none;
    border-color: var(--dkk-primary);
    box-shadow: 0 0 0 3px rgba(196, 22, 42, 0.12);
}

.dkk-auth-card h3 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
}

.dkk-auth-card h4 {
    margin: 1.5rem 0 0.5rem;
    font-size: 0.95rem;
    color: var(--dkk-text);
    padding-top: 1rem;
    border-top: 1px solid var(--dkk-border);
}

.dkk-auth-card h4:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Two-column row for side-by-side fields (e.g. first name + surname) */
.dkk-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.dkk-auth-row p {
    margin-bottom: 0;
}

.dkk-auth-row .dkk-auth-section-desc {
    grid-column: 1 / -1;
}

.dkk-auth-section-desc {
    font-size: 0.85rem;
    color: var(--dkk-text-light);
    margin: -0.25rem 0 0.75rem;
}

/* Remember me + forgot password */
.dkk-auth-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.dkk-auth-extras label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 400;
    margin-bottom: 0;
}

.dkk-auth-forgot {
    color: var(--dkk-primary);
    text-decoration: none;
    font-weight: 500;
}

.dkk-auth-forgot:hover {
    text-decoration: underline;
}

/* Submit button full width */
.dkk-auth-submit {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
}

/* Pack selector */
.dkk-pack-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dkk-pack-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 2px solid var(--dkk-border);
    border-radius: var(--dkk-radius, 18px);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}

.dkk-pack-option:hover {
    border-color: var(--dkk-primary);
    background: var(--dkk-primary-light, #fef2f2);
}

.dkk-pack-option.selected {
    border-color: var(--dkk-primary);
    background: var(--dkk-primary-light, #fef2f2);
}

.dkk-pack-option input[type="radio"] {
    margin: 0;
    accent-color: var(--dkk-primary);
}

.dkk-pack-option-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dkk-pack-option-title {
    font-size: 0.95rem;
}

.dkk-pack-option-meta {
    font-size: 0.8rem;
    color: var(--dkk-text-light);
}

.dkk-pack-option-price {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--dkk-primary);
    white-space: nowrap;
}

/* Terms checkbox */
.dkk-auth-terms {
    background: var(--dkk-primary-light, #e8f4fd);
    padding: 0.75rem 1rem;
    border-radius: var(--dkk-radius-sm, 8px);
    margin-bottom: 1rem;
}

.dkk-auth-terms label {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 0;
    line-height: 1.5;
}

.dkk-auth-terms input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

/* Messages (error / success) */
.dkk-auth-msg {
    padding: 0.75rem 1rem;
    border-radius: var(--dkk-radius-sm, 8px);
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.dkk-auth-msg-error {
    background: #FEE2E2;
    color: #991B1B;
}

.dkk-auth-msg-success {
    background: #D1FAE5;
    color: #065F46;
}

.dkk-auth-msg-info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Logged-in state */
.dkk-auth-logged-in {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.dkk-auth-logged-in .dkk-card {
    padding: 2.5rem 2rem;
}

.dkk-auth-avatar {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.dkk-auth-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Legacy login page classes (kept for backwards compat) */
.dkk-login-forms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.dkk-login-form,
.dkk-register-form {
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius);
    padding: 32px;
}

.dkk-login-form h2,
.dkk-register-form h2 {
    margin: 0 0 20px;
    font-size: 20px;
}

.dkk-login-form label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
}

.dkk-login-form input[type="text"],
.dkk-login-form input[type="password"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--dkk-border);
    border-radius: 4px;
    margin-bottom: 16px;
}

.dkk-login-form .button-primary {
    width: 100%;
}

/* Logged in state */
.dkk-logged-in {
    text-align: center;
    padding: 32px;
    background: #fff;
    border: 1px solid var(--dkk-border);
    border-radius: var(--dkk-radius);
}

/* Buttons */
.dkk-frontend-wrap .button {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid var(--dkk-primary);
    border-radius: 4px;
    background: #fff;
    color: var(--dkk-primary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.dkk-frontend-wrap .button-primary {
    background: var(--dkk-primary);
    color: #fff;
    border-color: var(--dkk-primary);
}

.dkk-frontend-wrap .button-primary:hover {
    background: #0b74bb;
}

.dkk-frontend-wrap h2:first-child {
    margin-top: 0;
}
/* ==========================================================================
   Book Wizard � storyline flow (theme gallery, character pick, scene player)
   ========================================================================== */

.dkk-wizard-flow { max-width: 860px; margin: 0 auto; }

/* Wizard top bar — always lets the child leave (home) */
.dkk-wizard-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #fff;
    border: 4px solid var(--dkk-secondary, #1A6B1A);
    border-radius: 999px;
    padding: 8px 12px 8px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.06);
    font-family: var(--dkk-fun-font);
}
.dkk-wizard-bar-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--dkk-text, #011A40);
}
.dkk-wizard-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.dkk-wizard-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    color: var(--dkk-text, #011A40);
    background: #FFF3D6;
    border: 2px solid #fff;
    text-decoration: none;
    box-shadow: 0 3px 0 rgba(0,0,0,0.08);
    transition: background 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}
.dkk-wizard-nav a:hover {
    background: #FFD166;
    transform: translateY(1px);
}
.dkk-wizard-logout {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    color: #7C2D12;
    background: #FFEDD5;
    border: 2px solid #fff;
    text-decoration: none;
    box-shadow: 0 3px 0 rgba(0,0,0,0.08);
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.15s ease;
}
.dkk-wizard-logout:hover {
    background: #FED7AA;
    transform: translateY(1px);
}
.dkk-wizard-home {
    padding: 8px 18px;
    font-size: 15px;
    text-decoration: none;
}

.dkk-notice { border-radius: var(--dkk-radius); padding: 12px 16px; margin: 12px 0; }
.dkk-notice-error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.dkk-notice-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }

.dkk-btn {
    display: inline-block;
    padding: 14px 32px;
    border: 4px solid #fff;
    border-radius: var(--dkk-btn-radius, 999px);
    font-size: 19px;
    font-weight: 800;
    font-family: var(--dkk-fun-font);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
    box-shadow: 0 6px 0 rgba(0,0,0,0.12), 0 8px 18px rgba(0,0,0,0.08);
    letter-spacing: 0.3px;
}
.dkk-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 rgba(0,0,0,0.12), 0 10px 20px rgba(0,0,0,0.10); opacity: var(--dkk-btn-hover-opacity, 0.85); }
.dkk-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.08); }
.dkk-btn-primary { background: var(--dkk-primary); color: #fff; }
.dkk-btn-primary:hover { background: color-mix(in srgb, var(--dkk-primary, #C4162A) 80%, #000); }
.dkk-btn-primary:disabled { background: #B8B8E0; cursor: not-allowed; box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.dkk-btn-secondary { background: #fff; color: var(--dkk-text); border-color: var(--dkk-border); }
.dkk-btn-big { font-size: 24px; padding: 20px 48px; }
.dkk-btn-finish { background: var(--dkk-success); color: #fff; border-color: #fff; box-shadow: 0 6px 0 #1F9D54, 0 8px 18px rgba(46,204,113,0.4); }
.dkk-btn-finish:hover { background: #27AE60; }
.dkk-step-actions { display: flex; gap: 14px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }

/* --- Theme gallery --- */
.dkk-theme-gallery {
    position: relative;
    padding: 8px 0;
}

/* Big hero banner with Spark and welcome */
.dkk-gallery-hero {
    position: relative;
    text-align: center;
    margin: 0 auto 32px;
    max-width: 800px;
    background: linear-gradient(135deg, #FFFAF0 0%, #FCE8EB 100%);
    border: 6px solid #fff;
    border-radius: 32px;
    padding: 30px 24px 36px;
    box-shadow: 0 12px 0 rgba(0,0,0,0.08), 0 18px 36px rgba(0,0,0,0.10);
    transform: rotate(-0.5deg);
}
.dkk-gallery-hero::before {
    content: "⭐";
    position: absolute;
    top: -16px;
    left: 24px;
    background: var(--dkk-secondary);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 4px solid #fff;
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
    transform: rotate(-15deg);
    animation: dkk-float 3s ease-in-out infinite;
}
.dkk-gallery-hero::after {
    content: "✨";
    position: absolute;
    top: -16px;
    right: 24px;
    background: var(--dkk-pink);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 4px solid #fff;
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
    transform: rotate(15deg);
    animation: dkk-float 3.5s ease-in-out infinite reverse;
}
.dkk-gallery-hero-spark {
    display: inline-block;
    margin-bottom: 8px;
    transform: scale(1.15);
}
.dkk-gallery-hero-title {
    font-size: 42px;
    font-weight: 900;
    color: var(--dkk-text);
    margin: 0 0 8px;
    line-height: 1.15;
    text-shadow: 3px 3px 0 #FFD4D4;
    font-family: var(--dkk-fun-font);
}
.dkk-hero-emoji {
    display: inline-block;
    animation: dkk-bob-emoji 2s ease-in-out infinite;
}
@keyframes dkk-bob-emoji {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-6px) rotate(8deg); }
}
.dkk-hero-underline {
    position: relative;
    display: inline-block;
    color: var(--dkk-primary);
}
.dkk-hero-underline::after {
    content: "";
    position: absolute;
    left: -4px;
    right: -4px;
    bottom: 2px;
    height: 14px;
    background: var(--dkk-secondary);
    z-index: -1;
    transform: skewX(-8deg);
    border-radius: 4px;
}
.dkk-gallery-hero-subtitle {
    font-size: 18px;
    color: var(--dkk-text-light);
    margin: 0;
    font-weight: 700;
}

/* Decorative starfield around the gallery */
.dkk-theme-gallery::before {
    content: "✨ 📖 ⭐ 🌈 ✨";
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 28px;
    opacity: 0.6;
    pointer-events: none;
    letter-spacing: 18px;
    animation: dkk-float 4s ease-in-out infinite;
}

/* Empty state */
.dkk-empty-state {
    text-align: center;
    padding: 48px 16px;
    background: #fff;
    border: 5px dashed var(--dkk-border);
    border-radius: 22px;
    margin: 24px 0;
}
.dkk-empty-emoji {
    font-size: 64px;
    display: block;
    margin-bottom: 12px;
    animation: dkk-bob-emoji 2.5s ease-in-out infinite;
}
.dkk-empty-state h3 {
    margin: 0 0 8px;
    font-size: 26px;
    color: var(--dkk-text);
}

/* Card grid */
.dkk-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
    margin: 24px 0;
    padding: 16px 4px;
}
.dkk-theme-card {
    position: relative;
    background: #fff;
    border: 6px solid #fff;
    border-radius: 26px;
    overflow: visible;
    cursor: pointer;
    padding: 0;
    text-align: left;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
    font-family: inherit;
    box-shadow: 0 10px 0 rgba(0,0,0,0.10), 0 16px 32px rgba(0,0,0,0.12);
    animation: dkk-card-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.dkk-theme-card:nth-child(1) { animation-delay: 0.05s; }
.dkk-theme-card:nth-child(2) { animation-delay: 0.12s; }
.dkk-theme-card:nth-child(3) { animation-delay: 0.19s; }
.dkk-theme-card:nth-child(4) { animation-delay: 0.26s; }
.dkk-theme-card:nth-child(5) { animation-delay: 0.33s; }
.dkk-theme-card:nth-child(6) { animation-delay: 0.40s; }
@keyframes dkk-card-enter {
    0%   { transform: scale(0.7) rotate(-12deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg);     opacity: 1; }
}
.dkk-theme-card:nth-child(4n+1) { transform: rotate(-1.8deg); }
.dkk-theme-card:nth-child(4n+2) { transform: rotate(1.2deg); }
.dkk-theme-card:nth-child(4n+3) { transform: rotate(-0.6deg); }
.dkk-theme-card:nth-child(4n+4) { transform: rotate(1.8deg); }
.dkk-theme-card:hover {
    transform: translateY(-10px) rotate(0deg) scale(1.04);
    box-shadow: 0 16px 0 rgba(0,0,0,0.12), 0 24px 44px rgba(0,0,0,0.18);
    z-index: 2;
}
.dkk-theme-card:hover .dkk-theme-cta { background: var(--theme-ribbon, var(--dkk-pink)); }
.dkk-theme-card:hover .dkk-theme-spark-peek { transform: rotate(20deg) scale(1.15); }
.dkk-theme-card:hover .dkk-theme-ribbon { transform: rotate(-3deg) scale(1.05); }

/* Ribbon */
.dkk-theme-ribbon {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    background: var(--theme-ribbon, var(--dkk-pink));
    color: #fff;
    padding: 6px 22px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.5px;
    border: 3px solid #fff;
    box-shadow: 0 4px 0 rgba(0,0,0,0.18);
    z-index: 4;
    transition: transform 0.2s;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
    white-space: nowrap;
    font-family: var(--dkk-fun-font);
}

/* Spark peeking */
.dkk-theme-spark-peek {
    position: absolute;
    top: -22px;
    right: -22px;
    z-index: 3;
    transform: rotate(15deg);
    transition: transform 0.3s;
    animation: dkk-spark-wiggle 4s ease-in-out infinite;
}
@keyframes dkk-spark-wiggle {
    0%, 100% { transform: rotate(15deg); }
    50%      { transform: rotate(-5deg); }
}
.dkk-theme-spark-icon {
    display: inline-block;
    font-size: 56px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}
.dkk-theme-spark-img {
    display: block;
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.30));
}

/* Cover */
.dkk-theme-cover {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--theme-bg-1, #FFD4D4) 0%, var(--theme-bg-2, #D4EDD4) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    border-bottom: 4px dashed #fff;
}
.dkk-theme-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dkk-theme-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.3) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.2) 0%, transparent 30%);
}
.dkk-theme-cover-emoji {
    font-size: 110px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.20));
    animation: dkk-bob-emoji 3s ease-in-out infinite;
    display: block;
}
.dkk-theme-cover-shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
    pointer-events: none;
}

/* Info */
.dkk-theme-info {
    padding: 18px 20px 22px;
    text-align: center;
}
.dkk-theme-info h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 900;
    color: var(--dkk-text);
    font-family: var(--dkk-fun-font);
    line-height: 1.2;
}
.dkk-theme-info p {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--dkk-text-light);
    line-height: 1.4;
    min-height: 20px;
}
.dkk-theme-meta {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.dkk-theme-ages, .dkk-theme-pages {
    display: inline-block;
    font-size: 12px;
    background: var(--theme-bg-1, #FFD4D4);
    color: var(--dkk-text);
    border-radius: 999px;
    padding: 5px 12px;
    font-weight: 800;
    border: 2px solid #fff;
    box-shadow: 0 2px 0 rgba(0,0,0,0.10);
}
.dkk-theme-pages { background: var(--theme-bg-2, #D4EDD4); }
.dkk-theme-cta {
    background: var(--theme-accent, var(--dkk-primary));
    color: #fff;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 900;
    font-size: 15px;
    display: inline-block;
    box-shadow: 0 4px 0 rgba(0,0,0,0.18);
    transition: background 0.2s, transform 0.2s;
    font-family: var(--dkk-fun-font);
    border: 3px solid #fff;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
}
.dkk-theme-cta span {
    display: inline-block;
    transition: transform 0.2s;
}
.dkk-theme-card:hover .dkk-theme-cta span { transform: translateX(4px); }

/* --- Character pick --- */
.dkk-character-pick { text-align: center; }
.dkk-character-pick-spark-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}
.dkk-character-spark {
    width: 90px;
    height: 108px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
    transform: rotate(-6deg);
    animation: dkk-spark-wiggle 3.5s ease-in-out infinite;
}
.dkk-character-pick h2 {
    font-size: 36px;
    font-weight: 900;
    color: var(--dkk-text);
    margin: 16px 0 8px;
    text-shadow: 3px 3px 0 #FFB7E0;
    transform: rotate(0.5deg);
}
.dkk-character-pick p.dkk-helper-text {
    font-size: 18px;
    color: var(--dkk-text-light);
    margin: 0 0 18px;
}
.dkk-gender-toggle { display: flex; gap: 14px; justify-content: center; margin: 18px 0; }
.dkk-gender-btn {
    padding: 16px 36px;
    font-size: 20px;
    font-weight: 900;
    font-family: var(--dkk-fun-font);
    border-radius: 999px;
    border: 4px solid #fff;
    background: #fff;
    color: var(--dkk-text);
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0,0,0,0.10);
    transition: transform 0.15s, box-shadow 0.15s;
}
.dkk-gender-btn:hover { transform: translateY(-2px); }
.dkk-gender-btn.active { background: var(--dkk-pink); color: #fff; border-color: #fff; box-shadow: 0 4px 0 #D44A82; }
.dkk-variant-row, .dkk-preset-row { display: flex; gap: 18px; justify-content: center; margin: 24px 0; flex-wrap: wrap; }
.dkk-variant-card, .dkk-preset-card {
    width: 160px;
    background: #fff;
    border: 5px solid #fff;
    border-radius: 22px;
    padding: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 0 rgba(0,0,0,0.08), 0 8px 16px rgba(0,0,0,0.10);
    position: relative;
}
.dkk-variant-card:nth-child(odd), .dkk-preset-card:nth-child(odd) { transform: rotate(-2deg); }
.dkk-variant-card:nth-child(even), .dkk-preset-card:nth-child(even) { transform: rotate(2deg); }
.dkk-variant-card:hover, .dkk-preset-card:hover { transform: translateY(-4px) rotate(0deg) scale(1.04); }
.dkk-variant-card.active, .dkk-preset-card.active {
    border-color: var(--dkk-secondary);
    box-shadow: 0 0 0 5px var(--dkk-secondary), 0 8px 0 #0E4E0E;
    transform: translateY(-4px) rotate(0deg) scale(1.05);
}
.dkk-character-art { width: 100%; height: auto; display: block; }
.dkk-character-placeholder svg { width: 100%; height: auto; }
.dkk-preset-card .dkk-character-art { border-radius: 12px; }
.dkk-name-field { margin: 24px auto; max-width: 420px; }
.dkk-name-field label {
    display: block;
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--dkk-text);
}
.dkk-name-field input {
    width: 100%;
    padding: 18px 22px;
    font-size: 22px;
    text-align: center;
    font-family: var(--dkk-fun-font);
    font-weight: 700;
    border: 5px solid var(--dkk-secondary);
    border-radius: 999px;
    background: #FFFAF0;
    color: var(--dkk-text);
}
.dkk-name-field input:focus { border-color: var(--dkk-primary); outline: none; box-shadow: 0 0 0 4px rgba(91,91,214,0.20); }

/* --- Scene player --- */
.dkk-scene-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 999px;
    border: 4px solid var(--dkk-secondary);
    box-shadow: 0 4px 0 rgba(0,0,0,0.06);
    font-family: var(--dkk-fun-font);
}
.dkk-progress-bar {
    flex: 1;
    height: 16px;
    background: #FFFAF0;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid var(--dkk-secondary);
}
.dkk-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dkk-secondary) 0%, var(--dkk-coral) 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
    background-size: 200% 100%;
    animation: dkk-progress-shine 3s linear infinite;
}
@keyframes dkk-progress-shine {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.dkk-progress-label {
    font-size: 16px;
    font-weight: 900;
    color: var(--dkk-text);
    white-space: nowrap;
    background: var(--dkk-primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 999px;
    border: 3px solid #fff;
    box-shadow: 0 2px 0 rgba(0,0,0,0.10);
}
.dkk-saving {
    font-size: 13px;
    color: var(--dkk-text-light);
    font-weight: 700;
    animation: dkk-blink 1s ease-in-out infinite;
}
.dkk-scene-save-zone {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dkk-save-btn {
    padding: 8px 16px;
    font-size: 15px;
    white-space: nowrap;
}
.dkk-saved {
    font-size: 13px;
    color: #fff;
    font-weight: 900;
    background: var(--dkk-success);
    padding: 3px 12px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 2px 0 #1F9D54;
}
@keyframes dkk-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.dkk-scene-canvas {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--dkk-primary-light);
    aspect-ratio: 16/9;
    margin-bottom: 14px;
}
.dkk-scene-bg { width: 100%; height: 100%; object-fit: cover; display: block; }
.dkk-scene-bg-placeholder { display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--dkk-text-light); }
.dkk-scene-character {
    position: absolute;
    left: 24px;
    bottom: 0;
    width: 22%;
    max-width: 180px;
    text-align: center;
}
.dkk-scene-character-name {
    display: inline-block;
    background: rgba(255,255,255,0.92);
    border-radius: 12px;
    padding: 3px 12px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
}
.dkk-spark-overlay { position: absolute; top: 12px; right: 12px; max-width: 260px; }
.dkk-scene-starter { font-size: 18px; font-style: italic; color: var(--dkk-text); text-align: center; margin: 10px 0; }

/* --- Writing pad --- */
.dkk-writing-pad { margin: 18px 0; }
.dkk-writing-pad label { display: block; font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.dkk-lined-paper { position: relative; background: #fff; border: 2px solid var(--dkk-border); border-radius: 14px; overflow: hidden; }
.dkk-lined-paper textarea {
    position: relative;
    z-index: 1;
    width: 100%;
    border: none;
    background: transparent;
    padding: 14px 18px;
    font-size: 20px;
    line-height: 40px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}
.dkk-lined-paper textarea:focus { outline: none; }
.dkk-lined-paper .dkk-lines {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 39px,
        var(--dkk-border) 39px,
        var(--dkk-border) 40px
    );
    background-position: 0 14px;
    pointer-events: none;
}
.dkk-narrate-btn {
    margin-top: 10px;
    background: #fff;
    border: 2px solid var(--dkk-border);
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.dkk-narrate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Spark --- */
.dkk-spark { display: flex; align-items: flex-start; gap: 12px; margin: 14px 0; font-family: var(--dkk-fun-font); }
.dkk-spark-floating { flex-direction: column; align-items: flex-end; margin: 0; }
.dkk-spark-speech {
    position: relative;
    background: #FFFAF0;
    border: 4px solid #fff;
    border-radius: 22px;
    padding: 14px 18px;
    max-width: 320px;
    font-size: 16px;
    font-weight: 700;
    color: var(--dkk-text);
    box-shadow: 0 5px 0 rgba(0,0,0,0.08), 0 8px 16px rgba(0,0,0,0.10);
}
.dkk-spark-speech::after {
    content: "";
    position: absolute;
    bottom: -14px;
    right: 32px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 14px solid #fff;
    filter: drop-shadow(0 4px 0 rgba(0,0,0,0.05));
}
.dkk-spark-speech p { margin: 0; }
.dkk-spark-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #fff;
    border: 2px solid var(--dkk-border);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 16px;
    color: var(--dkk-text);
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}
.dkk-spark-close:hover { background: var(--dkk-coral); color: #fff; border-color: #fff; }
.dkk-spark-more {
    display: inline-block;
    margin-top: 8px;
    background: var(--dkk-secondary);
    border: 3px solid #fff;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 3px 0 #0E4E0E;
    font-family: var(--dkk-fun-font);
    transition: transform 0.15s;
}
.dkk-spark-more:hover { transform: translateY(-2px); }
.dkk-spark-more:active { transform: translateY(1px); box-shadow: 0 1px 0 #0E4E0E; }
.dkk-spark-body { flex-shrink: 0; }
.dkk-spark-collapsed { background: none; border: none; cursor: pointer; padding: 0; }
.dkk-spark-floating .dkk-spark-speech { order: 1; }
.dkk-spark-floating .dkk-spark-body { order: 2; }

/* --- Done screen --- */
.dkk-book-done { text-align: center; position: relative; }
.dkk-done-spark {
    width: 180px;
    height: 215px;
    object-fit: contain;
    display: block;
    margin: 0 auto -16px;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.20));
    animation: dkk-celebrate 2.5s ease-in-out infinite;
}
@keyframes dkk-celebrate {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%      { transform: translateY(-10px) rotate(-3deg); }
    50%      { transform: translateY(0) rotate(0deg); }
    75%      { transform: translateY(-10px) rotate(3deg); }
}
.dkk-done-card { background: #fff; border: 1px solid var(--dkk-border); border-radius: 16px; padding: 32px 24px; margin-top: 16px; }

@media (max-width: 600px) {
    .dkk-scene-canvas { aspect-ratio: 4/3; }
    .dkk-spark-overlay { position: static; max-width: none; margin-top: 8px; }
    .dkk-scene-character { width: 30%; left: 10px; }
}

/* --- 4-preset character selection --- */
.dkk-preset-row { display: flex; gap: 16px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.dkk-preset-card {
    position: relative;
    width: 160px;
    background: #fff;
    border: 4px solid var(--dkk-border);
    border-radius: 18px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    font-family: inherit;
}
.dkk-preset-card:hover { transform: translateY(-4px); }
.dkk-preset-card.active { border-color: var(--dkk-success); box-shadow: 0 0 0 4px #BBF7D0; }
.dkk-preset-card .dkk-character-art,
.dkk-preset-img { width: 100%; height: auto; border-radius: 12px; }
.dkk-preset-name {
    display: block;
    margin-top: 8px;
    text-align: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--dkk-text);
}
.dkk-preset-check {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 34px;
    height: 34px;
    background: var(--dkk-success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* --- Spark animations: floating hover + glow pulse --- */
@keyframes dkk-spark-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes dkk-spark-wing-flap {
    0%, 100% { transform: rotate(-30deg) scaleY(1); }
    50%      { transform: rotate(-30deg) scaleY(0.6); }
}
@keyframes dkk-spark-wing-flap-right {
    0%, 100% { transform: rotate(30deg) scaleY(1); }
    50%      { transform: rotate(30deg) scaleY(0.6); }
}
.dkk-spark-wing-left  { animation: dkk-spark-wing-flap 0.4s ease-in-out infinite; transform-origin: 22px 38px; }
.dkk-spark-wing-right { animation: dkk-spark-wing-flap-right 0.4s ease-in-out infinite; transform-origin: 68px 38px; }
@keyframes dkk-spark-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(253, 224, 71, 0.5)); }
    50% { filter: drop-shadow(0 0 14px rgba(253, 224, 71, 0.95)); }
}
.dkk-spark-body {
    width: auto;
    height: auto;
    max-width: 110px;
    max-height: 130px;
    display: block;
    animation: dkk-spark-bob 2.6s ease-in-out infinite;
}
.dkk-spark-body-img {
    width: 110px;
    height: 130px;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.30));
}
.dkk-spark-bubble .dkk-spark-body-img,
.dkk-spark-collapsed .dkk-spark-body-img {
    width: 80px;
    height: 95px;
}
@media (prefers-reduced-motion: reduce) {
    .dkk-spark-body { animation: none; }
}

@media (max-width: 600px) {
    .dkk-preset-card { width: 44%; }
}

/* --- Spark: clickable body + attention pulse + clue button --- */
.dkk-spark-body-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 50%;
}
.dkk-spark-body-btn:focus-visible { outline: 3px solid var(--dkk-primary); outline-offset: 3px; }

@keyframes dkk-spark-ring {
    0%   { box-shadow: 0 0 0 0 rgba(253, 224, 71, 0.85); }
    70%  { box-shadow: 0 0 0 16px rgba(253, 224, 71, 0); }
    100% { box-shadow: 0 0 0 0 rgba(253, 224, 71, 0); }
}
.dkk-spark-attention { animation: dkk-spark-ring 2s ease-out infinite; }

.dkk-spark-mute {
    position: absolute;
    top: 2px;
    right: 30px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
    opacity: 0.7;
    transition: opacity 0.15s;
    border-radius: 4px;
}
.dkk-spark-mute:hover { opacity: 1; background: rgba(0,0,0,0.05); }

@keyframes dkk-spark-talk {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-3px) scale(1.03); }
    75% { transform: translateY(-2px) scale(1.01); }
}
.dkk-spark-body-talking {
    animation: dkk-spark-talk 0.35s ease-in-out infinite !important;
}
.dkk-spark-body-btn.dkk-spark-talking {
    animation: dkk-spark-ring 0.6s ease-out infinite !important;
}

.dkk-spark-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dkk-spark-actions .dkk-spark-more { margin-top: 0; }
.dkk-spark-clue-btn {
    display: inline-block;
    background: #FBBF24;
    border: none;
    border-radius: 12px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #78350F;
    cursor: pointer;
}
.dkk-spark-clue-btn:hover { background: #F59E0B; color: #fff; }

/* ==========================================================================
   BOOK PAGE LAYOUT — top half picture, bottom half writing, page strip
   ========================================================================== */

.dkk-book-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 920px;
    margin: 0 auto;
    font-family: var(--dkk-fun-font);
}

/* --- Top half: scene picture with character + Spark --- */
.dkk-page-picture {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 26px;
    overflow: hidden;
    background: linear-gradient(135deg, #E8EDF5 0%, #FFE8E0 100%);
    box-shadow: 0 10px 0 rgba(0, 0, 0, 0.08), 0 14px 28px rgba(0, 0, 0, 0.10);
    border: 6px solid #fff;
}
.dkk-page-picture-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dkk-page-picture-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--dkk-text-light);
    font-weight: 700;
}
.dkk-page-hero {
    position: absolute;
    left: 4%;
    bottom: 0;
    width: 28%;
    max-width: 220px;
    text-align: center;
    z-index: 2;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.30));
    animation: dkk-hero-bob 3s ease-in-out infinite;
}
@keyframes dkk-hero-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.dkk-page-hero .dkk-character-art,
.dkk-page-hero .dkk-character-placeholder {
    width: 100%;
    height: auto;
    display: block;
}
.dkk-page-hero-name {
    display: inline-block;
    background: var(--dkk-secondary);
    color: #fff;
    border-radius: 999px;
    padding: 5px 16px;
    font-weight: 900;
    font-size: 16px;
    margin-bottom: 6px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.18);
    border: 3px solid #fff;
}
.dkk-page-spark {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 4;
    max-width: 300px;
    transform: scale(1.05);
}
.dkk-page-picture-caption {
    position: absolute;
    left: 50%;
    top: 16px;
    transform: translateX(-50%) rotate(-1deg);
    background: #fff;
    border: 4px solid var(--dkk-secondary);
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 17px;
    font-style: italic;
    font-weight: 800;
    color: var(--dkk-text);
    max-width: 80%;
    text-align: center;
    box-shadow: 0 4px 0 rgba(0,0,0,0.10);
    z-index: 3;
    font-family: var(--dkk-fun-font);
}
@keyframes dkk-choices-pulse {
    0%, 100% { box-shadow: 0 5px 0 #C03030, 0 0 0 0 rgba(232,80,80,0.7); }
    50%      { box-shadow: 0 5px 0 #C03030, 0 0 0 16px rgba(232,80,80,0); }
}

/* --- Bottom half: lined writing pad --- */
.dkk-page-writing {
    background: #FFFAF0;
    border: 5px dashed var(--dkk-secondary);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 6px 0 rgba(0,0,0,0.06), 0 10px 20px rgba(0,0,0,0.08);
    position: relative;
}
.dkk-page-writing::before {
    content: "✏️";
    position: absolute;
    top: -18px;
    left: 22px;
    background: var(--dkk-secondary);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.18);
    border: 3px solid #fff;
}
.dkk-page-writing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.dkk-page-writing-header label {
    font-size: 20px;
    font-weight: 900;
    color: var(--dkk-text);
    font-family: var(--dkk-fun-font);
}
.dkk-page-writing .dkk-narrate-btn {
    background: var(--dkk-mint);
    color: #fff;
    border: 3px solid #fff;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 3px 0 #1D6E48, 0 6px 12px rgba(45,143,94,0.3);
    transition: transform 0.15s;
}
.dkk-page-writing .dkk-narrate-btn:hover:not(:disabled) { transform: translateY(-2px); }
.dkk-page-writing .dkk-narrate-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: 0 2px 0 #1D6E48; }
.dkk-lined-paper {
    position: relative;
    background: #fff;
    border: 3px solid var(--dkk-secondary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 0 4px #fff;
}
.dkk-lined-paper textarea {
    position: relative;
    z-index: 1;
    width: 100%;
    border: none;
    background: transparent;
    padding: 18px 22px;
    font-size: 22px;
    line-height: 42px;
    resize: vertical;
    font-family: var(--dkk-fun-font);
    font-weight: 600;
    color: var(--dkk-text);
    box-sizing: border-box;
    min-height: 180px;
}
.dkk-lined-paper textarea:focus { outline: none; }
.dkk-lined-paper .dkk-lines {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 41px,
        #B5CFFF 41px,
        #B5CFFF 42px
    );
    background-position: 0 18px;
    pointer-events: none;
}
.dkk-lined-paper::before {
    content: "";
    position: absolute;
    left: 48px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #D4EDD4;
    z-index: 0;
    pointer-events: none;
}

/* Page title with Spark */
.dkk-page-title-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.dkk-page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    color: var(--dkk-text);
    text-align: center;
    text-shadow: 3px 3px 0 #FFD4D4;
    transform: rotate(-1deg);
    flex: 1;
}
.dkk-page-title-spark {
    width: 64px;
    height: 76px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
    transform: rotate(8deg);
    animation: dkk-spark-wiggle 4s ease-in-out infinite;
}
@keyframes dkk-spark-wiggle {
    0%, 100% { transform: rotate(8deg) scale(1); }
    50%      { transform: rotate(-2deg) scale(1.05); }
}

/* Writing pad with Spark */
.dkk-page-writing-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.dkk-writing-spark {
    width: 56px;
    height: 66px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.20));
    transform: rotate(-8deg);
    animation: dkk-spark-wiggle 3.5s ease-in-out infinite reverse;
}

/* Page strip label with Spark */
.dkk-page-strip-spark {
    display: inline-block;
    vertical-align: middle;
    width: 40px;
    height: 48px;
    object-fit: contain;
    margin-left: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.20));
    transform: rotate(10deg);
    animation: dkk-spark-wiggle 4s ease-in-out infinite;
}

/* --- Page strip: thumbnails of every book page --- */
.dkk-page-strip-wrap {
    margin-top: 4px;
}
.dkk-page-strip-label {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 900;
    color: var(--dkk-pink);
    font-family: var(--dkk-fun-font);
    text-align: center;
    text-shadow: 2px 2px 0 #fff;
}
.dkk-page-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 12px 6px 14px;
    scrollbar-width: thin;
    background: #fff;
    border-radius: 18px;
    border: 3px dashed var(--dkk-pink);
}
.dkk-page-strip::-webkit-scrollbar { height: 8px; }
.dkk-page-strip::-webkit-scrollbar-thumb { background: var(--dkk-pink); border-radius: 4px; }
.dkk-page-thumb {
    position: relative;
    flex-shrink: 0;
    width: 72px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    border: 4px solid #fff;
    background: #fff;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
    box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 6px 12px rgba(0,0,0,0.10);
}
.dkk-page-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dkk-page-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 28px;
    background: linear-gradient(135deg, #FFD4D4 0%, #D4EDD4 100%);
}
.dkk-page-thumb-num {
    position: absolute;
    left: 4px;
    bottom: 4px;
    background: var(--dkk-primary);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    border: 2px solid #fff;
}
.dkk-page-thumb-tick {
    position: absolute;
    right: 4px;
    top: 4px;
    background: var(--dkk-success);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    border: 2px solid #fff;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}
.dkk-page-thumb:hover { transform: translateY(-4px) rotate(0deg); }
.dkk-page-thumb.active {
    border-color: var(--dkk-secondary);
    box-shadow: 0 0 0 4px var(--dkk-secondary), 0 6px 0 #0E4E0E, 0 8px 16px rgba(0,0,0,0.15);
    transform: translateY(-4px) scale(1.05);
}
.dkk-page-thumb.filled { border-color: var(--dkk-success); }
.dkk-page-thumb:disabled { cursor: default; opacity: 0.7; }
.dkk-page-thumb:disabled:hover { transform: none; }

@media (max-width: 700px) {
    .dkk-page-picture { aspect-ratio: 4 / 3; }
    .dkk-page-hero { width: 36%; left: 2%; }
    .dkk-page-spark { max-width: 220px; }
    .dkk-page-thumb { width: 60px; height: 76px; }
    .dkk-gallery-header h2, .dkk-character-pick h2 { font-size: 28px; }
}

/* ==========================================================================
   CHILD DASHBOARD — modern kid-friendly look matching the design system
   ========================================================================== */

/* Dashboard colors are now set globally by DKK_Branding::build_css().
   The variables --dkk-cd-bg, --dkk-cd-text, etc. are injected via inline :root. */

.dkk-child-dashboard-react {
    font-family: var(--dkk-cd-fun-font);
    color: var(--dkk-cd-text);
    max-width: 1200px;
    margin: 0 auto;
}

.dkk-cd-loading {
    text-align: center;
    padding: 80px 20px;
}

/* Hero with Spark */
.dkk-cd-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #C4162A 0%, #9A1020 55%, #E85050 130%);
    border: 5px solid #fff;
    border-radius: 26px;
    padding: 28px 30px;
    margin-bottom: 24px;
    box-shadow: 0 8px 0 rgba(0,0,0,0.08), 0 12px 24px rgba(0,0,0,0.10);
    color: #fff;
}
.dkk-cd-hero-text {
    flex: 1 1 360px;
    text-align: left;
}
.dkk-cd-hero-title {
    margin: 0 0 6px;
    font-size: 34px;
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.18);
}
.dkk-cd-hero-line {
    margin: 0 0 18px;
    font-size: 17px;
    color: rgba(255,255,255,0.92);
    font-weight: 600;
    max-width: 520px;
}
.dkk-cd-hero-cta .dkk-btn {
    background: #1A6B1A;
    color: var(--dkk-cd-text);
    border: 3px solid #fff;
    box-shadow: 0 5px 0 rgba(0,0,0,0.18);
    font-size: 17px;
    padding: 14px 28px;
}
.dkk-cd-hero-cta .dkk-btn:hover { background: #FFC940; }
.dkk-cd-hero-spark {
    flex: 0 1 320px;
    min-width: 260px;
}
.dkk-cd-hero-spark .dkk-spark {
    background: rgba(255,255,255,0.12);
    border: 3px solid rgba(255,255,255,0.6);
    border-radius: 20px;
    padding: 10px 12px;
}
.dkk-cd-hero-spark .dkk-spark-speech {
    background: #fff;
}
.dkk-cd-hero-spark .dkk-spark-speech p {
    color: var(--dkk-cd-text);
}
.dkk-cd-request h2 { margin-top: 0; }
.dkk-cd-request .dkk-btn-big { font-size: 18px; padding: 16px 34px; }
.dkk-cd-request-tab { max-width: 640px; margin: 0 auto; }

/* Toast */
.dkk-cd-toast {
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 800;
    margin-bottom: 16px;
    border: 3px solid #fff;
    box-shadow: 0 4px 0 rgba(0,0,0,0.08);
}
.dkk-cd-toast-success { background: #D1FAE5; color: #065F46; }
.dkk-cd-toast-error { background: #FEE2E2; color: #991B1B; }

/* Tabs */
.dkk-cd-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 4px solid var(--dkk-cd-border);
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.dkk-cd-tab {
    background: transparent;
    border: 0;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: 900;
    color: var(--dkk-cd-text-light);
    cursor: pointer;
    border-bottom: 5px solid transparent;
    margin-bottom: -4px;
    font-family: inherit;
    transition: all 0.15s;
}
.dkk-cd-tab:hover { color: var(--dkk-cd-purple); }
.dkk-cd-tab.active { color: var(--dkk-cd-purple); border-bottom-color: var(--dkk-cd-purple); }

/* Stat cards */
.dkk-cd-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.dkk-cd-stat {
    background: #fff;
    border: 4px solid #fff;
    border-radius: 20px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 6px 0 rgba(0,0,0,0.08), 0 10px 18px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.dkk-cd-stat:hover { transform: translateY(-3px); box-shadow: 0 9px 0 rgba(0,0,0,0.10), 0 14px 24px rgba(0,0,0,0.12); }
.dkk-cd-stat::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: var(--dkk-cd-purple);
}
.dkk-cd-stat-purple::before { background: var(--dkk-cd-purple); }
.dkk-cd-stat-yellow::before { background: var(--dkk-cd-yellow); }
.dkk-cd-stat-pink::before { background: var(--dkk-cd-pink); }
.dkk-cd-stat-mint::before { background: var(--dkk-cd-mint); }
.dkk-cd-stat-coral::before { background: var(--dkk-cd-coral); }
.dkk-cd-stat-sky::before { background: var(--dkk-cd-sky); }
.dkk-cd-stat-green::before { background: var(--dkk-cd-green); }
.dkk-cd-stat-icon { font-size: 32px; margin-bottom: 4px; }
.dkk-cd-stat-num {
    font-size: 28px;
    font-weight: 900;
    color: var(--dkk-cd-text);
    line-height: 1.1;
}
.dkk-cd-stat-label {
    font-size: 12px;
    color: var(--dkk-cd-text-light);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Cards */
.dkk-cd-card {
    background: #fff;
    border: 4px solid #fff;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 6px 0 rgba(0,0,0,0.08), 0 10px 20px rgba(0,0,0,0.10);
    margin-bottom: 16px;
}
.dkk-cd-card h2 {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 900;
    color: var(--dkk-cd-text);
    text-shadow: 2px 2px 0 #FFD4D4;
}
.dkk-cd-muted { color: var(--dkk-cd-text-light); font-size: 14px; font-weight: 600; margin: 8px 0 0; }

/* Progress bar */
.dkk-cd-progress { margin: 12px 0; }
.dkk-cd-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--dkk-cd-text-light);
    font-weight: 800;
    margin-bottom: 6px;
}
.dkk-cd-progress-bar {
    background: #FFFAF0;
    border: 3px solid var(--dkk-cd-yellow);
    border-radius: 999px;
    height: 18px;
    overflow: hidden;
}
.dkk-cd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dkk-cd-yellow) 0%, var(--dkk-cd-coral) 100%);
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
    animation: dkk-cd-progress-shine 2.5s linear infinite;
}
@keyframes dkk-cd-progress-shine {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* 2-col grid */
.dkk-cd-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 700px) { .dkk-cd-grid-2 { grid-template-columns: 1fr; } }
.dkk-cd-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--dkk-cd-border);
    font-size: 15px;
}
.dkk-cd-stat-row:last-child { border-bottom: 0; }
.dkk-cd-stat-row strong { color: var(--dkk-cd-purple); font-size: 18px; }

/* CTA */
.dkk-cd-cta {
    text-align: center;
    background: linear-gradient(135deg, var(--dkk-cd-purple) 0%, var(--dkk-cd-pink) 100%);
    border: 5px solid #fff;
    border-radius: 26px;
    padding: 30px 20px;
    margin-top: 20px;
    box-shadow: 0 12px 0 rgba(0,0,0,0.10), 0 18px 32px rgba(91,91,214,0.30);
    color: #fff;
}
.dkk-cd-cta h2 { color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,0.20); margin-bottom: 14px; }
.dkk-cd-cta .dkk-btn {
    background: var(--dkk-cd-yellow);
    color: var(--dkk-cd-text);
    border-color: #fff;
}
.dkk-cd-cta .dkk-btn:hover { background: var(--dkk-cd-yellow); color: var(--dkk-cd-text); }

/* Book grid */
.dkk-cd-books-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.dkk-cd-books-header h2 { margin: 0; font-size: 24px; font-weight: 900; }
.dkk-cd-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.dkk-cd-book-card {
    background: #fff;
    border: 4px solid #fff;
    border-radius: 22px;
    box-shadow: 0 6px 0 rgba(0,0,0,0.08), 0 10px 20px rgba(0,0,0,0.10);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.dkk-cd-book-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 rgba(0,0,0,0.10), 0 14px 24px rgba(0,0,0,0.12); }
.dkk-cd-book-cover {
    background: linear-gradient(135deg, #FFFAF0 0%, #FFE8E0 100%);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    border-bottom: 4px solid #fff;
}
.dkk-cd-book-body { padding: 14px; }
.dkk-cd-book-body h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 900;
    color: var(--dkk-cd-text);
}
.dkk-cd-book-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.dkk-cd-book-actions .dkk-btn { flex: 1; padding: 7px 10px; font-size: 12px; min-width: 100px; }

/* Empty state */
.dkk-cd-empty {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border: 4px dashed var(--dkk-cd-border);
    border-radius: 22px;
}
.dkk-cd-empty h3 { margin: 12px 0 8px; font-size: 22px; color: var(--dkk-cd-text); }
.dkk-cd-empty p { color: var(--dkk-cd-text-light); margin-bottom: 18px; }

/* Achievements */
.dkk-cd-achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.dkk-cd-achievement {
    background: #F9FAFB;
    border: 4px solid #F9FAFB;
    border-radius: 18px;
    padding: 18px 14px;
    text-align: center;
    transition: transform 0.15s;
    opacity: 0.5;
}
.dkk-cd-achievement.earned {
    background: linear-gradient(135deg, #FFFAF0 0%, #FFF0E0 100%);
    border-color: var(--dkk-cd-yellow);
    box-shadow: 0 4px 0 var(--dkk-cd-yellow), 0 6px 12px rgba(255,184,0,0.25);
    opacity: 1;
}
.dkk-cd-achievement:hover { transform: translateY(-2px); }
.dkk-cd-achievement-icon { font-size: 36px; margin-bottom: 6px; }
.dkk-cd-achievement-name { font-weight: 900; font-size: 14px; margin-bottom: 4px; }
.dkk-cd-achievement-desc { font-size: 12px; color: var(--dkk-cd-text-light); line-height: 1.4; }
.dkk-cd-achievement-reward {
    margin-top: 8px;
    background: var(--dkk-cd-yellow);
    color: var(--dkk-cd-text);
    border-radius: 999px;
    padding: 3px 10px;
    display: inline-block;
    font-size: 12px;
    font-weight: 900;
    border: 2px solid #fff;
}

/* ==========================================================================
   A5 BOOK PAGE — the new layout matching the printed book (148×210mm)
   - Cover: full-bleed illustration with title overlay
   - Story: top half picture + bottom half lined writing area
   - Back cover: "The End" with hero credit
   ========================================================================== */

.dkk-a5-page {
    width: 100%;
    max-width: 520px;        /* matches ~A4 at screen viewing size */
    aspect-ratio: 210 / 297;  /* exact A4 paper proportions */
    margin: 0 auto;
    perspective: 1200px;
}

.dkk-a5-page-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    border: 4px solid #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 12px 0 rgba(0,0,0,0.10),
        0 18px 36px rgba(0,0,0,0.18),
        inset 0 0 0 1px rgba(0,0,0,0.05);
}

.dkk-a5-page-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dkk-a5-page-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    background: linear-gradient(135deg, #FFFAF0 0%, #FFE8E0 100%);
}

/* Cover page */
.dkk-a5-cover .dkk-a5-page-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
}
.dkk-a5-cover-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8%;
    text-align: center;
    color: #fff;
    padding: 16px 24px;
    z-index: 2;
    text-shadow: 2px 3px 0 rgba(0,0,0,0.45);
}
.dkk-a5-cover-by {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.95;
}
.dkk-a5-cover-hero {
    font-size: 44px;
    font-weight: 900;
    margin: 0 0 6px;
    line-height: 1.05;
    font-family: var(--dkk-fun-font);
}
.dkk-a5-cover-theme {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    opacity: 0.95;
}

/* Story page — top picture, bottom writing */
.dkk-a5-story {
    background: transparent;
    box-shadow: none;
}
.dkk-a5-story .dkk-a5-page-inner {
    display: flex;
    flex-direction: column;
    background: #FFFAF0;
}
.dkk-a5-picture {
    position: relative;
    flex: 1.18; /* picture gets ~54% of page height, writing ~46% */
    overflow: hidden;
    border-bottom: 3px dashed var(--dkk-secondary, #1A6B1A);
}
.dkk-a5-picture-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dkk-a5-hero {
    position: absolute;
    left: 4%;
    bottom: 0;
    width: 26%;
    max-width: 130px;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.30));
    animation: dkk-hero-bob 3s ease-in-out infinite;
}
.dkk-a5-hero .dkk-character-art,
.dkk-a5-hero .dkk-character-placeholder {
    width: 100%;
    height: auto;
    display: block;
}
.dkk-a5-hero-name {
    display: inline-block;
    background: var(--dkk-secondary, #1A6B1A);
    color: #fff;
    border-radius: 999px;
    padding: 3px 10px;
    font-weight: 900;
    font-size: 12px;
    margin-bottom: 4px;
    border: 2px solid #fff;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}
@keyframes dkk-hero-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
/* Story page layout — A5 book page with Bright Spark's clue panel below (outside the picture) */
.dkk-story-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.dkk-story-layout .dkk-a5-page {
    margin: 0;
}
/* Bright Spark's clue deck — sits outside the picture, full-width, big firefly, roomy cards */
.dkk-spark-deck-area {
    width: 100%;
    max-width: 560px;
}
.dkk-spark-deck-area .dkk-spark {
    margin: 0;
}
.dkk-spark-deck-area .dkk-spark-deck {
    max-width: none;
    padding: 16px 18px;
    border-width: 4px;
}
.dkk-spark-deck-area .dkk-spark-deck-header {
    gap: 12px;
    margin-bottom: 14px;
}
/* Bright Spark in the deck header is compact (next to the intro line). The
   explicit max-width/max-height beat the base mascot cap below so the image
   can never be silently squished by it again. */
.dkk-spark-deck-area .dkk-spark-body,
.dkk-spark-deck-area .dkk-spark-body-img,
.dkk-spark-deck-header .dkk-spark-body-img.small {
    width: 64px;
    height: 76px;
    max-width: 80px;
    max-height: 92px;
}
.dkk-spark-deck-area .dkk-spark-deck-hint {
    font-size: 14px;
    line-height: 1.35;
}
/* Compact Bright Spark header + card labels stay hidden on mobile */
.dkk-spark-deck-header .dkk-spark-body-img.small {
    width: 64px;
    height: 76px;
    max-width: 80px;
    max-height: 92px;
}
.dkk-spark-ask-btn {
    margin-top: 6px;
    background: var(--dkk-primary, #C4162A);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--dkk-fun-font, sans-serif);
    box-shadow: 0 3px 0 rgba(0,0,0,0.15);
    transition: transform 0.12s, background 0.15s;
}
.dkk-spark-ask-btn:hover:not(:disabled) { background: #8B5CF6; transform: translateY(-1px); }
.dkk-spark-ask-btn:disabled { background: #C4B5FD; cursor: not-allowed; }
.dkk-spark-deck-area .dkk-spark-card-row {
    gap: 12px;
}
.dkk-spark-deck-area .dkk-clue-card-text {
    font-size: 12px;
    line-height: 1.25;
}
.dkk-a5-picture-caption {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    background: #fff;
    border: 3px solid var(--dkk-secondary, #1A6B1A);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-style: italic;
    font-weight: 800;
    color: var(--dkk-text, #011A40);
    max-width: 80%;
    text-align: center;
    box-shadow: 0 2px 0 rgba(0,0,0,0.10);
    z-index: 3;
    font-family: var(--dkk-fun-font, sans-serif);
}

.dkk-a5-writing {
    flex: 1;
    background: #FFFAF0;
    padding: 8px 12px 10px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.dkk-a5-writing-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.dkk-a5-writing-spark {
    width: 22px;
    height: 26px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.20));
    animation: dkk-spark-wiggle 3.5s ease-in-out infinite reverse;
    flex-shrink: 0;
}
.dkk-a5-writing-header label {
    font-size: 11px;
    font-weight: 900;
    color: var(--dkk-text, #011A40);
    flex: 1;
    font-family: var(--dkk-fun-font, sans-serif);
}
.dkk-a5-writing .dkk-narrate-btn {
    background: var(--dkk-mint, #2D8F5E);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 2px 0 #1D6E48;
    cursor: pointer;
    font-family: var(--dkk-fun-font, sans-serif);
}
.dkk-a5-writing .dkk-narrate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.dkk-a5-writing .dkk-lined-paper {
    flex: 1;
    background: #fff;
    border: 2px solid var(--dkk-secondary, #1A6B1A);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 0 2px #fff;
}
.dkk-a5-writing .dkk-lined-paper textarea {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 8px 12px 8px 32px;
    font-size: 14px;
    line-height: 22px;
    resize: none;
    font-family: var(--dkk-fun-font, sans-serif);
    font-weight: 600;
    color: var(--dkk-text, #011A40);
    box-sizing: border-box;
}
.dkk-a5-writing .dkk-lined-paper textarea:focus { outline: none; }
.dkk-a5-writing .dkk-lines {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 21px,
        #B5CFFF 21px,
        #B5CFFF 22px
    );
    background-position: 0 8px;
    pointer-events: none;
}
.dkk-a5-writing .dkk-lined-paper::before {
    content: "";
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: #D4EDD4;
    z-index: 0;
    pointer-events: none;
}

.dkk-page-wordcount {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--dkk-text, #011A40);
    font-family: var(--dkk-fun-font, sans-serif);
    background: #fff;
    border-top: 1px dashed rgba(26, 107, 26, 0.25);
}
.dkk-page-wordcount-char {
    opacity: 0.6;
    font-weight: 600;
}
.dkk-page-wordcount-single {
    padding: 4px 2px 0;
    margin-top: 2px;
    border-top: none;
}

/* Back cover */
.dkk-a5-back-cover .dkk-a5-page-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}
.dkk-a5-back-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10%;
    text-align: center;
    color: #fff;
    z-index: 2;
    text-shadow: 2px 3px 0 rgba(0,0,0,0.45);
    padding: 0 24px;
}
.dkk-a5-back-text h2 {
    font-size: 40px;
    font-weight: 900;
    margin: 0 0 8px;
    font-family: var(--dkk-fun-font, sans-serif);
}
.dkk-a5-back-text p {
    font-size: 16px;
    margin: 4px 0;
    font-weight: 700;
    font-family: var(--dkk-fun-font, sans-serif);
}
.dkk-a5-back-by {
    font-size: 14px !important;
    opacity: 0.9;
    margin-top: 12px !important;
}

/* ==========================================================================
   SPARK CLUE-CARD DECK — 5 cards, click to flip, Spark speaks each
   ========================================================================== */

.dkk-spark-deck {
    background: #FFFAF0;
    border: 4px solid #fff;
    border-radius: 22px;
    padding: 12px;
    box-shadow:
        0 8px 0 rgba(0,0,0,0.10),
        0 12px 24px rgba(0,0,0,0.12);
    font-family: var(--dkk-fun-font, sans-serif);
    max-width: 460px;
}
.dkk-spark-deck-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.dkk-spark-deck-title {
    flex: 1;
    min-width: 0;
}
.dkk-spark-deck-hint {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    color: var(--dkk-text, #011A40);
    line-height: 1.3;
}
.dkk-spark-deck-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.dkk-spark-mute,
.dkk-spark-deck-close {
    background: #fff;
    border: 2px solid var(--dkk-border, #E8DFC8);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 14px;
    color: var(--dkk-text, #011A40);
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    padding: 0;
    transition: background 0.15s;
}
.dkk-spark-mute:hover, .dkk-spark-deck-close:hover { background: var(--dkk-secondary, #1A6B1A); color: #fff; }
.dkk-spark-deck-close { font-size: 18px; }

.dkk-spark-card-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    perspective: 1000px;
}

/* Clue card — 3D flip */
.dkk-clue-card {
    aspect-ratio: 3 / 4;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    perspective: 800px;
    font-family: inherit;
    position: relative;
}
.dkk-clue-card:disabled { cursor: default; }
.dkk-clue-card.empty { cursor: default; }

.dkk-clue-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.dkk-clue-card.revealed .dkk-clue-card-inner {
    transform: rotateY(180deg);
}

.dkk-clue-card-front,
.dkk-clue-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.10);
    border: 3px solid #fff;
    overflow: hidden;
}
.dkk-clue-card-front {
    background: linear-gradient(135deg, var(--dkk-secondary, #1A6B1A) 0%, #0E4E0E 100%);
    color: #fff;
}
.dkk-clue-card-front::after {
    content: "?";
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 16px;
    font-weight: 900;
    opacity: 0.7;
}
.dkk-clue-card-back {
    background: #fff;
    color: var(--dkk-text, #011A40);
    transform: rotateY(180deg);
    border: 3px solid var(--dkk-secondary, #1A6B1A);
    padding: 8px 6px;
}
.dkk-clue-card.empty .dkk-clue-card-front {
    background: #F5F5F5;
    color: #999;
    box-shadow: none;
}
.dkk-clue-card-emoji { font-size: 26px; line-height: 1; }
.dkk-clue-card-emoji-lg { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.dkk-clue-card-num {
    display: block;
    font-size: 11px;
    font-weight: 900;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dkk-clue-card-tap {
    display: block;
    font-size: 10px;
    font-weight: 700;
    margin-top: 3px;
    opacity: 0.85;
}
.dkk-clue-card-text {
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--dkk-text, #011A40);
    flex: 1;
    display: flex;
    align-items: center;
    text-align: center;
}
.dkk-clue-card-readby {
    display: block;
    font-size: 9px;
    font-weight: 800;
    color: var(--dkk-coral, #E87050);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dkk-clue-card:not(.revealed):hover .dkk-clue-card-front {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 5px 0 rgba(0,0,0,0.12), 0 8px 14px rgba(0,0,0,0.18);
}
.dkk-clue-card-front { transition: transform 0.2s, box-shadow 0.2s; }

/* Collapsed Spark (just the firefly + hint) */
.dkk-spark-collapsed {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.dkk-spark-collapsed-hint {
    font-size: 11px;
    font-weight: 900;
    color: var(--dkk-text, #011A40);
    background: var(--dkk-secondary, #1A6B1A);
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
    font-family: var(--dkk-fun-font, sans-serif);
    white-space: nowrap;
    animation: dkk-choices-pulse 2s ease-in-out infinite;
}

@media (max-width: 700px) {
    .dkk-a5-page { max-width: 95vw; }
    .dkk-a5-cover-hero { font-size: 32px; }
    .dkk-a5-back-text h2 { font-size: 32px; }
    .dkk-spark-deck-area { max-width: 100%; }
    /* Compact Bright Spark in the deck header, still overriding the base cap */
    .dkk-spark-deck-area .dkk-spark-body,
    .dkk-spark-deck-area .dkk-spark-body-img,
    .dkk-spark-deck-header .dkk-spark-body-img.small {
        width: 48px;
        height: 58px;
        max-width: 56px;
        max-height: 66px;
    }
    /* Clue deck becomes 2x2 on small screens so clue images stay readable */
    .dkk-spark-card-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .dkk-clue-card-num, .dkk-clue-card-tap, .dkk-clue-card-readby { display: none; }
    .dkk-spark-deck-area .dkk-clue-card-text { font-size: 9px; line-height: 1.2; }
    .dkk-clue-card-text { font-size: 9px; line-height: 1.2; }
}

/* ============================================================
   BOOK READER — "View My Book" preview (all 14 pages)
   ============================================================ */
.dkk-book-reader { max-width: 760px; margin: 0 auto; }
.dkk-reader-header { text-align: center; margin-bottom: 14px; }
.dkk-reader-header h2 { font-family: var(--dkk-fun-font, sans-serif); font-size: 28px; margin: 0 0 4px; color: var(--dkk-text, #011A40); }
.dkk-reader-header p { margin: 0; color: var(--dkk-text, #011A40); font-weight: 600; }

.dkk-reader-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}
.dkk-reader-nav {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: var(--dkk-primary, #C4162A);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(0,0,0,0.18);
    transition: transform 0.15s, opacity 0.15s;
}
.dkk-reader-nav:hover:not(:disabled) { transform: translateY(-2px); }
.dkk-reader-nav:disabled { opacity: 0.35; cursor: default; }
.dkk-reader-page { flex: 1; min-width: 0; }
.dkk-reader-page .dkk-a5-page { max-width: 520px; }
.dkk-reader-page-num {
    text-align: center;
    margin-top: 10px;
    font-weight: 800;
    color: var(--dkk-text, #011A40);
    font-size: 14px;
}
.dkk-reader-page-type {
    display: inline-block;
    margin-left: 8px;
    background: var(--dkk-secondary, #1A6B1A);
    color: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: 1px;
}

/* Cover pages in the reader */
.dkk-reader-page .dkk-a5-cover-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dkk-reader-page .dkk-a5-cover-hero {
    position: absolute;
    left: 6%;
    bottom: 6%;
    width: 38%;
    max-width: 190px;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
}
.dkk-reader-page .dkk-a5-cover-hero .dkk-character-art,
.dkk-reader-page .dkk-a5-cover-hero .dkk-character-placeholder {
    width: 100%;
    height: auto;
    display: block;
}
.dkk-reader-page .dkk-a5-cover-text h1 {
    font-size: 30px;
    font-weight: 900;
    margin: 0 0 4px;
    line-height: 1.1;
    font-family: var(--dkk-fun-font, sans-serif);
}
.dkk-reader-page .dkk-a5-cover-text p {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    opacity: 0.95;
}
.dkk-reader-page .dkk-a5-cover-text .dkk-cover-the-end { font-size: 26px; font-weight: 900; }

/* Read-only written story text */
.dkk-reader-page .dkk-lined-paper-readonly p {
    margin: 0;
    padding: 14px 16px;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 700;
    color: var(--dkk-text, #011A40);
    font-family: var(--dkk-fun-font, sans-serif);
    min-height: 100%;
    white-space: pre-wrap;
}

/* Cover thumbs in the strip */
.dkk-book-reader .dkk-page-thumb { position: relative; }
.dkk-book-reader .dkk-page-thumb.cover::after {
    content: "📕";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(255,255,255,0.65);
    border-radius: 10px;
}
.dkk-book-reader .dkk-page-thumb.cover img { opacity: 0.35; }

@media (max-width: 700px) {
    .dkk-reader-nav { width: 40px; height: 40px; font-size: 18px; }
    .dkk-reader-stage { gap: 6px; }
    .dkk-reader-page .dkk-a5-cover-text h1 { font-size: 22px; }
    .dkk-reader-page .dkk-lined-paper-readonly p { font-size: 13px; }
}




.dkk-credit-gate { max-width: 520px; margin: 0 auto; text-align: center; }
.dkk-credit-gate h2 { font-size: 2rem; }
.dkk-credit-gate .dkk-credit-gate-emoji { font-size: 3.5rem; display: block; margin-bottom: 8px; }

.dkk-credit-request-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.dkk-credit-request-card { background: #fff; border: 1px solid var(--dkk-border); border-radius: var(--dkk-radius); padding: 16px 18px; box-shadow: 0 2px 0 rgba(0,0,0,0.06); }
.dkk-credit-request-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dkk-credit-status { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 999px; }
.dkk-credit-status-pending { background: #FEF3C7; color: #92400E; }
.dkk-credit-status-approved { background: #D1FAE5; color: #065F46; }
.dkk-credit-status-denied { background: #FEE2E2; color: #991B1B; }
.dkk-credit-status-consumed { background: #E5E7EB; color: #374151; }
.dkk-credit-request-date { color: var(--dkk-muted, #888); font-size: 0.85rem; margin-top: 4px; }
.dkk-credit-request-note { margin-top: 6px; font-size: 0.9rem; }
.dkk-credit-request-actions { display: flex; gap: 10px; margin-top: 14px; }
.dkk-credit-flash { border-radius: var(--dkk-radius); padding: 10px 14px; margin-bottom: 12px; font-weight: 600; }
.dkk-credit-flash.dkk-ok { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.dkk-credit-flash.dkk-err { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.dkk-credit-empty { color: var(--dkk-muted, #888); }

/* ============================================================
   Parent account dashboard — professional view
   Scoped to WooCommerce account pages so the kids' area is untouched.
   ============================================================ */
.woocommerce-account {
    --acct-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --acct-ink: var(--dkk-acct-ink, #011A40);
    --acct-muted: var(--dkk-acct-muted, #5B6080);
    --acct-line: var(--dkk-border, #E8DFC8);
    --acct-bg: var(--dkk-acct-bg, #FFFAF0);
    --acct-card: var(--dkk-acct-card, #FFFFFF);
    --acct-navy: var(--dkk-acct-navy, #0F1E3D);
    --acct-navy-2: var(--dkk-acct-navy-2, #1B2F5B);
    --acct-accent: var(--dkk-primary, #C4162A);
}
.woocommerce-account .woocommerce,
.woocommerce-account .dkk-account-dashboard {
    font-family: var(--acct-font);
    color: var(--acct-ink);
}
/* Professional font for the whole parent account page — override the
   theme's playful Comic Neue everywhere on this page so the parent
   dashboard reads as corporate/clean, never child-like. */
.woocommerce-account,
.woocommerce-account .woocommerce,
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .dkk-account-dashboard,
.woocommerce-account .dkk-family,
.woocommerce-account h1,
.woocommerce-account h2,
.woocommerce-account h3,
.woocommerce-account h4,
.woocommerce-account p,
.woocommerce-account li,
.woocommerce-account a,
.woocommerce-account .woocommerce-MyAccount-navigation ul li a,
.woocommerce-account input,
.woocommerce-account select,
.woocommerce-account textarea,
.woocommerce-account button,
.woocommerce-account .dkk-account-btn,
.woocommerce-account .dkk-family-btn,
.woocommerce-account .dkk-family-input,
.woocommerce-account .dkk-family-select {
    font-family: var(--acct-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}
.woocommerce-account .woocommerce {
    background: var(--acct-bg);
}
.woocommerce-account .woocommerce-MyAccount-content {
    float: none;
    width: 100%;
    padding: 28px 32px;
    min-height: 480px;
    background: var(--acct-card);
    border: 1px solid var(--acct-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}
/* Account page tabs — styled, inline (horizontal) on desktop. */
.woocommerce-account .woocommerce-MyAccount-navigation {
    float: none;
    width: 100%;
    margin-bottom: 22px;
    padding: 6px;
    background: var(--acct-bg, #F1F5F9);
    border: 1px solid var(--acct-line);
    border-radius: 12px;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin: 0;
    border-bottom: 0;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 10px 18px;
    color: var(--acct-muted);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s, opacity 0.15s;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    color: var(--acct-ink);
    background: rgba(127, 127, 127, 0.10);
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    color: #fff;
    background: var(--acct-accent, #C4162A);
}

/* Hero */
.dkk-account-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--acct-card);
    border: 1px solid var(--acct-line);
    border-radius: 14px;
    padding: 28px 32px;
    margin-bottom: 22px;
    color: var(--acct-ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.dkk-account-hero-text h1 {
    margin: 2px 0 6px;
    font-size: 26px;
    font-weight: 700;
    color: var(--acct-navy);
    letter-spacing: -0.4px;
}
.dkk-account-hero-text p {
    margin: 0;
    color: var(--acct-muted);
    font-size: 14px;
}
.dkk-account-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--acct-accent);
}
.dkk-account-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dkk-account-btn {
    display: inline-flex;
    align-items: center;
    background: var(--acct-accent);
    color: #fff;
    padding: 11px 20px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}
.dkk-account-btn:hover { background: color-mix(in srgb, var(--acct-accent) 80%, #000); color: #fff; transform: translateY(-1px); }
.dkk-account-btn-secondary {
    background: var(--acct-bg, #F1F5F9);
    color: var(--acct-navy);
    border: 1px solid var(--acct-line);
}
.dkk-account-btn-secondary:hover { background: color-mix(in srgb, var(--acct-bg, #F1F5F9) 85%, #000); color: var(--acct-navy); }

/* Stat cards */
.dkk-account-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.dkk-account-stat {
    background: var(--acct-card);
    border: 1px solid var(--acct-line);
    border-radius: 12px;
    padding: 18px 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.dkk-account-stat-num {
    display: block;
    font-size: 30px;
    font-weight: 700;
    color: var(--acct-navy);
    letter-spacing: -0.5px;
}
.dkk-account-stat-label {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--acct-muted);
    font-weight: 500;
}

/* Cards */
.dkk-account-card {
    background: var(--acct-card);
    border: 1px solid var(--acct-line);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.dkk-account-card-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--acct-ink);
}
.dkk-account-card p { margin: 0; color: var(--acct-muted); font-size: 14px; line-height: 1.6; }
.dkk-account-card p a { color: var(--acct-accent); text-decoration: none; font-weight: 600; }
.dkk-account-card p a:hover { text-decoration: underline; }
.dkk-account-children {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.dkk-account-children li {
    background: var(--acct-bg, #F1F5F9);
    border: 1px solid var(--acct-line);
    color: var(--acct-ink);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
}
.dkk-account-help { border-left: 4px solid var(--acct-accent); }

/* Typography inside account endpoints */
.woocommerce-account .woocommerce-MyAccount-content h1,
.woocommerce-account .woocommerce-MyAccount-content h2,
.woocommerce-account .woocommerce-MyAccount-content h3 {
    color: var(--acct-ink);
    font-family: var(--acct-font);
    font-weight: 700;
}
.woocommerce-account .woocommerce-MyAccount-content h2 {
    font-size: 20px;
    margin: 0 0 12px;
}
.woocommerce-account .woocommerce-MyAccount-content p,
.woocommerce-account .woocommerce-MyAccount-content li {
    color: var(--acct-muted);
    font-size: 14px;
}
.woocommerce-account .woocommerce-MyAccount-content strong { color: var(--acct-ink); }
.woocommerce-account table.shop_table {
    border: 1px solid var(--acct-line);
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
}
.woocommerce-account table.shop_table th,
.woocommerce-account table.shop_table td {
    border-color: var(--acct-line);
    padding: 12px 14px;
    font-family: var(--acct-font);
}
.woocommerce-account table.shop_table th { background: var(--acct-bg, #F8FAFC); color: var(--acct-muted); font-weight: 600; }
.woocommerce-account .button {
    background: var(--acct-accent);
    color: #fff;
    border-radius: 9px;
    padding: 9px 16px;
    font-weight: 600;
    font-size: 13.5px;
}
.woocommerce-account .button:hover { background: color-mix(in srgb, var(--acct-accent) 80%, #000); color: #fff; }
.woocommerce-account .woocommerce-info,
.woocommerce-account .woocommerce-message {
    background: var(--acct-bg, #EFF6FF);
    border-top: 3px solid var(--acct-accent, #2563EB);
    color: var(--acct-ink);
    font-size: 14px;
    border-radius: 8px;
}
.woocommerce-account .woocommerce-Addresses .woocommerce-Address {
    background: var(--acct-card);
    border: 1px solid var(--acct-line);
    border-radius: 12px;
    padding: 18px 20px;
}
.woocommerce-account .woocommerce-Address h3 {
    margin: 0 0 8px;
    font-size: 15px;
}
.woocommerce-account .woocommerce-Address address { font-style: normal; color: var(--acct-muted); font-size: 14px; }

/* Book Credits tab */
.dkk-account-hero-compact { padding: 24px 28px; }
.dkk-account-section-title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
    color: var(--acct-ink);
}
.dkk-credit-pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.dkk-credit-pack-card {
    background: var(--acct-card);
    border: 1px solid var(--acct-line);
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.dkk-credit-pack-card:hover {
    transform: translateY(-3px);
    border-color: var(--acct-accent);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}
.dkk-credit-pack-creds {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--acct-navy);
}
.dkk-credit-pack-label {
    margin-top: 2px;
    font-size: 13px;
    color: var(--acct-muted);
    font-weight: 500;
}
.dkk-credit-pack-price {
    margin: 12px 0 14px;
    font-size: 18px;
    font-weight: 700;
    color: var(--acct-accent);
}
.dkk-credit-pack-card .dkk-btn { width: 100%; justify-content: center; }
.woocommerce-account .dkk-credit-pack-card .dkk-btn { padding: 11px 16px; font-size: 13.5px; }

/* Signup credit pack selector */
.dkk-pack-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--acct-card, #fff);
    border: 1.5px solid var(--acct-line, #e2e8f0);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dkk-pack-option:hover { border-color: var(--acct-accent, #C4162A); }
.dkk-pack-option.selected {
    border-color: var(--acct-accent, #C4162A);
    box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.12);
}
.dkk-pack-option input[type="radio"] { accent-color: var(--acct-accent, #C4162A); width: 18px; height: 18px; }
.dkk-pack-option-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dkk-pack-option-title { font-size: 15px; color: var(--acct-navy, #011A40); }
.dkk-pack-option-meta { font-size: 13px; color: var(--acct-muted, #5B6080); }
.dkk-pack-option-price { font-size: 16px; font-weight: 700; color: var(--acct-accent, #C4162A); white-space: nowrap; }

/* Family & Profiles app */
.dkk-family-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 20px;
    align-items: start;
}
.dkk-family-card {
    background: var(--acct-card);
    border: 1px solid var(--acct-line);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.dkk-family-card-title {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 700;
    color: var(--acct-ink);
}
.dkk-family-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.dkk-family-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--acct-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #EDEFF7;
}
.dkk-family-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dkk-family-avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dkk-family-field { display: block; margin-bottom: 14px; }
.dkk-family-field > span {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--acct-muted);
    margin-bottom: 6px;
}
.dkk-family-input,
.dkk-family-select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--acct-line);
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--acct-font);
    color: var(--acct-ink);
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dkk-family-input:focus,
.dkk-family-select:focus {
    border-color: var(--acct-accent);
    box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.15);
}
.dkk-family-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--acct-line);
    background: #fff;
    color: var(--acct-ink);
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--acct-font);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dkk-family-btn:hover { border-color: var(--acct-accent); color: var(--acct-accent); }
.dkk-family-btn-primary { background: var(--acct-accent); border-color: var(--acct-accent); color: #fff; }
.dkk-family-btn-primary:hover { background: color-mix(in srgb, var(--dkk-primary, #C4162A) 80%, #000); color: #fff; }
.dkk-family-btn-ghost { background: transparent; }
.dkk-family-btn-danger { color: #DC2626; border-color: #FECACA; }
.dkk-family-btn-danger:hover { background: #FEF2F2; color: #B91C1C; border-color: #FCA5A5; }
.dkk-family-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.dkk-family-child-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.dkk-family-child-card {
    background: var(--acct-card);
    border: 1px solid var(--acct-line);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.dkk-family-child-name { margin: 10px 0 2px; font-size: 15px; font-weight: 700; color: var(--acct-ink); }
.dkk-family-child-age { margin: 0 0 12px; font-size: 13px; color: var(--acct-muted); }
.dkk-family-child-actions { display: flex; gap: 8px; justify-content: center; }
.dkk-family-empty {
    border: 1.5px dashed var(--acct-line);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    color: var(--acct-muted);
    font-size: 14px;
}
.dkk-family-msg {
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 13.5px;
    margin: 0 0 14px;
}
.dkk-family-msg-ok { background: #ECFDF5; border: 1px solid #A7F3D0; color: #047857; }
.dkk-family-msg-err { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; }
.dkk-family-sep { border: 0; border-top: 1px solid var(--acct-line); margin: 20px 0; }

@media (max-width: 900px) {
    .dkk-family-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .woocommerce-account .woocommerce-MyAccount-content { padding: 18px; }
    .dkk-account-hero { padding: 22px 20px; }
    .dkk-credit-pack-grid { grid-template-columns: 1fr; }
}

/* ---------- Write Your Own Book (custom writer — one page at a time) ---------- */

.dkk-custom-writer {
    max-width: 860px;
    margin: 0 auto;
}

.dkk-custom-writer.dkk-book-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dkk-custom-title-row {
    background: #fff;
    border: 1.5px solid var(--dkk-border, #E2E8F0);
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.dkk-custom-label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--dkk-text, #0F172A);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.dkk-custom-title-row .dkk-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 10px;
    border: 2px solid var(--dkk-border, #E2E8F0);
    background: var(--dkk-bg, #FFFAF0);
    color: var(--dkk-text, #0F172A);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dkk-custom-title-row .dkk-input:focus {
    outline: none;
    border-color: var(--dkk-primary, #C4162A);
    box-shadow: 0 0 0 3px rgba(196, 22, 42, 0.12);
}

.dkk-custom-title-row .dkk-input::placeholder {
    color: var(--dkk-text-muted, #5B6080);
    font-weight: 400;
}

/* Page head badge inside the writing card */
.dkk-custom-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--dkk-primary, #C4162A), var(--dkk-primary-dark, #9A1020));
    border-radius: 12px 12px 0 0;
}

.dkk-custom-page-num {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
}

.dkk-custom-page-done {
    font-size: 12px;
    font-weight: 700;
    color: #047857;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    padding: 2px 10px;
    border-radius: 999px;
    animation: dkk-badge-pop 0.3s ease;
}

@keyframes dkk-badge-pop {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* The writing card (no scene image — just a clean writing canvas) */
.dkk-custom-writer .dkk-a5-story {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.dkk-custom-writer .dkk-a5-story .dkk-a5-page-inner {
    background: #fff;
    border-radius: 12px;
    border: 1.5px solid var(--dkk-border, #E2E8F0);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.dkk-custom-writer .dkk-a5-story .dkk-a5-page-inner:focus-within {
    box-shadow: 0 4px 16px rgba(196, 22, 42, 0.1), 0 0 0 2px rgba(196, 22, 42, 0.15);
}

.dkk-custom-writer .dkk-a5-writing {
    padding: 0;
}

.dkk-custom-writer .dkk-a5-writing .dkk-lined-paper {
    border: none;
    border-radius: 0;
}

.dkk-custom-writer .dkk-a5-writing .dkk-lined-paper textarea {
    min-height: 220px;
    font-size: 16px;
    line-height: 1.7;
    padding: 20px 24px;
    color: var(--dkk-text, #0F172A);
    resize: none;
}

.dkk-custom-writer .dkk-a5-writing .dkk-lined-paper textarea::placeholder {
    color: var(--dkk-text-muted, #5B6080);
    font-style: italic;
    font-size: 15px;
}

/* Preview mode */
.dkk-custom-preview {
    background: #fff;
    border: 1.5px solid var(--dkk-border, #E2E8F0);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.dkk-custom-preview h2 {
    margin: 0 0 20px;
    text-align: center;
    font-size: 22px;
    color: var(--dkk-text, #0F172A);
}

.dkk-custom-preview-page {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--dkk-border, #E2E8F0);
}

.dkk-custom-preview-page:last-child {
    border-bottom: 0;
}

.dkk-custom-preview-page-num {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dkk-primary, #C4162A);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.dkk-custom-preview-page p {
    margin: 4px 0 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--dkk-text, #0F172A);
}

/* ==========================================================================
   RESPONSIVE — MOBILE FIXES
   ========================================================================== */

@media (max-width: 640px) {
    /* Auth row stacks to single column */
    .dkk-auth-row {
        grid-template-columns: 1fr;
    }

    /* Legacy login/register forms stack */
    .dkk-login-forms {
        grid-template-columns: 1fr;
    }

    /* Activity badges wrap */
    .dkk-activity-meta {
        flex-wrap: wrap;
    }

    .dkk-activity-rewards {
        flex-wrap: wrap;
    }

    /* Variant cards shrink on mobile */
    .dkk-variant-card {
        width: 44%;
        min-width: 0;
    }

    /* Dashboard hero title */
    .dkk-cd-hero-title {
        font-size: 26px;
    }

    /* Page title */
    .dkk-page-title {
        font-size: 22px;
    }

    /* Auth form wider on mobile */
    .dkk-auth-card {
        max-width: 100%;
        margin-left: 12px;
        margin-right: 12px;
    }

    /* Auth tabs font smaller */
    .dkk-auth-tab {
        font-size: 0.9rem;
        padding: 0.6rem 0.5rem;
    }

    /* Gallery hero — title and padding */
    .dkk-gallery-hero-title {
        font-size: 28px;
    }

    .dkk-gallery-hero {
        padding: 20px 16px 24px;
        border-radius: 22px;
    }

    /* Theme cover emoji smaller */
    .dkk-theme-cover-emoji {
        font-size: 72px;
    }

    /* Big CTA button smaller */
    .dkk-btn-big {
        font-size: 18px;
        padding: 14px 28px;
    }

    /* Spark speech bubble fits mobile */
    .dkk-spark-speech {
        max-width: 90vw;
        font-size: 14px;
        padding: 12px 14px;
    }

    /* Scene progress bar tighter */
    .dkk-scene-progress {
        padding: 8px 10px;
        gap: 8px;
    }

    .dkk-progress-label {
        font-size: 13px;
        padding: 3px 10px;
    }

    /* Child dashboard hero spark — remove min-width */
    .dkk-cd-hero-spark {
        min-width: 0;
        flex-basis: 100%;
    }

    /* Account nav — stack tabs vertically on mobile */
    .woocommerce-account .woocommerce-MyAccount-navigation ul {
        flex-direction: column;
        align-items: stretch;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li {
        width: 100%;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li a {
        display: flex;
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        font-size: 14px;
        white-space: normal;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        padding: 6px;
    }

    /* Account hero tighter */
    .dkk-account-hero {
        gap: 14px;
        padding: 20px 16px;
    }

    /* Stat cards — keep modern auto-fit grid; tighten gap/padding on mobile */
    .dkk-account-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    .woocommerce-account table.shop_table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Custom writer textarea tighter */
    .dkk-custom-writer .dkk-a5-writing .dkk-lined-paper textarea {
        padding: 14px 16px;
        min-height: 180px;
    }
}
