:root {
  color-scheme: only light;
  --kraft: #d9b98a;
  --kraft-koyu: #b8925c;
  --lacivert: #13233f;
  --lacivert-2: #1f3560;
  --amber: #f2b03c;
  --turuncu: #e4572e;
  --turuncu-koyu: #a8361a;
  --krem: #fbf5e8;
  --yesil: #23744c;
  --wa: #1f8f4e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; overflow-x: clip; }
body {
  background-color: var(--kraft);
  background-image: repeating-linear-gradient(90deg, rgba(90, 60, 20, .07) 0 2px, transparent 2px 14px);
  color: var(--lacivert);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 16px; line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button { font: inherit; }

/* ---------- Üst: valiz kapağı ---------- */
.ust {
  position: relative; background: var(--lacivert); color: var(--krem);
  padding: 40px 16px 34px; text-align: center; overflow: hidden;
  border-bottom: 10px solid var(--lacivert-2);
}
.kayis { position: absolute; inset: 0; pointer-events: none; }
.kayis::before, .kayis::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 26px; background: var(--amber); opacity: .18;
}
.kayis::before { left: 18%; }
.kayis::after { right: 18%; }
.etiket-ust {
  position: absolute; top: 12px; right: -8px; transform: rotate(8deg);
  background: var(--amber); color: var(--lacivert); font-weight: 800; font-size: 13px; letter-spacing: .08em;
  padding: 4px 18px 4px 12px; border-radius: 6px 0 0 6px;
}
h1 { position: relative; margin: 0; font-weight: 800; font-size: clamp(40px, 12vw, 58px); line-height: 1; letter-spacing: -.02em; }
h1 span { display: block; font-family: Caveat, "Comic Sans MS", cursive; font-weight: 700; color: var(--amber); font-size: 1.12em; transform: rotate(-2deg); margin-top: 2px; }
.soz { position: relative; max-width: 420px; margin: 12px auto 0; font-size: 17px; opacity: .92; }

main { max-width: 600px; margin: 0 auto; padding: 18px 16px 60px; }

/* ---------- Seçim ---------- */
fieldset {
  border: 0; margin: 0 0 14px; padding: 14px 14px 16px; background: var(--krem);
  border-radius: 14px; box-shadow: 0 3px 0 rgba(19, 35, 63, .18);
}
legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-weight: 800; font-size: 19px; }
legend b {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 6px; border-radius: 50%;
  background: var(--turuncu); color: #fff; font-size: 15px; vertical-align: 2px;
}
.cipler { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.cip {
  font-size: 16px; font-weight: 700; min-height: 44px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--lacivert); border: 2px solid var(--lacivert);
}
.cip[aria-pressed="true"] { background: var(--lacivert); color: var(--krem); }
.cip span { margin-right: 5px; }

.gun { clear: both; display: flex; align-items: center; justify-content: center; gap: 18px; }
.gun-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--lacivert); color: var(--krem); font-size: 30px; font-weight: 800; line-height: 1;
  box-shadow: 0 4px 0 #050a14;
}
.gun-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #050a14; }
.gun-btn:disabled { opacity: .35; cursor: default; }
#gunYazi { min-width: 120px; text-align: center; font-size: 34px; font-weight: 800; }
#gunKaydir { width: 100%; margin-top: 12px; accent-color: var(--turuncu); height: 28px; }

.bos { text-align: center; font-weight: 700; font-size: 18px; margin: 22px 0; }

/* ---------- Sonuç ---------- */
.ozet {
  position: relative; margin: 26px 0 12px; padding: 14px 16px 14px 18px; background: var(--krem);
  border-radius: 10px; border-left: 10px dashed var(--turuncu); font-size: 16px;
  box-shadow: 0 3px 0 rgba(19, 35, 63, .18);
}
.ozet b { font-size: 18px; }
.bilet-no {
  display: block; font-size: 12px; font-weight: 800; letter-spacing: .25em; color: var(--turuncu); margin-bottom: 2px;
}

.ilerleme {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  margin: 0 -16px 14px; padding: 10px 16px; background: var(--lacivert); color: var(--krem);
  box-shadow: 0 6px 12px rgba(19, 35, 63, .25);
}
.valiz-ikon { font-size: 26px; }
.bar { flex: 1; height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.dolu { height: 100%; width: 0; background: var(--amber); border-radius: 99px; transition: width .25s; }
.sayi { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.ilerleme.hazir .dolu { background: #6fd39b; }

.unutulan {
  background: var(--turuncu); color: #fff; border-radius: 14px; padding: 14px 14px 6px; margin-bottom: 14px;
  box-shadow: 0 4px 0 var(--turuncu-koyu);
}
.unutulan h2 { margin: 0; font-size: 21px; }
.kucuk { font-size: 14px; opacity: .85; margin: 2px 0 8px; }
.orta { text-align: center; }
.unutulan .maddeler li { background: rgba(255, 255, 255, .96); color: var(--lacivert); }

.not-kagit {
  margin: 0 0 10px; padding: 10px 12px; background: #fff6d8; border-radius: 4px; font-size: 15px;
  box-shadow: 0 2px 0 rgba(19, 35, 63, .15); transform: rotate(-.4deg);
}
.not-kagit ul { margin: 6px 0 0; padding-left: 20px; }
.not-kagit li { margin-bottom: 4px; }

.kategori {
  position: relative; background: var(--krem); border-radius: 14px; padding: 12px 12px 6px; margin: 16px 0 0;
  box-shadow: 0 3px 0 rgba(19, 35, 63, .18);
}
.kategori h2 {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  margin: 0 0 8px; font-size: 19px;
}
.kat-sayi { font-size: 14px; font-weight: 700; color: var(--kraft-koyu); font-variant-numeric: tabular-nums; }
.kategori.bitti h2 .kat-sayi { color: var(--yesil); }
.kategori.bitti h2 .kat-sayi::before { content: "✓ "; }

.maddeler { list-style: none; margin: 0; padding: 0; }
.maddeler li {
  display: flex; align-items: flex-start; gap: 4px; background: #fff; border-radius: 10px; margin-bottom: 6px;
  border: 1.5px solid rgba(19, 35, 63, .1);
}
.maddeler label { flex: 1; display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px 10px 10px; cursor: pointer; min-height: 48px; }
.maddeler input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kutucuk {
  flex: none; width: 26px; height: 26px; margin-top: 1px; border: 2.5px solid var(--lacivert); border-radius: 7px; background: #fff;
  display: grid; place-items: center;
}
.maddeler input:focus-visible + .kutucuk { outline: 3px solid var(--amber); outline-offset: 2px; }
.maddeler input:checked + .kutucuk { background: var(--lacivert); }
.maddeler input:checked + .kutucuk::after { content: ""; width: 7px; height: 13px; border: solid var(--amber); border-width: 0 3.5px 3.5px 0; transform: translateY(-2px) rotate(45deg); }
.metin { flex: 1; min-width: 0; }
.ad { font-weight: 700; }
.adet {
  display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 6px; background: var(--amber);
  font-weight: 800; font-size: 14px; white-space: nowrap; vertical-align: 1px;
}
.metin small { display: block; font-size: 13.5px; opacity: .72; margin-top: 2px; }
li.tamam .ad { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .55; }
li.tamam .adet, li.tamam small { opacity: .5; }
.cikar {
  flex: none; width: 40px; height: 44px; border: 0; background: none; color: var(--lacivert); opacity: .35;
  font-size: 24px; cursor: pointer; border-radius: 8px;
}
.cikar:hover, .cikar:focus-visible { opacity: 1; background: rgba(228, 87, 46, .12); color: var(--turuncu-koyu); }

.kendi { margin: 18px 0 0; background: var(--krem); border-radius: 14px; padding: 14px; box-shadow: 0 3px 0 rgba(19, 35, 63, .18); }
.kendi label { display: block; font-weight: 800; margin-bottom: 8px; }
.ekle-satir { display: flex; gap: 8px; }
.ekle-satir input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--lacivert); background: #fff;
}

.dugme {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 10px 18px;
  border: 0; border-radius: 14px; cursor: pointer; background: var(--lacivert); color: var(--krem); font-weight: 800; font-size: 17px;
  box-shadow: 0 4px 0 #050a14; text-decoration: none;
}
.dugme:active { transform: translateY(3px); box-shadow: 0 1px 0 #050a14; }
.dugme.kucuk-d { min-height: 46px; }
.dugme.wa { background: var(--wa); box-shadow: 0 4px 0 #0f5a30; }
.dugme.ikincil { background: var(--krem); color: var(--lacivert); box-shadow: 0 4px 0 rgba(19, 35, 63, .35); }
.paylas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 8px; }
.paylas .wa { grid-column: 1 / -1; font-size: 19px; }
#gosterBtn { grid-column: 1 / -1; }

.alt { text-align: center; padding: 10px 16px 40px; font-size: 14px; max-width: 520px; margin: 0 auto; }
.alt p { margin: 4px 0; }

.bildirim {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0;
  background: var(--lacivert); color: var(--krem); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 20;
  transition: .2s; pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.bildirim.acik { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 640px) {
  .paylas { grid-template-columns: repeat(4, 1fr); }
  .paylas .wa { grid-column: span 2; }
}

/* ---------- Yazdırma ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .ust { background: none; color: #000; padding: 0 0 6px; border: 0; text-align: left; }
  .ust .soz, .kayis, .etiket-ust { display: none; }
  h1 { font-size: 22pt; }
  h1 span { display: inline; color: #000; font-size: 1em; transform: none; }
  #secim, #bos, .ilerleme, .kendi, .paylas, .orta, .alt, .bildirim, .cikar, #uyarilar { display: none !important; }
  main { max-width: none; padding: 0; }
  .ozet { box-shadow: none; border: 1px solid #000; border-left-width: 1px; margin: 6px 0 10px; }
  .unutulan { background: none; color: #000; box-shadow: none; border: 2px solid #000; padding: 6px 8px 2px; }
  .unutulan .kucuk { display: none; }
  .unutulan h2 { font-size: 13pt; }
  #kategoriler { columns: 2; column-gap: 10mm; }
  .kategori { break-inside: avoid; box-shadow: none; background: none; padding: 0; margin: 0 0 8px; }
  .kategori h2 { font-size: 12.5pt; border-bottom: 1px solid #000; margin-bottom: 3px; }
  .kat-sayi { display: none; }
  .maddeler li { border: 0; border-radius: 0; margin: 0; background: none !important; }
  .maddeler label { padding: 2px 0; min-height: 0; gap: 6px; }
  .kutucuk { width: 12pt; height: 12pt; border-width: 1.2px; border-radius: 2px; }
  .maddeler input:checked + .kutucuk { background: #fff; }
  .maddeler input:checked + .kutucuk::after { border-color: #000; width: 4px; height: 8px; border-width: 0 2px 2px 0; }
  .adet { background: none; border: 1px solid #000; font-size: 9pt; padding: 0 4px; }
  .metin small { font-size: 8.5pt; }
  li.tamam .ad { text-decoration: none; opacity: 1; }
  li.tamam .adet, li.tamam small { opacity: 1; }
}
