/* ============================================================
   KELİME AVI — oyun sayfası stilleri
   ============================================================ */
.wh-page { padding: 18px 16px 40px; display: flex; justify-content: center; }
#wh { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; }
.wh-head { width: 100%; display: grid; grid-template-columns: 76px 1fr 76px; align-items: center; gap: 8px; }
.wh-head > .icon-btn { justify-self: start; }
.wh-titles { text-align: center; }
.wh-titles h1 { font-size: 28px; display: inline-flex; align-items: center; gap: 8px; }
.wh-day { font-family: "Fredoka", sans-serif; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--badge-bg); border: 1px solid var(--badge-border); color: var(--violet-bright); }
.wh-titles p { margin: 4px 0 0; color: var(--ink-dim); font-size: 14px; }

#wh-theme {
  margin-top: 12px;
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 6px 18px; border-radius: 16px;
  border: 1.5px solid var(--violet);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(242, 158, 51, 0.12));
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.22);
  line-height: 1.15;
}
#wh-theme small { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
#wh-theme b { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; color: var(--ink); }

#wh-modes { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.wh-mode {
  position: relative;
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-dim);
  font-family: "Fredoka", sans-serif; font-size: 14px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.wh-mode:hover { border-color: var(--violet); color: var(--ink); }
.wh-mode.active { background: var(--violet); border-color: var(--violet); color: #fff; }
.wh-mark { position: absolute; top: -7px; right: -5px; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; color: #fff; background: #4abf8c; box-shadow: 0 0 0 2px var(--bg); }

#wh-hud { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 12px 0 10px; }
.wh-stat { display: flex; flex-direction: column; line-height: 1.1; }
.wh-stat.right { align-items: flex-end; }
.wh-stat small { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.wh-stat b { font-family: "Fredoka", sans-serif; font-size: 24px; color: var(--ink); }
#wh-hint {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px;
  border: 1px dashed var(--violet); background: transparent; color: var(--violet-bright);
  font-family: "Fredoka", sans-serif; font-size: 14.5px; cursor: pointer;
}
#wh-hint:hover:not(:disabled) { background: var(--badge-bg); }
#wh-hint:disabled { opacity: 0.4; cursor: default; }
#wh-hint-n { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--violet); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }

/* Tablo */
#wh-grid {
  --n: 8;
  position: relative;
  width: min(480px, 94vw);
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  grid-template-rows: repeat(var(--n), minmax(0, 1fr));
  gap: 3px;
  padding: 8px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}
.wh-cell {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--bg-soft-2);
  font-family: "Fredoka", sans-serif; font-weight: 600;
  font-size: calc(min(480px, 94vw) / var(--n) * 0.46);
  color: var(--ink);
  transition: background 0.15s, transform 0.15s;
  min-width: 0; min-height: 0;
}
.wh-cell.sel { transform: scale(1.06); color: #fff; background: rgba(166, 123, 251, 0.35); }
.wh-cell.got { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.wh-cell.hint { z-index: 4; animation: wh-hint 1s ease-in-out infinite; box-shadow: 0 0 0 2px #ffcc33, 0 0 14px rgba(255, 204, 51, 0.8); color: #ffcc33; }
@keyframes wh-hint { 50% { transform: scale(1.12); } }
.wh-svg { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); z-index: 3; pointer-events: none; overflow: visible; }
.wh-line { stroke-width: 70; stroke-linecap: round; opacity: 0.5; mix-blend-mode: screen; animation: wh-draw 0.35s ease-out; }
@keyframes wh-draw { from { opacity: 0; stroke-width: 20; } to { opacity: 0.5; stroke-width: 70; } }
#wh-drag-line { stroke: #a67bfb; stroke-width: 74; stroke-linecap: round; opacity: 0; }
#wh-drag-line.on { opacity: 0.4; }
#wh-grid.miss { animation: wh-miss 0.35s ease; }
@keyframes wh-miss { 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }

#wh-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; max-width: 520px; }
#wh-list span {
  font-family: "Fredoka", sans-serif; font-size: 14px; letter-spacing: 0.04em;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink);
  transition: all 0.25s;
}
#wh-list span.got { background: var(--sc); border-color: transparent; color: #fff; text-decoration: line-through; text-decoration-thickness: 2px; opacity: 0.85; }
#wh-list span.pop { animation: wh-pop 0.45s cubic-bezier(.34,1.56,.64,1); }
@keyframes wh-pop { 40% { transform: scale(1.25); } }

#wh-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;
}
#wh-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Pencereler */
.wh-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: wh-fade 0.25s ease-out; }
@keyframes wh-fade { from { opacity: 0; } to { opacity: 1; } }
.wh-card {
  position: relative; 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: wh-card-in 0.35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes wh-card-in { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wh-card.end { animation: wh-end-in 0.6s cubic-bezier(.22, 1.2, .36, 1) both; }
@keyframes wh-end-in { 0% { transform: scale(1.9); opacity: 0; filter: blur(6px); } 60% { opacity: 1; filter: blur(0); } 100% { transform: scale(1); opacity: 1; } }
.wh-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink-dim); cursor: pointer; }
.wh-card h3 { font-size: 24px; margin: 6px 0 8px; }
.wh-card p { color: var(--ink-dim); font-size: 14.5px; margin: 0 0 10px; }
.wh-intro-demo { position: relative; display: inline-flex; gap: 4px; margin: 6px 0 4px; }
.wh-intro-demo i { position: relative; z-index: 2; width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-soft-2); color: var(--ink); font-style: normal; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; }
.wh-intro-demo b { position: absolute; left: 0; top: 50%; height: 32px; transform: translateY(-50%); border-radius: 999px; background: #f29e33; opacity: 0.55; mix-blend-mode: screen; z-index: 3; pointer-events: none; animation: wh-demo 2.2s ease-in-out infinite; }
@keyframes wh-demo { 0%, 10% { width: 36px; opacity: 0.55; } 55%, 85% { width: 100%; opacity: 0.55; } 100% { width: 100%; opacity: 0; } }
.wh-how { list-style: none; padding: 0; margin: 10px 0 16px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.wh-how li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-dim); font-size: 14.5px; }
.wh-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; }
.wh-go { font-size: 17px; padding: 13px 32px; }
.wh-end-emoji { font-size: 40px; line-height: 1; }
.wh-end-theme { color: var(--violet-bright) !important; font-family: "Fredoka", sans-serif; }
.wh-end-time { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 54px; line-height: 1; color: var(--ink); margin: 2px 0 10px; }
.wh-end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.wh-end-stats div { display: flex; flex-direction: column; align-items: center; }
.wh-end-stats b { font-family: "Fredoka", sans-serif; font-size: 20px; color: var(--ink); }
.wh-end-stats span { font-size: 12px; color: var(--ink-faint); }
.wh-next-mode { width: 100%; margin-bottom: 10px; padding: 10px; border-radius: 14px; border: 1px dashed var(--violet); background: rgba(139, 92, 246, 0.08); color: var(--ink); font-family: "Fredoka", sans-serif; font-size: 15px; cursor: pointer; }
.wh-next-mode:hover { background: rgba(139, 92, 246, 0.2); }
.wh-next { display: flex; justify-content: center; align-items: baseline; gap: 10px; color: var(--ink-dim); font-size: 14px; margin-bottom: 12px; }
.wh-next b { font-family: "Fredoka", sans-serif; font-size: 20px; color: var(--ink); }
.wh-end-actions { display: flex; gap: 10px; }
.wh-end-actions .btn { flex: 1 1 0; justify-content: center; padding-left: 10px; padding-right: 10px; }
.wh-share-preview { text-align: left; white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--ink); margin: 6px 0 14px; user-select: text; -webkit-user-select: text; }
.wh-share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.wh-share-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-family: "Fredoka", sans-serif; font-size: 13px; text-decoration: none; cursor: pointer; }
.wh-share-btn .ic { font-size: 20px; height: 24px; display: inline-flex; align-items: center; }
.wh-share-btn svg { width: 22px; height: 22px; }
.wh-share-btn:hover { border-color: var(--violet); }

/* Seçilme olmasın */
.page:has(#wh) main, #wh, #wh *, .wh-modal, .wh-modal * { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.wh-share-preview { -webkit-user-select: text; user-select: text; }

@media (max-width: 640px) {
  .wh-page { padding-top: 10px; }
  .wh-titles h1 { font-size: 22px; }
  .wh-titles p { display: none; }
  #wh-grid { padding: 6px; gap: 2px; }
  .wh-svg { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
  body:has(#wh) .egg-moon { display: none; }
}
@media (prefers-reduced-motion: reduce) { .wh-cell.hint, .wh-intro-demo b { animation: none; } }


/* ---------- Sağ üst: seri / geçmiş düğmesi ---------- */
.wh-statsbox {
  justify-self: end;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 10px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink);
  font-family: "Fredoka", sans-serif; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.wh-statsbox:hover { border-color: var(--violet); transform: translateY(-2px); }
.wh-statsbox span { font-size: 15px; }
.wh-statsbox b { color: #f29e33; }
.wh-statsbox small { font-size: 11px; color: var(--ink-dim); }

/* ---------- Geçmiş penceresi ---------- */
.wh-modal:has(.history) { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(6, 4, 14, 0.84); }
.wh-card.history { width: min(480px, 100%); display: flex; flex-direction: column; overflow: hidden; padding-bottom: 14px; }
.wh-h-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 14px; }
.wh-h-sum div { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 14px; background: var(--bg-soft-2); border: 1px solid var(--line); }
.wh-h-sum b { font-family: "Fredoka", sans-serif; font-size: 22px; color: var(--ink); line-height: 1.1; }
.wh-h-sum span { font-size: 12px; color: var(--ink-faint); }
.wh-h-sum .fire { border-color: rgba(242, 158, 51, 0.6); background: linear-gradient(180deg, rgba(242, 158, 51, 0.18), rgba(242, 158, 51, 0.04)); }
.wh-h-sum .fire b { color: #f6b04d; }
.wh-h-scroll {
  text-align: left;
  max-height: min(58vh, 520px); overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -10px; padding: 0 10px 8px;
  scrollbar-width: thin; scrollbar-color: var(--violet) transparent;
  will-change: transform; transform: translateZ(0);
}
.wh-h-scroll::-webkit-scrollbar { width: 8px; }
.wh-h-scroll::-webkit-scrollbar-track { background: rgba(139, 92, 246, 0.08); border-radius: 99px; }
.wh-h-scroll::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #a67bfb, #7c3aed); border-radius: 99px; }
.wh-h-title { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 8px; font-family: "Fredoka", sans-serif; font-size: 15.5px; color: var(--ink); }
.wh-h-title small { font-size: 12px; color: var(--ink-faint); font-weight: 500; }
.wh-recs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.wh-rec { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid rgba(166, 123, 251, 0.45); background: var(--bg-soft-2); font-family: "Fredoka", sans-serif; }
.wh-rec b { font-size: 15px; color: var(--ink); }
.wh-rec strong { font-size: 26px; line-height: 1.1; color: #ffcc33; font-weight: 600; }
.wh-rec em { font-style: normal; font-size: 12.5px; color: var(--ink-dim); font-family: "Manrope", sans-serif; }
.wh-rec.hard { border-color: rgba(242, 158, 51, 0.6); }
.wh-rec.none { opacity: 0.5; border-color: var(--line); }
.wh-rec.none strong { color: var(--ink-faint); }
.wh-hday { margin: 12px 0 6px; font-family: "Fredoka", sans-serif; font-size: 13px; letter-spacing: 0.04em; color: var(--violet-bright); }
.wh-hday:first-child { margin-top: 0; }
.wh-row {
  display: grid; grid-template-columns: 48px 1fr auto auto; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 6px; border-radius: 13px;
  background: var(--bg-soft-2); border: 1px solid var(--line);
  font-family: "Fredoka", sans-serif;
}
.wh-row time { font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.wh-row-th { font-size: 15px; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-row-th small { font-size: 11.5px; color: var(--ink-faint); margin-left: 3px; }
.wh-row-mode { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(139, 92, 246, 0.2); color: var(--violet-bright); }
.wh-row-mode.hard { background: rgba(242, 158, 51, 0.18); color: #f6b04d; }
.wh-row-n { text-align: right; font-size: 15px; color: var(--ink); line-height: 1.15; }
.wh-row-n small { font-size: 11.5px; color: var(--ink-faint); }
.wh-row.clean { border-color: rgba(255, 204, 51, 0.55); background: linear-gradient(90deg, rgba(255, 204, 51, 0.12), rgba(255, 204, 51, 0.02)); }
.wh-row.clean .wh-row-n small { color: #ffcc33; }
.wh-h-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; text-align: center; }
.wh-h-empty img { width: 90px; height: 90px; object-fit: contain; }
.wh-h-empty p { margin: 0; color: var(--ink-dim); font-size: 14.5px; }
@media (max-width: 640px) {
  .wh-head { grid-template-columns: 64px 1fr 64px; }
  .wh-row { grid-template-columns: 42px 1fr auto auto; gap: 8px; padding: 8px 10px; }
}
