/* Tema renkleri, oyun alanı ve ortak sayfa bileşenleri. */
:root {
  color-scheme:light;
  --bg:#F8FAFC;
  --surface:#fff;
  --text:#172033;
  --muted:#526176;
  --line:#CBD5E1;
  --brand:#1E1B4B;
  --primary-text:#fff;
  --correct:#14B8A6;
  --present:#F59E0B;
  --absent:#475569;
  --key:#E2E8F0;
  --shadow:0 20px 70px #1e1b4b18;
  font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif
}

@media(prefers-color-scheme:dark) {
  :root:not([data-theme=light]) {
    color-scheme:dark;
    --brand:#2DD4BF;
    --primary-text:#0F172A;
    --bg:#0F172A;
    --surface:#172237;
    --text:#F8FAFC;
    --muted:#B4C1D3;
    --line:#475569;
    --key:#334155;
    --shadow:0 20px 70px #0005
  }
}

:root[data-theme=dark] {
  color-scheme:dark;
  --brand:#2DD4BF;
  --primary-text:#0F172A;
  --bg:#0F172A;
  --surface:#172237;
  --text:#F8FAFC;
  --muted:#B4C1D3;
  --line:#475569;
  --key:#334155;
  --shadow:0 20px 70px #0005
}

:root[data-contrast=high] {
  --correct:#F97316;
  --present:#3B82F6
}

.game .board {
  width:min(100%,310px,max(170px,calc((100svh - 390px)*.78)))
}

* {
  box-sizing:border-box
}

body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  line-height:1.6
}

a {
  color:inherit;
  text-underline-offset:3px
}

button,input,select,textarea {
  font:inherit
}

button,.button {
  cursor:pointer;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 14px;
  background:var(--surface);
  color:var(--text);
  text-decoration:none;
  font-weight:650
}

button:hover,.button:hover {
  filter:brightness(.95)
}

button:disabled {
  opacity:.5;
  cursor:wait
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:3px solid var(--present);
  outline-offset:3px
}

.primary {
  background:var(--brand);
  color:var(--primary-text);
  border-color:var(--brand)
}

.danger {
  color:#BE123C
}

input,select,textarea {
  width:100%;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--bg);
  color:var(--text)
}

label {
  display:block;
  margin:12px 0
}

h1,h2,h3 {
  line-height:1.2;
  letter-spacing:-.035em
}

h1 {
  font-size:clamp(1.8rem,5vw,2.8rem)
}

p {
  margin:12px 0
}

.topbar {
  max-width:1024px;
  margin:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px;
  padding-top:max(16px,env(safe-area-inset-top));
  border-bottom:1px solid var(--line)
}

.logo {
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:850;
  font-size:1.25rem;
  text-decoration:none;
  white-space:nowrap
}

.logo img {
  width:40px;
  height:40px
}

.top-actions {
  display:flex;
  gap:6px
}

.top-actions button,.top-actions a {
  padding:8px 10px
}

.skip {
  position:absolute;
  left:16px;
  top:-80px;
  background:var(--surface);
  z-index:10
}

.skip:focus {
  top:12px
}

.game {
  max-width:480px;
  margin:auto;
  padding:16px;
  min-height:calc(100svh - 75px);
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:12px
}

.eyebrow {
  text-transform:uppercase;
  letter-spacing:.18em;
  font-size:.7rem;
  font-weight:800;
  color:var(--muted);
  margin:0
}

.game-heading {
  display:flex;
  align-items:center;
  justify-content:space-between
}

.game-heading h1 {
  font-size:1.2rem;
  margin:2px 0
}

.mode-tabs {
  display:flex;
  gap:6px
}

.mode-tabs button {
  flex:1;
  font-size:.85rem;
  padding:9px 5px
}

.mode-tabs button[aria-pressed=true] {
  background:var(--brand);
  color:var(--primary-text);
  border-color:var(--brand)
}

.game-note {
  color:var(--muted);
  font-size:.8rem;
  text-align:center;
  margin:0;
  min-height:24px
}

.board {
  width:min(100%,310px);
  margin:auto;
  display:grid;
  gap:6px;
  padding:4px 0
}

.guess-row {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px
}

.tile {
  aspect-ratio:1;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2px solid var(--line);
  border-radius:10px;
  font-size:1.65rem;
  font-weight:800;
  background:var(--surface);
  line-height:1
}

.tile.filled {
  border-color:var(--muted)
}

.tile.hint {
  color:var(--muted);
  opacity:.55
}

.correct {
  background:var(--correct)!important;
  color:#071C23!important;
  border-color:var(--correct)!important
}

.present {
  background:var(--present)!important;
  color:#111827!important;
  border-color:var(--present)!important
}

.absent {
  background:var(--absent)!important;
  color:#fff!important;
  border-color:var(--absent)!important
}

[data-contrast=high] .present {
  color:#fff!important
}

.reveal .tile {
  animation:flip .35s ease both
}

.shake {
  animation:shake .3s
}

.keyboard {
  padding-bottom:max(8px,env(safe-area-inset-bottom));
  margin-top:auto;
  display:grid;
  gap:6px;
  touch-action:manipulation
}

.key-row {
  display:flex;
  justify-content:center;
  gap:4px
}

.key {
  padding:0;
  min-width:0;
  flex:1;
  height:48px;
  border:0;
  border-radius:7px;
  font-size:clamp(.75rem,3.2vw,1rem);
  background:var(--key)
}

.key.wide {
  flex:1.6;
  font-size:.7rem
}

.settings {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  font-size:.8rem
}

.settings button {
  padding:5px 8px
}

.article {
  max-width:760px;
  margin:40px auto;
  padding:0 16px 32px
}

.article h2 {
  margin-top:32px
}

.lead {
  font-size:1.1rem;
  color:var(--muted)
}

.card,.cta {
  background:var(--surface);
  border:1px solid var(--line);
  padding:20px;
  border-radius:18px;
  margin:20px 0
}

.cta {
  border-left:4px solid var(--correct)
}

.cta p {
  margin-top:0
}

.footer {
  max-width:1024px;
  margin:32px auto 0;
  border-top:1px solid var(--line);
  padding:24px 16px max(24px,env(safe-area-inset-bottom));
  font-size:.8rem;
  color:var(--muted)
}

.footer nav {
  display:flex;
  gap:16px;
  flex-wrap:wrap
}

.footer small {
  display:block;
  margin-top:14px
}

.footer small a {
  display:inline-block;
  margin-right:10px
}

.seo {
  max-width:700px;
  margin:32px auto;
  padding:0 16px;
  color:var(--muted)
}

dialog {
  width:min(92vw,480px);
  max-height:88svh;
  border:1px solid var(--line);
  border-radius:22px;
  padding:24px;
  background:var(--surface);
  color:var(--text);
  box-shadow:var(--shadow)
}

dialog::backdrop {
  background:#0f172a99;
  backdrop-filter:blur(4px)
}

.dialog-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px
}

.dialog-head h2 {
  margin:0
}

.dialog-head button {
  padding:5px 12px
}

.actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:16px 0
}

.actions>* {
  flex:1
}

.toast {
  position:fixed;
  z-index:100;
  top:85px;
  left:50%;
  transform:translateX(-50%);
  width:max-content;
  max-width:calc(100% - 32px);
  padding:12px 18px;
  border-radius:12px;
  background:var(--text);
  color:var(--bg);
  box-shadow:var(--shadow);
  text-align:center
}

.stats-grid {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px
}

.stat {
  padding:12px;
  background:var(--bg);
  border-radius:10px;
  font-size:.8rem
}

.stat strong {
  display:block;
  font-size:1.6rem
}

.bar {
  display:flex;
  gap:10px;
  align-items:center;
  margin:8px 0
}

.bar meter {
  flex:1;
  width:100%
}

.table-scroll {
  overflow:auto
}

table {
  width:100%;
  border-collapse:collapse;
  font-size:.85rem
}

th,td {
  text-align:left;
  padding:10px 6px;
  border-bottom:1px solid var(--line)
}

td:first-child {
  overflow-wrap:anywhere
}

caption {
  text-align:left;
  font-weight:700;
  padding:12px 0
}

details {
  border-bottom:1px solid var(--line);
  padding:16px 0
}

summary {
  font-weight:700;
  cursor:pointer
}

.example {
  display:flex;
  gap:5px
}

.example .tile {
  width:45px
}

.badge {
  font-size:.75rem;
  color:var(--muted)
}

[hidden] {
  display:none!important
}

@keyframes flip {
  from {
    transform:rotateX(80deg)
  }
  to {
    transform:rotateX(0)
  }
}

@keyframes shake {
  25%,75% {
    transform:translateX(-5px)
  }
  50% {
    transform:translateX(5px)
  }
}

@media(max-width:390px) {
  .topbar {
    gap:6px
  }
  .logo {
    font-size:1.05rem;
    gap:6px
  }
  .logo img {
    width:32px;
    height:32px
  }
  .top-actions button,.top-actions a {
    padding:7px 8px
  }
  .game {
    gap:8px
  }
  .key {
    height:46px
  }
  .board {
    width:min(100%,280px)
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important
  }
}

/* Mobil üst menü ve sprint durumu. */
.topbar {
  flex-wrap:wrap
}

.topbar>.settings {
  width:100%;
  justify-content:flex-end
}

.top-actions {
  flex-wrap:wrap
}

.mode-tabs button {
  min-width:0;
  font-size:.78rem
}

.sprint-counters {
  display:flex;
  justify-content:space-between;
  font-weight:700
}

#sprint-progress {
  width:100%;
  height:12px;
  accent-color:var(--brand)
}

.emoji-preview {
  font-family:ui-monospace,monospace;
  font-size:1.3rem;
  line-height:1.5
}

button:disabled {
  opacity:.55;
  cursor:not-allowed
}

