/* ============================================================
   HARF YAĞMURU — oyun sayfası stilleri
   ============================================================ */
.lr-page { padding: 18px 16px 40px; display: flex; justify-content: center; }
#lr { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; }
.lr-head { text-align: center; margin-bottom: 10px; }
.lr-head h1 { font-size: 28px; }
.lr-head p { margin: 4px 0 0; color: var(--ink-dim); font-size: 14px; }

#lr-hud { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin-bottom: 10px; }
.lr-stat { display: flex; flex-direction: column; line-height: 1.1; }
.lr-stat.right { align-items: flex-end; }
.lr-stat small { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.lr-stat b { font-family: "Fredoka", sans-serif; font-size: 26px; color: var(--ink); }
.lr-clock { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 100px; }
#lr-time { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 22px; color: var(--ink); }
.lr-timebar-wrap { width: 100px; height: 6px; border-radius: 99px; background: var(--bg-soft-2); overflow: hidden; }
#lr-timebar { height: 100%; background: linear-gradient(90deg, #4abf8c, #ffcc33, #f29e33); transform-origin: left; transition: transform 0.2s linear; }
#lr-hud.hurry #lr-time { color: #e64d4d; animation: lr-pulse 1s ease-in-out infinite; }
#lr-hud.hurry #lr-timebar { background: #e64d4d; }
@keyframes lr-pulse { 50% { transform: scale(1.12); } }
#lr-combo { min-height: 18px; font-family: "Fredoka", sans-serif; font-size: 13px; color: #ffcc33; opacity: 0; transform: scale(0.8); transition: opacity 0.2s, transform 0.25s cubic-bezier(.34,1.56,.64,1); }
#lr-combo.on { opacity: 1; transform: scale(1); }

/* Yağmur alanı */
#lr-field {
  --ts: 48px;
  position: relative;
  width: 100%;
  height: min(440px, 52vh);
  min-height: 300px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 80% 10%, rgba(243, 230, 166, 0.18), transparent 40%),
    linear-gradient(180deg, #120c26 0%, #1d1440 70%, #2a1d55 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
  user-select: none;
}
#lr-field::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(243,230,166,0.7), transparent),
    radial-gradient(1.2px 1.2px at 42% 8%, rgba(243,230,166,0.5), transparent),
    radial-gradient(1.6px 1.6px at 68% 26%, rgba(243,230,166,0.6), transparent),
    radial-gradient(1.2px 1.2px at 88% 52%, rgba(243,230,166,0.5), transparent),
    radial-gradient(1.4px 1.4px at 24% 60%, rgba(243,230,166,0.4), transparent);
}
#lr-field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; pointer-events: none;
  background: linear-gradient(90deg, #8b5cf6, #ed6ba1, #f29e33);
  opacity: 0.55;
}
#lr-field.frozen { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 0 40px rgba(159, 220, 255, 0.35); border-color: #9fdcff; }
.lr-tile {
  position: absolute; left: 0; top: 0;
  width: var(--ts); height: var(--ts);
  border: none; padding: 0;
  border-radius: 12px;
  background: var(--c);
  color: #fff;
  font-family: "Fredoka", sans-serif; font-weight: 600;
  font-size: calc(var(--ts) * 0.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 6px 14px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  will-change: transform;
  touch-action: manipulation;
}
.lr-tile.gold { color: #4a2c00; text-shadow: none; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.18), 0 0 18px rgba(255, 204, 51, 0.9); animation: lr-glow 1s ease-in-out infinite; }
@keyframes lr-glow { 50% { box-shadow: inset 0 -4px 0 rgba(0,0,0,0.18), 0 0 28px rgba(255, 204, 51, 1); } }
.lr-tile.ice { color: #1b4b6b; text-shadow: none; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.12), 0 0 16px rgba(159, 220, 255, 0.9); }
#lr-field.frozen .lr-tile:not(.ice) { filter: saturate(0.7) brightness(1.1); }
.lr-tile.picked { animation: lr-picked 0.35s ease forwards; }
@keyframes lr-picked { to { opacity: 0; transform: translate(var(--px, 0), var(--py, 0)) scale(1.5); } }
.lr-tile.picked, .lr-tile.burst, .lr-tile.splash { transition: opacity 0.35s, scale 0.35s; opacity: 0; scale: 1.6; pointer-events: none; animation: none; }
.lr-tile.splash { scale: 0.4; }
.lr-tile.fade { opacity: 0.25; transition: opacity 0.6s; }

.lr-float {
  position: absolute; left: 50%; bottom: 30px;
  transform: translateX(-50%);
  white-space: nowrap; pointer-events: none; z-index: 5;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 20px; color: #fff;
  background: linear-gradient(90deg, #8b5cf6, #ed6ba1);
  padding: 5px 16px; border-radius: 999px;
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.5);
  animation: lr-float 1.4s ease-out forwards;
}
@keyframes lr-float {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  75% { opacity: 1; transform: translate(-50%, -60px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(0.95); }
}
#lr-tap {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 10px 18px; border-radius: 999px;
  background: rgba(11, 8, 24, 0.75); color: #f5f3ff;
  font-family: "Fredoka", sans-serif; font-size: 15px; white-space: nowrap; z-index: 4;
}

/* Kelime çubuğu */
.lr-bar { width: 100%; display: flex; gap: 8px; margin-top: 12px; align-items: stretch; }
#lr-letters {
  flex: 1; min-height: 56px;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px;
  padding: 6px 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  cursor: pointer;
}
#lr-letters em { font-style: normal; color: var(--ink-faint); font-size: 14px; }
#lr-letters span {
  width: 36px; height: 40px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--violet); color: #fff;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 20px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22);
}
#lr-letters span.gold { background: #ffcc33; color: #4a2c00; box-shadow: 0 0 12px rgba(255, 204, 51, 0.8), inset 0 -3px 0 rgba(0,0,0,0.18); }
#lr-letters span.pop { animation: lr-in 0.25s cubic-bezier(.34,1.56,.64,1); }
@keyframes lr-in { from { transform: scale(0.3) translateY(-20px); } to { transform: none; } }
#lr-letters.bad { animation: lr-shake 0.4s ease, lr-badline 0.9s ease; }
@keyframes lr-badline { 0%, 60% { border-color: #e64d4d; } 100% { border-color: var(--line); } }
@keyframes lr-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
#lr-letters.good span { background: #4abf8c; animation: lr-jump 0.4s ease both; }
@keyframes lr-jump { 50% { transform: translateY(-10px) scale(1.1); } }
.lr-bar .btn { flex: none; justify-content: center; }
#lr-del { width: 56px; padding: 0; font-size: 20px; }
#lr-submit { padding-left: 20px; padding-right: 20px; }
.lr-bar .btn:disabled { opacity: 0.45; cursor: default; transform: none; }

#lr-toast {
  position: fixed; top: 96px; left: 50%;
  transform: translate(-50%, -10px);
  z-index: 3600;
  background: var(--ink); color: var(--bg);
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px;
  padding: 10px 18px; border-radius: 12px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
#lr-toast.show { opacity: 1; transform: translate(-50%, 0); }

.lr-keys-hint { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: 13.5px; color: var(--ink-dim); }
.lr-k { display: inline-flex; align-items: center; gap: 5px; }
.lr-k b { font-weight: 600; color: var(--ink); }
.lr-k kbd {
  min-width: 26px; height: 24px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 3px;
  background: var(--bg-soft); color: var(--ink);
  font-family: "Fredoka", sans-serif; font-size: 12.5px;
}
@media (hover: none) and (pointer: coarse) { .lr-keys-hint, .lr-how-keys { display: none !important; } }

/* Pencereler */
.lr-modal {
  position: fixed; inset: 0; z-index: 4500;
  background: rgba(6, 4, 14, 0.72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: lr-fade 0.25s ease-out;
}
@keyframes lr-fade { from { opacity: 0; } to { opacity: 1; } }
.lr-card {
  width: min(420px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.25), transparent 70%), var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px 22px 20px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: lr-card-in 0.35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes lr-card-in { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lr-card.end { animation: lr-end-in 0.6s cubic-bezier(.22, 1.2, .36, 1) both; }
@keyframes lr-end-in { 0% { transform: scale(1.9); opacity: 0; filter: blur(6px); } 60% { opacity: 1; filter: blur(0); } 100% { transform: scale(1); opacity: 1; } }
.lr-card h3 { font-size: 24px; margin: 6px 0 10px; }
.lr-card p { color: var(--ink-dim); font-size: 14.5px; margin: 0 0 10px; }
.lr-intro-rain { height: 70px; display: flex; justify-content: center; gap: 6px; }
.lr-intro-rain i {
  font-style: normal; width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c); color: #fff; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 19px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22);
  animation: lr-drop 1.6s ease-in infinite; animation-delay: calc(var(--i) * 0.22s);
}
.lr-intro-rain i.gold, .lr-intro-rain i.ice { color: #2b1a00; }
@keyframes lr-drop { 0% { transform: translateY(-14px); opacity: 0; } 20% { opacity: 1; } 80% { transform: translateY(28px); opacity: 1; } 100% { transform: translateY(34px); opacity: 0; } }
.lr-how { list-style: none; padding: 0; margin: 8px 0 16px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.lr-how li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-dim); font-size: 14.5px; }
.lr-how li span { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--violet); color: #fff; font-family: "Fredoka", sans-serif; font-size: 14px; }
.lr-go { font-size: 17px; padding: 13px 32px; }
.lr-end-emoji { font-size: 40px; line-height: 1; }
.lr-end-score { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 54px; line-height: 1; color: var(--ink); margin: 4px 0 6px; }
.lr-newbest { color: #ffcc33 !important; font-family: "Fredoka", sans-serif; font-size: 16px !important; }
.lr-muted { color: var(--ink-faint) !important; }
.lr-end-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 10px; }
.lr-end-stats div { display: flex; flex-direction: column; align-items: center; }
.lr-end-stats b { font-family: "Fredoka", sans-serif; font-size: 20px; color: var(--ink); word-break: break-all; }
.lr-end-stats span { font-size: 12px; color: var(--ink-faint); }
.lr-found { margin-bottom: 12px; }
.lr-found small { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.lr-found div { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.lr-found span { font-family: "Fredoka", sans-serif; font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--badge-bg); border: 1px solid var(--badge-border); color: var(--violet-bright); }
.lr-end-actions { display: flex; gap: 10px; margin-top: 6px; }
.lr-end-actions .btn { flex: 1 1 0; justify-content: center; padding-left: 10px; padding-right: 10px; }

@media (max-width: 640px) {
  .lr-page { padding-top: 10px; }
  .lr-head h1 { font-size: 22px; }
  .lr-head p { display: none; }
  #lr-field { height: 50vh; }
  #lr-letters span { width: 30px; height: 36px; font-size: 18px; }
  body:has(#lr) .egg-moon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lr-tile.gold, .lr-intro-rain i, #lr-hud.hurry #lr-time { animation: none; }
}

/* Çift tıklayınca / hızlı dokununca yazılar mavi seçilmesin */
#lr, #lr *, .lr-tile { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
#lr ::selection { background: transparent; }
.lr-bar .btn:focus { outline: none; }
.lr-bar .btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* Oyun alanında ve pencerelerde çift tıklayınca yazılar mavi seçilmesin */
.page:has(#lr) main, #lr, #lr *, .lr-modal, .lr-modal * { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
#lr ::selection, .lr-modal ::selection, .page:has(#lr) main ::selection { background: transparent; }

/* ---------- Süre azalırken: alan da hissettirsin ---------- */
/* Son 10 sn: kenarlarda yavaşça nabız gibi atan kırmızı ışık */
#lr-field.hurry { border-color: rgba(230, 77, 77, 0.55); animation: lr-hurry 1s ease-in-out infinite; }
@keyframes lr-hurry {
  0%, 100% { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 0 0 rgba(230, 77, 77, 0); }
  50% { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 22px rgba(230, 77, 77, 0.25), inset 0 0 38px rgba(230, 77, 77, 0.22); }
}
/* Son 5 sn: daha hızlı nabız */
#lr-field.final { border-color: rgba(230, 77, 77, 0.85); animation-duration: 0.5s; }
#lr-field.hurry::after { background: linear-gradient(90deg, #e64d4d, #ff8f6b, #e64d4d); opacity: 0.85; }
/* Arkada büyük, yarı saydam geri sayım (harflerin ARKASINDA, tıklamayı engellemez) */
#lr-count {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-family: "Fredoka", sans-serif; font-weight: 600;
  font-size: min(42vw, 230px); line-height: 1;
  color: rgba(230, 77, 77, 0.16);
  opacity: 0;
}
#lr-count.go { animation: lr-count 1s ease-out both; }
@keyframes lr-count { 0% { opacity: 0; transform: scale(1.5); } 20% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(0.85); } }
.lr-tile { z-index: 1; }
/* Saat her saniye hafifçe zıplasın */
#lr-hud.hurry #lr-time.bump { animation: lr-bump 0.35s cubic-bezier(.34,1.56,.64,1); }
@keyframes lr-bump { 40% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { #lr-field.hurry, #lr-count.go, #lr-time.bump { animation: none; } #lr-count.go { opacity: 1; } }
