:root {
  --bg-color: #000000 ;
  --text-color: #ffffff;
  --border-color: #38444d;
  --key-bg: #8191a0;
  --key-pressed: #5c6e7e;
  --correct: #2da22d;
  --present: #c5bb00;
  --absent: #3a444c;
  --max-width: 500px;
  --header-height: 50px;
	--alert: #c1b700;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; */
	/* font-family: SF Pro Display; */
	/* font-family: "Barlow Condensed", sans-serif; */
	font-family: SF Pro Display, sans-serif;
  
  /* KOMPAKT MANTIK: */
  display: flex;
  justify-content: center; /* Yatay ortala */
  align-items: flex-start;     /* Dikey ortala (İçerik kısaysa ortada durur) */
  
  width: 100%;
  min-height: 100dvh;      /* En az ekran boyu */
  overflow-y: auto;        /* Scroll serbest */
  touch-action: manipulation;
}

.game-container {
  width: 100%;
  max-width: var(--max-width);
  
  /* Gruplama Ayarları */
  display: flex;
  flex-direction: column;
  align-items: center; /* Her şeyi ortala */
  justify-content: center; /* Dikeyde de ortada topla */
  
  /* Elementler arası sabit boşluk (Gereksiz açılmayı engeller) */
  /* gap: 10px;  */
}

/* --- HEADER --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  height: 40px; /* Header'ı biraz kibarlaştırdık */
  width: 100%;
  /* border-bottom: 1px solid var(--border-color); */
  flex-shrink: 0;
	margin-top: 5px;

	color: #fff;
  font-weight: 700;
  font-size: 24px;
  /* font-family: "Barlow Condensed", sans-serif; */
  text-transform: uppercase;
  pointer-events: none;
}

.header-logo {
width: 30px;
/* margin-right: 10px; */
margin-left: 10px;
}

header h1 {
position: absolute;
left: 50%;
transform: translateX(-50%);
padding: 0;
margin: 0;
font-size: 1.5rem;
font-weight: 700;
font-family: "Barlow Condensed", sans-serif;
pointer-events: auto;
}

.stats-icon {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-icon:hover {
    color: var(--correct);
    transform: scale(1.1);
}
/* --- MOD ALANI --- */

.mode-container {
width: 100%;
margin-top: 3px;
margin-bottom: 10px !important;

display: flex;
justify-content: center;
}

.mod {
	background-color: #1d9cf048;
	color: rgba(240, 240, 240, 0.95);
	border: 2px solid #1d9cf05c;
	font-weight: 700;
	padding: 6px 12px;
	border-radius: 5px;
	font-size: 0.85rem;
	text-align: center;
	width: fit-content;
	/* margin: 0 auto; */
	margin: 0 3px;
	user-select: none;
	cursor: pointer;
	transition: all 0.3s ease;
}

.mod:hover {
	background-color: #1d9cf060;
	border-color: #1d9cf080;
	transform: scale(1.05);
}

.mod.active {
	background-color: var(--correct);
	border-color: var(--correct);
	color: white;
}

/* --- BOARD (Oyun Alanı) --- */
.board-container {
  /* Flex-grow YOK. Kendi boyutu neyse o kadar yer kaplasın. */
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 10px;
	margin-bottom: 10px;
}

#board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  grid-gap: 5px;
  
  /* Board Boyutları - Dinamik olacak, JavaScript tarafından ayarlanacak */
  width: 100%;
  max-width: 320px; /* İdeal mobil genişlik */
  /* aspect-ratio dinamik olacak */
}

.tile-row {
  display: grid;
  /* grid-template-columns dinamik olacak, JavaScript tarafından ayarlanacak */
  grid-gap: 5px;
}

.tile {
  border: 2px solid var(--border-color);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  font-weight: 700;
  text-transform: uppercase;
  background-color: transparent; /* Arka planı boş bırak */

	border-radius: 5px;
}

/* --- KLAVYE --- */
.keyboard-container {
  width: 100%;
  padding: 0 5px;
  /* Klavye artık sayfaya yayılmıyor, board'un hemen altında */
}

#keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.key {
  background-color: var(--key-bg);
  color: white;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 48px; /* Tuşları biraz daha kompakt yaptık */
  flex: 1;
  font-size: 1.2rem;
  user-select: none;
}

#enter-key, #del-key {
  flex: 1.4;
  font-size: 0.75rem;
}

/* --- RENKLER & EFEKTLER --- */
.tile[data-state="active"] {
  border-color: #566068;
  animation: pop 0.1s ease-in-out;
}

.tile.correct, .key.correct { background-color: var(--correct) !important; border-color: var(--correct) !important; color: white; }
.tile.present, .key.present { background-color: var(--present) !important; border-color: var(--present) !important; color: white; }
.tile.absent, .key.absent { background-color: var(--absent) !important; border-color: var(--absent) !important; color: white; }

.tile.flip { animation: flip 0.6s ease forwards; }

@keyframes flip {
  0% { transform: rotateX(0); border-color: #566068; }
  50% { transform: rotateX(90deg); border-color: #566068; }
  100% { transform: rotateX(0); }
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* --- KUŞ --- */
.kus {
  /* display: block; */
	position: absolute;
	top: 0px;
	left: 10px;
  height: 75px; /* Sabit yükseklik */
  width: auto;
  animation: nefesAl 3s infinite ease-in-out;
  margin-top: 5px; /* Klavye ile arasında minik boşluk */
}

@keyframes nefesAl {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Çok küçük ekranlar için önlem */
@media (max-width: 350px) {
  .key { height: 42px; font-size: 0.8rem; }
  #board { max-width: 280px; }
}

/* --- TOAST BİLDİRİMLERİ (Final Versiyon) --- */
#message-container {
  position: fixed;
  top: 65px; /* Header'dan biraz aşağıda */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 100%;
}

.message {
  background-color: var(--alert);
  color: rgb(255, 255, 255);
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1.05rem;
	letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
  
  /* GİRİŞ ANİMASYONU */
  animation: slideIn 0.3s ease-out forwards;
}

/* ÇIKIŞ DURUMU (Özel Animasyon) */
.message.fade-out {
  /* Giriş animasyonunu iptal et, çıkışı başlat */
  animation: slideOut 0.3s ease-in forwards;
}

/* Giriş Keyframe */
@keyframes slideIn {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Çıkış Keyframe */
@keyframes slideOut {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); } /* Yukarı kaçarak silin */
}

/* --- SONUÇ MODALI (POPUP) --- */
.modal-overlay {
  display: none; /* Varsayılan olarak gizli */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Arkası yarı saydam siyah */
  z-index: 2000;
  justify-content: center;
  align-items: center;
  /* backdrop-filter: blur(0.5px); Arkadaki oyunu hafif buzla */
}

.modal-overlay.show {
  display: flex; /* Class eklenince görünür olur */
}

.modal-content {
  background-color: var(--bg-color); /* Twitter Koyu Arkaplan */
  border: 2px solid var(--border-color);
  padding: 25px;
  border-radius: 10px;
  width: 90%;
  max-width: 320px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: var(--absent);
  font-size: 1.2rem;
  cursor: pointer;
}

#modal-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  /* font-family: "Barlow Condensed", sans-serif; */
  text-transform: uppercase;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.stat-box {
  background-color: #192734; /* Biraz daha açık ton */
  padding: 15px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-label {
  font-size: 0.8rem;
  color: #8899a6;
  font-weight: 600;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.stat-value.accent {
  color: var(--correct); /* Kelime mavi olsun */
  letter-spacing: 2px;
}

#modal-message {
  font-size: 0.9rem;
  color: #8899a6;
}

.share-logo {
  width: 20px;
  height: 20px;
  margin-right: 5px;
	filter: brightness(0) invert(1);
}

.share-btn {
  background-color: #1d9bf0;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 700;
	letter-spacing: 0.5px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 15px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.share-btn:hover {
  background-color: #1a8cd8;
  transform: scale(1.05);
}

.share-btn:active {
  transform: scale(0.98);
}

/* --- İSTATİSTİK MODALI --- */
#stats-modal .modal-content {
  max-width: 400px;
}

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

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
	justify-content: center;
  /* gap: 5px; */
  padding: 10px;
  background-color: #192734;
  border-radius: 8px;
}

.stat-number {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1;
}

.stat-text {
  font-size: 0.75rem;
  color: #8899a6;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#close-stats-modal {
  position: absolute;
  top: 5px;
  right: 13px;
  background: none;
  border: none;
  color: var(--absent);
  font-size: 1.9rem;
  cursor: pointer;
}

#stats-modal h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* TAKİP ET BUTONU */

.information {
	position: absolute;
	bottom: 10px;
	width: 85%;
	padding: 5px 10px;

	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;

	background-color: #1a8cd8;
	border: 2px solid #0070bb;
	border-radius: 8px;
}

.profile-picture {
	height: 30px;
	margin: 0;
	padding: 0;
}

.text {
	font-weight: 700;
	letter-spacing: 0.3px;
}

/* Kutunun varsayılan hali */
.information {
	transition: opacity 0.5s ease, visibility 0.5s ease;
	opacity: 1;
	visibility: visible;
	cursor: pointer; /* Tıklanabilir olduğunu gösterir */
}

/* JS ile eklenecek gizleme sınıfı */
.information.hide-toast {
	opacity: 0;
	visibility: hidden;
	pointer-events: none; /* Görünmezken tıklamayı engeller */
}