/* Pişti ve eşli pişti ortak ekran stili (ortak/pisti-ekran.js ile) */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #13261d;
  background: #e9f1ea;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, select { font: inherit; }
[hidden] { display: none !important; }
.gizli-baslik { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.oyun { height: 100%; max-width: 78rem; margin: 0 auto; padding: 0.4rem 0.45rem 0.45rem; display: grid; gap: 0.4rem;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "panel" "masa"; }
@media (min-width: 600px) and (min-aspect-ratio: 1/1) {
  .oyun { grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "panel masa"; padding: 0.7rem; gap: 0.9rem; }
  .yan { align-self: center; gap: 0.6rem !important; }
  .satir--ayar { flex-wrap: wrap; }
  .satir--ayar > .dugme { flex-basis: 100%; }
}
.yan { grid-area: panel; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.satir { display: flex; gap: 0.35rem; align-items: flex-end; }
.satir > * { flex: 1 1 0; min-width: 0; }
label.secim { display: flex; flex-direction: column; font-size: 0.68rem; font-weight: 700; color: #2a5e45; gap: 0.08rem; }
select { width: 100%; min-height: 2.4rem; padding: 0.2rem 0.25rem; border-radius: 10px; border: 2px solid #b4d4c1; background: #fff; color: #13261d; font-size: 0.84rem; font-weight: 700; }
.dugme { min-height: 2.4rem; padding: 0.3rem 0.5rem; border: 0; border-radius: 10px; background: #1c6b46; color: #fff; font-weight: 700; font-size: 0.86rem; cursor: pointer; line-height: 1.15; }
.dugme:hover:not(:disabled) { filter: brightness(1.07); }
.dugme:disabled { opacity: 0.45; cursor: default; }
.dugme:focus-visible, select:focus-visible { outline: 3px solid #e8892b; outline-offset: 2px; }

.tablo { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.skor { background: rgba(255,255,255,0.92); border-radius: 12px; padding: 0.25rem 0.5rem; box-shadow: 0 1px 4px rgba(19,38,29,0.12);
  border: 2px solid transparent; min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 0.3rem; }
.skor.sirada { border-color: #e8892b; }
.skor .ad { font-weight: 800; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skor .toplam { font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; grid-row: span 2; }
.skor .ek { font-size: 0.68rem; color: #2a5e45; font-weight: 700; line-height: 1.2; }
.hedef-yazi { margin: 0; font-size: 0.7rem; font-weight: 700; color: #2a5e45; text-align: center; }
.mesaj { margin: 0; font-weight: 700; min-height: 2.5em; text-align: center; font-size: 0.86rem; line-height: 1.25; display: flex; align-items: center; justify-content: center; }
.ipucu-yazi { margin: 0; font-size: 0.74rem; color: #2a5e45; text-align: center; line-height: 1.35; }
@media (max-width: 599px), (max-aspect-ratio: 1/1) { .ipucu-yazi { display: none; } .hedef-yazi { display: none; } }
@media (max-height: 560px) and (max-aspect-ratio: 1/1) { .mesaj { min-height: 2.3em; font-size: 0.8rem; } label.secim { font-size: 0.62rem; } }

/* Masa */
.masa { grid-area: masa; min-height: 0; min-width: 0; container-type: size; display: grid; }
.cuha { --gen: min(19cqw, 15.5cqh, 6.4rem); --kucuk: calc(var(--gen) * 0.58); width: 100%; height: 100%; border-radius: 16px; padding: 0.4rem;
  background: radial-gradient(ellipse at 50% 45%, #2c8a5a 0%, #1d6a44 70%, #175838 100%); box-shadow: inset 0 0 0 3px #134a2f, 0 3px 10px rgba(0,0,0,0.2);
  display: grid; gap: 0.3rem; color: #f1f7f2; min-height: 0; }
.cuha--2 { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "ust" "orta" "el"; }
.cuha--4 { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: ". ust ." "sol orta sag" ". el ."; }
.koltuk { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; min-width: 0; border-radius: 10px; padding: 0.1rem 0.25rem; border: 2px solid transparent; }
.koltuk.sirada { border-color: #f2b13c; background: rgba(0,0,0,0.12); }
.koltuk--ust { grid-area: ust; }
.koltuk--sol { grid-area: sol; align-self: center; }
.koltuk--sag { grid-area: sag; align-self: center; }
.koltuk .isim { font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.koltuk .isim small { font-weight: 700; opacity: 0.85; }
.arkalar { display: flex; min-height: calc(var(--kucuk) * 1.4); }
.arkalar .pk-kart { --pk-gen: var(--kucuk); }
.arkalar .pk-kart + .pk-kart { margin-left: calc(var(--kucuk) * -0.62); }
.koltuk--sol .arkalar, .koltuk--sag .arkalar { flex-direction: column; min-height: 0; }
.koltuk--sol .arkalar .pk-kart + .pk-kart, .koltuk--sag .arkalar .pk-kart + .pk-kart { margin-left: 0; margin-top: calc(var(--kucuk) * -1.1); }

.orta { grid-area: orta; display: flex; align-items: center; justify-content: center; gap: calc(var(--gen) * 0.3); min-height: 0; min-width: 0; }
.deste { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.7rem; font-weight: 700; }
.deste .pk-kart { --pk-gen: calc(var(--gen) * 0.75); }
.deste .bos { width: calc(var(--gen) * 0.75); height: calc(var(--gen) * 1.05); border-radius: 6px; border: 2px dashed rgba(255,255,255,0.35); }
.yigin-kutu { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; min-width: 0; }
.yigin { position: relative; height: calc(var(--gen) * 1.4); width: calc(var(--gen) * 2.2); }
.yigin .pk-kart { --pk-gen: var(--gen); position: absolute; top: 0; }
.yigin .bos { position: absolute; left: 0; top: 0; width: var(--gen); height: calc(var(--gen) * 1.4); border-radius: calc(var(--gen) * 0.09); border: 2px dashed rgba(255,255,255,0.35); }
.yigin.alindi .pk-kart { box-shadow: 0 0 0 3px #f2b13c, 0 1px 3px rgba(0,0,0,0.35); }
.yigin-yazi { font-size: 0.72rem; font-weight: 700; text-align: center; min-height: 1.2em; white-space: nowrap; }
.rozet { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #f2b13c; color: #2b1a00; font-weight: 900;
  font-size: 0.9rem; padding: 0.25rem 0.55rem; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,0.35); white-space: nowrap; z-index: 9; }

.el { grid-area: el; display: flex; justify-content: center; gap: calc(var(--gen) * 0.12); padding-bottom: 0.1rem; min-height: calc(var(--gen) * 1.4 + 0.3rem); align-items: flex-end; }
.el button.pk-kart { --pk-gen: var(--gen); border: 0; padding: 0; cursor: pointer; }
.el button.pk-kart:disabled { cursor: default; }
.el.sirada button.pk-kart:hover:not(:disabled) { transform: translateY(-6%); }
.el button.pk-kart:focus-visible { outline: 3px solid #f2b13c; outline-offset: 2px; }
.el.bekle button.pk-kart { filter: brightness(0.92); }

@media (prefers-reduced-motion: no-preference) {
  .yigin .pk-kart.yeni { animation: dus 0.22s ease-out; }
  @keyframes dus { from { transform: translateY(30%) scale(0.92); opacity: 0.4; } to { transform: none; opacity: 1; } }
  .el button.pk-kart { transition: transform 0.12s; }
}

/* Panel (el sonu, maç sonu) */
.ortu { position: fixed; inset: 0; background: rgba(10, 32, 22, 0.55); display: grid; place-items: center; padding: 0.6rem; z-index: 20; }
.panel { background: #fff; color: #13261d; border-radius: 16px; padding: 0.9rem 1rem; width: min(25rem, 100%); max-height: 100%; overflow: auto; text-align: center;
  display: flex; flex-direction: column; gap: 0.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.panel h2 { margin: 0; color: #1c6b46; font-size: 1.25rem; }
.panel p { margin: 0; line-height: 1.4; font-size: 0.9rem; }
.panel table { border-collapse: collapse; width: 100%; font-size: 0.84rem; }
.panel th, .panel td { padding: 0.18rem 0.35rem; border-bottom: 1px solid #e1ece5; }
.panel th:first-child, .panel td:first-child { text-align: left; }
.panel td { text-align: center; font-variant-numeric: tabular-nums; }
.panel tr.kalin td, .panel tr.kalin th { font-weight: 900; }
.panel .dugmeler { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.panel .dugme { padding: 0.45rem 1rem; }
@media (max-height: 560px) { .panel { padding: 0.6rem 0.7rem; gap: 0.35rem; } .panel table { font-size: 0.76rem; } .panel th, .panel td { padding: 0.1rem 0.3rem; } }
