@font-face {
  font-family: "Sansita Swashed";
  src: url("/fonts/sansita-swashed.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Rethink Sans";
  src: url("/fonts/rethink-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --kizilcik: #a51c28;
  --sarap: #6d0e19;
  --cam: #0e4a36;
  --cam-koyu: #083324;
  --kar: #fff8ec;
  --varak: #ecc057;
  --varak-koyu: #b98a1f;
  --murekkep: #2b1712;
  --soluk: #6b564b;
  --cizgi: #dccbad;
  --susleme: "Sansita Swashed", Georgia, serif;
  --metin: "Rethink Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--sarap);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--metin);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--kar);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(130% 60% at 50% -8%, #c22a37 0%, var(--kizilcik) 42%, var(--sarap) 100%);
}

#kar {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
#isiklar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 62px;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
#isiklar svg { display: block; width: 100%; height: 62px; }
#isiklar .tel { stroke: #3d060d; stroke-width: 2; fill: none; }
#isiklar .duy { fill: #3d060d; }
#isiklar .ampul { animation: goz-kirp 3.2s ease-in-out infinite; }
#isiklar .sari { fill: var(--varak); color: var(--varak); }
#isiklar .beyaz { fill: #fffdf6; color: #fffdf6; }
#isiklar .yesil { fill: #8ee0b4; color: #8ee0b4; }
#isiklar .ampul { filter: drop-shadow(0 0 5px currentColor); }
#isiklar .g2 { animation-delay: -1.1s; }
#isiklar .g3 { animation-delay: -2.2s; }
@keyframes goz-kirp {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

main {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  width: min(100% - 32px, 440px);
  margin: 0 auto;
  padding: calc(74px + env(safe-area-inset-top)) 0 20px;
}

/* ---------- başlık ---------- */
.baslik { text-align: center; margin-bottom: 26px; }
.baslik h1 {
  margin: 0 auto;
  max-width: 7em;
  font-family: var(--susleme);
  font-weight: 800;
  font-size: clamp(2.9rem, 15vw, 4rem);
  line-height: .96;
  letter-spacing: -.01em;
  text-shadow: 0 3px 0 var(--sarap), 0 10px 24px rgba(40, 0, 6, .45);
  text-wrap: balance;
}
.baslik p {
  margin: 16px auto 0;
  max-width: 30ch;
  font-size: 1.0625rem;
  color: #ffe9dc;
  text-wrap: pretty;
}
body:not([data-ekran="giris"]) .baslik h1 { font-size: clamp(2.1rem, 10.5vw, 2.8rem); max-width: none; }
body[data-ekran="yukleniyor"] main { visibility: hidden; }

/* ---------- kâğıt kart ---------- */
.kart {
  position: relative;
  background: var(--kar);
  color: var(--murekkep);
  border-radius: 6px;
  padding: 30px 20px 24px;
  box-shadow: 0 3px 0 rgba(40, 0, 6, .35), 0 24px 44px -20px rgba(30, 0, 5, .8);
}
.kart::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  border-radius: 6px 6px 0 0;
  background: repeating-linear-gradient(-45deg, var(--kizilcik) 0 9px, var(--kar) 9px 18px);
}
.kart h2 {
  margin: 0 0 6px;
  font-family: var(--susleme);
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1.15;
}
.kart p { margin: 0 0 14px; }
.kart .ipucu:last-child { margin-bottom: 0; }

/* ---------- sekmeler ---------- */
.sekmeler {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2px solid var(--cizgi);
  margin-bottom: 20px;
}
.sekmeler button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 4px solid transparent;
  margin-bottom: -2px;
  padding: 8px 4px 12px;
  min-height: 52px;
  font-family: var(--susleme);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--soluk);
  cursor: pointer;
}
.sekmeler button[aria-selected="true"] { color: var(--murekkep); border-bottom-color: var(--kizilcik); }

/* ---------- form ---------- */
.alan { margin-bottom: 16px; }
.alan label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type="text"], input[type="password"] {
  appearance: none;
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 14px;
  font: inherit;
  font-size: 1.125rem;
  color: var(--murekkep);
  background: #fff;
  border: 2px solid var(--cizgi);
  border-radius: 6px;
}
input:focus-visible { outline: 3px solid rgba(14, 74, 54, .28); outline-offset: 1px; border-color: var(--cam); }
.sifre-kutu { position: relative; }
.sifre-kutu input { padding-right: 84px; }
.sifre-kutu button {
  position: absolute;
  top: 4px; right: 4px; bottom: 4px;
  width: 76px;
  appearance: none;
  border: 0;
  border-radius: 4px;
  background: none;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: var(--cam);
  cursor: pointer;
}
.ipucu { margin: 6px 0 0; font-size: .9375rem; color: var(--soluk); }
.kart > .ipucu { margin-top: 14px; }

.uyari {
  margin: 0 0 16px;
  padding: 11px 12px;
  border-left: 4px solid var(--kizilcik);
  border-radius: 4px;
  background: #fbe2de;
  color: #7c111c;
  font-size: 1rem;
}
.uyari.acik { margin: 14px 0 0; text-align: left; }

/* ---------- düğmeler ---------- */
.dugme {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--cam);
  color: var(--kar);
  font-family: var(--susleme);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--cam-koyu);
  transition: transform .08s ease, box-shadow .08s ease;
  touch-action: manipulation;
}
.dugme:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--cam-koyu); }
.dugme[disabled] { opacity: .55; cursor: default; }
.dugme.varak { background: var(--varak); color: var(--murekkep); box-shadow: 0 5px 0 var(--varak-koyu); }
.dugme.varak:active { box-shadow: 0 1px 0 var(--varak-koyu); }
.dugme.cizgili {
  background: transparent;
  color: var(--kizilcik);
  box-shadow: inset 0 0 0 2px var(--kizilcik);
  font-size: 1.2rem;
}
.dugme.cizgili:active { transform: none; background: #fbe2de; box-shadow: inset 0 0 0 2px var(--kizilcik); }
.dugme + .dugme { margin-top: 14px; }

.metin-dugme {
  appearance: none;
  background: none;
  border: 0;
  padding: 10px 6px;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  color: var(--kar);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.metin-dugme.koyu { color: var(--cam); }
.metin-dugme.tehlike { color: var(--kizilcik); }

:where(button, a):focus-visible { outline: 3px solid var(--varak); outline-offset: 3px; }
.kart :where(button):focus-visible, .pusula :where(button):focus-visible, dialog :where(button):focus-visible { outline-color: var(--cam); }

/* ---------- bekleme ekranı ---------- */
.ara-baslik {
  margin: 0 0 14px;
  font-family: var(--susleme);
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
}
.kagitlar {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
}
.kagitlar li {
  background: var(--kar);
  color: var(--murekkep);
  padding: 11px 12px;
  border-radius: 3px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  box-shadow: 0 3px 0 rgba(40, 0, 6, .3);
  transform: rotate(-1.1deg);
}
.kagitlar li:nth-child(2n) { transform: rotate(.9deg); }
.kagitlar li:nth-child(3n) { transform: rotate(-.3deg); background: #f7e9cf; }
.kagitlar li.ben { box-shadow: inset 0 -5px 0 var(--varak), 0 3px 0 rgba(40, 0, 6, .3); }

/* ---------- çekiliş ---------- */
.sahne { text-align: center; }
.torba {
  appearance: none;
  position: relative;
  display: block;
  width: min(64vw, 250px);
  margin: 0 auto 18px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}
.torba svg { display: block; width: 100%; height: auto; transform-origin: 50% 90%; }
.torba.salla svg { animation: salla .75s ease-in-out; }
@keyframes salla {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-7deg); }
  35% { transform: rotate(6deg); }
  55% { transform: rotate(-5deg); }
  75% { transform: rotate(3deg); }
}
.ucan {
  position: absolute;
  left: 50%;
  top: 14%;
  width: 20%;
  aspect-ratio: 46 / 70;
  margin-left: -10%;
  border-radius: 2px;
  background: var(--kar);
  box-shadow: 0 6px 14px rgba(40, 0, 6, .35);
  opacity: 0;
}
.torba.cikti .ucan { animation: yuksel .7s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes yuksel {
  0% { opacity: 1; transform: translateY(0) rotate(3deg) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-95%) rotate(-8deg) scale(1.9); }
}
.sahne.kucuk .torba { width: 104px; margin-bottom: 4px; cursor: default; }
.sahne.kucuk #cek { display: none; }

.pusula {
  position: relative;
  margin: 6px 0 0;
  padding: 26px 18px 38px;
  text-align: center;
  color: var(--murekkep);
  background: linear-gradient(180deg, #fff8ec 0%, #f5e8d0 49.7%, #fffbf2 50.3%, #fff8ec 100%);
  transform: rotate(-1.4deg);
  transform-origin: 50% 0;
  filter: drop-shadow(0 16px 20px rgba(30, 0, 5, .55));
  --dis: conic-gradient(from -45deg at 50% 100%, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 18px 100%;
  -webkit-mask: var(--dis);
  mask: var(--dis);
}
.pusula.aciliyor { animation: ac .7s cubic-bezier(.2, .8, .25, 1) both; }
@keyframes ac {
  from { opacity: 0; transform: perspective(700px) rotateX(-86deg) rotate(-1.4deg); }
  to { opacity: 1; transform: perspective(700px) rotateX(0) rotate(-1.4deg); }
}
.pusula p { margin: 0; }
.pusula-ust { font-weight: 700; color: var(--soluk); }
.pusula-isim {
  margin: 8px 0 12px !important;
  font-family: var(--susleme);
  font-weight: 800;
  font-size: clamp(2.5rem, 13vw, 3.5rem);
  line-height: 1.05;
  color: var(--kizilcik);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.pusula.katli .pusula-isim { color: var(--cizgi); font-weight: 400; }
.pusula-alt { font-size: 1rem; color: var(--soluk); }

/* ---------- yönetim ---------- */
#yonetim { margin-top: 30px; }
.liste { list-style: none; margin: 20px 0 18px; padding: 0; border-top: 2px solid var(--cizgi); }
.liste li {
  display: flex;
  align-items: center;
  gap: 4px 10px;
  flex-wrap: wrap;
  padding: 6px 0;
  border-bottom: 1px solid var(--cizgi);
  min-height: 52px;
}
.liste .ad { flex: 1 1 8ch; font-weight: 700; overflow-wrap: anywhere; }
.liste .durum { font-size: .9375rem; color: var(--soluk); }
.liste .durum.tamam { color: var(--cam); font-weight: 700; }
.liste .metin-dugme { padding: 8px 4px; font-size: .9375rem; }

/* ---------- alt ---------- */
footer {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  flex-wrap: wrap;
  font-size: 1rem;
  color: #ffe9dc;
}
.tepeler {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: calc(64px + env(safe-area-inset-bottom));
  flex: none;
  margin-top: 12px;
}

/* ---------- onay penceresi ---------- */
dialog {
  width: min(100% - 32px, 400px);
  padding: 24px 20px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--kar);
  color: var(--murekkep);
  font-family: var(--metin);
  box-shadow: 0 30px 60px -10px rgba(20, 0, 4, .8);
}
dialog::backdrop { background: rgba(50, 4, 12, .72); }
dialog h2 { margin: 0 0 8px; font-family: var(--susleme); font-weight: 700; font-size: 1.6rem; line-height: 1.15; }
dialog p { margin: 0 0 18px; }
.pencere-dugmeler { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.pencere-dugmeler .dugme { margin: 0; font-size: 1.2rem; }
.pencere-dugmeler .dugme.kirmizi { background: var(--kizilcik); box-shadow: 0 5px 0 var(--sarap); }
.pencere-dugmeler .dugme.kirmizi:active { box-shadow: 0 1px 0 var(--sarap); }

.noscript { position: relative; z-index: 4; margin: 120px 16px; text-align: center; }

/* ---------- geniş ekran ---------- */
@media (min-width: 720px) {
  #isiklar, #isiklar svg { height: 74px; }
  main { padding-top: 108px; width: min(100% - 48px, 460px); }
  .baslik { margin-bottom: 34px; }
  .kart { padding: 36px 30px 30px; }
  .kagitlar { grid-template-columns: repeat(3, 1fr); }
  .tepeler { height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
