/* Patika - stil. Sicak kagit/guaj hissi: krem, orman yesili, mercan, gunes sarisi. Mantiksal ozellikler (RTL uyumlu). */
@font-face { font-family: "Baloo Bhai"; src: url("../fonts/BalooBhai-Regular.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: block; }
@font-face { font-family: "Nunito Cyr"; src: url("../fonts/Nunito-800-cyrillic.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: block; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
:root {
  --ink: #3a2b4a; --ink2: #6a5a7a; --paper: #fffaf0; --card: #fffdf6; --line: #eadfc8;
  --green: #52ae6c; --green-d: #2f7f4f; --coral: #ef6f5e; --coral-d: #c4483a; --sun: #f6c445; --sun-d: #d99f1a; --sky: #5aa3dc; --sky-d: #2f74ad;
  --tap: 56px; --r: 18px;
  --font: "Baloo Bhai", "Nunito Cyr", "Trebuchet MS", system-ui, -apple-system, "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans JP", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfeee6; color: var(--ink); font-family: var(--font); font-weight: 600; -webkit-user-select: none; user-select: none; overscroll-behavior: none; touch-action: manipulation; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#bg { position: absolute; inset: 0; z-index: 0; }
#bg canvas { display: block; }
#screens { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.screen { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding-inline: 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.screen.enter { animation: scrIn .22s ease-out; }
@keyframes scrIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
button { font-family: inherit; font-weight: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; }
.ic { width: 1.5em; height: 1.5em; display: block; flex: none; }
.ic.sm { width: 1.1em; height: 1.1em; } .ic.gold { color: var(--sun); filter: drop-shadow(0 1px 0 rgba(150,100,0,.35)); }
.icw { display: inline-flex; }

/* ust cubuk */
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 0 6px; min-height: 64px; }
.topbar .ttl { flex: 1; margin: 0; text-align: center; font-size: 1.45rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.topbar .sp { flex: 1; }
.iconbtn { width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; background: var(--card); color: var(--ink); display: grid; place-items: center; box-shadow: 0 3px 0 var(--line), 0 6px 12px rgba(60,40,80,.12); border: 2px solid #fff; }
.iconbtn.ghost { visibility: hidden; box-shadow: none; }
.iconbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 2px solid #fff; box-shadow: 0 3px 0 var(--line); font-size: 1.15rem; font-weight: 800; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 2px 18px; -webkit-overflow-scrolling: touch; }

/* dugmeler */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--tap); padding: 8px 22px; border-radius: 20px; font-size: 1.2rem; font-weight: 800; background: var(--card); color: var(--ink); border: 2px solid #fff; box-shadow: 0 4px 0 var(--line), 0 8px 14px rgba(60,40,80,.12); max-width: 100%; text-align: center; line-height: 1.1; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn .bl { min-width: 0; overflow-wrap: anywhere; }
.btn.primary { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-d), 0 8px 14px rgba(40,100,60,.25); text-shadow: 0 1px 0 rgba(0,0,0,.18); }
.btn.primary:active { box-shadow: 0 1px 0 var(--green-d); }
.btn.accent { background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-d), 0 8px 14px rgba(180,60,50,.25); text-shadow: 0 1px 0 rgba(0,0,0,.18); }
.btn.sec { background: #fff; } .btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink2); }
.btn.danger { background: #fff; color: var(--coral-d); }
.btn.big { min-height: 76px; font-size: 1.5rem; border-radius: 26px; width: 100%; }
.btn .b1 { display: block; font-size: 1.55rem; } .btn .b2 { display: block; font-size: 1rem; opacity: .9; font-weight: 600; }
.btn.big .bl { text-align: start; }
.linkbtn { max-width: 100%; text-align: center; flex: 0 1 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; color: var(--ink2); font-size: 1rem; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(90,70,110,.3); text-underline-offset: 3px; }
.linkbtn .ic { width: 1.2em; height: 1.2em; }
.okfoot { display: inline-flex; align-items: center; gap: 6px; color: var(--green-d); font-weight: 800; min-height: 48px; }
.okfoot .ic { width: 1.2em; height: 1.2em; }

/* ana ekran */
.homebody { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; overflow: hidden; }
.logo-wrap { width: min(100%, 340px); }
.logo { display: block; width: 100%; height: auto; max-height: 22vh; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(60,40,80,.18)); }
.gtitle { margin: -4px 0 0; font-size: 3.1rem; line-height: 1; font-weight: 800; letter-spacing: .02em; color: var(--green-d); text-shadow: 0 3px 0 #fff, 0 6px 10px rgba(60,40,80,.15); }
.gtag { margin: 0 8px 4px; text-align: center; color: var(--ink2); font-size: 1.05rem; line-height: 1.2; }
.homebody .btn { width: 100%; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.sq { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 92px; padding: 8px 4px; border-radius: 22px; background: var(--card); border: 2px solid #fff; box-shadow: 0 4px 0 var(--line), 0 8px 14px rgba(60,40,80,.1); min-width: 0; }
.sq:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.sqi { position: relative; color: var(--green-d); } .sqi .ic { width: 2em; height: 2em; }
.sql { font-size: 1rem; font-weight: 800; text-align: center; line-height: 1.05; overflow-wrap: anywhere; } .sqs { font-size: .85rem; color: var(--ink2); }
.dot { position: absolute; inset-block-start: -2px; inset-inline-end: -6px; width: 14px; height: 14px; border-radius: 50%; background: var(--coral); border: 2px solid #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.25); } }
.homefoot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 10px; padding: 2px 0 0; }

/* bolum listesi */
.lvscroll { padding-top: 6px; }
.lvgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lv { min-height: 64px; aspect-ratio: 1 / 1.05; border-radius: 18px; background: var(--card); border: 2px solid #fff; box-shadow: 0 3px 0 var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 1.3rem; font-weight: 800; color: var(--ink); min-width: 0; }
.lv.done { background: #eaf8dd; } .lv.cur { background: var(--sun); box-shadow: 0 3px 0 var(--sun-d); animation: pulse 1.6s infinite; }
.lv.locked { background: rgba(255,255,255,.5); color: #a99cb8; box-shadow: none; } .lv:active { transform: translateY(2px); }
.lvs { display: flex; gap: 2px; } .lvs i { width: 11px; height: 11px; background: #d9d0c4; clip-path: polygon(50% 0, 62% 35%, 98% 38%, 70% 60%, 80% 96%, 50% 75%, 20% 96%, 30% 60%, 2% 38%, 38% 35%); }
.lvs i.on { background: var(--sun-d); }

/* oyun */
.scr-game { padding-inline: 8px; }
.hud { display: flex; align-items: center; gap: 8px; padding: 6px 0 2px; }
.hud .iconbtn { width: 52px; height: 52px; }
.hmid { flex: 1; min-width: 0; text-align: center; line-height: 1.05; }
.lvl { font-size: 1.35rem; font-weight: 800; } .hsub { font-size: .95rem; color: var(--ink2); display: flex; gap: 6px; justify-content: center; align-items: baseline; flex-wrap: wrap; }
.hsub b { color: var(--ink); font-size: 1.1rem; }
.combo { color: var(--coral-d); font-weight: 800; opacity: 0; transition: opacity .2s; font-size: 1.2rem; } .combo.on { opacity: 1; animation: pulse .5s; }
.htime { display: flex; align-items: center; gap: 4px; min-width: 76px; justify-content: flex-end; font-size: 1.35rem; font-weight: 800; }
.htime .ic { width: 1.2em; height: 1.2em; color: var(--sky-d); }
.barrow { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; }
.bar { flex: 1; height: 14px; border-radius: 9px; background: rgba(255,255,255,.7); border: 2px solid #fff; overflow: hidden; box-shadow: inset 0 2px 3px rgba(60,40,80,.12); }
.bar .fill { height: 100%; width: 100%; transform-origin: left center; background: linear-gradient(90deg, #52ae6c, #8ed06a); transition: transform .25s linear; }
html[dir=rtl] .ic.flip { transform: scaleX(-1); }
html[dir=rtl] .bar .fill { transform-origin: right center; }
.bar .fill.mid { background: linear-gradient(90deg, #f6c445, #ffd96a); } .bar .fill.low { background: linear-gradient(90deg, #ef6f5e, #ff9a7a); }
.bstars { display: flex; gap: 1px; } .bstars .ic { color: #cfc4bb; width: 1.25em; height: 1.25em; } .bstars .ic.on { color: var(--sun); }
.boardwrap { position: relative; flex: 1; min-height: 0; }
.board { position: absolute; inset: 0; touch-action: none; }
.banner { position: absolute; inset-inline: 16px; top: 6px; z-index: 3; text-align: center; background: rgba(58,43,74,.88); color: #fff; border-radius: 16px; padding: 8px 12px; font-size: 1.05rem; opacity: 0; transform: translateY(-6px); transition: all .22s; pointer-events: none; }
.banner.on { opacity: 1; transform: none; }
.tip { flex: none; pointer-events: none; display: flex; justify-content: center; padding: 2px 4px 4px; transition: opacity .6s, max-height .6s; max-height: 90px; }
.tip.fade { opacity: 0; max-height: 0; padding: 0; overflow: hidden; }
.tip span { background: #fff8d8; border: 2px solid var(--sun); border-radius: 16px; padding: 8px 14px; font-size: 1rem; line-height: 1.2; text-align: center; box-shadow: 0 3px 8px rgba(60,40,80,.16); }
.powerbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px 0 2px; }
.pw { position: relative; min-height: 64px; border-radius: 20px; background: var(--card); border: 2px solid #fff; box-shadow: 0 4px 0 var(--line), 0 6px 10px rgba(60,40,80,.1); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 4px 2px; min-width: 0; color: var(--green-d); }
.pw:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.pw .ic { width: 1.7em; height: 1.7em; } .pl { font-size: clamp(.62rem, 3.1vw, .8rem); overflow-wrap: normal; hyphens: none; color: var(--ink); font-weight: 700; line-height: 1; max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.cnt { position: absolute; inset-block-start: -8px; inset-inline-end: -4px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: var(--coral); color: #fff; font-size: .9rem; display: grid; place-items: center; border: 2px solid #fff; font-weight: 800; }
.pw.zero { color: #a99cb8; } .pw.zero .cnt { background: var(--sun-d); } .pw.armed { background: #ffe2dc; border-color: var(--coral); }

/* pencereler */
#overlay { position: absolute; inset: 0; z-index: 20; display: none; } #overlay.on { display: block; }
.dim { position: absolute; inset: 0; background: rgba(40,28,60,.5); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fadeIn .18s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(100%, 420px); max-height: 100%; overflow-y: auto; background: var(--paper); border-radius: 28px; border: 3px solid #fff; box-shadow: 0 10px 0 rgba(0,0,0,.08), 0 20px 40px rgba(30,20,50,.35); padding: 20px 18px 16px; animation: pop .22s ease-out; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.mt { margin: 0 0 8px; text-align: center; font-size: 1.6rem; line-height: 1.1; font-weight: 800; overflow-wrap: anywhere; }
.mp { margin: 6px 0; text-align: center; font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; } .mp.sub, .sub { color: var(--ink2); font-size: 1rem; }
.macts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; } .macts .btn { width: 100%; }
.bigicon { display: grid; place-items: center; color: var(--green-d); } .bigicon .ic { width: 3.6em; height: 3.6em; }
.rstars { display: flex; justify-content: center; gap: 8px; margin: 6px 0 10px; }
.rs { color: #d9d0c4; transform: scale(.8); transition: transform .3s; } .rs .ic { width: 3.6em; height: 3.6em; }
.rs.on.pop { color: var(--sun); transform: scale(1.12); filter: drop-shadow(0 3px 0 rgba(150,100,0,.35)); animation: starIn .45s ease-out; } .rs.on:not(.pop) { color: #d9d0c4; }
@keyframes starIn { 0% { transform: scale(.2) rotate(-40deg); } 70% { transform: scale(1.3) rotate(8deg); } 100% { transform: scale(1.12); } }
.rline { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 1.2rem; padding: 4px 6px; } .rline.sub { font-size: 1rem; color: var(--ink2); }
.rline.gain { justify-content: center; align-items: center; gap: 6px; font-weight: 800; color: var(--green-d); margin-top: 6px; }
.togs { display: flex; flex-direction: column; gap: 8px; }
.tog { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 6px 14px; border-radius: 18px; background: var(--card); border: 2px solid #fff; box-shadow: 0 3px 0 var(--line); width: 100%; text-align: start; font-size: 1.1rem; font-weight: 700; }
.tog .tl { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.1; } .tog .ic { color: var(--green-d); }
.tog .knob { width: 52px; height: 30px; border-radius: 15px; background: #cfc4bb; position: relative; flex: none; transition: background .15s; }
.tog .knob::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: inset-inline-start .15s; }
.tog[aria-checked=true] .knob { background: var(--green); } .tog[aria-checked=true] .knob::after { inset-inline-start: 25px; }
.tog.lang .lvname { color: var(--green-d); font-size: 1.1rem; text-align: end; min-width: 0; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; } .stack .btn { width: 100%; }
.hint { margin: 6px 6px 0; font-size: .95rem; color: var(--ink2); line-height: 1.25; } .ver { text-align: center; color: var(--ink2); font-size: .9rem; margin: 14px 0 0; }
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 4px; }
.langb { min-height: 52px; border-radius: 16px; background: #fff; border: 2px solid var(--line); font-size: 1.1rem; font-weight: 700; padding: 4px 8px; overflow-wrap: anywhere; } .langb.on { background: #eaf8dd; border-color: var(--green); }
.plist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plist li { display: flex; gap: 10px; align-items: flex-start; font-size: 1.02rem; line-height: 1.22; text-align: start; } .plist .ic { color: var(--green-d); margin-top: 1px; width: 1.4em; height: 1.4em; } .plist span:not(.icw) { min-width: 0; overflow-wrap: anywhere; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 4px 0 8px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 1px; border-radius: 12px; background: #fff; border: 2px solid var(--line); font-size: .7rem; min-width: 0; color: var(--green-d); }
.day .ic { width: 1.6em; height: 1.6em; } .day.today { border-color: var(--sun); background: #fff6d6; } .day.past { opacity: .5; } .dn { color: var(--ink2); line-height: 1; overflow-wrap: anywhere; text-align: center; } .dx { color: var(--ink); font-weight: 800; font-size: .85rem; }

/* koy / defter */
.intro { margin: 2px 6px 10px; color: var(--ink2); text-align: center; line-height: 1.25; font-size: 1rem; }
.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; min-height: 150px; border-radius: 22px; background: rgba(255,253,246,.92); border: 2px solid #fff; box-shadow: 0 4px 0 var(--line); min-width: 0; }
.bcard.can { border-color: var(--sun); box-shadow: 0 4px 0 var(--sun-d); } .bcard.rep { background: #f1fbe6; }
.bn { font-size: 1.1rem; font-weight: 800; text-align: center; line-height: 1.05; overflow-wrap: anywhere; } .bs { display: inline-flex; align-items: center; gap: 4px; font-size: 1rem; color: var(--ink2); } .bs.ok { color: var(--green-d); font-weight: 800; }
.bcv { display: block; max-width: 100%; } .bigb { display: grid; place-items: center; margin: 4px 0; }
.bkgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bk { position: relative; min-height: 64px; display: grid; place-items: center; border-radius: 16px; padding: 2px; min-width: 0; }
.bk canvas { max-width: 100%; height: auto; } .bk:not(.got) canvas { filter: grayscale(1) brightness(.55) contrast(.8); opacity: .75; }
.bk .q { position: absolute; font-size: 1.6rem; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.acv { max-width: 100%; }

#toast { position: absolute; z-index: 30; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 36px); bottom: max(96px, calc(env(safe-area-inset-bottom) + 90px)); text-align: center; pointer-events: none; opacity: 0; transform: translateY(8px); transition: all .2s; background: rgba(58,43,74,.93); color: #fff; padding: 10px 16px; border-radius: 16px; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
#toast.on { opacity: 1; transform: none; }

/* kisa ekranlar (360x640 vb.) */
@media (max-height: 720px) {
  .topbar { min-height: 56px; padding: 6px 0 2px; }
  .homebody { gap: 7px; } .logo { max-height: 14vh; } .gtitle { font-size: 2.5rem; } .gtag { font-size: .95rem; margin-bottom: 0; }
  .btn.big { min-height: 64px; } .btn.big .b1 { font-size: 1.35rem; } .sq { min-height: 78px; } .sqi .ic { width: 1.7em; height: 1.7em; }
  .linkbtn { min-height: 44px; } .homefoot { padding-bottom: 0; }
  .modal { padding: 14px 14px 12px; } .mt { font-size: 1.4rem; } .rs .ic { width: 3em; height: 3em; } .macts { gap: 8px; margin-top: 10px; }
}

/* gercek sanat: logo gorseli kendi basina baslik; alt baglantilar arka plan uzerinde okunur kalsin */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.logo-wrap { width: min(100%, 400px); }
.logo { max-height: 27vh; }
.homefoot .linkbtn, .homefoot .okfoot { background: rgba(255, 250, 235, .88); border-radius: 24px; text-decoration: none; padding: 0 14px; box-shadow: 0 2px 0 rgba(120, 100, 80, .18); }
@media (max-height: 640px) { .logo { max-height: 20vh; } }
