/* ==========================================================================
   cardle.cc — Claude Design tasarımından uyarlandı
   ========================================================================== */

:root {
  --bg: #FFFFFF;
  --ink: #12141A;
  --accent: #E8402A;
  --accent-dark: #C22F1C;
  --muted: #6E7480;
  --muted-light: #8A8F9A;
  --border: #E7E8EC;
  --border-soft: #F1F2F5;
  --surface: #FAFAFB;

  --ok-border: #CFEBDC;
  --ok-bg: #F5FCF8;
  --ok-ink: #137048;
  --ok-strong: #1F9D63;

  --no-border: #F1D8D3;
  --no-bg: #FFF7F5;
  --no-ink: #B4331F;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  /* alt reklam şeridi içeriği kapatmasın diye altta boşluk */
  padding-bottom: 110px;
}

/* ---------- sayfa yerleşimi: [sol reklam] [oyun] [sağ reklam] ---------- */
.page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  padding: 40px 20px 20px;
}
.content {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ---------- reklam alanları ---------- */
.ad-col {
  flex: 0 0 160px;
  width: 160px;
  height: 600px;
  position: sticky;
  top: 40px;
  overflow: hidden;
  border-radius: 14px;
}
.ad-bottom {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 50;
  overflow: hidden;
}
/* AdSense kimliği girilene kadar görünen gri kutu */
.ad-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: #FBFBFC;
  border: 1px dashed var(--border);
  color: #C3C7D0;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
}
.ad-bottom.ad-placeholder { border: 0; border-top: 1px dashed var(--border); }

/* Dar ekranda yan reklamlar gizlenir, oyun ortada kalır */
@media (max-width: 1120px) {
  .ad-col { display: none; }
}

button { font-family: inherit; cursor: pointer; }
input  { font-family: inherit; }

/* ---------- animasyonlar (tasarımdan) ---------- */
@keyframes cdIn    { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cdPop   { 0% { opacity: 0; transform: scale(.94); } 60% { transform: scale(1.012); } 100% { opacity: 1; transform: scale(1); } }
@keyframes cdShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes cdSlide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes cdRow   { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes cdRise  { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.rise { animation: cdRise .34s var(--ease) both; }

/* ---------- logo ---------- */
header {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: cdIn .32s var(--ease) both;
}
.logo {
  border: 0; background: none; padding: 0;
  font-family: 'Hammersmith One', sans-serif;
  font-size: 30px; letter-spacing: -0.035em; color: var(--ink); line-height: 1;
}
.logo span { color: var(--accent); }
.tagline { font-size: 13px; letter-spacing: 0.02em; color: var(--muted-light); }

/* ---------- ekran ---------- */
.screen {
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column; gap: 14px;
}
.hidden { display: none !important; }

/* ---------- menü kartları ---------- */
.mode-card {
  text-align: left;
  border: 1px solid var(--border); background: var(--bg);
  border-radius: 18px; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .16s var(--ease), border-color .16s ease, box-shadow .16s ease;
}
.mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: 0 10px 28px rgba(18,20,26,.07);
}
.mode-card:active { transform: translateY(0) scale(.995); }

.mode-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mode-title { font-family: 'Hammersmith One', sans-serif; font-size: 20px; letter-spacing: -0.01em; }
.mode-desc  { font-size: 14px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }

.badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-light);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px;
}
.badge-accent { color: var(--accent); border-color: rgba(232,64,42,.3); }

/* ---------- üst çubuk ---------- */
.hud { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.icon-btn {
  border: 1px solid var(--border); background: var(--bg); border-radius: 10px;
  width: 34px; height: 34px; font-size: 15px; color: var(--muted); line-height: 1;
  transition: border-color .14s ease, color .14s ease;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }

.hud-center { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-light); }
.stat { display: flex; align-items: baseline; gap: 6px; font-family: 'Hammersmith One', sans-serif; }
.stat-num   { font-size: 26px; letter-spacing: -0.02em; }
.stat-num.low { color: var(--accent); }
.stat-label { font-size: 12px; color: var(--muted-light); letter-spacing: 0.06em; }

/* ---------- süre çubuğu ---------- */
.progress-wrap { height: 3px; width: 100%; background: var(--border-soft); border-radius: 99px; overflow: hidden; }
.progress-bar  { height: 100%; width: 100%; background: var(--accent); border-radius: 99px; transition: width 1s linear; }

/* ---------- fotoğraf ---------- */
.photo-frame {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden; background: var(--surface);
}
.image-grid {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
}
.image-grid.complete { gap: 0; background-size: cover; background-position: center; }
.image-grid.complete .tile { opacity: 0; }

.tile {
  background-size: 300% 200%;
  background-repeat: no-repeat;
  transition: opacity .5s var(--ease);
}
.tile.hidden-tile { opacity: 0; background: var(--surface) !important; }

.dots { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; pointer-events: none; }
.dot  { width: 9px; height: 9px; border-radius: 99px; background: #D8DAE0; transition: background .2s ease; }
.dot.used { background: var(--accent); }
.dot.win  { background: var(--ok-strong); }

/* ---------- tahmin ---------- */
.block { display: flex; flex-direction: column; gap: 10px; }
.guess-row { display: flex; gap: 10px; }
.input-wrap { position: relative; flex: 1 1 auto; min-width: 0; }

#guess-input, #player-name, #fact-input {
  width: 100%;
  border: 1.5px solid var(--border); border-radius: 14px;
  padding: 15px 16px; font-size: 16px; color: var(--ink);
  outline: none; background: var(--bg);
  transition: border-color .14s ease, box-shadow .14s ease;
}
#guess-input:focus, #player-name:focus, #fact-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(18,20,26,.06);
}

.dark-btn {
  flex: 0 0 auto; border: 0; background: var(--ink); color: #fff;
  border-radius: 14px; padding: 0 24px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  transition: background .14s ease, transform .14s var(--ease);
}
.dark-btn:hover:not(:disabled) { background: var(--accent); }
.dark-btn:active { transform: scale(.97); }
.dark-btn:disabled { opacity: .45; cursor: not-allowed; }
.dark-btn.small { padding: 12px 18px; font-size: 14px; border-radius: 12px; }
.dark-btn.wide  { flex: 1 1 0; padding: 16px; }

.light-btn {
  border: 1px solid var(--border); background: var(--bg); color: var(--ink);
  border-radius: 14px; padding: 16px; font-size: 15px; font-weight: 600;
  transition: border-color .14s ease;
}
.light-btn:hover { border-color: var(--ink); }
.light-btn.wide { flex: 1 1 0; }

.ghost-link {
  border: 0; background: none; padding: 10px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color .14s ease;
}
.ghost-link:hover { color: var(--ink); }

/* ---------- öneri listesi ---------- */
.suggestions {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(18,20,26,.1);
  overflow: hidden; z-index: 20;
  animation: cdSlide .16s var(--ease) both;
}
.suggestions:empty { display: none; }
.suggestions button {
  display: block; width: 100%; text-align: left;
  border: 0; background: var(--bg); padding: 13px 16px;
  font-size: 15px; color: var(--ink); transition: background .12s ease;
}
.suggestions button:hover, .suggestions button.active { background: #F6F7F9; }

/* ---------- yanlış tahminler ---------- */
.history { display: flex; flex-direction: column; gap: 8px; }
.history div {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--no-border); background: var(--no-bg);
  border-radius: 12px; padding: 12px 14px;
  font-size: 14px; font-weight: 500; color: var(--no-ink);
  animation: cdRow .2s var(--ease) both;
}
.history div span { font-size: 12px; }

/* ---------- doğru/yanlış şeridi ---------- */
.reveal {
  border: 1px solid var(--no-border); background: var(--no-bg);
  border-radius: 16px; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  animation: cdShake .32s var(--ease) both, cdIn .2s ease both;
}
.reveal.ok {
  border-color: var(--ok-border); background: var(--ok-bg);
  animation: cdPop .28s var(--ease) both;
}
.reveal-text { display: flex; flex-direction: column; gap: 3px; }
.reveal-label {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--no-ink);
}
.reveal.ok .reveal-label { color: var(--ok-ink); }
.reveal-name { font-family: 'Hammersmith One', sans-serif; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); }

/* ---------- fact soruları ---------- */
#fact-block { animation: cdRise .28s var(--ease) both; gap: 12px; }
.fact-question {
  font-family: 'Hammersmith One', sans-serif;
  font-size: 19px; line-height: 1.35; letter-spacing: -0.01em; text-wrap: pretty;
}
.fact-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choice-btn {
  border: 1.5px solid var(--border); background: var(--bg); color: var(--ink);
  border-radius: 14px; padding: 16px 14px;
  font-family: 'Hammersmith One', sans-serif; font-size: 16px;
  transition: border-color .14s ease, background .14s ease, transform .14s var(--ease);
}
.choice-btn:hover:not(:disabled) { transform: translateY(-2px); }
.choice-btn:active { transform: translateY(0) scale(.98); }
.choice-btn.right { border-color: var(--ok-strong); background: #F2FBF6; color: var(--ok-ink); }
.choice-btn.wrong { border-color: var(--accent); background: var(--no-bg); color: var(--no-ink); }
.choice-btn.dim   { border-color: var(--border-soft); color: #A8ADB8; }

.fact-number { display: flex; gap: 10px; align-items: center; }
.fact-number .input-wrap { flex: 1 1 auto; }
.unit { font-size: 13px; color: var(--muted-light); white-space: nowrap; }
.fact-feedback { font-size: 14px; font-weight: 500; line-height: 1.5; }
.fact-feedback.ok { color: var(--ok-ink); }
.fact-feedback.no { color: var(--no-ink); }
.fact-next-wrap { align-self: flex-start; }

/* ---------- oyun sonu ---------- */
#screen-gameover { align-items: center; gap: 22px; }
.over-label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-light); }
.big-score {
  display: flex; align-items: baseline; gap: 10px;
  animation: cdPop .4s var(--ease) both;
  font-family: 'Hammersmith One', sans-serif;
}
.big-score #final-score { font-size: 84px; line-height: .9; letter-spacing: -0.04em; }
.big-score #final-unit  { font-size: 18px; color: var(--muted-light); }

.grade {
  font-family: 'Hammersmith One', sans-serif;
  font-size: 17px; letter-spacing: -0.01em; color: var(--muted);
  text-align: center; margin-top: -8px;
  animation: cdIn .4s var(--ease) both;
}

.summary { width: 100%; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; }
.summary:empty { display: none; }
.summary div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--border-soft);
  animation: cdRow .24s var(--ease) both;
}
.summary .s-name { font-size: 15px; color: var(--ink); }
.summary .s-mark { font-size: 13px; font-weight: 600; }
.summary .s-mark.ok { color: var(--ok-ink); }
.summary .s-mark.no { color: var(--no-ink); }

#name-block { width: 100%; }
.save-msg { font-size: 14px; font-weight: 600; color: var(--ok-ink); min-height: 18px; }
.btn-row { display: flex; gap: 10px; width: 100%; }

/* ---------- skor tablosu ---------- */
.board-head { display: flex; align-items: center; justify-content: space-between; }
.board-title { font-family: 'Hammersmith One', sans-serif; font-size: 22px; letter-spacing: -0.015em; }
.board-sub { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-light); }

.tabs { display: flex; gap: 10px; }
.tab {
  flex: 1 1 0; border: 1px solid var(--border); background: var(--bg);
  border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 600; color: var(--muted);
  transition: border-color .14s ease, color .14s ease;
}
.tab.active { border-color: var(--ink); color: var(--ink); }

.score-list { display: flex; flex-direction: column; }
.score-list .row {
  display: grid; grid-template-columns: 30px 1fr auto;
  align-items: center; gap: 14px;
  padding: 15px 12px; border-radius: 12px;
  border-bottom: 1px solid #F5F6F8;
  animation: cdRow .22s var(--ease) both;
}
.score-list .row.me { background: var(--no-bg); }
.score-list .rank  { font-family: 'Hammersmith One', sans-serif; font-size: 14px; color: var(--muted-light); }
.score-list .who   { font-size: 15px; }
.score-list .row.me .who { font-weight: 600; }
.score-list .pts   { font-family: 'Hammersmith One', sans-serif; font-size: 17px; letter-spacing: -0.01em; }
.score-list .row.me .pts { color: var(--accent); }
.score-list .empty {
  padding: 28px 12px; text-align: center; font-size: 14px; color: var(--muted-light);
}

/* ---------- görsel kaynakları sayfası ---------- */
.credits-page { gap: 22px; }
.credits-page .screen { gap: 18px; }

.credit-note {
  font-size: 14px; line-height: 1.6; color: var(--muted);
  border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px;
  background: var(--surface);
}
.credit-note p { margin: 0 0 10px; }
.credit-note p:last-child { margin-bottom: 0; }
.credit-note a { color: var(--accent); }
.credit-note strong { color: var(--ink); }

.credit-list { display: flex; flex-direction: column; }
.credit-row {
  display: grid; grid-template-columns: 76px 1fr;
  gap: 14px; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--border-soft);
}
.credit-row img {
  width: 76px; height: 57px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); display: block;
}
.credit-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.credit-car { font-family: 'Hammersmith One', sans-serif; font-size: 16px; letter-spacing: -0.01em; }
.credit-meta { font-size: 13px; color: var(--muted); }
.credit-meta a { color: var(--accent); }
.credit-meta strong { color: var(--ink); font-weight: 600; }
.credit-src {
  font-size: 12px; color: var(--muted-light);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.credit-src:hover { color: var(--ink); }

.credits-back { align-self: flex-start; text-decoration: none; display: inline-block; }

/* alt bilgi (oyun sayfası) */
.site-foot {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 6px 14px;          /* uzun çeviriler alt satıra insin */
  font-size: 13px; color: var(--muted-light); padding-top: 6px;
  text-align: center;
}
.site-foot a { white-space: nowrap; }
.site-foot a { color: var(--muted-light); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ---------- mobil ---------- */
@media (max-width: 480px) {
  body { padding: 28px 16px 56px; gap: 22px; }
  .big-score #final-score { font-size: 68px; }
  .fact-question { font-size: 17px; }
  .mode-card { padding: 20px; }
}

/* ---------- yasal metin sayfaları (gizlilik vb.) ---------- */
.legal { font-size: 15px; line-height: 1.65; color: var(--muted); }
.legal .lead {
  font-size: 16px; color: var(--ink);
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 16px; padding: 18px 20px; margin: 0 0 4px;
}
.legal h2 {
  font-family: 'Hammersmith One', sans-serif; font-weight: normal;
  font-size: 17px; letter-spacing: -0.01em; color: var(--ink);
  margin: 26px 0 8px;
}
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--accent); }
.legal strong { color: var(--ink); font-weight: 600; }

/* ---------- dil seçici ---------- */
.lang-select {
  margin-top: 8px;
  font-family: inherit; font-size: 12px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px 5px 10px;
  cursor: pointer; outline: none;
  transition: border-color .14s ease, color .14s ease;
}
.lang-select:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- içerik sayfalarında dil geçişi ---------- */
.lang-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px;
  margin-top: 8px; font-size: 12px;
}
.lang-links a { color: var(--muted-light); text-decoration: none; }
.lang-links a:hover { color: var(--ink); }
.lang-links .on { color: var(--accent); font-weight: 600; }

/* ---------- günün arabası ---------- */
.mode-daily { border-color: rgba(232,64,42,.35); }
.mode-daily:hover { border-color: var(--accent); }
.badge-done {
  color: #fff !important; background: var(--ok-strong);
  border-color: var(--ok-strong) !important;
}
.daily-extra {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%;
}
.streak-line {
  font-family: 'Hammersmith One', sans-serif; font-size: 15px; color: var(--ink);
}
.countdown {
  font-family: 'Hammersmith One', sans-serif; font-size: 14px; color: var(--muted);
  letter-spacing: 0.02em;
}
.comeback { font-size: 13px; color: var(--muted-light); text-align: center; }

/* ---------- telefonda klavye açıkken ---------- */
/* Klavye ekranın yarısını kaplıyor: logoyu ve alt bilgiyi gizleyip
   fotoğrafı küçültüyoruz ki fotoğraf ve yazı alanı birlikte görünsün. */
body.keyboard-open { padding-top: 10px; gap: 10px; }
body.keyboard-open header,
body.keyboard-open .site-foot,
body.keyboard-open .lang-select { display: none; }
body.keyboard-open .page { padding-top: 8px; }
body.keyboard-open .content { gap: 12px; }
/* fotoğrafın boyutu JS ile piksel olarak ayarlanır (iOS'ta vh klavyeyle değişmez) */
body.keyboard-open .photo-frame { margin: 0 auto; }
body.keyboard-open .history { max-height: 22vh; overflow-y: auto; }

/* Dar ekranda fotoğraf ortalanır; genişlik sınırı JS'ten gelir */
@media (max-width: 480px) {
  .photo-frame { margin: 0 auto; }
}
