/* Ortak görünüm: Temel İngilizce oyun ailesi. Her oyun kendi renklerini :root'ta ezer. */
:root {
  --bg-top: #1d2b8f;
  --bg-mid: #5b2bb5;
  --bg-low: #e0457b;
  --ink: #16163a;
  --card: #ffffff;
  --accent: #ffd23f;
  --accent-shadow: #c99a00;
  --good: #2ee6a6;
  --bad: #ff4d6d;
  --text: #ffffff;
  --u: min(1vw, 1vh);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-top);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.14) 0 2px, transparent 3px) 0 0 / 90px 90px,
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 55%, var(--bg-low) 100%);
}

#hud {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 16px 8px;
}
.hud-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  font-weight: 800;
  font-size: clamp(18px, calc(var(--u) * 3.6), 34px);
  line-height: 1.1;
}
.hud-label {
  font-size: clamp(10px, calc(var(--u) * 1.6), 14px);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .75;
}
.lives { letter-spacing: .1em; color: var(--accent); }

.panel {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 460px);
  max-height: 92vh;
  overflow: auto;
  padding: 28px 22px;
  border-radius: 24px;
  background: rgba(22,22,58,.8);
  backdrop-filter: blur(8px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
[hidden] { display: none !important; }
.panel.small { width: min(80vw, 320px); }

h1 {
  font-size: clamp(38px, calc(var(--u) * 9), 72px);
  line-height: .95;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -.02em;
}
h2 { font-size: clamp(24px, calc(var(--u) * 5), 40px); font-weight: 900; }
h3 { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.lead { font-size: clamp(15px, calc(var(--u) * 2.4), 19px); line-height: 1.4; opacity: .92; }
.best { font-size: 15px; opacity: .85; }
.keys { font-size: 12px; opacity: .55; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 40px;
  font: inherit;
  font-weight: 900;
  font-size: clamp(18px, calc(var(--u) * 3), 24px);
  cursor: pointer;
  color: var(--ink);
}
.btn.primary { background: var(--accent); box-shadow: 0 5px 0 var(--accent-shadow); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--accent-shadow); }
.btn.ghost { background: rgba(255,255,255,.14); color: var(--text); }

.final { display: flex; flex-direction: column; align-items: center; }
.final-score { font-size: clamp(48px, calc(var(--u) * 11), 88px); font-weight: 900; color: var(--accent); line-height: 1; }
.new-best { color: var(--good); font-weight: 800; font-size: 16px; }

.review { list-style: none; display: grid; gap: 6px; margin-top: 8px; max-height: 32vh; overflow: auto; width: 100%; text-align: left; }
.review li { padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: 15px; line-height: 1.35; }
.review li b { color: var(--accent); }

.banner {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  padding: .4em 1em;
  border-radius: 16px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(20px, calc(var(--u) * 5), 44px);
  white-space: nowrap;
  pointer-events: none;
  animation: banner 1.6s ease-out forwards;
}
@keyframes banner {
  0% { opacity: 0; scale: .7; }
  15% { opacity: 1; scale: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes shake {
  20% { translate: -6px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; }
}

@media (hover: none) and (pointer: coarse) {
  .keys, .key { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; }
}
