/* Kelime Türet — İznik çini esinli tema.
   Harf taşları sırlı seramik gibi: krem yüzey, koyu sır kenar, alttan kalın gölge. */

:root {
  --bg1: #14307a; --bg2: #0a1c4d;
  --face: #f6efdc; --face-edge: #d9ccab;
  --ink: #14307a;          /* taş üstü harf rengi */
  --cta: #e4572e; --cta-dark: #a8381a; --cta-text: #fff;
  --gold: #f4c542; --gold-dark: #b8860b;
  --good: #2fa56a; --bad: #e0453a;
  --glass: rgba(255,255,255,.10);
  --text: #fdf8ea;
  --cols: 5;
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='1.5'%3E%3Crect x='20' y='20' width='32' height='32'/%3E%3Crect x='20' y='20' width='32' height='32' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='5'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
html, body { height: 100%; }
body {
  font-family: var(--sans); color: var(--text); overflow: hidden;
  background: var(--pat), radial-gradient(120% 90% at 50% 0%, var(--bg1), var(--bg2));
  transition: background-color .6s;
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ic { width: 1.25em; height: 1.25em; flex: none; }
[hidden] { display: none !important; }

#app { position: relative; height: 100dvh; max-width: 520px; margin: 0 auto; }
.screen {
  position: absolute; inset: 0; display: none; flex-direction: column;
  padding: max(env(safe-area-inset-top), 10px) 14px max(env(safe-area-inset-bottom), 14px);
}
.screen.active { display: flex; }

/* ---- Üst çubuk ---- */
.topbar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.menu-top, #screen-menu .topbar { justify-content: flex-end; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14);
  font-weight: 800; font-size: 1rem; min-height: 38px;
}
.chip-star { color: var(--gold); }
.chip-energy { color: #ffd86b; }
.chip .plus { background: var(--gold); color: #3b2a00; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; font-size: .95rem; line-height: 1; margin-left: 2px; }
.chip .of { opacity: .6; font-weight: 700; margin-left: -4px; }
.chip.pulse { animation: bump .45s; }
.btn-round { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14); }
.btn-round .ic { width: 22px; height: 22px; }
.stage-title { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.stage-title b { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-title span { font-size: .82rem; opacity: .75; }

/* ---- Menü ---- */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.logo { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.logo-row { display: flex; gap: 6px; }
.logo .tile {
  width: clamp(36px, 10.5vw, 52px); height: clamp(46px, 13.5vw, 66px);
  font-size: clamp(1.5rem, 6.5vw, 2.3rem);
  animation: settle .7s cubic-bezier(.2,1.4,.4,1) backwards;
}
.tagline { font-size: 1.05rem; opacity: .85; letter-spacing: .01em; }
.menu-actions { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.menu-meta { text-align: center; font-size: .92rem; opacity: .8; min-height: 1.3em; }
.menu-row { display: flex; gap: 8px; }
.menu-row .btn { flex: 1; min-width: 0; padding: 0 8px; gap: 6px; }
.menu-row .btn-icon { flex: 0 0 52px; padding: 0; }

/* ---- Düğmeler ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 16px; border-radius: 16px; font-weight: 800; font-size: 1.05rem;
  transition: transform .08s, box-shadow .08s, opacity .2s;
}
.btn:disabled, .btn.off { opacity: .45; }
.btn-cta { background: var(--cta); color: var(--cta-text); box-shadow: 0 5px 0 var(--cta-dark), 0 8px 14px rgba(0,0,0,.25); text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.btn-dark { background: rgba(0,0,0,.34); box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.btn-ghost { background: var(--glass); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.2); min-height: 52px; font-size: .95rem; }
.btn-good { background: var(--good); box-shadow: 0 5px 0 #1d7449, 0 8px 14px rgba(0,0,0,.2); color: #fff; }
.btn-gold { background: var(--gold); color: #3b2a00; box-shadow: 0 5px 0 var(--gold-dark), 0 8px 14px rgba(0,0,0,.2); }
.btn-text { min-height: 44px; font-weight: 700; opacity: .8; text-decoration: underline; text-underline-offset: 3px; }
.btn-xl { min-height: 68px; font-size: 1.6rem; border-radius: 20px; letter-spacing: .02em; }
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 transparent; }
.btn-ghost:active:not(:disabled) { transform: scale(.97); }
.btn-ghost.attn { animation: bump 1.4s infinite; box-shadow: inset 0 0 0 2px var(--gold); color: var(--gold); }
.cost { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-size: .85rem; background: rgba(0,0,0,.3); padding: 2px 7px; border-radius: 99px; color: var(--gold); }
.cost .ic { width: 1em; height: 1em; }

/* ---- Oyun ---- */
.progress-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; }
.progress { flex: 1; height: 12px; border-radius: 99px; background: rgba(0,0,0,.3); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #ffe48a); border-radius: 99px; transition: width .4s ease-out; }
#progress-text { font-size: .85rem; white-space: nowrap; text-align: right; }
.hearts { display: flex; gap: 3px; }
.hearts .ic { width: 20px; height: 20px; color: #ff6b6b; transition: transform .2s, opacity .3s; }
.hearts .ic.lost { color: rgba(255,255,255,.2); transform: scale(.8); }
.hearts.hit { animation: shake .4s; }

.found {
  flex: 0 0 auto; height: 92px; overflow-y: auto; padding: 8px; border-radius: 16px;
  background: rgba(0,0,0,.22); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.25);
}
.found:empty::before { content: "Bulduğun kelimeler burada görünür."; opacity: .55; font-size: .9rem; padding: 4px 6px; }
.found .w {
  background: var(--face); color: var(--ink); font-family: var(--serif); font-weight: 800; font-size: .95rem;
  padding: 3px 10px; border-radius: 8px; display: flex; gap: 6px; align-items: baseline; animation: pop .3s;
  box-shadow: 0 2px 0 var(--face-edge);
}
.found .w small { font-family: var(--sans); font-weight: 800; color: var(--cta-dark); font-size: .75rem; }

.play-area { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding-top: 10px; min-height: 0; }
.hint-bar { text-align: center; font-weight: 800; letter-spacing: .12em; font-family: var(--serif); font-size: 1.05rem; color: var(--gold); display: flex; justify-content: center; align-items: center; gap: 8px; }
.hint-bar small { font-family: var(--sans); font-weight: 600; letter-spacing: 0; opacity: .8; }
.slots {
  min-height: 74px; border-radius: 18px; padding: 8px; display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap;
  background: rgba(0,0,0,.3); box-shadow: inset 0 3px 10px rgba(0,0,0,.35); transition: background .25s;
}
.slots.ok { background: rgba(47,165,106,.45); }
.slots.bad { animation: shake .4s; background: rgba(224,69,58,.4); }
.slots:empty::before { content: "Harflere dokun"; opacity: .5; font-size: .95rem; }
.slots .tile { width: 38px; height: 50px; font-size: 1.45rem; animation: pop .15s; }

/* Harf taşı */
.tile {
  background: var(--face); color: var(--ink); font-family: var(--serif); font-weight: 800;
  border-radius: 10px; display: grid; place-items: center; position: relative;
  box-shadow: 0 4px 0 var(--face-edge), 0 6px 8px rgba(0,0,0,.25), inset 0 0 0 2.5px var(--face), inset 0 0 0 4px color-mix(in srgb, var(--ink) 45%, transparent);
}
.pool { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 14px 10px; padding: 6px 4px 8px; }
.pool .tile { height: clamp(54px, 9.5dvh, 68px); font-size: 1.9rem; cursor: pointer; border-radius: 12px; transition: transform .08s, box-shadow .08s, opacity .2s; }
.pool .tile:active:not(.empty) { transform: translateY(4px); box-shadow: 0 0 0 var(--face-edge), 0 1px 2px rgba(0,0,0,.2), inset 0 0 0 2.5px var(--face), inset 0 0 0 4px color-mix(in srgb, var(--ink) 45%, transparent); }
.pool .tile.empty { opacity: .3; pointer-events: none; transform: translateY(4px); box-shadow: inset 0 0 0 2.5px var(--face); }
.tile .cnt { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; border-radius: 99px; background: var(--cta); color: #fff; font: 800 .78rem var(--sans); display: grid; place-items: center; border: 2px solid var(--face); padding: 0 4px; }
.tile .pts { position: absolute; bottom: 3px; right: 6px; font: 700 .68rem var(--sans); opacity: .65; }
.controls { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 10px; }
.controls .btn { font-size: .95rem; padding: 0 8px; min-height: 56px; flex-direction: row; }
.controls .btn-cta { font-size: 1.05rem; }

/* ---- Modal ---- */
.modal-back {
  position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(4,8,24,.72); backdrop-filter: blur(3px); animation: fade .2s;
}
.modal {
  width: 100%; max-height: 92dvh; overflow-y: auto; border-radius: 24px; padding: 22px 18px 18px; position: relative;
  background: var(--face); color: #2a2418;
  box-shadow: 0 18px 40px rgba(0,0,0,.5), inset 0 0 0 3px var(--face), inset 0 0 0 5px color-mix(in srgb, var(--ink) 50%, transparent);
  animation: rise .28s cubic-bezier(.2,1.2,.4,1);
}
.modal h2 { font-family: var(--serif); font-size: 1.55rem; color: var(--ink); text-align: center; margin-bottom: 6px; line-height: 1.2; }
.modal p.sub { text-align: center; color: #5a5038; margin-bottom: 14px; line-height: 1.4; }
.modal .stack { display: flex; flex-direction: column; gap: 10px; }
.modal .btn { width: 100%; }
.modal .btn-ghost { color: var(--ink); background: rgba(20,48,122,.08); box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.25); }
.modal .btn-text { color: #5a5038; }
.modal .x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #5a5038; background: rgba(0,0,0,.06); }
.modal .x .ic { width: 18px; height: 18px; }
.btn small { font-weight: 700; opacity: .85; font-size: .8rem; }
.btn .col { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.big-hearts { display: flex; justify-content: center; gap: 6px; margin: 4px 0 10px; }
.big-hearts .ic { width: 30px; height: 30px; color: rgba(0,0,0,.18); }
.balance { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.balance .chip { background: var(--ink); color: var(--gold); }
.countdown { text-align: center; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat-row { display: flex; justify-content: center; gap: 22px; margin: 6px 0 14px; }
.stat { text-align: center; color: var(--ink); }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; }
.stat span { font-size: .8rem; color: #5a5038; }
.reward-line { text-align: center; font-weight: 800; color: #9a6a00; margin-bottom: 8px; }

/* Mağaza */
.pack { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: #fffaf0; box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.18); text-align: left; width: 100%; position: relative; }
.pack:active { transform: scale(.98); }
.pack .amt { display: flex; align-items: center; gap: 6px; font-family: var(--serif); font-weight: 800; font-size: 1.35rem; color: var(--ink); flex: 1; }
.pack .amt .ic { color: #e0a800; width: 1.4em; height: 1.4em; }
.pack .amt small { display: block; font: 600 .78rem var(--sans); color: #6a5f46; }
.pack .price { background: var(--cta); color: #fff; font-weight: 800; padding: 9px 14px; border-radius: 12px; min-width: 84px; text-align: center; box-shadow: 0 3px 0 var(--cta-dark); }
.pack .tag { position: absolute; top: -9px; left: 12px; background: var(--ink); color: var(--gold); font: 800 .7rem var(--sans); padding: 2px 8px; border-radius: 99px; }
.pack.owned .price { background: var(--good); box-shadow: 0 3px 0 #1d7449; }
.section-title { font-weight: 800; color: #5a5038; font-size: .85rem; margin: 12px 0 2px; }

/* Günlük hediye */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 8px 0 14px; }
.day { border-radius: 10px; padding: 7px 0 5px; text-align: center; background: #fffaf0; box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.18); color: var(--ink); font-weight: 800; font-size: .72rem; }
.day b { display: flex; align-items: center; justify-content: center; gap: 1px; font-size: .95rem; color: #9a6a00; margin-top: 2px; }
.day b .ic { width: .9em; height: .9em; }
.day.done { background: var(--good); color: #fff; box-shadow: none; }
.day.done b { color: #fff; }
.day.today { box-shadow: 0 0 0 2.5px var(--cta); }

/* Ayarlar */
.row { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid rgba(0,0,0,.08); font-weight: 700; color: #2a2418; }
.switch { width: 54px; height: 32px; border-radius: 99px; background: #b9b19a; position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch.on { background: var(--good); }
.switch.on::after { transform: translateX(22px); }
.ver { text-align: center; font-size: .78rem; color: #8a7f66; margin-top: 12px; }

/* Reklam (yalnızca tarayıcı test modunda) */
.fake-ad { position: absolute; inset: 0; z-index: 90; background: #111; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
.fake-ad .box { width: 80%; max-width: 320px; aspect-ratio: 16/10; border-radius: 14px; background: repeating-linear-gradient(45deg,#2a2a2a,#2a2a2a 14px,#222 14px,#222 28px); display: grid; place-items: center; font-weight: 800; color: #aaa; }

/* Toast */
#toast { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translate(-50%, 20px); background: rgba(0,0,0,.82); color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 700; font-size: .95rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: 88%; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Animasyon */
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes settle { 0% { transform: translateY(-40px) rotate(var(--r, -6deg)); opacity: 0; } 100% { transform: translateY(0) rotate(var(--r, 0deg)); opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes bump { 0%,100% { transform: scale(1); } 40% { transform: scale(1.1); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px) scale(.94); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-height: 640px) { .found { height: 70px; } .slots { min-height: 62px; } .slots .tile { width: 34px; height: 44px; } .pool { gap: 10px 8px; } }

.controls .btn { white-space: nowrap; }
@media (max-width: 380px) { .controls { gap: 8px; } .controls .btn { font-size: .88rem; gap: 4px; padding: 0 4px; } .controls .btn .ic { width: 1.05em; height: 1.05em; } .controls .btn-cta { font-size: .95rem; } }

/* ===================== DÜELLO ===================== */
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 8px; border-radius: 99px; background: var(--cta); color: var(--cta-text); font: 800 .8rem var(--sans); box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.duel-btn { position: relative; }
.duel-btn .badge { position: absolute; top: -8px; right: 10px; margin: 0; }

.avatar { display: inline-grid; place-items: center; width: var(--s, 36px); height: var(--s, 36px); border-radius: 50%; color: #fff; font: 800 calc(var(--s, 36px) * .48) var(--serif); flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55), 0 2px 0 rgba(0,0,0,.25); text-shadow: 0 1px 0 rgba(0,0,0,.25); position: relative; }
.avatar.bot::after { content: "⚙"; position: absolute; right: -4px; bottom: -4px; font-size: .55em; background: #fff; color: #333; border-radius: 50%; width: 1.3em; height: 1.3em; display: grid; place-items: center; text-shadow: none; }
#duel-profile { gap: 8px; max-width: 150px; padding: 4px 12px 4px 5px; }
#duel-profile span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }

.duel-actions { display: flex; gap: 10px; margin: 6px 0 12px; }
.duel-actions .btn { flex: 1; min-height: 50px; font-size: 1rem; }
.duel-list { flex: 1; overflow-y: auto; padding-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.duel-list h3 { font-size: .86rem; font-weight: 800; opacity: .75; margin: 8px 2px 0; }
.duel-empty { text-align: center; opacity: .8; padding: 36px 20px; line-height: 1.5; }
.mcard { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 16px; background: rgba(0,0,0,.26); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12); }
.mcard.mine { background: rgba(244,197,66,.16); box-shadow: inset 0 0 0 2px var(--gold); }
.mcard.lead { box-shadow: inset 0 0 0 2px var(--good); }
.mcard.behind { box-shadow: inset 0 0 0 2px var(--bad); }
.mcard.lead .score { color: #6fe0a0; }
.mcard.behind .score { color: #ff8a80; }
.mcard:active { transform: scale(.985); }
.mcard .info { flex: 1; min-width: 0; line-height: 1.25; }
.mcard .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .info small { opacity: .75; font-size: .82rem; }
.mcard .score { font: 800 1.15rem var(--serif); white-space: nowrap; }
.tag-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font: 800 .74rem var(--sans); }
.tag-pill.win { background: var(--good); color: #fff; } .tag-pill.lose { background: var(--bad); color: #fff; } .tag-pill.draw { background: #8a8f9c; color: #fff; }

.vs-bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin: 4px 0 6px; }
.vs-side { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 14px; background: rgba(0,0,0,.26); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .25s, background .25s; min-width: 0; }
.vs-side.right { flex-direction: row-reverse; text-align: right; }
.vs-side.turn { background: rgba(244,197,66,.18); box-shadow: inset 0 0 0 2px var(--gold); }
.vs-side .nm { min-width: 0; line-height: 1.15; }
.vs-side .nm b { display: block; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-side .nm span { font: 800 1.35rem var(--serif); }
.vs-mid { font-weight: 800; opacity: .6; font-size: .8rem; }
.pass-dots { display: flex; gap: 3px; margin-top: 2px; }
.vs-side.right .pass-dots { justify-content: flex-end; }
.pass-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.22); }
.pass-dots i.on { background: var(--gold); }
.turn-banner { text-align: center; font-weight: 800; font-size: .92rem; min-height: 22px; margin-bottom: 6px; }
.turn-banner.mine { color: var(--gold); }
.turn-banner small { font-weight: 600; opacity: .75; }
.found.moves { height: auto; flex: 1; min-height: 56px; }
.found.moves .w.opp { background: color-mix(in srgb, var(--face) 55%, var(--ink)); color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.found.moves .w.opp small { color: var(--gold); }
.found.moves .w.pass { background: transparent; color: var(--text); opacity: .7; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3); font-family: var(--sans); font-weight: 700; font-size: .82rem; }
.found.moves .w.fresh { animation: pop .4s, glow 1.2s; }
@keyframes glow { 0% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: 0 2px 0 var(--face-edge); } }
.pool .tile.cnt0 { opacity: .3; }

/* Giriş / profil / arkadaş */
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 6px 0 12px; }
.avatar-grid button { border-radius: 50%; padding: 0; outline-offset: 3px; }
.avatar-grid button.sel .avatar { box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 2px #fff; }
.field { width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid rgba(20,48,122,.25); background: #fffaf0; font: 700 1.05rem var(--sans); color: #2a2418; user-select: text; -webkit-user-select: text; }
.field:focus { outline: 3px solid var(--gold); border-color: var(--ink); }
.codebox { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fffaf0; border-radius: 16px; padding: 10px 14px; box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.2); margin-bottom: 12px; }
.codebox b { font: 800 1.7rem var(--serif); letter-spacing: .14em; color: var(--ink); }
.codebox small { display: block; color: #6a5f46; font-weight: 600; }
.codebox .btn { width: auto; min-height: 44px; font-size: .9rem; }
.frow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.07); color: #2a2418; }
.frow .nm { flex: 1; min-width: 0; line-height: 1.2; } .frow .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .frow .nm small { color: #6a5f46; }
.frow .btn { width: auto; min-height: 40px; padding: 0 12px; font-size: .88rem; border-radius: 12px; box-shadow: none; }
.frow .btn:active { transform: none; }
.mini-x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #8a7f66; background: rgba(0,0,0,.06); }
.mini-x .ic { width: 16px; height: 16px; }
.stats3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 12px; }
.stats3 div { background: #fffaf0; border-radius: 12px; padding: 8px 4px; text-align: center; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.15); }
.stats3 b { display: block; font: 800 1.25rem var(--serif); } .stats3 span { font-size: .72rem; color: #6a5f46; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { padding: 10px 4px; border-radius: 12px; font-weight: 800; background: rgba(20,48,122,.08); color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.2); }
.seg button.sel { background: var(--ink); color: #fff; }
.spinner { width: 46px; height: 46px; border-radius: 50%; margin: 6px auto 12px; border: 5px solid rgba(20,48,122,.15); border-top-color: var(--cta); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { font-size: .82rem; color: #6a5f46; text-align: center; margin-top: 8px; line-height: 1.4; }

/* Hesap: menüdeki avatar düğmesi ve Google giriş kartı */
.chip-acct { margin-right: auto; padding: 4px 12px 4px 4px; gap: 8px; color: #fff; max-width: 52%; }
.chip-acct .n { font-weight: 800; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-radius: 16px; cursor: pointer;
  background: #fff; color: #1f2937; box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 8px 18px rgba(0,0,0,.18); font: inherit; }
.login-card .g { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 800 1.25rem var(--sans);
  color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.login-card .t { display: flex; flex-direction: column; gap: 2px; }
.login-card b { font-size: 1rem; }
.login-card small { font-size: .82rem; color: #4b5563; line-height: 1.3; }
.login-card:active { transform: translateY(2px); }
.acct-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; text-align: left; }
.acct-head .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-head .who b { font: 800 1.25rem var(--serif); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-head .who small { color: #555; font-size: .85rem; overflow-wrap: anywhere; }
.acct-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.acct-badges span { background: var(--ink); color: var(--gold); font: 800 .75rem var(--sans); padding: 3px 9px; border-radius: 99px; }
.acct-badges span.off { background: #e5e7eb; color: #555; }
.buy-list { list-style: none; margin: 6px 0 12px; padding: 0; text-align: left; font-size: .9rem; color: #333; max-height: 160px; overflow: auto; }
.buy-list li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 2px; border-bottom: 1px solid rgba(0,0,0,.08); }
.buy-list li small { color: #666; white-space: nowrap; }

/* Pes et düğmesi (bayrak) */
.btn-giveup { color: #ffb4a2; flex: none; }
.btn-giveup .ic { width: 20px; height: 20px; }
.game-top .chip { padding-left: 9px; padding-right: 9px; }

/* İstatistikler */
.seg.seg4 { grid-template-columns: repeat(4, 1fr); }
.seg.seg4 button { font-size: .8rem; padding: 10px 1px; letter-spacing: -.01em; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.st-card { background: #fffaf0; border-radius: 14px; padding: 9px 12px; text-align: left; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.15); min-width: 0; }
.st-card.wide { grid-column: span 2; }
.st-card span { display: block; font-size: .76rem; font-weight: 700; color: #6a5f46; }
.st-card b { display: block; font: 800 1.3rem var(--serif); margin-top: 2px; overflow-wrap: anywhere; }
.st-card b.dim { font: 700 .95rem var(--sans); opacity: .6; }
.st-word { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
.st-word em { font-style: normal; font-weight: 800; color: var(--cta-dark); font-size: .9rem; }
.mini-tiles { display: inline-flex; gap: 3px; flex-wrap: wrap; flex: none; max-width: 100%; }
.mini-tiles i { font-style: normal; width: 26px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: var(--face); color: var(--ink);
  font: 800 1.05rem var(--serif); box-shadow: 0 2px 0 var(--face-edge), inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 35%, transparent); }
.stats-modal .section-title:first-child { margin-top: 4px; }

/* ===================== AÇIK TEMA ===================== */
:root[data-theme=light] {
  --text: #1f2b48; --glass: rgba(255,255,255,.7);
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%2314307a' stroke-opacity='.07' stroke-width='1.5'%3E%3Crect x='20' y='20' width='32' height='32'/%3E%3Crect x='20' y='20' width='32' height='32' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='5'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme=light] .chip, [data-theme=light] .btn-round { background: rgba(255,255,255,.85); box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.16), 0 2px 0 rgba(20,48,122,.08); }
[data-theme=light] .chip-star, [data-theme=light] .chip-energy { color: #a26a00; }
[data-theme=light] .chip-acct { color: var(--text); }
[data-theme=light] .btn-dark { background: rgba(255,255,255,.85); color: var(--ink); box-shadow: 0 5px 0 rgba(20,48,122,.18), inset 0 0 0 1.5px rgba(20,48,122,.12); }
[data-theme=light] .btn-ghost { box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.2), 0 2px 0 rgba(20,48,122,.06); }
[data-theme=light] .btn-ghost.attn { color: #a26a00; box-shadow: inset 0 0 0 2px #d9a400; }
[data-theme=light] .cost { background: rgba(20,48,122,.1); color: #a26a00; }
[data-theme=light] .progress { background: rgba(20,48,122,.12); box-shadow: inset 0 1px 3px rgba(20,48,122,.18); }
[data-theme=light] .progress-fill { background: linear-gradient(90deg, #e0a800, #f4c542); }
[data-theme=light] .hearts .ic.lost { color: rgba(20,48,122,.18); }
[data-theme=light] .found, [data-theme=light] .slots { background: rgba(20,48,122,.07); box-shadow: inset 0 2px 8px rgba(20,48,122,.12); }
[data-theme=light] .slots.ok { background: rgba(47,165,106,.3); }
[data-theme=light] .slots.bad { background: rgba(224,69,58,.25); }
[data-theme=light] .found .w { box-shadow: 0 2px 0 var(--face-edge), inset 0 0 0 1px rgba(20,48,122,.12); }
[data-theme=light] .hint-bar, [data-theme=light] .turn-banner.mine { color: #a26a00; }
[data-theme=light] .mcard, [data-theme=light] .vs-side { background: rgba(255,255,255,.8); box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.12); }
[data-theme=light] .mcard.mine, [data-theme=light] .vs-side.turn { background: rgba(244,197,66,.22); box-shadow: inset 0 0 0 2px #d9a400; }
[data-theme=light] .mcard.lead { box-shadow: inset 0 0 0 2px var(--good); }
[data-theme=light] .mcard.behind { box-shadow: inset 0 0 0 2px var(--bad); }
[data-theme=light] .mcard.lead .score { color: #1d8a52; }
[data-theme=light] .mcard.behind .score { color: #c8372d; }
[data-theme=light] .pass-dots i { background: rgba(20,48,122,.2); }
[data-theme=light] .pass-dots i.on { background: #e0a800; }
[data-theme=light] .found.moves .w.pass { box-shadow: inset 0 0 0 1.5px rgba(20,48,122,.3); }
[data-theme=light] .btn-giveup { color: #c8372d; }
[data-theme=light] .modal-back { background: rgba(20,30,60,.45); }
