/* ÇILGIN ORMAN — 5+ yaş dostu arayüz */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #123524; color: #fff; font-family: 'Fredoka', 'Baloo 2', 'Trebuchet MS', 'Comic Sans MS', system-ui, sans-serif; touch-action: none; overscroll-behavior: none; }
#app { position: fixed; inset: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }
button { font-family: inherit; color: inherit; border: 0; cursor: pointer; }

/* ---- HUD ---- */
#hud { position: absolute; inset: 0; pointer-events: none; padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
.hud-row { position: absolute; top: max(8px, env(safe-area-inset-top)); display: flex; flex-wrap: wrap; gap: 6px; max-width: 62%; }
.hud-row.left { left: max(8px, env(safe-area-inset-left)); }
.hud-row.right { right: max(8px, env(safe-area-inset-right)); justify-content: flex-end; max-width: 46%; }
.pill { pointer-events: auto; background: rgba(15, 22, 40, .72); backdrop-filter: blur(8px); border: 2px solid #ffbe0b; border-radius: 18px; padding: 5px 11px; font-weight: 800; font-size: 14px; text-shadow: 0 2px 0 #000a; box-shadow: 0 4px 0 #0006; white-space: nowrap; }
.pill.btn { background: linear-gradient(135deg, #7c3aed, #db2777); }
.pill.btn.sm { font-size: 12px; padding: 4px 10px; border-radius: 14px; }
.pill.btn:active { transform: translateY(3px); }
.quick-pwa-bar { display: flex; justify-content: center; gap: 8px; margin: 6px 0 10px; }
.mic-pre-join { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 0 12px; }
.mic-pre-join button.ready { background: linear-gradient(135deg, #059669, #10b981); border-color: #a7f3d0; }
.pre-mic-bar { width: 140px; height: 8px; background: rgba(0,0,0,0.5); border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,0.4); }
.pre-mic-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #06d6a0, #ffd60a); transition: width 0.08s; }
#roomPill { cursor: pointer; border-color: #4cc9f0; } #stPill { border-color: #4cc9f0; } #mountPill { border-color: #f72585; } #regionPill { border-color: #06d6a0; }

.quest { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); width: min(88vw, 420px); pointer-events: auto; background: linear-gradient(135deg, rgba(109, 40, 217, 0.88), rgba(219, 39, 119, 0.88)); backdrop-filter: blur(4px); border: 2.5px solid #ffbe0b; border-radius: 16px; padding: 4px 12px; text-align: center; box-shadow: 0 4px 16px #0007; cursor: pointer; z-index: 20; transition: all .2s; }
.quest.idle { width: auto; max-width: 260px; padding: 3px 10px; background: rgba(15, 23, 42, 0.75); border: 1.5px solid rgba(255, 190, 11, 0.7); }
.quest.idle p, .quest.idle .q-bar, .quest.idle .q-foot { display: none; }
.q-head { display: flex; justify-content: center; align-items: center; gap: 6px; color: #ffe066; font-weight: 900; font-size: 11px; letter-spacing: .3px; text-transform: uppercase; }
.mini { pointer-events: auto; background: #0005; border-radius: 10px; padding: 1px 6px; font-size: 11px; }
.quest p { font-size: 11px; font-weight: 700; margin-top: 1px; line-height: 1.2; max-height: 28px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-bar { height: 4px; background: #0006; border-radius: 4px; margin-top: 3px; overflow: hidden; border: 1px solid #fff5; }
.q-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #06d6a0, #ffd60a); transition: width .25s; }
.q-foot { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; margin-top: 2px; opacity: .95; }

.score { position: absolute; left: max(8px, env(safe-area-inset-left)); top: 44px; font-size: 10px; font-weight: 800; background: rgba(15, 22, 40, 0.75); backdrop-filter: blur(4px); border-radius: 12px; padding: 4px 8px; max-width: 120px; display: flex; flex-direction: column; gap: 1px; z-index: 15; border: 1px solid rgba(255,255,255,0.2); }
.score div { display: flex; justify-content: space-between; gap: 6px; white-space: nowrap; overflow: hidden; }
.score .me { color: #ffe066; } .score .bot { opacity: .7; }

.compass { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-weight: 900; text-shadow: 0 2px 0 #000; z-index: 15; }
.compass span { font-size: 22px; color: #ffe066; display: inline-block; filter: drop-shadow(0 2px 0 #000); }
.compass small { font-size: 10px; margin-top: -3px; }
.phase { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.75); border: 1.5px solid #fff; border-radius: 12px; padding: 2px 10px; font-weight: 900; font-size: 13px; z-index: 15; }
.countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: min(28vw, 160px); font-weight: 900; color: #ffe066; -webkit-text-stroke: 6px #6d28d9; paint-order: stroke fill; text-shadow: 0 8px 0 #0006; animation: pop .5s ease-out; z-index: 40; pointer-events: none; }
@keyframes pop { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, rgba(5, 150, 105, 0.92), rgba(14, 165, 233, 0.92)); backdrop-filter: blur(6px); border: 3px solid #fff; border-radius: 20px; padding: 10px 18px; text-align: center; font-weight: 900; font-size: 16px; box-shadow: 0 10px 26px #0008; animation: pop .45s ease-out; max-width: 86vw; z-index: 45; }
.result small { display: block; font-size: 13px; margin-top: 3px; color: #fff7ae; }
.toast { position: absolute; top: 92px; left: 50%; transform: translate(-50%, -6px); background: rgba(6, 214, 160, 0.9); backdrop-filter: blur(4px); color: #06251d; padding: 4px 14px; border-radius: 14px; border: 2px solid #fff; font-weight: 900; font-size: 12px; opacity: 0; transition: .2s; text-align: center; max-width: 80vw; box-shadow: 0 4px 14px #0006; pointer-events: none; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: rgba(239, 71, 111, 0.92); color: #fff; }

.voicebar { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: 176px; display: flex; flex-direction: column; gap: 5px; pointer-events: auto; }
.chip { background: #0f1628cc; border: 2px solid #4cc9f0; border-radius: 14px; padding: 4px 10px; font-size: 12px; font-weight: 800; text-align: right; }
.chip.on { background: #ffbe0b; color: #111; border-color: #fff; }
.mic { position: absolute; right: 14px; bottom: 160px; width: 110px; height: 8px; background: #0008; border-radius: 6px; overflow: hidden; border: 1px solid #fff6; }
.mic i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #06d6a0, #ef476f); }

/* ---- kontroller ---- */
#controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; }
#joy { width: 128px; height: 128px; border-radius: 50%; background: #0004; border: 3px dashed #fff8; position: relative; pointer-events: auto; touch-action: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ffe66d, #f3722c); border: 3px solid #fff; box-shadow: 0 4px 10px #0007; pointer-events: none; }
.pad { display: grid; grid-template-columns: repeat(2, auto); gap: 10px; pointer-events: auto; }
.talk-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.round { width: 68px; height: 68px; border-radius: 50%; border: 4px solid #fff; font-size: 24px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 6px 0 #0006, 0 8px 14px #0005; touch-action: none; text-shadow: 0 1px 0 #000; }
.round span { font-size: 10px; margin-top: -2px; text-transform: uppercase; }
.round:active, .round.down { transform: translateY(4px); box-shadow: 0 2px 0 #0006; }
.talk { background: linear-gradient(135deg, #fbbf24, #f97316); width: 76px; height: 76px; position: relative; } .talk.live { animation: pulse .4s infinite alternate; border-color: #ff0055; }
.talk-badge { position: absolute; top: 4px; right: 4px; font-size: 13px; filter: drop-shadow(0 2px 2px #000); }
.act { background: linear-gradient(135deg, #f72585, #b5179e); } .jump { background: linear-gradient(135deg, #4cc9f0, #4361ee); }
@keyframes pulse { to { transform: scale(1.12); box-shadow: 0 0 26px #ff0055; } }

/* Radial Ses Menüsü */
.radial-voice { position: absolute; top: 50%; left: 50%; width: 0; height: 0; pointer-events: none; z-index: 60; }
.radial-voice:not([hidden]) { pointer-events: auto; }
.radial-item {
  position: absolute; left: 0; top: 0; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  transform: rotate(var(--angle)) translate(var(--dist)) rotate(calc(-1 * var(--angle)));
  border-radius: 50%; background: rgba(15, 23, 42, 0.95); border: 2.5px solid #ffbe0b;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6); transition: transform 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.12s;
  pointer-events: auto; cursor: pointer;
}
.radial-item .emoji { font-size: 20px; pointer-events: none; }
.radial-item .lbl { font-size: 8px; font-weight: 800; color: #fff; margin-top: -3px; text-transform: uppercase; pointer-events: none; }
.radial-item.on, .radial-item.hover {
  transform: rotate(var(--angle)) translate(var(--dist)) rotate(calc(-1 * var(--angle))) scale(1.32);
  background: #ffbe0b; border-color: #fff; box-shadow: 0 0 20px #ffbe0b, 0 6px 16px rgba(0,0,0,0.8);
}
.radial-item.on .lbl, .radial-item.hover .lbl { color: #0f172a; }

/* PWA Kurulum Rehberi */
.pwa-steps { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; text-align: left; }
.pwa-step { background: rgba(0,0,0,0.3); border: 1.5px solid #4cc9f0; border-radius: 14px; padding: 10px 14px; font-size: 14px; color: #f8fafc; line-height: 1.4; }
.pwa-step b { color: #ffe066; }
@media (pointer: fine) and (min-width: 900px) { #joy { opacity: .35; } }

/* ---- modallar ---- */
.modal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: #060a14c0; backdrop-filter: blur(5px); z-index: 50; padding: 12px; pointer-events: auto; }
.modal.on { display: flex; }
.box { position: relative; width: min(100%, 540px); max-height: 94vh; overflow: auto; background: #1d2340; border: 4px solid #ffbe0b; border-radius: 26px; padding: 18px; text-align: center; box-shadow: 0 18px 40px #000a; touch-action: pan-y; }
.box.wide { width: min(100%, 720px); }
.box h1 { color: #ffbe0b; font-size: 30px; text-shadow: 0 3px 0 #000; } .box h2 { color: #ffbe0b; font-size: 22px; margin-bottom: 8px; }
.sub { font-size: 13px; color: #cbd5e1; margin-bottom: 10px; } .hint { font-size: 12px; color: #94a3b8; margin: 8px 0; }
.box label { display: block; text-align: left; font-size: 13px; font-weight: 800; color: #ffbe0b; margin: 10px 0 4px; }
.row { display: flex; gap: 8px; } .row.two > div { flex: 1; }
input[type=text], input:not([type]), input[type=range] { width: 100%; }
.box input:not([type=range]) { padding: 10px 12px; border-radius: 14px; border: 3px solid #4cc9f0; background: #0f172a; color: #fff; font: 800 16px inherit; outline: 0; }
.dice { background: linear-gradient(135deg, #f72585, #7209b7); border: 3px solid #fff; border-radius: 14px; padding: 0 14px; font-weight: 900; white-space: nowrap; }
.err { margin-top: 8px; background: #ef476f; color: #fff; padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 900; border: 2px solid #fff; }
.shake { animation: shake .45s; } @keyframes shake { 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }
.go { margin-top: 10px; background: linear-gradient(135deg, #06d6a0, #059669); border: 3px solid #fff; border-radius: 18px; padding: 12px 26px; font-size: 18px; font-weight: 900; box-shadow: 0 5px 0 #065f46; }
.go:active { transform: translateY(3px); box-shadow: 0 2px 0 #065f46; }
.modal-actions {
  position: sticky; bottom: -18px;
  background: linear-gradient(180deg, rgba(29, 35, 64, 0.88) 0%, #1d2340 40%);
  padding: 10px 0 6px; margin-top: 10px;
  border-top: 1.5px solid rgba(255, 190, 11, 0.35);
  display: flex; gap: 10px; justify-content: center; z-index: 10;
}
.modal-actions button { flex: 1; }
.x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; background: #ef476f; border: 3px solid #fff; font-size: 20px; font-weight: 900; }
.grid { display: grid; gap: 9px; margin: 8px 0; }
.grid.mounts { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); } .grid.items { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 56vh; overflow: auto; } .grid.cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 60vh; overflow: auto; }
.card { background: #2b3258; border: 3px solid #475569; border-radius: 16px; padding: 9px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform .1s; }
.card:active { transform: scale(.96); } .card.sel, .card.eq { border-color: #06d6a0; background: #173b45; box-shadow: 0 0 12px #06d6a080; } .card.lock { opacity: .55; border-color: #ef476f; }
.card .ic { font-size: 30px; } .card b { font-size: 13px; } .card small { font-size: 11px; color: #cbd5e1; line-height: 1.2; } .card .cost { font-size: 11px; font-weight: 900; color: #ffbe0b; }
.tag { font-size: 10px; background: #ef476f; border-radius: 8px; padding: 1px 6px; font-weight: 800; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.tabs button { background: #334155; border: 2px solid #94a3b8; border-radius: 14px; padding: 6px 12px; font-weight: 800; font-size: 12px; } .tabs button.on { background: #ffbe0b; color: #0f172a; border-color: #fff; }

/* ---- Auth & Profil ---- */
.auth-bar { margin: 10px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.btn.google { background: #ffffff; color: #1f2937; border: 2px solid #e5e7eb; border-radius: 14px; padding: 8px 18px; font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 3px 6px rgba(0,0,0,0.15); transition: transform .1s; }
.btn.google:active { transform: scale(.98); }
.user-profile { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.4); padding: 5px 12px; border-radius: 20px; border: 1px solid #ffbe0b; }
.user-profile img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-profile span { font-weight: 800; font-size: 13px; color: #ffe066; }

/* ---- Yeniden Bağlanma (Reconnect) ---- */
.reconn-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #f59e0b; color: #1e1b4b; padding: 8px 18px; border-radius: 20px; font-weight: 900; font-size: 14px; border: 3px solid #fff; box-shadow: 0 8px 20px rgba(0,0,0,0.4); z-index: 100; animation: pulse 1s infinite alternate; }

/* ---- Çocuk Onboarding Tutorial ---- */
.tutorial-box { max-width: 480px; padding: 24px 18px; }
.tut-slide { display: none; flex-direction: column; align-items: center; text-align: center; gap: 10px; min-height: 180px; }
.tut-slide.on { display: flex; }
.tut-icon { font-size: 54px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); }
.tut-slide h3 { font-size: 20px; color: #ffbe0b; }
.tut-slide p { font-size: 15px; color: #e2e8f0; line-height: 1.4; }
.tut-dots { display: flex; justify-content: center; gap: 8px; margin: 16px 0; }
.tut-dots .dot { width: 12px; height: 12px; border-radius: 50%; background: #475569; transition: background .2s, transform .2s; }
.tut-dots .dot.on { background: #ffbe0b; transform: scale(1.3); }

/* ---- Mobil Yatay Ekran Kilidi (Landscape Guard) ---- */
.rotate-overlay { display: none; }
@media (orientation: portrait) and (max-width: 900px) {
  .rotate-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: radial-gradient(circle at center, #1b4332, #081c15);
    display: flex; align-items: center; justify-content: center;
    color: #fff; text-align: center; padding: 24px;
  }
  .rotate-box { max-width: 320px; display: flex; flex-direction: column; align-items: center; }
  .phone-rotate-icon {
    width: 44px; height: 72px; border: 3.5px solid #ffbe0b; border-radius: 10px;
    margin-bottom: 18px; position: relative;
    animation: phoneRotate 2s ease-in-out infinite;
  }
  .phone-rotate-icon::after {
    content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
    width: 6px; height: 6px; border-radius: 50%; background: #ffbe0b;
  }
  @keyframes phoneRotate {
    0%, 20% { transform: rotate(0deg); }
    50%, 75% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
  }
  .rotate-box h3 { font-size: 22px; color: #ffbe0b; margin-bottom: 6px; }
  .rotate-box p { font-size: 14px; line-height: 1.35; color: #e2e8f0; font-weight: 600; }
}

@media (max-height: 800px) {
  .box { padding: 12px 16px; }
  .box h1 { font-size: 22px; }
  .sub { margin-bottom: 4px; font-size: 12px; }
  .quick-pwa-bar { margin: 4px 0 !important; }
  .auth-bar { margin: 6px 0; }
  .box label { margin: 6px 0 2px; font-size: 12px; }
  .card { padding: 6px 4px; }
  .card .ic { font-size: 24px; }
  .card b { font-size: 11px; }
  .card small { display: none; }
  .hint { margin: 4px 0; font-size: 11px; }
  .mic-pre-join { margin: 6px 0; }
}

@media (max-width: 640px) { .pill { font-size: 12px; padding: 4px 8px; } .quest { top: 44px; } .quest p { font-size: 11px; } #joy { width: 108px; height: 108px; } .round { width: 58px; height: 58px; font-size: 20px; } .talk { width: 64px; height: 64px; } .voicebar { bottom: 150px; } #regionPill { display: none; } .box h1 { font-size: 24px; } }
