/* ── TOKENS & SYSTEM VARIABLES ── */
:root {
  --bg: #ffffff;        /* Arka plan tamamen beyaz */
  --card: #ffffff;      /* Kart ve kutu arka planı beyaz */
  --ink: #000000;       /* Ana yazılar tam siyah */
  --mute: #555555;      /* İkincil yazılar koyu gri tonu */
  --acc: #d9482b;       /* Turuncu vurgu rengi (sabit) */
  --ok: #1a1a1a;        /* Doğru tahmin ve başarı durumu için siyah tonu */
  --line: #222222;      /* Kenarlıklar ve çizgiler için belirgin siyah tonu */
  --line-light: #e5e5e5;/* Hafif ayrım gerektiren zeminler için açık gri ton */
  --radius: 14px;
  --tr: 0.15s ease;
  --nav-h: 68px;
}

/* ── RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Trebuchet MS", system-ui, sans-serif;
  min-height: 100dvh;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ── OYUN WRAPPER ── */
.page-body {
  display: flex;
  justify-content: center;
  padding: 24px 16px 40px;
}

.app {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

h1 {
  color: var(--ink);
  font-size: clamp(1.5rem, 5vw, 2rem);
  letter-spacing: -0.5px;
  margin: 8px 0 6px;
}

.sub {
  color: var(--mute);
  margin-bottom: 18px;
}

/* ── KATEGORİ GRID ── */
#cats {
  display: grid;
  align-items: center;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  text-align: left;

}

.cat {
  background: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px;
  font: inherit;
  color: var(--card);
  cursor: pointer;
  transition: border-color var(--tr), transform var(--tr), color var(--tr);
  text-align: center;

}

#cats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#cats .cat:last-child:nth-child(3n + 1) {
  grid-column: 2;
}

.cat:hover { 
  border-color: var(--acc); 
  color: var(--acc);
  transform: translateY(-2px); 
}

.cat:focus-visible { 
  outline: 2px solid var(--acc); 
  outline-offset: 2px; 
}

.cat span { 
  display: block; 
  font-size: 28px; 
  margin-bottom: 4px; 
}

.cat small { 
  color: var(--mute); 
  font-size: 12px; 
}

/* ── OYUN ALANI & SVG ── */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--ink);
}

.ghost {
  background: black;
  border: 1.5px solid var(--line);
  color: var(--card);
  border-radius: 8px;
  padding: 6px 10px;
  transition: background var(--tr), color var(--tr);
}

.ghost:hover { 
  background: var(--card); 
  color: var(--ink);
}

#hang {
  width: 200px;
  max-width: 50%;
  margin: 8px auto;
  display: block;
  fill: none;
  stroke: var(--ink);
  stroke-width: 5;
  stroke-linecap: round;
}

.part {
  stroke: var(--acc); /* Asılan parçalar turuncu */
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--tr);
}

.part.on { 
  visibility: visible; 
  opacity: 1; 
}

#lives { 
  color: var(--mute); 
  font-size: 14px; 
  margin: 4px 0; 
}

#word {
  color: var(--ink);
  font-size: clamp(26px, 8vw, 40px);
  font-weight: 800;
  letter-spacing: 0.15em;
  margin: 14px 0;
  min-height: 1.4em;
  word-break: break-word;
  font-family: "Roboto Mono", monospace;
}

#msg {
  min-height: 28px;
  font-weight: 700;
  transition: color var(--tr);
}

/* ── KLAVYE ── */
#keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 12px 0;
}

#keys button {
  width: 42px;
  height: 44px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  transition: background var(--tr), color var(--tr), transform 0.1s;
}

#keys button:not(:disabled):hover  { 
  background: var(--ink); 
  color: var(--bg);
}

#keys button:not(:disabled):active { 
  transform: scale(0.93); 
}

#keys button:focus-visible { 
  outline: 2px solid var(--acc); 
  outline-offset: 2px; 
}

#keys button.ok  { 
  background: var(--ink); 
  color: #ffffff; 
  border-color: var(--ink); 
}

#keys button.bad { 
  background: var(--line-light); 
  color: #999999; 
  border-color: #cccccc; 
  text-decoration: line-through; 
}

#keys button:disabled { 
  cursor: default; 
}

#next {
  background: var(--acc);
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 700;
  margin-top: 10px;
  transition: opacity var(--tr), transform var(--tr);
}

#next:hover { 
  opacity: 0.9; 
  transform: translateY(-1px); 
}

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



.result{
    display: none;
    position: absolute;
    top: 20%;
    left: 40%;
    align-items: center;
    margin: 0 auto;
    flex-direction: column;
    z-index: 10;
    width: 300px;
    height: 400px;
    border: 1px solid #0D6EFD;
    background-color: #0D6EFD;
    border-radius: 22.5px;

  background: rgba(13, 110, 253, 0.15);
  backdrop-filter: blur(3px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}


.result h2{
    margin-top: 20px;
    display: flex;

}

.result .close-btn{
    position: absolute;
    display: flex;
    text-decoration: none;
    background-color: transparent;
    background: none;
    border: none;
    font-weight: bold;
    font-size: large;
    top: 0;
    right: 0;
    margin: 7.5px;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.result .tryagnbtn{
    position: absolute;
    display: flex;
    margin: 10px;
    bottom: 0;
    text-decoration: none;
    border-radius: 17.5px;
    border:1px solid #004cbf;
    background-color: #0D6EFD;
    font-weight: bold;
    width: 200px;
    height: 35px;
    justify-content: center;
    align-items: center;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;

}

.result .tryagnbtn:hover {
    background-color: #0b5ed7; /* Biraz daha koyu ve canlı mavi */
    border-color: #0a58ca;
    box-shadow: 1px 1px 14px rgba(13, 110, 253, 0.45); /* Parlayan gölge */
    transform: translateY(-2px); /* Buton hafifçe havaya kalkar */
}

/* ── ACTIVE: Tıklandığında (Basılma Hissi) ── */
.result .tryagnbtn:active {
    background-color: #0a58ca; /* Daha koyu ton */
    transform: translateY(1px) scale(0.97); /* Basılma/küçülme efekti */
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3); /* Gölge içeri gömülür */
}

.tryagnbtn .try-agan{
    color: white;
    display: flex;
    position: absolute;
}


.result.show{
    display: flex !important;
}



.result-win{
    display: none;
    position: absolute;
    top: 20%;
    left: 40%;
    align-items: center;
    margin: 0 auto;
    flex-direction: column;
    z-index: 10;
    width: 300px;
    height: 400px;
    border: 1px solid #0D6EFD;
    background-color: #0D6EFD;
    border-radius: 22.5px;

  background: rgba(13, 110, 253, 0.15);
  backdrop-filter: blur(3px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.result-win .tryagnbtn{
    position: absolute;
    display: flex;
    margin: 10px;
    bottom: 0;
    text-decoration: none;
    border-radius: 17.5px;
    border:1px solid #004cbf;
    background-color: #0D6EFD;
    font-weight: bold;
    width: 200px;
    height: 35px;
    justify-content: center;
    align-items: center;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;

}


.result-win .close-btn{
    position: absolute;
    display: flex;
    text-decoration: none;
    background-color: transparent;
    background: none;
    border: none;
    font-weight: bold;
    font-size: large;
    top: 0;
    right: 0;
    margin: 7.5px;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.result-win h2{
    margin-top: 20px;
    display: flex;

}


.result-win .tryagnbtn:hover {
    background-color: #0b5ed7; /* Biraz daha koyu ve canlı mavi */
    border-color: #0a58ca;
    box-shadow: 1px 1px 14px rgba(13, 110, 253, 0.45); /* Parlayan gölge */
    transform: translateY(-2px); /* Buton hafifçe havaya kalkar */
}

/* ── ACTIVE: Tıklandığında (Basılma Hissi) ── */
.result-win .tryagnbtn:active {
    background-color: #0a58ca; /* Daha koyu ton */
    transform: translateY(1px) scale(0.97); /* Basılma/küçülme efekti */
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3); /* Gölge içeri gömülür */
}

.result-win .tryagnbtn .try-agan{
    color: white;
    display: flex;
    position: absolute;
}

.result-win.show{
    display: flex !important;
}

.result-win .scoreui{
  font-weight: 500;
  margin: 20px;
}

.scr-txt{
    font-weight: bolder;
    margin: 20px;
}

.result .scoreui, .result-win .scoreui{
    font-weight: bold;
    font-size: medium;
    border: 1px solid #0D6EFD;
    padding: 0 12px;
    width: fit-content;
    box-sizing: border-box;
    height: 30px;
    border-radius: 10px;
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
    background-color: white;
}