/* Tavla — telefon öncelikli arayüz (Piyon ceviz teması) */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --metin: #f5ecdf;
  --soluk: #c0ad93;
  --cok-soluk: #8e7c66;
  --panel: rgba(255, 236, 214, .055);
  --panel-kenar: rgba(255, 226, 190, .11);
  --vurgu: #f2a553;
  --vurgu-koyu: #d27b2e;
  --vurgu-metin: #22140a;
  --alt-bosluk: env(safe-area-inset-bottom, 0px);
  --ust-bosluk: env(safe-area-inset-top, 0px);
  --kenar: max(10px, env(safe-area-inset-left), env(safe-area-inset-right));
  --ust-h: 50px;
  --serit-h: 50px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--metin);
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  position: fixed; inset: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background-color: #140d08;
  background-image:
    radial-gradient(75% 48% at 50% 40%, rgba(243, 160, 82, .2) 0%, rgba(243, 160, 82, .06) 45%, transparent 75%),
    radial-gradient(120% 60% at 50% 115%, rgba(0, 0, 0, .7), transparent 65%),
    linear-gradient(180deg, #24170e 0%, #1a110b 55%, #100a06 100%);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--vurgu); outline-offset: 2px; }

/* ---------- Yerleşim ---------- */
.uygulama {
  height: 100vh; height: 100dvh;
  max-width: 760px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--ust-h) var(--serit-h) minmax(0, 1fr) var(--serit-h) auto;
  row-gap: 2px;
  padding: var(--ust-bosluk) var(--kenar) 0;
}

.ust { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 2px; }
.geri-link {
  justify-self: start; display: inline-flex; align-items: center; gap: 2px;
  height: 38px; padding: 0 12px 0 6px; border-radius: 12px;
  color: var(--soluk); text-decoration: none; font-size: 14px; font-weight: 650;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-kenar);
}
.geri-link svg { width: 20px; height: 20px; }
.geri-link:active { background: rgba(255, 236, 214, .12); }
.baslik { text-align: center; min-width: 0; }
.marka-ad { font-weight: 780; font-size: 18px; letter-spacing: .01em; line-height: 1.1; }
.marka-alt { font-size: 11.5px; color: var(--soluk); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.ust-dugmeler { justify-self: end; display: flex; gap: 8px; }
.ikon-dugme { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: var(--soluk); background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-kenar); }
.ikon-dugme:active { background: rgba(255, 236, 214, .12); }
.ikon-dugme svg { width: 22px; height: 22px; }
#sesDugme .ses-kapali { display: none; }
#sesDugme[aria-pressed="false"] .ses-acik { display: none; }
#sesDugme[aria-pressed="false"] .ses-kapali { display: block; }

/* ---------- Oyuncu şeritleri ---------- */
.serit { display: flex; align-items: center; gap: 10px; padding: 0 4px; min-width: 0; width: 100%; max-width: 720px; justify-self: center; }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(150deg, #3d2b1d, #21160e);
  box-shadow: inset 0 0 0 1px var(--panel-kenar);
  transition: box-shadow .3s;
}
.avatar i { width: 24px; height: 24px; border-radius: 50%; display: block; }
.avatar i.beyaz { background: radial-gradient(circle at 35% 30%, #fffaf0, #e9dcc5 55%, #b9a280); box-shadow: 0 2px 4px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(150, 120, 80, .25); }
.avatar i.siyah { background: radial-gradient(circle at 35% 30%, #6a4637, #2c1a12 60%, #120a06); box-shadow: 0 2px 4px rgba(0, 0, 0, .6), inset 0 0 0 3px rgba(255, 210, 170, .1); }
.serit.sirada .avatar { box-shadow: inset 0 0 0 2px var(--vurgu), 0 0 18px rgba(242, 165, 83, .4); }
.kimlik { min-width: 0; flex: 1; }
.kimlik .ad { font-weight: 690; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kimlik .alt { font-size: 12.5px; color: var(--soluk); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.serit.sirada .alt b { color: var(--vurgu); font-weight: 650; }
.kimlik .alt b { font-weight: 600; }
.kimlik .ince { font-weight: 500; color: var(--cok-soluk); }
.skor {
  flex: none; min-width: 52px; padding: 4px 10px; border-radius: 11px; text-align: center; line-height: 1.05;
  color: var(--soluk); background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--panel-kenar);
}
.skor b { display: block; font-size: 18px; font-weight: 800; color: var(--metin); font-variant-numeric: tabular-nums; }
.skor small { font-size: 10.5px; font-weight: 650; }
.dusunuyor i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; margin-left: 3px; vertical-align: middle; animation: nokta 1.1s infinite; }
.dusunuyor i:nth-child(2) { animation-delay: .15s; }
.dusunuyor i:nth-child(3) { animation-delay: .3s; }
@keyframes nokta { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

/* ---------- Tahta ---------- */
.tahta-alan { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.tahta {
  display: block; width: 100%; height: 100%; max-width: 720px;
  touch-action: manipulation;
}
.tahta .vurus { cursor: pointer; fill: transparent; }
.tahta .vurus:focus { outline: none; }
.tahta .vurus:focus-visible { stroke: var(--vurgu); stroke-width: 3; }
.tahta .tas-kat use, .tahta .ucan { pointer-events: none; }
.tahta .sayi { font: 800 15px system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.tahta .sayi.beyaz { fill: #5a3d22; }
.tahta .sayi.siyah { fill: #f3dcc0; }
.tahta .hedef { fill: rgba(255, 196, 120, .16); stroke: #ffc477; stroke-width: 2.4; stroke-dasharray: 5 4; pointer-events: none; animation: nabiz 1.1s ease-in-out infinite; }
.tahta .hedef-ucgen { fill: rgba(255, 190, 110, .22); pointer-events: none; }
.tahta .secili-halka { fill: none; stroke: #ffd08a; stroke-width: 3.2; pointer-events: none; filter: drop-shadow(0 0 5px rgba(255, 190, 100, .9)); }
.tahta .oynar-halka { fill: none; stroke: rgba(255, 208, 138, .55); stroke-width: 2; pointer-events: none; }
.tahta .tepsi-hedef { fill: rgba(255, 196, 120, .2); stroke: #ffc477; stroke-width: 2.4; stroke-dasharray: 5 4; pointer-events: none; animation: nabiz 1.1s ease-in-out infinite; }
.tahta .son-iz { fill: rgba(255, 220, 160, .14); pointer-events: none; }
@keyframes nabiz { 50% { opacity: .55; } }

.tahta .zar-grup { pointer-events: none; }
.tahta .zar { transform-box: fill-box; transform-origin: center; transition: opacity .25s; }
.tahta .zar.kullanildi { opacity: .3; }
.tahta .zar.donuyor { animation: zarDon .5s cubic-bezier(.3, .7, .3, 1); }
@keyframes zarDon {
  0% { transform: translateY(-26px) rotate(-200deg) scale(.7); opacity: .4; }
  60% { transform: translateY(4px) rotate(18deg) scale(1.05); opacity: 1; }
  100% { transform: none; }
}

.bildirim {
  position: absolute; left: 50%; top: 30%; z-index: 5;
  transform: translate(-50%, -50%) scale(.96); opacity: 0;
  max-width: min(86%, 420px); padding: 10px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 700; text-align: center; line-height: 1.3;
  color: var(--metin); background: rgba(28, 18, 11, .9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 210, 160, .2);
  pointer-events: none; transition: opacity .22s, transform .22s;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.bildirim.acik { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- Alt düğmeler ---------- */
.bar {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr); gap: 8px;
  width: 100%; max-width: 720px; justify-self: center;
  padding: 6px 0 calc(10px + var(--alt-bosluk));
}
.bar-dugme, .ana-eylem {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 58px; border-radius: 16px; min-width: 0;
  font-size: 12px; font-weight: 650; color: var(--soluk);
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-kenar);
  transition: background .15s, opacity .15s, transform .1s, color .15s;
}
.bar-dugme span, .ana-eylem span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar-dugme svg { width: 22px; height: 22px; flex: none; }
.bar-dugme:active:not(:disabled), .ana-eylem:active:not(:disabled) { transform: scale(.96); }
.bar-dugme:disabled { opacity: .32; cursor: default; }
.ana-eylem {
  flex-direction: row; gap: 9px; font-size: 17px; font-weight: 800;
  color: var(--vurgu-metin);
  background: linear-gradient(180deg, #f7b46c, #d47d30);
  box-shadow: 0 10px 22px -8px rgba(242, 140, 50, .75), inset 0 1px 0 rgba(255, 255, 255, .38);
}
.ana-eylem svg { width: 24px; height: 24px; flex: none; }
.ana-eylem .tamam-ikon { display: none; }
.ana-eylem.bitti .zar-ikon { display: none; }
.ana-eylem.bitti .tamam-ikon { display: block; }
.ana-eylem.dikkat { animation: cagir 1.6s ease-in-out infinite; }
@keyframes cagir { 50% { box-shadow: 0 10px 26px -6px rgba(255, 160, 70, 1), 0 0 0 4px rgba(242, 165, 83, .25), inset 0 1px 0 rgba(255, 255, 255, .38); } }
.ana-eylem:disabled {
  cursor: default; color: var(--soluk); font-size: 14px; font-weight: 650;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-kenar);
}
.ana-eylem:disabled svg { opacity: .5; }

/* ---------- Alt sayfalar ---------- */
.perde { position: fixed; inset: 0; z-index: 40; background: rgba(8, 5, 3, .58); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.perde.acik { opacity: 1; }
.sayfa {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-width: 560px; margin: 0 auto; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px max(18px, env(safe-area-inset-left)) calc(16px + var(--alt-bosluk)) max(18px, env(safe-area-inset-right));
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #2c1e13 0%, #1c130c 100%);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 220, 180, .14);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
.sayfa.acik { transform: none; }
.sayfa:focus { outline: none; }
.tutamac { width: 42px; height: 5px; border-radius: 3px; background: rgba(255, 230, 200, .22); margin: 0 auto 10px; }
.sayfa h2 { margin: 2px 0 14px; font-size: 23px; font-weight: 780; letter-spacing: -.01em; }
.grup { margin-bottom: 16px; }
.grup-baslik { font-size: 13px; color: var(--soluk); font-weight: 650; margin: 0 2px 8px; }
.aciklama { font-size: 13px; color: var(--cok-soluk); margin: 8px 3px 0; min-height: 1.35em; line-height: 1.4; }

.kartlar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kart {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px; border-radius: 18px; min-height: 64px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-kenar);
  transition: background .15s, box-shadow .15s;
}
.kart svg { width: 30px; height: 30px; flex: none; color: var(--soluk); }
.kart span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kart b { font-size: 15px; font-weight: 720; }
.kart small { font-size: 12px; color: var(--soluk); line-height: 1.3; }
.kart[aria-pressed="true"] { background: rgba(242, 165, 83, .14); box-shadow: inset 0 0 0 2px var(--vurgu); }
.kart[aria-pressed="true"] svg { color: var(--vurgu); }
@media (max-width: 360px) { .kartlar { grid-template-columns: 1fr; } }

.segment { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 15px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px var(--panel-kenar); }
.segment button { height: 44px; border-radius: 11px; font-weight: 650; font-size: 14.5px; color: var(--soluk); transition: background .15s, color .15s; }
.segment button[aria-pressed="true"] { background: linear-gradient(180deg, #f6b067, var(--vurgu-koyu)); color: var(--vurgu-metin); box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }

.ana-dugme {
  display: block; width: 100%; height: 54px; border-radius: 17px; margin-top: 6px;
  background: linear-gradient(180deg, #f7b46c, #d47d30); color: var(--vurgu-metin);
  font-weight: 780; font-size: 16.5px;
  box-shadow: 0 10px 22px -8px rgba(242, 140, 50, .7), inset 0 1px 0 rgba(255, 255, 255, .38);
}
.ana-dugme:active { transform: scale(.98); }
.ikincil-dugme { display: block; width: 100%; height: 46px; border-radius: 14px; margin-top: 4px; color: var(--soluk); font-weight: 650; }
.ikincil-dugme:active { background: var(--panel); }

.kurallar { margin: 0 0 14px; padding: 0 0 0 18px; display: grid; gap: 9px; font-size: 14.5px; line-height: 1.45; color: #e7dccb; }
.kurallar b { color: var(--metin); }
.kurallar li::marker { color: var(--vurgu); }

.son-ust { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.son-ust h2 { margin: 0 0 2px; font-size: 26px; }
.son-alt { margin: 0; font-size: 14px; color: var(--soluk); }
.son-alt b { color: var(--vurgu); }
.son-tas { width: 56px; height: 56px; flex: none; border-radius: 50%; }
.son-tas.beyaz { background: radial-gradient(circle at 35% 30%, #fffaf0, #e9dcc5 55%, #b9a280); box-shadow: 0 6px 14px rgba(0, 0, 0, .55), inset 0 0 0 6px rgba(150, 120, 80, .22); }
.son-tas.siyah { background: radial-gradient(circle at 35% 30%, #6a4637, #2c1a12 60%, #120a06); box-shadow: 0 6px 14px rgba(0, 0, 0, .6), inset 0 0 0 6px rgba(255, 210, 170, .1); }
.son-skor {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 14px 16px; margin-bottom: 10px; border-radius: 18px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-kenar);
}
.son-skor .taraf { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.son-skor .taraf:last-child { text-align: right; }
.son-skor .taraf span { font-size: 13px; color: var(--soluk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.son-skor .taraf b { font-size: 30px; font-weight: 820; font-variant-numeric: tabular-nums; }
.son-skor .orta { font-size: 12px; color: var(--cok-soluk); text-align: center; line-height: 1.3; }

/* Geniş ekran: biraz daha ferah */
@media (min-width: 700px) and (min-height: 700px) {
  :root { --ust-h: 60px; --serit-h: 58px; }
  .marka-alt { max-width: 320px; }
  .bar { padding-top: 10px; }
}
/* Alçak ekran (yatay telefon) */
@media (max-height: 560px) {
  :root { --ust-h: 42px; --serit-h: 40px; }
  .bar-dugme, .ana-eylem { height: 46px; }
  .avatar { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .tahta .zar.donuyor, .tahta .hedef, .tahta .tepsi-hedef, .ana-eylem.dikkat { animation: none; }
}
