/* css/cocuk.css: çocuk köşesi (tablet odaklı). Satır içi stil yok; tüm görünüm bu dosyada. */
:root {
    --bg1: #8fd3ff; --bg2: #e6f7ff;
    --ink: #24324a; --panel: #ffffffee; --shadow: 0 6px 0 rgba(36, 50, 74, .18);
    --blue: #3b82f6; --green: #22c55e; --orange: #fb923c; --pink: #f472b6; --yellow: #facc15; --purple: #a78bfa;
    --board: min(88vw, 60vh, 740px);
    --pal: min(15vmin, 92px);
    --top: 76px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
    touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
    background: linear-gradient(180deg, var(--bg1), var(--bg2)); color: var(--ink);
    font-family: "Trebuchet MS", "Comic Sans MS", "Segoe UI", system-ui, sans-serif; font-weight: 800;
}
.hidden { display: none !important; }
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; }

.app {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100vh; height: 100dvh;
    display: flex; flex-direction: column;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Üst çubuk */
.topbar { flex: 0 0 var(--top); display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 10px; }
.title { margin: 0; font-size: clamp(26px, 5.2vmin, 44px); letter-spacing: .5px; text-align: center; flex: 1; }
.top-right { display: flex; align-items: center; gap: 10px; }
.stars { background: var(--panel); border-radius: 999px; padding: 8px 16px; font-size: 24px; box-shadow: var(--shadow); white-space: nowrap; }
.btn-round {
    width: 58px; height: 58px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); font-size: 30px;
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); cursor: pointer;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; touch-action: manipulation;
}
.btn-round:active, .big-btn:active, .opt:active, .tool:active, .tile:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(36, 50, 74, .18); }

/* Ana sayfa */
.home { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px 18px 24px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 3vmin, 30px); width: min(100%, 980px); }
.tile {
    position: relative; background: #fff; border-radius: 28px; box-shadow: var(--shadow); padding: 18px 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--ink);
    min-height: min(34vh, 34vw); touch-action: manipulation;
}
.tile .pic { font-size: clamp(64px, 14vmin, 130px); line-height: 1.05; }
.tile .name { font-size: clamp(26px, 5.4vmin, 46px); }
.tile.t-sudoku { background: #fff1b8; } .tile.t-color { background: #ffd6e7; } .tile.t-video { background: #cfe8ff; } .tile.t-puzzle { background: #d9f7d0; }
.tile.soon { filter: grayscale(.55); opacity: .75; pointer-events: none; }
.tile .ribbon { position: absolute; top: 14px; right: -8px; background: var(--orange); color: #fff; padding: 4px 16px; border-radius: 8px 0 0 8px; font-size: 18px; box-shadow: var(--shadow); }

/* Genel paneller ve düğmeler */
.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2.4vmin, 24px); padding: 8px 16px 20px; overflow: auto; }
.card { background: var(--panel); border-radius: 28px; padding: clamp(14px, 3vmin, 28px); box-shadow: var(--shadow); width: min(100%, 720px); display: flex; flex-direction: column; gap: clamp(10px, 2vmin, 20px); }
.row-label { font-size: clamp(20px, 3.6vmin, 30px); margin: 0; text-align: center; }
.row { display: flex; gap: clamp(8px, 2vmin, 18px); justify-content: center; flex-wrap: wrap; }
.opt {
    min-width: clamp(84px, 18vmin, 150px); min-height: clamp(64px, 11vmin, 92px); border-radius: 22px; border: 4px solid transparent;
    background: #fff; box-shadow: var(--shadow); font-size: clamp(26px, 5vmin, 40px); color: var(--ink); cursor: pointer; padding: 6px 14px;
    font-family: "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-weight: 800; touch-action: manipulation;
}
.opt.on { border-color: var(--blue); background: #e0edff; }
.big-btn {
    min-height: clamp(70px, 12vmin, 100px); padding: 8px clamp(24px, 6vmin, 54px); border-radius: 999px; border: 0; background: var(--green); color: #fff;
    font-size: clamp(28px, 6vmin, 46px); box-shadow: 0 6px 0 #15803d; cursor: pointer; font-family: inherit; font-weight: 800; touch-action: manipulation;
}
.big-btn.alt { background: var(--blue); box-shadow: 0 6px 0 #1d4ed8; }

/* Sudoku */
.game { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vmin, 34px); padding: 6px 12px 16px; flex-direction: column; }
@media (orientation: landscape) {
    :root { --board: min(68vh, 52vw, 680px); }
    .game { flex-direction: row; }
}
.board {
    --n: 4; width: var(--board); height: var(--board); display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr);
    gap: 0; background: #1e3a5f; border: 6px solid #1e3a5f; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); touch-action: manipulation;
}
.cell {
    background: #fff; display: flex; align-items: center; justify-content: center; border: 1px solid #cfd8e6; cursor: pointer;
    font-size: calc(var(--board) / var(--n) * .58); line-height: 1; position: relative; touch-action: manipulation;
    font-family: "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-weight: 800;
}
.cell.emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cell.given { background: #fff4c2; }
.cell.hl { background: #e8f3ff; }
.cell.given.hl { background: #fdeba6; }
.cell.same { background: #c9f4d4; }
.cell.sel { background: #ffe08a; outline: 5px solid var(--orange); outline-offset: -5px; z-index: 1; }
.cell.bl { border-left: 4px solid #1e3a5f; } .cell.bt { border-top: 4px solid #1e3a5f; }
.cell.shake { animation: shake .45s; }
.cell.pop { animation: pop .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes pop { 0% { transform: scale(.3); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

.side { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vmin, 20px); }
.palette { display: flex; gap: clamp(8px, 1.8vmin, 16px); flex-wrap: wrap; justify-content: center; max-width: var(--board); }
@media (orientation: landscape) { .palette { max-width: min(40vw, 470px); } }
.sym {
    width: var(--pal); height: var(--pal); border-radius: 22px; border: 4px solid transparent; background: #fff; box-shadow: var(--shadow); cursor: pointer; padding: 0;
    font-size: calc(var(--pal) * .62); line-height: 1; display: flex; align-items: center; justify-content: center; color: var(--ink); touch-action: manipulation;
    font-family: "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-weight: 800;
}
.sym.emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.sym.on { border-color: var(--orange); background: #fff0d8; transform: scale(1.08); }
.tools { display: flex; gap: clamp(8px, 1.8vmin, 16px); justify-content: center; }
.tool {
    width: calc(var(--pal) * .9); height: calc(var(--pal) * .9); border-radius: 50%; border: 0; background: var(--purple); box-shadow: 0 5px 0 #6d4fd8; cursor: pointer;
    font-size: calc(var(--pal) * .5); display: flex; align-items: center; justify-content: center; color: #fff; touch-action: manipulation;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Kutlama penceresi */
.overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(20, 40, 80, .55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.win { background: #fff; border-radius: 34px; padding: clamp(18px, 4vmin, 40px); text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: clamp(10px, 2.4vmin, 22px); align-items: center; max-width: 560px; }
.win .big { font-size: clamp(60px, 16vmin, 120px); line-height: 1; }
.win h2 { margin: 0; font-size: clamp(30px, 7vmin, 54px); }
.confetti { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti span { position: absolute; top: -60px; animation: fall 3.2s linear forwards; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
@keyframes fall { to { transform: translateY(115vh) rotate(360deg); opacity: .9; } }

/* Boyama */
.paint { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 12px 12px; }
.canvas-wrap { flex: 1; min-height: 0; width: min(100%, 1100px); display: flex; align-items: center; justify-content: center; }
.art { width: 100%; height: 100%; display: block; touch-action: manipulation; filter: drop-shadow(0 6px 0 rgba(36, 50, 74, .2)); }
.art .r { cursor: pointer; }
.palette-c { display: flex; flex-wrap: wrap; gap: clamp(6px, 1.4vmin, 14px); justify-content: center; max-width: 1100px; }
.sw {
    --c: #fff; width: min(11vmin, 72px); height: min(11vmin, 72px); border-radius: 50%; border: 5px solid #fff; background: var(--c); box-shadow: 0 4px 0 rgba(36, 50, 74, .35); cursor: pointer; padding: 0; touch-action: manipulation;
}
.sw.on { border-color: var(--ink); transform: scale(1.15); }
.paint-tools { display: flex; align-items: center; gap: clamp(8px, 2vmin, 18px); justify-content: center; }
.paint-tools .tool { background: var(--blue); box-shadow: 0 5px 0 #1d4ed8; }
.paint-tools .tool.warn { background: var(--orange); box-shadow: 0 5px 0 #c2570c; }
.dots { display: flex; gap: 8px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; opacity: .6; }
.dot.on { background: var(--blue); opacity: 1; }

@media (max-height: 560px) { :root { --top: 60px; } .btn-round { width: 48px; height: 48px; font-size: 24px; } .stars { font-size: 20px; padding: 4px 12px; } }

/* Boyama resimleri (SVG) */
.art .r { stroke: #24324a; stroke-width: 6; stroke-linejoin: round; }
.art .r.bg { stroke: none; }
.art .n { fill: none; stroke: #24324a; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.art .d { fill: #24324a; stroke: none; pointer-events: none; }

@media (orientation: portrait) { .palette-c { max-width: 560px; } }
