/* style.css – super simple, bright, big UI for 3-year-old kids */

:root {
    --bg: #fff7f0;
    --panel: #ffffff;
    --border: #ffd9b5;
    --accent: #ffb84d;
    --accent-strong: #ff6b81;
    --blue: #4cc3ff;
    --green: #71e38f;
    --shadow-soft: 0 10px 24px rgba(255, 163, 102, 0.35);
    --radius-big: 30px;
    --radius-med: 24px;
    --text-main: #ff6b3d;
    --text-soft: #ff9b3d;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body.app-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 0 0, #ffe3e3, transparent 55%),
        radial-gradient(circle at 100% 0, #e1f3ff, transparent 55%),
        radial-gradient(circle at 0 100%, #ffecc7, transparent 50%),
        #fff7f0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Rounded", "Segoe UI", sans-serif;
    color: var(--text-main);
}

/* TOP BAR */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #fff5e8;
    border-bottom: 3px solid #ffd7b2;
    box-shadow: 0 6px 16px rgba(255, 180, 120, 0.4);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, #fff, #ffe6f1 55%),
        radial-gradient(circle at 75% 70%, #ffe45e, #ffb84d 80%);
    box-shadow: 0 8px 18px rgba(255, 153, 102, 0.7);
    position: relative;
}

.brand-logo::before {
    content: "🎨";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #ff6b3d;
}

/* top-right */

.top-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-pill {
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 999px;
    background: #e0ffe6;
    border: 2px solid #71e38f;
    color: #298f52;
}

.btn {
    border-radius: 999px;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.07s ease, box-shadow 0.07s ease, background 0.07s ease;
}

.btn.small {
    font-size: 0.85rem;
    padding: 6px 14px;
}

.btn.ghost {
    background: #ffffff;
    color: #ff6b3d;
    border: 2px solid #ffc9a3;
    box-shadow: 0 4px 10px rgba(255, 163, 120, 0.5);
}

.btn.primary {
    background: linear-gradient(135deg, #ffb84d, #ff6b81);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(255, 138, 101, 0.7);
}

.btn.wide {
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(255, 163, 120, 0.7);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(255, 163, 120, 0.8);
}

/* LAYOUT */

.layout {
    display: grid;
    grid-template-columns: 22% minmax(0, 56%) 22%;
    gap: 18px;
    padding: 16px 16px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* PANELS */

.panel {
    background: var(--panel);
    border-radius: var(--radius-big);
    border: 3px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-title-big {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
}

/* LEFT: THUMB GRID */

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding-right: 4px;
}

.thumb-grid::-webkit-scrollbar {
    width: 8px;
}
.thumb-grid::-webkit-scrollbar-thumb {
    background: #ffd7b2;
    border-radius: 999px;
}

.thumb-item {
    border: none;
    padding: 0;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    background: #fff2dd;
    box-shadow: 0 6px 14px rgba(255, 180, 120, 0.7);
    height: 110px;
    position: relative;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.thumb-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 153, 102, 0.8);
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: radial-gradient(circle at 40% 20%, #ffffff, #ffeeda 70%);
}

.thumb-lock {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffcfdf;
    border: 2px solid #ffa2c4;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CENTER: CANVAS + TOOLS */

.panel-center {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.banner {
    width: 100%;
    text-align: center;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 0.95rem;
}
.banner-error {
    background: #ffe3e3;
    border: 2px solid #ff9b9b;
    color: #d94848;
}

.canvas-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.round-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #ffd7b2;
    background: #fff;
    color: #ff6b3d;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(255, 180, 120, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}
.round-btn.small {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
}

.round-btn:active {
    transform: translateY(1px);
    box-shadow: 0 3px 8px rgba(255, 180, 120, 0.8);
}

/* canvas area */

.canvas-shell {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-radius: var(--radius-big);
    background:
        radial-gradient(circle at 0 0, #ffe9e9, transparent 55%),
        radial-gradient(circle at 100% 100%, #e3f9ff, transparent 55%),
        #fff;
    border: 3px dashed #ffd9b5;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-wrapper {
    transform-origin: center center;
    transition: transform 0.12s ease-out;
}

canvas {
    background:
        radial-gradient(circle at 30% 15%, #ffffff, #fff5e4 70%);
    border-radius: 32px;
    border: 4px solid #ffd7b2;
    box-shadow: 0 18px 40px rgba(255, 163, 120, 0.9);
    max-width: 100%;
    image-rendering: pixelated;
}

/* tools */

.tools-row {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: center;
}

.main-tools {
    margin-top: 4px;
}

.tool-btn {
    border-radius: 30px;
    border: 3px solid #ffd9b5;
    background: #fff8ea;
    cursor: pointer;
    padding: 10px 12px;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 8px 18px rgba(255, 180, 120, 0.7);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}
.tool-btn.big {
    min-width: 110px;
    padding: 12px 14px;
}

.tool-btn .tool-icon {
    font-size: 2.1rem;
}
.tool-btn .tool-text {
    font-size: 1.0rem;
    font-weight: 700;
    color: #ff7b4d;
}

.tool-btn.active {
    background: linear-gradient(135deg, #ffecb3, #ffd1dc);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(255, 153, 102, 0.9);
}

.size-row {
    margin-top: 2px;
}

.label-big {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff7b4d;
}

/* big range */

.size-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 50%;
    height: 8px;
    border-radius: 999px;
    background: #ffe1c7;
    outline: none;
}
.size-row input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffb84d;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 184, 77, 0.5);
}

/* palette */

.palette {
    margin-top: 6px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.color-dot {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid #fff7f0;
    box-shadow: 0 6px 18px rgba(255, 140, 114, 0.7);
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.color-dot.active {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 10px 24px rgba(255, 140, 114, 0.9);
}

/* RIGHT: IDEAS */

.panel-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.preview-container {
    flex: 1;
    min-height: 0;
    border-radius: 24px;
    background: #fffaf2;
    border: 2px dashed #ffd9b5;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
}

.preview-container::-webkit-scrollbar {
    width: 8px;
}
.preview-container::-webkit-scrollbar-thumb {
    background: #ffd7b2;
    border-radius: 999px;
}

.preview-thumb {
    width: 100%;
    border-radius: 20px;
    border: 3px solid #ffd7b2;
    box-shadow: 0 8px 18px rgba(255, 163, 120, 0.8);
}

.preview-empty {
    font-size: 1.0rem;
    color: var(--text-soft);
    text-align: center;
    padding-top: 30px;
}

.export-btn {
    margin-top: 4px;
    font-size: 1.1rem;
}

/* FOOTER (not used heavily, keep tiny) */

.footer {
    text-align: center;
    padding: 8px 0 14px;
    font-size: 0.8rem;
    color: #ff9b3d;
}

/* RESPONSIVE */

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 25% minmax(0, 75%);
        grid-template-rows: auto auto;
    }
    .panel-right {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .thumb-grid {
        max-height: 220px;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .panel {
        padding: 14px;
    }
    .main-tools {
        flex-wrap: wrap;
    }
    .tool-btn.big {
        flex: 1 1 45%;
    }
    .canvas-shell {
        padding: 10px;
    }
}
