:root {
  --zemin: #f4f1fb;
  --kagit: #ffffff;
  --murekkep: #221d36;
  --soluk: #5d5873;
  --cizgi: #ddd6ef;
  --ana: #5232b8;
  --ana-koyu: #3e2295;
  --vurgu: #f3a712;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--murekkep);
  background: var(--zemin);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #1d63c9; outline-offset: 2px; }
h2 { margin: 0; font-size: 0.95rem; }

.duzen { display: flex; flex-direction: column; gap: 14px; padding: 8px 10px 14px; }
.cark-alan { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cark-kutu {
  position: relative;
  /* 20px: sağa taşan okun (ve gölgesinin) dar ekranda kesilmemesi için pay */
  width: min(calc(100% - 20px), calc(100dvh - 128px), 680px);
  aspect-ratio: 1;
}
#cark { display: block; width: 100%; height: 100%; touch-action: manipulation; cursor: pointer; }
.ok {
  position: absolute;
  right: -6px;
  top: 50%;
  width: 34px;
  height: 41px;
  transform: translateY(-50%) rotate(90deg);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
  pointer-events: none;
}
.ok path { fill: var(--murekkep); }
.ok circle { fill: #fff; }
.sonuc {
  margin: 0;
  min-height: 1.6em;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.sonuc .kazanan { color: var(--ana); }
.sonuc small { display: block; font-size: 0.8rem; font-weight: 600; color: var(--soluk); }

.dugme {
  border: 2px solid var(--cizgi);
  border-radius: 12px;
  background: var(--kagit);
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  touch-action: manipulation;
}
.dugme:hover { border-color: #b9addf; }
.dugme--ana { background: var(--ana); border-color: var(--ana); color: #fff; }
.dugme--ana:hover { background: var(--ana-koyu); border-color: var(--ana-koyu); }
.dugme--buyuk { width: min(100%, 420px); min-height: 52px; font-size: 1.2rem; }
.dugme--kucuk { min-height: 36px; padding: 0.25rem 0.7rem; font-size: 0.85rem; }
.dugme:disabled { opacity: 0.45; cursor: default; }

.liste-alan { display: flex; flex-direction: column; gap: 8px; }
.etiket-satir { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.etiket-satir label { font-weight: 800; }
.etiket-satir small { font-weight: 500; color: var(--soluk); }
.sayac { font-size: 0.85rem; color: var(--soluk); font-variant-numeric: tabular-nums; white-space: nowrap; }
textarea {
  width: 100%;
  min-height: 9.5rem;
  resize: vertical;
  border: 2px solid var(--cizgi);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  background: var(--kagit);
  font-size: 1rem;
  line-height: 1.45;
}
textarea:read-only { background: #f7f6fb; color: var(--soluk); }
.not { margin: 0; font-size: 0.85rem; color: #9b2c1f; }
.not:empty { display: none; }
.hazirlar { display: flex; flex-wrap: wrap; gap: 6px; }
.hazirlar .dugme { flex: 1 1 auto; }
.kutucuk { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.kutucuk input { width: 22px; height: 22px; margin: 0; accent-color: var(--ana); }
.cikanlar-kutu { background: var(--kagit); border: 2px solid var(--cizgi); border-radius: 12px; padding: 8px 10px; }
.cikanlar { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; font-size: 0.9rem; }
.cikanlar li { background: var(--zemin); border-radius: 8px; padding: 3px 8px; overflow-wrap: anywhere; max-width: 100%; }
.cikanlar li:first-child { background: var(--ana); color: #fff; font-weight: 700; }
.cikanlar:empty::before { content: "Henüz çeviriş yok."; color: var(--soluk); }

@media (min-width: 720px) {
  .duzen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
    gap: 22px;
    align-items: start;
    padding: 14px 18px;
  }
  .cark-kutu { width: min(calc(100% - 20px), calc(100dvh - 132px), 680px); }
  .cikanlar { max-height: 28vh; overflow: auto; }
}
