/* Sayı Bulmaca uygulamasının renkleri: mor ana renk, yeşil +, kırmızı − */
:root {
  --bg-top: #1e1e2c;
  --bg-mid: #262645;
  --bg-low: #3b2f7a;
  --surface: #2d2d44;
  --primary: #6c63ff;
  --plus: #00e676;
  --minus: #ff5252;
  --accent: #6c63ff;
  --accent-shadow: #463fb8;
}
.btn.primary { color: #fff; }
h1 { color: #fff; }
h1::first-line { color: var(--primary); }
.plus { color: var(--plus); }
.minus { color: var(--minus); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.row .btn { padding: 12px 22px; }
#btn-daily small { opacity: .75; font-weight: 700; margin-left: .3em; }
.final-score { color: var(--plus); }

#board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  padding: 4px 16px max(14px, env(safe-area-inset-bottom));
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
/* Yatay ekranda geçmiş solda, tuş takımı sağda */
@media (min-aspect-ratio: 5/4) {
  #board {
    grid-template-rows: none;
    grid-template-columns: 1fr minmax(260px, 40vh);
    max-width: 980px;
    align-items: center;
  }
}

#history-wrap {
  min-height: 0;
  overflow: auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}
#history { list-style: none; display: flex; flex-direction: column; gap: 6px; }
#history li {
  display: grid;
  grid-template-columns: 1.6em 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--surface);
  animation: slideIn .25s ease-out;
}
@keyframes slideIn { from { opacity: 0; translate: 0 8px; } }
#history .n { opacity: .5; font-size: 13px; }
#history .g { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: clamp(22px, calc(var(--u) * 4), 30px); letter-spacing: .18em; }
#history .num { display: flex; flex-direction: column; min-width: 0; }
#history .en { font-size: 12px; opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#history .p, #history .m { font-weight: 900; font-size: 18px; min-width: 2.2em; text-align: right; }
#history .p { color: var(--plus); }
#history .m { color: var(--minus); }
#history .zero { color: rgba(255,255,255,.35); }
#history-empty { margin: auto; max-width: 30em; text-align: center; opacity: .7; line-height: 1.45; font-size: 15px; padding: 12px; }

#input-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#slots { display: flex; gap: 8px; }
.slot {
  width: clamp(46px, calc(var(--u) * 9), 64px);
  aspect-ratio: 1 / 1.15;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.25);
  display: grid;
  place-items: center;
  font-size: clamp(26px, calc(var(--u) * 5.5), 40px);
  font-weight: 900;
}
.slot.filled { border-color: var(--primary); background: rgba(108,99,255,.18); }
#slots.shake { animation: shake .35s ease-out; }
#toast { min-height: 1.3em; font-size: 14px; color: var(--minus); font-weight: 700; text-align: center; }

#pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(100%, 340px);
}
.pad-key {
  border: 0;
  border-radius: 14px;
  padding: 0;
  height: clamp(44px, calc(var(--u) * 8.5), 62px);
  background: var(--surface);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: clamp(20px, calc(var(--u) * 4), 28px);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.pad-key:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.pad-key.used { opacity: .45; }
.pad-key.fn { background: #3a3a58; }
.pad-key.ok { background: var(--primary); }
.pad-key:focus-visible { outline: 3px solid var(--plus); outline-offset: 2px; }

.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 40px; font-weight: 900; letter-spacing: .2em; color: #fff; }
.english { font-size: 15px; opacity: .75; margin-top: -8px; }
