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

:root {
    --brand-blue: #2d6cdf;
    --brand-blue-dark: #1f58c5;
    --brand-purple: #a855f7;
    --brand-yellow: #fbbf24;
    --brand-green: #34d399;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --shadow-soft: 0 18px 40px rgba(46, 82, 102, 0.12);
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-pill: 999px;
}

body {
    font-family: 'Nunito', Arial, sans-serif;
    background: linear-gradient(180deg, #e6f2ff 0%, #f7fbff 100%);
    color: var(--text-primary);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 1 auto;
}

.brand-heading {
    font-family: 'Fredoka', 'Nunito', Arial, sans-serif;
    font-weight: 600;
}

.app-shell {
    background: var(--surface);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
    padding: 40px;
    margin-top: 40px;
    margin-bottom: 40px;
}

@media (max-width: 767.98px) {
    .app-shell {
        padding: 24px;
        border-radius: 20px;
    }
}

.pill-nav {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
    gap: 0.5rem;
}

.pill-nav .nav-link {
    border-radius: var(--radius-pill);
    padding: 0.35rem 1.4rem;
    font-weight: 600;
    color: var(--brand-blue);
    background: rgba(45, 108, 223, 0.08);
    margin: 0;
    transition: all 0.2s ease;
}

.pill-nav .nav-link:hover,
.pill-nav .nav-link:focus,
.pill-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
}

@media (min-width: 992px) {
    .pill-nav {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }
}

.hero-title {
    font-family: 'Fredoka', 'Nunito', Arial, sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 3vw, 2.6rem);
    color: var(--brand-blue-dark);
}

.subheading {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.card-pack,
.card-page {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 26px rgba(60, 102, 128, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-pack:hover,
.card-page:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 36px rgba(60, 102, 128, 0.14);
}

.card-pack img,
.card-page img {
    border-radius: var(--radius-md);
}

.pack-hero {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.pack-hero-wrapper .pack-hero {
    height: auto;
    max-height: 340px;
}

.hero-preview {
    max-height: 180px;
    object-fit: cover;
}

.btn-primary,
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    border: none;
    border-radius: var(--radius-pill);
    font-family: 'Fredoka', 'Nunito', Arial, sans-serif;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    box-shadow: 0 10px 22px rgba(45, 108, 223, 0.35);
    padding: 0.55rem 1.8rem;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #255ac6 0%, #1a4aa8 100%);
}

.btn-outline-primary {
    border-radius: var(--radius-pill);
    font-weight: 600;
    color: var(--brand-blue);
    border: 2px solid rgba(45, 108, 223, 0.4);
    padding: 0.5rem 1.6rem;
}

.badge-freemium {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-pill);
    background: rgba(168, 85, 247, 0.15);
    color: var(--brand-purple);
    font-weight: 600;
    font-size: 0.85rem;
}

.badge-freemium .lock-icon {
    font-size: 0.95rem;
}

.ad-banner {
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 0.95rem;
    font-weight: 600;
    font-family: 'Fredoka', 'Nunito', Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.ad-footer-bar {
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffa94d 0%, #ff7f0a 100%);
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-weight: 600;
    font-family: 'Fredoka', 'Nunito', Arial, sans-serif;
    margin-top: 2rem;
}

.ad-placeholder {
    background: rgba(226, 232, 240, 0.6);
    border-radius: var(--radius-lg);
    border: 2px dashed rgba(148, 163, 184, 0.6);
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.color-palette {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.coloring-stage {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.canvas-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 0.75rem;
}

.panel-title {
    margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .panel-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.canvas-wrapper {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-wrapper canvas {
    width: 100%;
    height: auto;
    max-width: 640px;
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.palette-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.used-colors {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.used-colors-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.used-colors-list {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    min-height: 32px;
    flex-wrap: wrap;
}

.used-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.used-colors-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.used-colors.is-empty .used-colors-label {
    opacity: 0.7;
}

.color-swatch {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-swatch:hover,
.color-swatch:focus {
    transform: translateY(-2px);
}

.tool-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.4rem 0.5rem;
    background: rgba(148, 163, 184, 0.08);
    border-radius: 999px;
}

.tool-button {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 8px 18px rgba(30, 64, 175, 0.18);
    color: var(--brand-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

.tool-button .tool-icon,
.tool-button i {
    display: inline-block;
    font-size: 1.35rem;
    line-height: 1;
}

.tool-button:hover,
.tool-button:focus {
    transform: translateY(-2px);
}

.tool-button.active,
.color-swatch.active {
    box-shadow: 0 0 0 4px rgba(45, 108, 223, 0.18), 0 10px 20px rgba(30, 64, 175, 0.18);
    transform: translateY(-2px);
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-left,
.action-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.action-right {
    margin-left: auto;
}

.interstitial-modal {
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    border: none;
}

.interstitial-modal .modal-header {
    border-bottom: none;
}

.interstitial-modal .modal-footer {
    border-top: none;
}

.footer-links a {
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 0.75rem;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--brand-blue);
}
