:root {
    --primary: #FF6B35;
    --secondary: #4ECDC4;
    --accent: #FFE066;
    --dark: #2D3142;
    --bg: #FFF9F0;
    --radius: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--dark);
}

/* ---------- Ecran selectare limbă ---------- */
.lang-select-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: linear-gradient(160deg, var(--secondary), var(--primary));
    color: white;
}
.lang-select-screen h1 { font-size: 64px; margin: 0; }
.lang-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
    width: 100%;
    max-width: 320px;
}
.lang-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: var(--dark);
    text-decoration: none;
    padding: 16px 20px;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.flag { font-size: 28px; }

/* ---------- Header / Nav ---------- */
.app-header {
    background: var(--primary);
    color: white;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 10;
}
.logo { color: white; text-decoration: none; font-weight: 700; font-size: 18px; }
.main-nav a {
    color: white;
    text-decoration: none;
    margin-left: 14px;
    font-weight: 600;
    font-size: 14px;
}
.app-main { padding: 16px; max-width: 800px; margin: 0 auto; }
.app-footer { text-align: center; padding: 20px; color: #999; font-size: 13px; }

/* ---------- Grile ---------- */
.page-title { font-size: 24px; margin-bottom: 16px; }
.episode-grid, .coloring-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.episode-card, .coloring-card, .product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform .15s ease;
}
.episode-card:active, .product-card:active { transform: scale(0.97); }
.episode-card img, .coloring-card img, .product-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}
.episode-card-title, .product-card-title {
    padding: 10px;
    font-weight: 600;
    font-size: 14px;
}

/* ---------- Pagina episod ---------- */
.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius);
    overflow: hidden;
    background: black;
}
.video-wrapper iframe { width: 100%; height: 100%; border: 0; }
.episode-title { font-size: 22px; margin: 16px 0 4px; }
.avg-rating { color: #888; font-size: 14px; margin-bottom: 10px; }
.episode-description { line-height: 1.6; }

/* ---------- Formular recenzie ---------- */
.review-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    margin: 16px 0;
}
.review-form input, .review-form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}
.star-select { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-select input { display: none; }
.star-select label {
    font-size: 28px;
    color: #ddd;
    cursor: pointer;
}
.star-select input:checked ~ label,
.star-select label:hover,
.star-select label:hover ~ label { color: var(--accent); }
.review-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}
.success-msg { color: #2e7d32; font-weight: 600; }
.error-msg { color: #c62828; font-weight: 600; }
.review-item {
    background: white;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
}
.review-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.review-stars { color: var(--accent); }
.empty-state { color: #999; text-align: center; padding: 40px 0; }

/* ---------- Toolbar desen ---------- */
.draw-toolbar {
    background: white;
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 10px;
    position: sticky;
    top: 62px;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.color-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    align-items: center;
}
.swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    padding: 0;
}
.swatch.active { border-color: var(--dark); transform: scale(1.1); }
#customColor {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    padding: 0;
    background: none;
    cursor: pointer;
}
.tool-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.brush-sizes { display: flex; gap: 4px; }
.brush-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}
.brush-btn.active { border-color: var(--primary); background: #FFF3EC; }
.tool-btn {
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.tool-btn.active { border-color: var(--primary); background: #FFF3EC; }
.tool-btn-primary { background: var(--secondary); color: white; border-color: var(--secondary); }

.canvas-wrapper {
    background: white;
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.canvas-scroll {
    overflow: auto;
    max-height: 65vh;
    border-radius: 8px;
    background: #f0f0f0;
}
.canvas-stack {
    position: relative;
}
#baseCanvas, #drawCanvas {
    display: block;
    border-radius: 8px;
}
#baseCanvas {
    position: relative;
    z-index: 1;
}
#drawCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    touch-action: none;
    cursor: crosshair;
}

/* ---------- Zoom ---------- */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.zoom-label {
    font-weight: 700;
    font-size: 14px;
    min-width: 46px;
    text-align: center;
}

/* ---------- Produse ---------- */
.product-price {
    color: var(--primary);
    font-weight: 700;
    margin-top: 2px;
}
