:root {
  --vurgu: #ff7a1a;
  --yesil: #7dffb0;
  --kirmizi: #ff4a3d;
  --yazi: #eef3f6;
  --font: "Bahnschrift", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; background: #05090d; color: var(--yazi); font-family: var(--font); user-select: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hud { pointer-events: none; display: none; }
#hasar { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255, 30, 20, 0) 45%, rgba(255, 30, 20, 0.75) 100%); }
#hata { position: fixed; left: 12px; bottom: 12px; z-index: 50; color: #ff8a80; font: 13px/1.4 Consolas, monospace; white-space: pre-wrap; max-width: 80vw; }

.ekran { position: fixed; inset: 0; display: none; align-items: center; justify-content: flex-start; padding: 0 7vw; z-index: 10;
  background: linear-gradient(90deg, rgba(3, 8, 12, 0.88) 0%, rgba(3, 8, 12, 0.55) 38%, rgba(3, 8, 12, 0) 70%); }
.ekran.acik { display: flex; }
#duraklat, #son, #kontroller, #gorevler, #ayarlar, #yukleniyor { justify-content: center; background: rgba(3, 8, 12, 0.72); backdrop-filter: blur(6px); }
#yukleniyor { background: #05090d; }

.panel { width: min(440px, 100%); animation: gir 0.45s ease-out; }
.panel.dar { width: min(400px, 100%); text-align: center; }
.panel.genis { width: min(620px, 100%); }
@keyframes gir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.ust { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.5em; color: var(--vurgu); font-weight: 600; }
h1 { margin: 0; font-size: clamp(48px, 7vw, 92px); line-height: 0.95; letter-spacing: 0.06em; font-weight: 700; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
h1 span { color: var(--vurgu); display: block; }
h2 { margin: 0 0 14px; font-size: 34px; letter-spacing: 0.14em; font-weight: 700; }
h2.kazandi { color: var(--yesil); }
h2.kaybetti { color: var(--kirmizi); }
.alt { margin: 14px 0 30px; font-size: 16px; letter-spacing: 0.12em; color: rgba(238, 243, 246, 0.75); }
.not { margin-top: 26px; font-size: 12px; letter-spacing: 0.08em; color: rgba(238, 243, 246, 0.45); }
.ipucu { font-size: 14px; line-height: 1.5; color: rgba(238, 243, 246, 0.75); margin: 18px 0; }

button { display: block; width: 100%; margin: 10px 0; padding: 14px 20px; font: 600 15px var(--font); letter-spacing: 0.2em; color: var(--yazi);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.22); cursor: pointer; text-align: left;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); transition: background 0.15s, border-color 0.15s, padding 0.15s; }
button:hover, button:focus-visible { background: rgba(255, 255, 255, 0.13); border-color: #fff; padding-left: 28px; outline: none; }
button.ana { background: var(--vurgu); border-color: var(--vurgu); color: #160800; }
button.ana:hover, button.ana:focus-visible { background: #ff9440; border-color: #ff9440; }
.panel.dar button { text-align: center; }
.panel.dar button:hover { padding-left: 20px; }


.tuslar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; }
.tuslar div { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.tuslar span { margin-left: 6px; color: rgba(238, 243, 246, 0.85); }
kbd { min-width: 30px; padding: 5px 8px; text-align: center; font: 600 12px var(--font); border: 1px solid rgba(255, 255, 255, 0.4); border-bottom-width: 3px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); }

#son-istatistik { margin: 8px 0 22px; border-top: 1px solid rgba(255, 255, 255, 0.18); }
#son-istatistik div { display: flex; justify-content: space-between; padding: 10px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.18); font-size: 15px; letter-spacing: 0.08em; }
#son-istatistik span { color: rgba(238, 243, 246, 0.7); }
#son-istatistik .derece b { color: var(--vurgu); font-size: 26px; line-height: 1; }

@media (max-width: 640px) { .tuslar { grid-template-columns: 1fr; } }

button.gorev { display: flex; align-items: center; gap: 18px; letter-spacing: 0.06em; }
button.gorev i { font-style: normal; font-size: 30px; font-weight: 700; opacity: 0.55; min-width: 44px; }
button.gorev b { display: block; font-size: 17px; letter-spacing: 0.16em; }
button.gorev small { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; letter-spacing: 0.02em; opacity: 0.85; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:disabled:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.22); padding-left: 20px; }
/* ayarlar */
.ayarlar { margin-bottom: 18px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.ayar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.ayar span { font-size: 15px; letter-spacing: 0.06em; }
.ayar small { display: block; margin-top: 2px; font-size: 12px; letter-spacing: 0.02em; color: rgba(238, 243, 246, 0.6); }
.ayar button { width: 220px; margin: 0; padding: 10px 14px; text-align: center; font-size: 13px; letter-spacing: 0.14em; flex: none; }
.ayar button:hover, .ayar button:focus-visible { padding-left: 14px; }
.ayar input[type=range] { width: 220px; accent-color: var(--vurgu); flex: none; }

/* acilis */
#karart { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 19; }
#intro { position: fixed; inset: 0; z-index: 20; display: none; pointer-events: none; }
#intro .bant { position: absolute; left: 0; right: 0; height: 11vh; background: #000; }
#intro .bant-ust { top: 0; }
#intro .bant-alt { bottom: 0; }
.intro-baslik { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; opacity: 0;
  letter-spacing: 0.5em; transition: opacity 1.4s ease, letter-spacing 3.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
.intro-baslik p { margin: 0 0 10px; font-size: 15px; color: var(--vurgu); font-weight: 600; letter-spacing: 0.6em; }
.intro-baslik h1 { font-size: clamp(54px, 9vw, 130px); letter-spacing: inherit; text-shadow: 0 6px 40px rgba(0, 0, 0, 0.75); }
.intro-baslik h1 span { display: inline; }
#intro.baslik .intro-baslik { opacity: 1; letter-spacing: 0.08em; }
.intro-gec { position: absolute; right: 4vw; bottom: 3.6vh; margin: 0; font-size: 12px; letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.55); }
@media (max-width: 640px) { .ayar { flex-direction: column; align-items: stretch; } .ayar button, .ayar input[type=range] { width: 100%; } }
/* oyun ici sinema sahneleri */
#sinema { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
#sinema .sbant { position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height 0.35s ease; }
#sinema .sbant-ust { top: 0; }
#sinema .sbant-alt { bottom: 0; }
#sinema.acik .sbant { height: 10vh; }
#sinema-yazi { position: absolute; left: 6vw; bottom: 13vh; margin: 0; font-size: clamp(20px, 2.6vw, 38px); font-weight: 700; letter-spacing: 0.3em;
  color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8); opacity: 0; transform: translateX(-16px); transition: opacity 0.4s ease 0.15s, transform 0.5s ease 0.15s; }
#sinema-yazi::before { content: ""; display: inline-block; width: 5px; height: 0.9em; margin-right: 0.5em; background: var(--vurgu); vertical-align: -0.08em; }
#sinema.acik #sinema-yazi { opacity: 1; transform: none; }
/* gorev listesi: cok gorev olunca kaydirilir */
#gorev-listesi { max-height: 62vh; overflow-y: auto; padding-right: 8px; margin-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--vurgu) transparent; }
#gorev-listesi button.gorev { margin: 7px 0; padding: 10px 18px; }
button.gorev em { font-style: normal; color: var(--vurgu); font-weight: 600; margin-right: 6px; }
button.gorev.ana em { color: #5a2400; }
/* dokunmatik kontroller */
#dokunmatik { position: fixed; inset: 0; z-index: 8; display: none; }
#dokunmatik.acik { display: block; }
#d-cubuk-alan { position: absolute; left: 0; top: 0; bottom: 0; width: 46%; }
#d-cubuk { position: fixed; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%; display: none; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.06); }
#d-cubuk.acik { display: block; }
#d-cubuk i { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: rgba(255, 122, 26, 0.75); border: 2px solid #fff; }
.d-btn { position: absolute; display: flex; align-items: center; justify-content: center; width: 68px; height: 68px; margin: 0; padding: 0; border-radius: 50%;
  clip-path: none; font: 700 12px var(--font); letter-spacing: 0.06em; text-align: center; color: #fff; background: rgba(8, 16, 22, 0.42);
  border: 2px solid rgba(255, 255, 255, 0.5); touch-action: none; transition: none; }
.d-btn:hover, .d-btn:focus-visible { padding: 0; background: rgba(8, 16, 22, 0.42); border-color: rgba(255, 255, 255, 0.5); }
.d-btn.basili { background: rgba(255, 122, 26, 0.8); border-color: #fff; }
.d-btn.buyuk { width: 96px; height: 96px; font-size: 15px; border-color: var(--vurgu); }
.d-btn.kucuk { width: 54px; height: 44px; border-radius: 10px; font-size: 11px; }
#d-ates { right: max(22px, env(safe-area-inset-right)); bottom: 26px; }
#d-fuze { right: calc(max(22px, env(safe-area-inset-right)) + 110px); bottom: 20px; }
#d-fisek { right: max(26px, env(safe-area-inset-right)); bottom: 136px; }
#d-hedef { right: calc(max(22px, env(safe-area-inset-right)) + 96px); bottom: 104px; }
#d-gaz { right: calc(max(22px, env(safe-area-inset-right)) + 196px); bottom: 20px; }
#d-fren { right: calc(max(22px, env(safe-area-inset-right)) + 182px); bottom: 104px; }
#d-duraklat { left: max(14px, env(safe-area-inset-left)); top: 12px; }
#d-takim { left: calc(max(14px, env(safe-area-inset-left)) + 64px); top: 12px; }
.sadece-dok { display: none; }
body.dokunmatik .sadece-dok { display: block; }
body.dokunmatik .tuslar { display: none; }
#cevir { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; background: #05090d; text-align: center; padding: 24px; }
#cevir p { font-size: 20px; letter-spacing: 0.12em; }
@media (orientation: portrait) and (pointer: coarse) { #cevir { display: flex; } }

/* alcak ekranlar (yatay telefon): menuler sigsin */
@media (max-height: 520px) {
  .ekran { align-items: flex-start; overflow-y: auto; padding: 14px 5vw; }
  .ust { font-size: 11px; margin-bottom: 2px; }
  h1 { font-size: 42px; }
  h1 span { display: inline; }
  h2 { font-size: 24px; margin-bottom: 8px; }
  .alt { margin: 6px 0 10px; font-size: 13px; }
  .not { display: none; }
  button { padding: 9px 16px; margin: 6px 0; font-size: 13px; }
  .ayar { padding: 5px 2px; }
  .ayar button { width: 170px; padding: 7px 10px; }
  .ayar input[type=range] { width: 170px; }
  .ayar small { display: none; }
  #gorev-listesi { max-height: 54vh; }
  .ipucu { margin: 8px 0; font-size: 13px; }
  #son-istatistik div { padding: 5px 4px; }
  .panel.genis { width: min(720px, 100%); }
  .intro-baslik h1 { font-size: 54px; }
}