* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Nunito", "Trebuchet MS", system-ui, sans-serif;
  background: linear-gradient(180deg, #fff6e5 0%, #e3f4ff 100%);
  color: #3a2e2a; user-select: none; -webkit-user-select: none; overscroll-behavior: none;
}
#app { max-width: 720px; margin: 0 auto; min-height: 100%; padding: max(10px, env(safe-area-inset-top)) 12px 24px; display: flex; flex-direction: column; }
button { font: inherit; border: none; cursor: pointer; color: inherit; }
h1 { font-size: 30px; margin: 6px 0; text-align: center; }
h2 { font-size: 24px; margin: 8px 0; text-align: center; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pill { background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 20px; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.iconbtn { background: #fff; border-radius: 50%; width: 54px; height: 54px; font-size: 28px; box-shadow: 0 4px 0 rgba(0,0,0,.12); flex: none; }
.iconbtn:active, .big:active, .opt:active, .tile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.speak { background: #ffd54f; }
.lockbtn { opacity: .35; width: 40px; height: 40px; font-size: 18px; }

.hello { text-align: center; font-size: 22px; font-weight: 800; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 10px; }
.tile { border-radius: 26px; padding: 16px 8px; text-align: center; font-weight: 900; font-size: 19px; color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.18); position: relative; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tile .em { font-size: 54px; line-height: 1.1; }
.tile .lv { font-size: 14px; opacity: .95; margin-top: 4px; }
.tile.locked { filter: grayscale(1); opacity: .55; }
.tile .lockinfo { position: absolute; top: 8px; right: 12px; font-size: 16px; }
.tile.wide { grid-column: span 2; min-height: 110px; }

.prompt { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 22px; padding: 12px 14px; font-size: 22px; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.prompt .txt { flex: 1; }
.visual { min-height: 170px; margin: 12px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 44px; border-radius: 24px; padding: 10px; background: rgba(255,255,255,.6); }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.opts.three { grid-template-columns: repeat(3, 1fr); }
.opt { background: #fff; border-radius: 22px; min-height: 96px; font-size: 44px; font-weight: 900; box-shadow: 0 6px 0 rgba(0,0,0,.14); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; }
.opt small { font-size: 16px; font-weight: 800; }
.opt img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.opt.right { background: #a5d6a7; animation: pop .4s; }
.opt.wrong { background: #ef9a9a; animation: shake .4s; }
.big { display: block; width: 100%; border-radius: 22px; padding: 18px; font-size: 24px; font-weight: 900; background: #ff8a00; color: #fff; box-shadow: 0 6px 0 #c56a00; margin-top: 12px; }
.big.green { background: #43a047; box-shadow: 0 6px 0 #2e7031; }
.big.blue { background: #1e88e5; box-shadow: 0 6px 0 #135ea0; }
.big.gray { background: #90a4ae; box-shadow: 0 6px 0 #607d8b; }

/* Basket */
.court { background: linear-gradient(#ffcc80, #ffb74d); position: relative; }
.hoop { position: absolute; top: 6px; right: 12px; font-size: 40px; }
.ball { display: inline-block; }
.ball.shoot { animation: shoot .8s forwards; }
/* Yarış */
.track { width: 100%; height: 64px; background: repeating-linear-gradient(90deg, #555 0 30px, #666 30px 60px); border-radius: 14px; position: relative; border-top: 4px dashed #fff; border-bottom: 4px dashed #fff; }
.track .car { position: absolute; top: 6px; font-size: 42px; transition: left .7s ease; transform: scaleX(-1); }
.track .flag { position: absolute; right: 6px; top: 6px; font-size: 40px; }
.sum { font-size: 40px; text-align: center; width: 100%; }
/* Havuz */
.pool { background: linear-gradient(#81d4fa, #29b6f6); }
.wave { animation: wave 2s ease-in-out infinite; display: inline-block; }

/* Hafıza */
.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.card { aspect-ratio: 1; border-radius: 16px; background: #1e88e5; font-size: 40px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 0 #135ea0; color: #fff; }
.card.open { background: #fff; color: inherit; box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.card.done { background: #c8e6c9; }

.score { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.score .pl { background: #fff; border-radius: 16px; padding: 8px 12px; font-weight: 900; font-size: 18px; text-align: center; }
.score .pl.turn { outline: 4px solid #ff8a00; }
.score img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; vertical-align: middle; }

.celebrate { font-size: 90px; text-align: center; animation: pop .6s; }

/* Ebeveyn */
.panel { background: #fff; border-radius: 20px; padding: 14px; margin: 10px 0; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.panel h3 { margin: 0 0 8px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tabs button { background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 800; white-space: nowrap; }
.tabs button.on { background: #ff8a00; color: #fff; }
.row { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.row input[type=text], .row input[type=number], textarea, select { font: inherit; font-size: 17px; padding: 8px 10px; border: 2px solid #ddd; border-radius: 12px; }
.row input[type=text] { flex: 1; min-width: 100px; }
textarea { width: 100%; min-height: 90px; font-size: 13px; }
.small { font-size: 14px; color: #6d625c; }
.btn { background: #eceff1; border-radius: 12px; padding: 8px 14px; font-weight: 800; }
.btn.or { background: #ff8a00; color: #fff; }
.btn.red { background: #e53935; color: #fff; }
.moodrow { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #eee; padding: 6px 0; }
.moodrow .f { font-size: 30px; }
.moodrow.neg { background: #fff3e0; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; font-size: 34px; display: inline-flex; align-items: center; justify-content: center; background: #fff3e0; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 10px auto; }
.keypad button { background: #fff; border-radius: 18px; font-size: 28px; font-weight: 900; padding: 16px 0; box-shadow: 0 4px 0 rgba(0,0,0,.1); }
.dots { text-align: center; font-size: 34px; letter-spacing: 8px; min-height: 44px; }

#toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: #3a2e2a; color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 800; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 9; }
#toast.show { opacity: .92; }

@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes shoot { 0% { transform: translate(0,0); } 50% { transform: translate(40px,-90px) scale(.9); } 100% { transform: translate(80px,-40px) scale(.6); opacity: 0; } }
@keyframes wave { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.overlay { position: fixed; inset: 0; z-index: 5; background: #fff6e5; overflow: auto; padding: 12px; }
.overlay > * { max-width: 700px; margin-left: auto; margin-right: auto; }
.livebar { position: sticky; top: 0; z-index: 4; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 6px; }
.livebar .pl { background: #fff; border-radius: 999px; padding: 4px 10px; font-weight: 900; font-size: 15px; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.livebar .pl.me { outline: 3px solid #ff8a00; }
.code { font-size: 64px; font-weight: 900; letter-spacing: 10px; text-align: center; color: #5e35b1; }
.sum2 { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.grp { display: inline-flex; flex-wrap: wrap; max-width: 46%; justify-content: center; background: rgba(255,255,255,.7); border-radius: 16px; padding: 6px; font-size: 30px; line-height: 1.15; }
.grp .it { display: inline-block; width: 36px; text-align: center; transition: transform .2s; }

.grp .it.gone { opacity: .3; position: relative; }
.grp .it.gone::after { content: '✖'; position: absolute; left: 8px; top: 0; color: #c62828; font-size: 26px; }
.grp .it.hl { transform: scale(1.35); filter: drop-shadow(0 0 6px #ffd54f); }
.opsign { font-size: 40px; }
.eq { width: 100%; text-align: center; font-size: 34px; font-weight: 900; margin-top: 6px; }

/* 3B oyunlar */
.k3 { position: fixed; inset: 0; z-index: 3; background: #8fd3ff; touch-action: none; overflow: hidden; }
.k3cv { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.k3load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.3); }
.k3hud { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; pointer-events: none; }
.k3hud button { pointer-events: auto; width: 46px; height: 46px; font-size: 22px; }
.k3stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.k3stats .pill { font-size: 16px; padding: 5px 10px; background: rgba(255,255,255,.88); }
.k3head { position: absolute; top: 64px; left: 0; right: 0; text-align: center; pointer-events: none; transform: scale(.75); }
.k3pw { position: absolute; top: 104px; left: 10px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.k3bar { width: 120px; height: 26px; background: rgba(0,0,0,.35); border-radius: 13px; position: relative; overflow: hidden; color: #fff; font-weight: 900; }
.k3bar span { position: absolute; left: 8px; top: 2px; z-index: 1; font-size: 16px; }
.k3bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ffca28, #ff7043); }
.k3msg { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-size: 34px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 #e65100, 0 0 12px rgba(0,0,0,.35); opacity: 0; pointer-events: none; padding: 0 16px; }
.k3msg.show { animation: k3pop 1.6s ease-out; }
@keyframes k3pop { 0% { opacity: 0; transform: scale(.5); } 15% { opacity: 1; transform: scale(1.15); } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.k3menu { position: absolute; inset: 0; display: none; overflow: auto; padding: 70px 14px 24px; background: rgba(20,40,70,.45); }
.k3menu.open { display: block; }
.k3card { max-width: 520px; margin: 0 auto; background: #fff6e5; border-radius: 26px; padding: 16px; box-shadow: 0 8px 0 rgba(0,0,0,.2); }
.k3card h3 { margin: 12px 0 6px; }
.k3mis { background: #fff; border-radius: 14px; padding: 10px 12px; margin: 6px 0; font-weight: 800; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.k3mis.ok { background: #c8e6c9; }
.k3grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.k3item { background: #fff; border-radius: 16px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 3px 0 rgba(0,0,0,.12); font-size: 13px; }
.k3item.wide { width: 100%; flex-direction: row; justify-content: center; gap: 10px; font-size: 16px; }
.k3item.on { outline: 3px solid #43a047; }
.k3item small { color: #6d625c; font-weight: 800; }
.k3sw { width: 44px; height: 44px; border-radius: 12px; display: block; box-shadow: inset 0 0 0 2px rgba(0,0,0,.1); }
.tile.big3d { grid-column: span 2; min-height: 150px; font-size: 24px; background-image: linear-gradient(135deg, rgba(255,255,255,.25), rgba(0,0,0,.15)) !important; }
.tile.big3d .em { font-size: 64px; }
.k3card .row { flex-wrap: nowrap; align-items: stretch; }
.k3card .row .big { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 20px; padding: 14px 8px; }
.kmap { position: absolute; top: 108px; right: 8px; width: 116px; height: 116px; pointer-events: none; }
.kturbo { position: absolute; top: 108px; left: 10px; width: 130px; height: 24px; border-radius: 12px; background: rgba(0,0,0,.35); overflow: hidden; pointer-events: none; }
.kturbo i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #29b6f6, #ffea00); transition: width .2s; }
.kturbo span { position: absolute; left: 8px; top: 1px; font-size: 16px; }
.kctl { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; padding: 0 10px; pointer-events: none; }
.kside { display: flex; gap: 10px; pointer-events: auto; }
.kbtn { width: 76px; height: 76px; border-radius: 50%; background: rgba(255,255,255,.82); font-size: 30px; font-weight: 900; box-shadow: 0 5px 0 rgba(0,0,0,.25); touch-action: none; user-select: none; -webkit-user-select: none; }
.kbtn.on { transform: translateY(3px) scale(.95); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.kbtn.drift { background: rgba(255,152,0,.9); color: #fff; font-size: 15px; }
.kbtn.turbo { background: rgba(41,182,246,.9); }
.k3item.lock { opacity: .55; filter: grayscale(.8); }
.aobj { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 20px); display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.9); border-radius: 16px; padding: 6px 12px; font-size: 15px; box-shadow: 0 3px 0 rgba(0,0,0,.12); pointer-events: none; }
.aobj span { display: inline-block; font-size: 22px; color: #e65100; transition: transform .15s; }
.ajoy { position: absolute; left: 18px; bottom: max(22px, env(safe-area-inset-bottom)); width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.25); border: 3px solid rgba(255,255,255,.6); touch-action: none; }
.ajoyk { position: absolute; left: 35px; top: 35px; width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 3px 0 rgba(0,0,0,.2); pointer-events: none; }
.abtns { position: absolute; right: 14px; bottom: max(22px, env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: flex-end; }
.aact { width: 86px; height: 86px; font-size: 36px; }
.aact.hot { background: #ffca28; animation: k3pulse 1s infinite; }
@keyframes k3pulse { 50% { transform: scale(1.08); } }
.adlg { position: absolute; left: 0; right: 0; bottom: 0; display: none; padding: 12px; }
.adlg.open { display: block; }
.adlgc { max-width: 560px; margin: 0 auto; background: #fff6e5; border-radius: 22px; padding: 14px 16px; box-shadow: 0 6px 0 rgba(0,0,0,.25); font-size: 18px; }
.adlgc b { color: #e65100; font-size: 20px; }
.adlgc p { margin: 8px 0 0; line-height: 1.35; }
.apz { background: #fff; border-radius: 16px; padding: 14px; font-size: 24px; font-weight: 900; text-align: center; margin: 10px 0; }
.asimon { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px auto; max-width: 300px; }
.asb { aspect-ratio: 1; border-radius: 22px; opacity: .55; box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.asb.lit { opacity: 1; transform: scale(1.06); box-shadow: 0 0 24px #fff; }
.bmeter { width: 26px; height: 150px; border-radius: 13px; background: rgba(0,0,0,.4); position: relative; overflow: hidden; visibility: hidden; border: 2px solid #fff; }
.bmeter.on { visibility: visible; }
.bmeter i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, #ffca28, #ff5722); }
.bmeter b { position: absolute; left: 0; right: 0; background: rgba(76,175,80,.85); border-top: 2px solid #fff; border-bottom: 2px solid #fff; }
.aact small { display: block; font-size: 11px; font-weight: 900; margin-top: -4px; }
.tbot { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px max(10px, env(safe-area-inset-bottom)); pointer-events: none; }
.tbot > * { pointer-events: auto; max-width: 560px; margin-left: auto; margin-right: auto; }
.tbot .big { margin-top: 8px; padding: 14px; font-size: 20px; }
.tpanel { display: none; background: rgba(255,246,229,.96); border-radius: 20px; padding: 10px; box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.tpanel.open { display: block; }
.tcards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tcard { background: #fff; border-radius: 14px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 3px 0 rgba(0,0,0,.12); font-size: 13px; }
.tcard span { font-size: 28px; }
.tcard.poor { opacity: .6; }
.tcard.lock { opacity: .45; filter: grayscale(1); }
.tinfo b { font-size: 17px; }
.tacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.tacts .btn { flex: 1; min-width: 100px; font-size: 15px; }
.tbr small { font-weight: 600; }
.tlv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.tlv .k3item { padding: 6px 2px; }
