/* TDS 105 — bölüm sonu oyunu: Kelime Yağmuru
 * Renkli ama göz yormayan pastel palet. Performans: bulanıklık (backdrop-filter) yok, sahne
 * (gökyüzü, güneş, tepeler) durağan çizimdir; yalnızca kelimeler (transform) hareket eder.
 * Yavaş bilgisayarda .lite sınıfı süsleri kapatır; oyun hızı hiçbir durumda değişmez.
 */

/* Gökyüzü renkleri seviyeyle yumuşakça değişir (kayıtlı özellikler geçiş yapabilir) */
@property --s1 { syntax: '<color>'; inherits: true; initial-value: #bfe0fb; }
@property --s2 { syntax: '<color>'; inherits: true; initial-value: #dcecfb; }
@property --s3 { syntax: '<color>'; inherits: true; initial-value: #eef3fa; }

.kg {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2vw, 22px);
  background: rgba(36, 44, 90, .58);
  opacity: 0;
  transition: opacity .25s ease;
  font-family: var(--font);
}
.kg.in { opacity: 1; }
.kg.out { opacity: 0; }
.kg-box {
  --s1: #bfe0fb;
  --s2: #dcecfb;
  --s3: #eef3fa;
  position: relative;
  width: min(1280px, 100%);
  height: min(860px, 100%);
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  overflow: hidden;
  outline: none;
  background: linear-gradient(180deg, #e9eef8 0%, #e3e8f4 100%);
  box-shadow: 0 40px 90px -30px rgba(20, 26, 70, .55);
  border: 1px solid #cfd6e6;
  transform: translateY(18px) scale(.98);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}
.kg.in .kg-box { transform: none; }
.kg-box[data-lv="2"] { --s1: #b6dcf8; --s2: #d9e8fa; --s3: #f1eefa; }
.kg-box[data-lv="3"] { --s1: #c3d2f6; --s2: #e2dcf6; --s3: #f6ecf0; }
.kg-box[data-lv="4"] { --s1: #cdc6f0; --s2: #ecd9ef; --s3: #fae6dc; }
.kg-box[data-lv="5"] { --s1: #d6c0ea; --s2: #f3d4e1; --s3: #fbe2cc; }
.kg-box[data-lv="6"] { --s1: #c9b4e3; --s2: #f0c9d7; --s3: #fbd9b8; }

/* Üst çubuk */
.kg-head { position: relative; z-index: 2; display: flex; align-items: center; gap: clamp(8px, 1.4vw, 16px); padding: 14px 18px 10px; }
.kg-brand { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.kg-logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: linear-gradient(135deg, #7cc0f5, #8b6fe0); box-shadow: 0 12px 26px -12px rgba(76, 91, 212, .8); flex: none; }
.kg-brand b { display: block; font: 800 22px/1.1 var(--display); color: var(--ink); }
.kg-brand small { display: block; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-stat { display: flex; flex-direction: column; align-items: center; padding: 6px 14px; border-radius: 14px; background: #f4f6fb; border: 1px solid var(--line); min-width: 74px; }
.kg-stat span { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kg-stat b { font: 800 22px/1.15 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.kg-score { min-width: 110px; background: linear-gradient(180deg, #eef0fd, #e3e7fb); border-color: #c4ccf5; }
.kg-score b { color: #3341b8; font-size: 26px; }
.kg-combo.hot { background: linear-gradient(135deg, #ffe5c9, #ffd3c7); border-color: #f2b48a; }
.kg-combo.hot b { color: #b4461a; }
.kg-combo.pop { animation: kg-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
.kg-lvl { background: linear-gradient(180deg, #e6f6ec, #d9f1e2); border-color: #a9dcbc; }
.kg-lvl b { color: #1b7a45; }
.kg-hearts { display: flex; gap: 4px; }
.kg-hearts svg { width: 30px; height: 30px; fill: #e0475e; transition: fill .3s ease, opacity .3s ease; }
.kg-hearts svg.lost { fill: #c3c9d8; opacity: .7; animation: kg-heart .5s ease; }
.kg-hearts svg.gain { animation: kg-heart-gain .7s cubic-bezier(.34, 1.56, .64, 1); }
.kg-time { display: flex; align-items: baseline; gap: 3px; padding: 6px 14px; border-radius: 14px; background: #f4f6fb; border: 1px solid var(--line); }
.kg-time b { font: 800 26px var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.kg-time span { font-size: 12px; font-weight: 800; color: var(--muted); }
.kg-box.hurry .kg-time { background: #fbe1e5; border-color: #f2a9b4; }
.kg-box.hurry .kg-time b { color: #c8293f; }
.kg-x { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: #f4f6fb; color: var(--ink-2); font-size: 24px; line-height: 1; cursor: pointer; }
.kg-x:hover { background: var(--card-2); }

/* Süre çubuğu: genişlik yerine ölçek (her karede düzen hesabı yapılmaz) */
.kg-bar { position: relative; z-index: 2; height: 7px; margin: 0 18px; border-radius: 999px; background: rgba(76, 91, 212, .14); overflow: hidden; }
.kg-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, #4fa3ec, #8b6fe0, #f2708f); transform-origin: left center; will-change: transform; }
.kg-box.hurry .kg-bar i { background: linear-gradient(90deg, #e0475e, #f08a4b); }

/* Oyun alanı: gökyüzü */
.kg-field {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  margin: 10px 18px 0;
  border-radius: 20px;
  overflow: hidden;
  cursor: text;
  background: linear-gradient(180deg, var(--s1) 0%, var(--s2) 58%, var(--s3) 100%);
  border: 1px solid rgba(76, 91, 212, .14);
  transition: --s1 2.5s ease, --s2 2.5s ease, --s3 2.5s ease;
}
.kg-sun {
  position: absolute;
  z-index: 0;
  right: 7%;
  top: 14%;
  width: clamp(70px, 9vw, 120px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe7a6 0 42%, rgba(255, 220, 130, .45) 43%, rgba(255, 220, 130, 0) 70%);
  transition: top 2.5s ease, background 2.5s ease;
}
.kg-box[data-lv="3"] .kg-sun, .kg-box[data-lv="4"] .kg-sun { top: 26%; }
.kg-box[data-lv="5"] .kg-sun, .kg-box[data-lv="6"] .kg-sun { top: 44%; background: radial-gradient(circle, #ffc58f 0 42%, rgba(255, 170, 120, .45) 43%, rgba(255, 170, 120, 0) 70%); }
/* Tepeler: kelimenin alt kenarı tepenin üstüne değince can gider */
.kg-hills { position: absolute; z-index: 3; left: 0; bottom: 0; width: 100%; height: clamp(54px, 9vh, 86px); pointer-events: none; }
.kg-hills .h1 { fill: #a9dcbd; }
.kg-hills .h2 { fill: #7fc79e; }
.kg-hills.hit .h2 { animation: kg-hill-hit .7s ease; }
.kg-hills.hit .h1 { animation: kg-hill-hit-2 .7s ease; }
.kg-flowers { position: absolute; z-index: 4; left: 0; right: 0; bottom: 4px; height: 26px; pointer-events: none; }
.kg-flowers i { position: absolute; bottom: 0; font-style: normal; font-size: 20px; line-height: 1; }

/* Bilgisayar parçaları: kelime parçanın kendisinin içinde, ortada (klavyenin şeridi, monitörün
   ekranı, RAM'in etiketi…). LED, sıradaki harfin parmak rengindedir (--fc).
   Dış kutu (.kg-w) yalnızca konumdur (transform). Görünüm, büyüme ve animasyonlar içteki parçadadır
   (.kg-b): aynı öğede konum + ölçek birleşirse tarayıcı konumu da büyütür, sağdaki parça dışarı kayar. */
.kg-w { --fc: #8a93a8; position: absolute; z-index: 2; left: 0; top: 0; will-change: transform; }
.kg-b {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font: 800 clamp(18px, 1.7vw, 26px)/1 var(--mono);
  color: #1f2a44;
  white-space: pre;
  filter: drop-shadow(0 10px 8px rgba(36, 44, 100, .26));
  transition: scale .15s ease, filter .2s ease;
  animation: kg-appear .35s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.kg-b i, .kg-b em { display: block; font-style: normal; flex: none; }
.kg-b .wd { display: block; position: relative; }
.kg-b .t { opacity: .45; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.kg-b .led { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--fc); box-shadow: 0 0 6px var(--fc), 0 0 0 1.5px rgba(244, 246, 251, .6); }

/* Klavye: tuş sıraları arasında kelime şeridi */
.p-kb .kg-b { padding: 7px 12px; gap: 5px; border-radius: 12px; background: linear-gradient(180deg, #eef1f6, #d5dbe6); box-shadow: inset 0 -4px 0 #b6bfce, inset 0 1px 0 rgba(255, 255, 255, .8); }
.p-kb .keys { align-self: stretch; height: 7px; border-radius: 2px; background: repeating-linear-gradient(90deg, #a9b2c4 0 11px, transparent 11px 14px); }
.p-kb .keys.sp { position: relative; }
.p-kb .keys.sp b { position: absolute; left: 32%; right: 32%; top: 0; bottom: 0; border-radius: 2px; background: #8f99ad; }
.p-kb .wd { padding: 5px 12px; border-radius: 6px; background: #f4f6fb; box-shadow: inset 0 0 0 1px #c3cad8, inset 0 -2px 0 #dde2ea; }
.p-kb .led { top: 5px; right: 6px; width: 5px; height: 5px; }

/* Monitör: kelime ekranda, altında ayak */
.p-mon .scr { position: relative; display: block; padding: 7px 7px 11px; border-radius: 10px; background: linear-gradient(180deg, #3a4360, #2b3249); box-shadow: inset 0 -3px 0 #222840; }
.p-mon .wd { padding: 9px 16px; border-radius: 5px; background: linear-gradient(160deg, #e3f1ff, #bcd9f6); }
.p-mon .led { bottom: 3px; left: 50%; margin-left: -3px; width: 5px; height: 5px; }
.p-mon .neck { width: 16px; height: 9px; background: linear-gradient(90deg, #7f889c, #b3bbcb, #7f889c); }
.p-mon .base { width: 76px; height: 6px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #a7afc0, #7f889c); }

/* Dizüstü: kelime ekranda, altında klavye gövdesi */
.p-lap .kg-b { padding: 0 16px; }
.p-lap .scr { position: relative; display: block; padding: 7px 7px 8px; border-radius: 9px 9px 2px 2px; background: linear-gradient(180deg, #4a5268, #353c52); }
.p-lap .wd { padding: 8px 14px; border-radius: 4px; background: linear-gradient(160deg, #f1ecff, #d7cdfb); }
.p-lap .led { top: 2px; left: 50%; margin-left: -2px; width: 4px; height: 4px; }
.p-lap .deck { position: relative; align-self: stretch; margin: 0 -16px; height: 10px; border-radius: 0 0 10px 10px; background: linear-gradient(180deg, #d5dbe6, #aab3c4); }
.p-lap .deck::after { content: ''; position: absolute; left: 42%; right: 42%; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: #8f99ad; }

/* Fare: kablolu, tekerleği LED */
.p-mouse .kg-b { flex-direction: row; align-items: center; }
.p-mouse .cable { width: 24px; height: 18px; margin: 0 -3px 14px 0; align-self: flex-end; border: 3px solid #7b8499; border-top: 0; border-right: 0; border-radius: 0 0 0 16px; }
.p-mouse .body { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px 14px 13px; border-radius: 22px 46% 46% 22px / 22px 50% 50% 22px; background: linear-gradient(180deg, #f3f5f9, #d4dae5); box-shadow: inset 0 -4px 0 #b8c0cf, inset 0 1px 0 rgba(255, 255, 255, .8); }
.p-mouse .body::before { content: ''; position: absolute; left: 0; top: 50%; width: 13px; height: 2px; margin-top: -1px; background: #aab3c4; }
.p-mouse .wheel { position: relative; z-index: 1; width: 8px; height: 20px; border-radius: 4px; background: var(--fc); box-shadow: 0 0 0 2px #9aa3b6, 0 0 6px var(--fc); }

/* RAM bellek: yeşil kart, çipler, etiket, altın uçlar (çentikli) */
.p-ram .board { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #34a06a, #2a8656); box-shadow: inset 0 -2px 0 #23734a; }
.p-ram .chips { align-self: stretch; height: 9px; border-radius: 1px; background: repeating-linear-gradient(90deg, #232838 0 18px, transparent 18px 24px); }
.p-ram .wd { padding: 4px 10px; border-radius: 3px; background: #f4f6fb; }
.p-ram .led { top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 1px; }
.p-ram .pins { align-self: stretch; display: flex; gap: 10px; height: 8px; }
.p-ram .pins i { flex: 3; border-radius: 0 0 2px 2px; background: repeating-linear-gradient(90deg, #e2bb52 0 4px, transparent 4px 6px); }
.p-ram .pins i:first-child { flex: 2; }

/* İşlemci: altın pinli taban, metal kapak üzerinde kelime */
.p-cpu .pkg { position: relative; display: block; padding: 10px; border-radius: 6px; background: radial-gradient(circle, #e2bb52 1.4px, transparent 1.9px) 0 0 / 7px 7px, linear-gradient(180deg, #2f8a58, #24704a); }
.p-cpu .lid { display: block; padding: 8px 14px; border-radius: 4px; background: linear-gradient(135deg, #f1f3f7, #c3cad7); box-shadow: inset 0 0 0 1px #aab3c4, 0 2px 4px rgba(0, 0, 0, .25); }
.p-cpu .mark { position: absolute; left: 3px; bottom: 3px; width: 0; height: 0; border: 4px solid transparent; border-left-color: #e2bb52; border-bottom-color: #e2bb52; }
.p-cpu .led { top: 3px; right: 3px; width: 5px; height: 5px; }

/* Ekran kartı: iki fan arasında kelime, altta PCIe uçları */
.p-gpu .card { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 6px 10px 6px 15px; border-radius: 8px; background: linear-gradient(180deg, #414a62, #2c3246); box-shadow: inset 5px 0 0 #a9b2c4, inset 0 -3px 0 #20263a; color: #eef1fb; }
.p-gpu .fan { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, #59627a 0 4px, transparent 4.5px), repeating-conic-gradient(#7a849c 0 22deg, #2f3549 22deg 45deg); box-shadow: 0 0 0 2px #1e2333; animation: kg-spin 1.2s linear infinite; }
.p-gpu .wd { padding: 4px 6px; }
.p-gpu .led { top: 4px; right: 6px; width: 5px; height: 5px; }
.p-gpu .pcie { align-self: flex-start; margin-left: 34%; width: 44%; height: 6px; border-radius: 0 0 2px 2px; background: repeating-linear-gradient(90deg, #e2bb52 0 3px, transparent 3px 5px); }

/* SSD: etiketli kutu, yanda bağlantı uçları */
.p-ssd .kg-b { flex-direction: row; align-items: center; }
.p-ssd .case { position: relative; display: inline-flex; padding: 6px; border-radius: 6px; background: linear-gradient(180deg, #4a5470, #333b55); box-shadow: inset 0 -3px 0 #272e45; }
.p-ssd .lbl { display: block; padding: 7px 12px 7px 20px; border-radius: 3px; background: linear-gradient(90deg, #f5c84c 0 9px, #f4f6fb 9px); }
.p-ssd .led { bottom: 2px; right: 3px; width: 4px; height: 4px; }
.p-ssd .conn { width: 7px; height: 22px; border-radius: 0 2px 2px 0; background: repeating-linear-gradient(180deg, #e2bb52 0 3px, transparent 3px 5px); }

/* USB bellek: anahtarlık halkası, gövde, metal uç */
.p-usb .kg-b { flex-direction: row; align-items: center; }
.p-usb .ring { width: 14px; height: 14px; margin-right: -3px; border-radius: 50%; border: 3px solid #9aa3b6; }
.p-usb .body { position: relative; display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 12px 4px 4px 12px; background: linear-gradient(180deg, #6b9af2, #3c6fd6); box-shadow: inset 0 -3px 0 #2f5cb8; color: #f4f6fb; }
.p-usb .led { top: 4px; right: 5px; width: 5px; height: 5px; }
.p-usb .plug { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 26px; height: 24px; padding-left: 6px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #eef1f6, #b9c1cf); box-shadow: inset 0 -2px 0 #a3acbd; }
.p-usb .plug i { width: 8px; height: 4px; border-radius: 1px; background: #6f7891; }

/* Yazıcı: üstte kâğıt, gövdede kelime, altta çıkış tepsisi */
.p-prn .paper { width: 64%; height: 11px; border-radius: 2px 2px 0 0; background: repeating-linear-gradient(180deg, #f4f6fb 0 3px, #d3d9e4 3px 4px); box-shadow: inset 0 0 0 1px #cfd6e4; }
.p-prn .body { position: relative; display: block; padding: 9px 16px 10px; border-radius: 9px 9px 5px 5px; background: linear-gradient(180deg, #eceff5, #cbd2de); box-shadow: inset 0 -4px 0 #b3bccb, inset 0 1px 0 rgba(255, 255, 255, .8); }
.p-prn .led { top: 5px; right: 7px; width: 5px; height: 5px; }
.p-prn .tray { width: 78%; height: 6px; border-radius: 0 0 5px 5px; background: linear-gradient(180deg, #9aa3b6, #7f889c); }

/* Modem: iki anten, gövdede kelime ve ışıklar */
.p-mdm .ant { align-self: stretch; display: flex; justify-content: space-between; padding: 0 16px; height: 14px; }
.p-mdm .ant i { width: 4px; height: 14px; border-radius: 2px 2px 0 0; background: #4a5268; transform-origin: bottom; }
.p-mdm .ant i:first-child { transform: rotate(-12deg); }
.p-mdm .ant i:last-child { transform: rotate(12deg); }
.p-mdm .body { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 14px 6px; border-radius: 9px; background: linear-gradient(180deg, #434c63, #2d3447); box-shadow: inset 0 -3px 0 #232a3c; color: #eef1fb; }
.p-mdm .leds { display: flex; gap: 6px; }
.p-mdm .leds i { width: 5px; height: 5px; border-radius: 50%; background: #4cc38a; box-shadow: 0 0 5px #4cc38a; }
.p-mdm .leds .led { position: static; background: var(--fc); box-shadow: 0 0 6px var(--fc); }

/* Kulaklık: kafa bandı, iki kulaklık arasında kelime */
.p-hp .band { align-self: stretch; margin: 0 7px -6px; height: 18px; border: 5px solid #4a5268; border-bottom: 0; border-radius: 40px 40px 0 0; }
.p-hp .row { display: inline-flex; align-items: center; }
.p-hp .cup { width: 16px; height: 36px; border-radius: 9px; background: linear-gradient(180deg, #5f6884, #3c4459); box-shadow: inset -3px 0 0 rgba(255, 255, 255, .12); }
.p-hp .wd { margin: 0 4px; padding: 7px 12px; border-radius: 9px; background: #eef1f6; box-shadow: inset 0 0 0 1px #c9d0dc; }
.p-hp .led { top: 1px; left: 50%; margin-left: -3px; }

/* Oyun kolu: yön tuşu ile düğmeler arasında kelime */
.p-pad .body { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 26px; background: linear-gradient(180deg, #7766e0, #5444c0); box-shadow: inset 0 -4px 0 #45369f; color: #f6f4ff; }
.p-pad .dpad { width: 18px; height: 18px; background: linear-gradient(#e9edf4, #e9edf4) center / 6px 18px no-repeat, linear-gradient(#e9edf4, #e9edf4) center / 18px 6px no-repeat; }
.p-pad .btns { width: 20px; height: 20px; background: radial-gradient(circle at 50% 16%, #f2708f 3px, transparent 3.6px), radial-gradient(circle at 84% 50%, #f2cf4a 3px, transparent 3.6px), radial-gradient(circle at 50% 84%, #4cc38a 3px, transparent 3.6px), radial-gradient(circle at 16% 50%, #4fa3ec 3px, transparent 3.6px); }
.p-pad .led { top: 4px; left: 50%; margin-left: -3px; width: 6px; height: 4px; border-radius: 2px; }

/* Pil (seyrek): yazılırsa +1 can */
.p-bat .kg-b { flex-direction: row; align-items: center; animation: kg-appear .35s cubic-bezier(.34, 1.56, .64, 1) backwards, kg-beat 1.1s ease-in-out .4s infinite; }
.p-bat .cell { display: inline-flex; padding: 4px; border-radius: 9px; border: 3px solid #3d4a62; background: #eef1f6; }
.p-bat .wd { padding: 6px 12px; border-radius: 4px; background: linear-gradient(90deg, #42b97f, #86dcae); color: #0f3a22; }
.p-bat .nub { width: 6px; height: 16px; border-radius: 0 3px 3px 0; background: #3d4a62; }
.p-bat .hb { position: absolute; top: -14px; right: 2px; padding: 2px 8px; border-radius: 999px; background: #e6f6ec; color: #17763f; border: 1px solid #9fd8b3; font: 800 11px/1.3 var(--font); white-space: nowrap; }

/* Hedef parça, yere yaklaşan parça, hata, yakalanma, düşme */
.kg-w.on { z-index: 3; }
.kg-w.on .kg-b { scale: 1.06; filter: drop-shadow(0 0 2px #4c5bd4) drop-shadow(0 0 7px rgba(76, 91, 212, .85)); }
.kg-w.warn .kg-b { filter: drop-shadow(0 0 2px #f08a4b) drop-shadow(0 0 7px rgba(240, 138, 75, .85)); }
.kg-w.on.warn .kg-b { filter: drop-shadow(0 0 2px #e0475e) drop-shadow(0 0 8px rgba(224, 71, 94, .85)); }
.kg-w.warn .led { animation: kg-blink .6s ease-in-out infinite; }
.kg-w.fk .kg-b { font-size: clamp(20px, 1.9vw, 28px); }
.kg-w.shake .kg-b { animation: kg-shake .35s ease; }
.kg-w.pop { pointer-events: none; }
.kg-w.pop .kg-b { animation: kg-part-pop .32s ease-out forwards; }
.kg-w.miss .kg-b { animation: kg-crash .6s ease forwards; }
.kg-w.fade .kg-b { opacity: .35; transition: opacity .4s ease; animation: none; }

.kg-float { position: absolute; z-index: 5; transform: translate(-50%, -50%); font: 900 24px var(--display); color: #3341b8; pointer-events: none; animation: kg-float .9s ease-out forwards; text-shadow: 0 2px 0 rgba(249, 250, 253, .95); }
.kg-p { position: absolute; z-index: 5; width: 9px; height: 9px; border-radius: 3px; pointer-events: none; animation: kg-spark .75s ease-out forwards; }
.kg-p.r { border-radius: 50%; }
.kg-drop { position: absolute; z-index: 5; width: 7px; height: 10px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #6fb3ee; pointer-events: none; animation: kg-drop .65s ease-out forwards; }
.kg-banner {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%);
  padding: 12px 28px;
  border-radius: 20px;
  background: linear-gradient(135deg, #4c5bd4, #8b6fe0);
  color: #f7f8fd;
  font: 800 clamp(22px, 2.4vw, 32px) var(--display);
  white-space: nowrap;
  box-shadow: 0 20px 40px -18px rgba(76, 91, 212, .8);
  pointer-events: none;
  animation: kg-banner 1.5s ease forwards;
}
.kg-banner.lv { background: linear-gradient(135deg, #2f9e6a, #4fa3ec); top: 30%; }
.kg-banner.combo { top: 46%; }
.kg-banner.c1 { background: linear-gradient(135deg, #f5a54a, #f2708f); }
.kg-banner.c2 { background: linear-gradient(135deg, #f2708f, #9b7cf0); }
.kg-banner.c3 { background: linear-gradient(135deg, #9b7cf0, #4fa3ec); }
.kg-banner.c4 { background: linear-gradient(135deg, #4fa3ec, #2fbf8f); }
.kg-banner.bonus { background: linear-gradient(135deg, #2fbf8f, #2f9e6a); top: 40%; }
.kg-banner.c5 { background: linear-gradient(135deg, #e0475e, #f5a54a, #f2cf4a); color: #3b2604; }

/* Alt bilgi: sıradaki tuş ve parmak */
.kg-foot { position: relative; z-index: 2; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 18px 16px; }
.kg-hint { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 16px; background: #f4f6fb; border: 1px solid var(--line); box-shadow: var(--shadow); }
.kg-hint-lbl { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kg-hint-key { min-width: 44px; height: 40px; padding: 0 10px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(180deg, #f9fafd, #e3e8f2); border: 1px solid #cdd4e4; box-shadow: inset 0 -3px 0 rgba(31, 42, 68, .14); font: 800 22px var(--mono); color: var(--ink); }
.kg-hint-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.kg-hint-txt { font-weight: 800; color: var(--ink-2); font-size: 15px; }
.kg-hint.bad { border-color: #f2a9b4; background: #fdeef0; animation: kg-shake .35s ease; }
.kg-hint.bad .kg-hint-key { border-color: #f2a9b4; color: #c8293f; }
.kg-msg { flex: 1; min-width: 200px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.kg-msg kbd, .kg-worst kbd, .kg-actions kbd { display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 7px; background: #e3e8f2; border: 1px solid #cdd4e4; font: 800 13px var(--mono); color: var(--ink); text-align: center; }

/* Görünmez yazma alanı: klavye girdisini (Türkçe karakterler, AltGr, ölü tuşlar) alır */
.kg-input { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

/* Ekranlar (başlangıç, duraklatma, sonuç) */
.kg-screen { position: absolute; inset: 0; z-index: 6; display: none; place-items: center; padding: 18px; background: rgba(228, 233, 242, .74); }
.kg-screen.show { display: grid; }
.kg-screen.clear { background: transparent; pointer-events: none; }
.kg-card {
  width: min(620px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 26px 30px 24px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: kg-card-in .4s cubic-bezier(.22, 1, .36, 1);
}
.kg-big { font-size: 48px; line-height: 1; animation: kg-bob 3s ease-in-out infinite; }
.kg-card h2 { margin-top: 8px; font: 800 30px var(--display); color: var(--ink); }
.kg-start h2 { background: linear-gradient(90deg, #4fa3ec, #8b6fe0 55%, #f2708f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kg-lead { margin-top: 6px; color: var(--ink-2); font-weight: 600; }
.kg-pick { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; padding: 6px 8px 6px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); font-weight: 700; color: var(--muted); font-size: 13px; }
.kg-sel { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--card-hi); font: 700 14px var(--font); color: var(--ink); max-width: 340px; }
.kg-rules { list-style: none; margin: 14px 0 0; display: grid; gap: 6px; text-align: left; font-size: 14px; color: var(--ink-2); }
.kg-rules li { padding: 7px 12px; border-radius: 12px; background: var(--card-2); }
.kg-rules li:nth-child(1) { border-left: 4px solid #f2708f; }
.kg-rules li:nth-child(2) { border-left: 4px solid #f5a54a; }
.kg-rules li:nth-child(3) { border-left: 4px solid #4cc38a; }
.kg-preview { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 700; align-items: center; }
.kg-preview i { font: 700 14px var(--mono); font-style: normal; color: var(--ink); padding: 3px 9px; border-radius: 9px; background: #e0efff; border: 1px solid #b9d6f3; }
.kg-preview i:nth-of-type(3n+2) { background: #ffe5ea; border-color: #f5c3cd; }
.kg-preview i:nth-of-type(3n) { background: #dff5e7; border-color: #b4e2c4; }
.kg-warn { color: var(--bad); font-weight: 700; }
.kg-board { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: var(--card-2); border: 1px solid #dde3ee; text-align: left; }
.kg-mine { font-weight: 700; color: var(--ink-2); font-size: 14px; }
.kg-mine b { color: #3341b8; }
.kg-top { list-style: none; margin-top: 8px; display: grid; gap: 4px; }
.kg-top li { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 10px; background: var(--card-hi); font-size: 14px; }
.kg-top li span { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--card-2); font: 800 12px var(--display); color: var(--muted); }
.kg-top li:nth-child(2) span { background: #f6dc9b; color: #8a5a07; }
.kg-top li:nth-child(3) span { background: #d9dee8; color: #4d586f; }
.kg-top li:nth-child(4) span { background: #f0c9a6; color: #8a4513; }
.kg-top li b { flex: 1; color: var(--ink); }
.kg-top li em { font: 800 15px var(--mono); font-style: normal; color: #3341b8; }
.kg-top li.me { background: var(--brand-soft); box-shadow: inset 0 0 0 1px #c4ccf5; }
.kg-top .kg-top-h { background: none; padding: 0 2px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.kg-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.kg-actions .btn { min-width: 150px; }
.kg-actions .btn-primary kbd { background: rgba(249, 250, 253, .25); border-color: transparent; color: inherit; margin-left: 6px; }
.btn.is-loading { opacity: .6; cursor: progress; }

.kg-count { font: 900 clamp(90px, 14vw, 160px)/1 var(--display); color: #3341b8; text-shadow: 0 10px 40px rgba(76, 91, 212, .35); animation: kg-count .65s ease both; }
.kg-count.go { font-size: clamp(60px, 9vw, 110px); color: #1b8a52; text-shadow: 0 10px 40px rgba(21, 128, 61, .3); }

.kg-over { position: relative; }
.kg-ribbon { position: absolute; top: 16px; right: -6px; padding: 6px 14px; border-radius: 10px 0 0 10px; background: linear-gradient(135deg, #f2b632, #d98a12); color: #3b2604; font-weight: 900; box-shadow: 0 10px 20px -10px rgba(217, 138, 18, .8); animation: kg-pop .6s cubic-bezier(.34, 1.56, .64, 1); }
.kg-stars { display: flex; justify-content: center; align-items: flex-end; gap: 6px; }
.kg-stars svg { width: 46px; height: 46px; fill: #d5dbe7; }
.kg-stars svg:nth-child(2) { width: 60px; height: 60px; }
.kg-stars svg.on { fill: #f5b532; filter: drop-shadow(0 4px 8px rgba(245, 181, 50, .5)); animation: kg-star .5s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: var(--d, 0s); }
.kg-final { margin-top: 6px; }
.kg-final span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kg-final b { font: 900 56px/1.05 var(--display); color: #3341b8; font-variant-numeric: tabular-nums; }
.kg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.kg-grid div { padding: 10px 6px; border-radius: 14px; background: var(--card-2); border: 1px solid #dde3ee; }
.kg-grid div:nth-child(1) { background: #e0efff; border-color: #c2dcf5; }
.kg-grid div:nth-child(3) { background: #ece5ff; border-color: #d5c9f5; }
.kg-grid div:nth-child(4) { background: #fff0d9; border-color: #f2d6a8; }
.kg-grid b { display: block; font: 800 22px var(--mono); color: var(--ink); }
.kg-grid span { font-size: 12px; font-weight: 700; color: var(--muted); }
.kg-grid .g { background: #dff5e7; border-color: #b4e2c4; }
.kg-grid .g b { color: #15803d; }
.kg-grid .m b { color: #b45309; }
.kg-grid .b b { color: #c8293f; }
.kg-tip { margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: var(--brand-soft); color: #2f3a8e; font-weight: 700; font-size: 14px; }
.kg-worst { margin-top: 10px; display: grid; gap: 6px; text-align: left; font-size: 13.5px; color: var(--ink-2); }
.kg-worst > span { font-weight: 800; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.kg-worst em { font-style: normal; font-weight: 700; padding: 6px 10px; border-radius: 12px; background: var(--card-hi); border-left: 4px solid var(--fc); }

/* Hafif mod (yavaş bilgisayar): süsler kapanır, hız aynı kalır */
.kg-box.lite .kg-b { filter: none; transition: none; animation: none; }
.kg-box.lite .kg-w.on .kg-b { filter: drop-shadow(0 0 2px #4c5bd4) drop-shadow(0 0 2px #4c5bd4); }
.kg-box.lite .kg-w.warn .kg-b { filter: drop-shadow(0 0 2px #f08a4b) drop-shadow(0 0 2px #f08a4b); }
.kg-box.lite .kg-w.pop .kg-b { animation: kg-part-pop .32s ease-out forwards; }
.kg-box.lite .p-gpu .fan { animation: none; }
.kg-box.lite .kg-field, .kg-box.lite .kg-sun { transition: none; }
.kg-box.lite .kg-w.warn .led, .kg-box.lite .kg-big { animation: none; }

/* Bölüm bitince çıkan davet kartı: üst çubuktaki Oyun düğmesinin altında (bildirimler sağ altta) */
.kg-offer {
  position: fixed;
  right: 22px;
  top: 86px;
  z-index: 8800;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 12px 12px 14px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid #c4ccf5;
  box-shadow: 0 24px 50px -20px rgba(36, 44, 100, .55);
  animation: kg-offer-in .5s cubic-bezier(.34, 1.56, .64, 1);
}
.kg-offer.out { animation: kg-offer-out .3s ease forwards; }
.kg-offer::before { content: ''; position: absolute; top: -7px; right: var(--ax, 40px); width: 12px; height: 12px; background: var(--card); border-left: 1px solid #c4ccf5; border-top: 1px solid #c4ccf5; transform: rotate(45deg); }
.kg-offer-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: linear-gradient(135deg, #7cc0f5, #8b6fe0); flex: none; animation: kg-bob 2.4s ease-in-out infinite; }
.kg-offer b { display: block; color: var(--ink); font-size: 15px; }
.kg-offer div > span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.kg-offer-x { border: none; background: none; font-size: 22px; color: var(--muted); cursor: pointer; padding: 0 4px; }

@keyframes kg-pop { 0% { transform: scale(1); } 45% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes kg-heart { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-10deg); } 100% { transform: scale(1); } }
@keyframes kg-blink { 50% { opacity: .35; } }
@keyframes kg-hill-hit { 0%, 100% { fill: #7fc79e; } 20% { fill: #f08f9f; } }
@keyframes kg-hill-hit-2 { 0%, 100% { fill: #a9dcbd; } 20% { fill: #f6b8c2; } }
@keyframes kg-shake { 20% { translate: -6px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }
@keyframes kg-appear { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes kg-beat { 0%, 100% { scale: 1; } 15% { scale: 1.1; } 30% { scale: 1; } 45% { scale: 1.07; } }
@keyframes kg-part-pop { 0% { scale: 1; opacity: 1; } 40% { scale: 1.14; opacity: 1; } 100% { scale: 1.26; opacity: 0; } }
@keyframes kg-crash { 0% { opacity: 1; } 45% { opacity: 1; rotate: 9deg; translate: 0 10px; } 100% { opacity: 0; rotate: 20deg; translate: 0 26px; } }
@keyframes kg-spin { to { rotate: 360deg; } }
@keyframes kg-heart-gain { 0% { transform: scale(.3); } 60% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes kg-float { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: 0 -60px; } }
@keyframes kg-spark { from { opacity: 1; transform: translate(0, 0) rotate(0); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(260deg) scale(.5); } }
@keyframes kg-drop { 0% { opacity: 1; transform: translate(0, 0); } 55% { transform: translate(calc(var(--dx) * .6), var(--dy)); } 100% { opacity: 0; transform: translate(var(--dx), 6px); } }
@keyframes kg-banner { 0% { opacity: 0; scale: .7; } 15% { opacity: 1; scale: 1.08; } 25% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; translate: 0 -24px; } }
@keyframes kg-card-in { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes kg-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes kg-count { 0% { opacity: 0; transform: scale(1.6); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.7); } }
@keyframes kg-star { from { opacity: 0; transform: scale(.2) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes kg-offer-in { from { opacity: 0; transform: translateY(-24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes kg-offer-out { to { opacity: 0; transform: translateY(-16px); } }

@media (max-width: 760px) {
  .kg-stat:not(.kg-score) { display: none; }
  .kg-brand b { font-size: 18px; }
  .kg-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .kg *, .kg-offer { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
