/* Göz yormayan, düşük kontrastlı sıcak tonlar. Koyu varsayılan, açık tema sistem tercihine göre. */
:root {
  --bg: #121418;
  --surface: #1a1d23;
  --surface-2: #232730;
  --line: #2c313b;
  --text: #e4e1da;
  --muted: #8a8f99;
  --accent: #7cc4ad;   /* kullanıcı vuruşu / iyi */
  --sys: #a3a8e8;      /* sistem vuruşu */
  --ok: #dcb36c;
  --off: #df8a7b;
  --radius: 14px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f0eb;
    --surface: #faf9f6;
    --surface-2: #ffffff;
    --line: #e1ddd4;
    --text: #2b2d31;
    --muted: #7a7d84;
    --accent: #3f9a80;
    --sys: #6c72c9;
    --ok: #b88a2e;
    --off: #c4624f;
    color-scheme: light;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.app {
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

/* ---------- üst bar ---------- */

.top { display: flex; align-items: center; justify-content: space-between; }
.top-actions { display: flex; gap: 8px; }
.lang-btn { font-size: 12px; font-weight: 600; letter-spacing: .06em; }

.brand { font-weight: 500; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.brand b { font-weight: 700; color: var(--accent); }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}
.icon-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn .ic-off { display: none; }
.icon-btn[aria-pressed="false"] { color: var(--muted); }
.icon-btn[aria-pressed="false"] .ic-on { display: none; }
.icon-btn[aria-pressed="false"] .ic-off { display: block; }

/* ---------- mod seçici ---------- */

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.modes button {
  border: 0;
  padding: 10px 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.modes button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }

/* ---------- sahne ---------- */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.learn-top { width: 100%; display: flex; flex-direction: column; gap: 18px; align-items: center; }

.presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.chip {
  min-width: 56px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.dots { display: flex; gap: 10px; }
.dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--line);
  transition: background .15s, transform .15s;
}
.dots span.sys  { background: var(--sys); transform: scale(1.2); }
.dots span.user,
.dots span.good { background: var(--accent); transform: scale(1.2); }
.dots span.ok   { background: var(--ok); transform: scale(1.2); }
.dots span.off  { background: var(--off); transform: scale(1.2); }

.status {
  margin: 0;
  min-height: 1.45em;
  color: var(--muted);
  text-align: center;
}

/* ---------- vuruş pedi ---------- */

.pad {
  --glow: var(--accent);
  position: relative;
  width: min(72vw, 300px, 40vh);
  min-width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 30%, var(--surface-2), var(--surface) 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform .08s ease-out;
}
.pad:active { transform: scale(.97); }
.pad.locked { cursor: default; opacity: .7; }
.pad.locked:active { transform: none; }

.pad::before,
.pad::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}
.pad::before { border: 2px solid var(--glow); }
.pad::after  { box-shadow: 0 0 40px 6px var(--glow); }

.pad.hit-sys { --glow: var(--sys); }
.pad.hit-user::before, .pad.hit-sys::before { animation: ring .4s ease-out; }
.pad.hit-user::after,  .pad.hit-sys::after  { animation: glow .4s ease-out; }

@keyframes ring {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.08); }
}
@keyframes glow {
  from { opacity: .45; }
  to   { opacity: 0; }
}

.pad-value {
  font-size: clamp(48px, 16vw, 76px);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.pad-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* ---------- alt alan ---------- */

.below { width: 100%; display: flex; flex-direction: column; gap: 14px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.stat {
  padding: 10px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
}
.stat.wide { grid-column: 1 / -1; }
#find .stats { grid-template-columns: repeat(3, 1fr); }
.stat strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

.actions { display: flex; gap: 8px; justify-content: center; }

.btn {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: border-color .2s, opacity .2s;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.actions { flex-wrap: wrap; }

.foot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hint { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.credit {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  opacity: .8;
  transition: color .2s, opacity .2s;
}
.credit span { color: var(--text); }
.credit:hover { color: var(--accent); opacity: 1; }
.credit:hover span { color: var(--accent); }
kbd {
  font: inherit;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

/* Dokunmatik cihazda Space ipucu gereksiz */
@media (hover: none) { .hint { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .pad.hit-user::before, .pad.hit-sys::before { animation-name: glow; }
  .pad:active { transform: none; }
}
