/* ============================================
   Kelime Oyunu — TV Referans Birebir Tasarım
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&display=swap');

/* ========================
   RESET
   ======================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: #0b132b;
  color: #fff;
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

/* Arka plan efektleri */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-color: #0b132b;
  background-image: radial-gradient(#1c2541 2px, transparent 2px);
  background-size: 24px 24px;
  z-index: 0;
}

body::after {
  display: none;
}

/* ========================
   ANA KAPSAYICI
   ======================== */
.app {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ========================
   EKRANLAR
   ======================== */
.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.screen.active {
  display: flex;
}

/* ========================
   MENÜ EKRANI
   ======================== */
.screen-menu {
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: max(32px, calc(16px + env(safe-area-inset-top, 0px))) 24px 32px;
}

.menu-logo {
  text-align: center;
}

.menu-logo h1 {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1.1;
  color: #ffab00;
  text-shadow: 4px 4px 0 #000;
}

.menu-sub {
  color: #8899bb;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 8px;
}

.menu-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 280px;
}

.menu-form input {
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  border: 3px solid #000;
  background: #1c2541;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
  font-family: inherit;
  box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.menu-form input:focus {
  border-color: #ffab00;
  background: #243054;
  box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.menu-form input::placeholder {
  color: #8899bb;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu-hs {
  color: #8899bb;
  font-size: 13px;
  text-align: center;
}

.menu-profile {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffab00;
  color: #000;
  padding: 8px 14px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 900;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  z-index: 100;
}

.menu-profile.hidden {
  display: none !important;
}

.btn-text {
  background: none;
  border: none;
  color: #ffab00;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  border: none !important;
}

#btn-logout {
  padding-left: 8px;
  margin-left: 4px;
  color: #d32f2f;
  font-weight: 900;
  border: none;
  background: none;
  cursor: pointer;
}

.leaderboard-container {
  width: 100%;
  max-width: 300px;
  background: #1c2541;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 220px;
}

.leaderboard-container.hidden {
  display: none !important;
}

.lb-title {
  text-align: center;
  font-size: 14px;
  color: #ffc107;
  letter-spacing: 2px;
  font-weight: 800;
  margin-bottom: 4px;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 4px;
}

.lb-list::-webkit-scrollbar {
  width: 4px;
}

.lb-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.lb-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.lb-item.loading {
  justify-content: center;
  color: #8899bb;
  font-style: italic;
  background: none;
}

.lb-item.me {
  border: 1px solid rgba(255, 193, 7, 0.5);
  background: rgba(255, 193, 7, 0.1);
}

.lb-rank {
  font-weight: 900;
  color: #8899bb;
  width: 24px;
}

.lb-name {
  flex: 1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.lb-score {
  font-weight: 900;
  color: #ffc107;
}

.btn-gold {
  width: 100%;
  max-width: 280px;
  padding: 16px;
  border: 3px solid #000;
  border-radius: 8px;
  background: #ffab00;
  color: #000;
  font-size: 20px;
  font-weight: 900;
  font-family: inherit;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 5px 5px 0 #000;
  transition: all 0.1s;
}

.btn-gold:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 #000;
}

.btn-secondary {
  background: #3a506b;
  color: #fff;
}

.btn-danger {
  background: #e53935;
  color: #fff;
}

/* Genel Gizleme */
.menu-form.hidden {
  display: none !important;
}

.btn-gold.hidden {
  display: none !important;
}



/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 43, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-content {
  background: #1c2541;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: 8px 8px 0 #000;
}

.modal-content h2 {
  color: #ffc107;
  font-size: 22px;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.rules-list li {
  font-size: 14px;
  line-height: 1.5;
  color: #d0d5e0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rules-list li:last-child {
  border-bottom: none;
}

.rules-list li strong {
  color: #ffab00;
}

.modal-buttons-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.modal-buttons-row .btn-gold {
  padding: 12px;
  font-size: 16px;
  flex: 1;
}

/* ========================
   OYUN EKRANI
   ======================== */
.screen-game {
  padding: max(24px, calc(12px + env(safe-area-inset-top, 0px))) 16px max(20px, env(safe-area-inset-bottom, 0px));
}

/* --- Üst Bar --- */
.game-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-start;
  flex-shrink: 0;
}

.top-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.btn-home-game {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #1c2541;
  border: 3px solid #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  transition: all 0.1s;
  flex-shrink: 0;
}

.btn-home-game:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

/* Puan Rozeti: Altın üst + Mor alt, çapraz kesilmiş */
.score-badge {
  display: flex;
  flex-direction: column;
  filter: drop-shadow(2px 3px 6px rgba(0, 0, 0, 0.5));
}

.score-main {
  background: #ffc107;
  color: #111;
  font-size: 24px;
  font-weight: 900;
  padding: 6px 40px 6px 16px;
  clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.score-sub {
  background: #1c2541;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  padding: 4px 34px 4px 16px;
  clip-path: polygon(0 0, 80% 0, 65% 100%, 0 100%);
  margin-top: -1px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding-top: 4px;
}

.progress-text {
  font-size: 13px;
  font-weight: 700;
  color: #8899bb;
  letter-spacing: 1px;
}

.timer-text {
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1;
  transition: color 0.3s;
}

.timer-text.warn {
  color: #ffeb3b;
}

.timer-text.danger {
  color: #ff5252;
  animation: pulse 0.6s infinite;
}

/* --- Altıgen Harf Kutuları --- */
.hex-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 20px 8px 16px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

/*
 * Altıgen Hücre
 * BEYAZ zemin — referans fotoğraftaki gibi.
 * clip-path altıgenlerde box-shadow çalışmaz,
 * bu yüzden outline/border yerine drop-shadow filter kullanıyoruz.
 */
.hex-cell {
  width: 44px;
  height: 50px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  flex-shrink: 0;
  transition: transform 0.3s;
  /* Varsayılan: beyaz boş kutu */
  background: #ffffff;
  color: transparent;
  overflow: hidden;
  position: relative;
}

/* Slot makinesi harf döndürme şeridi */
.hex-cell .slot-strip {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  will-change: transform;
}

.hex-cell .slot-strip .slot-char {
  width: 100%;
  height: 50px;
  /* hex-cell yüksekliğiyle eşit */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  font-weight: inherit;
  color: #0a1628;
  flex-shrink: 0;
}

/* Dönerken geçici olarak göster */
.hex-cell.slot-spinning {
  color: transparent !important;
}

.hex-cell.slot-spinning .slot-strip {
  animation: slotSpin var(--slot-duration, 0.7s) cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}

@keyframes slotSpin {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(var(--slot-offset));
  }
}

/* Açılmış harf — siyah metin */
.hex-cell.revealed {
  background: #ffffff;
  color: #0a1628;
  animation: hexPop 0.4s ease;
}

/* Cevap anında silik görünen açılmış harf (Placeholder) */
.hex-cell.revealed-placeholder {
  background: #ffffff;
  color: rgba(10, 22, 40, 0.25);
  /* Silik siyah metin */
}

/* Kullanıcının yazdığı harf — belirgin sarı */
.hex-cell.typed {
  background: #ffeb3b;
  color: #111;
}

/* Doğru cevap */
.hex-cell.correct-anim {
  background: #43a047 !important;
  color: #fff !important;
}

/* Yanlış cevap */
.hex-cell.wrong-anim {
  background: #e53935 !important;
  color: #fff !important;
  animation: shake 0.4s ease;
}

/* Uzun kelimeler için otomatik küçültme */
.hex-row[data-len="8"] .hex-cell {
  width: 40px;
  height: 46px;
  font-size: 20px;
}

.hex-row[data-len="9"] .hex-cell {
  width: 36px;
  height: 41px;
  font-size: 18px;
}

.hex-row[data-len="10"] .hex-cell {
  width: 32px;
  height: 37px;
  font-size: 16px;
}

/* --- 20s Cevap Süresi Barı --- */
.answer-bar {
  width: calc(100% - 24px);
  margin: 0 auto;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.answer-bar.visible {
  opacity: 1;
}

.answer-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  width: 100%;
  transition: width 1s linear, background 0.5s;
}

.answer-bar-fill.warn {
  background: linear-gradient(90deg, #ff9800, #ffc107);
}

.answer-bar-fill.danger {
  background: linear-gradient(90deg, #f44336, #ff5722);
  animation: barFlash 0.5s infinite;
}

.answer-bar-num {
  position: absolute;
  right: 0;
  top: -24px;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.3s;
}

.answer-bar.visible .answer-bar-num {
  opacity: 1;
}

.answer-bar-num.danger {
  color: #ff5252;
  animation: pulse 0.5s infinite;
}

/* --- İpucu Kutusu --- */
.clue-area {
  flex: 0 0 auto;
  /* SABIT — boşluk kaplama YOK */
  padding: 8px 0;
  transition: opacity 0.3s ease;
}

.clue-tray {
  margin: 0 4px;
  background: #1c2541;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 6px 6px 0 #000;
  position: relative;
}

/* Alt perspektif gölgesi */
.clue-tray::after {
  display: none;
}

.clue-inner {
  background: #0b132b;
  border-radius: 4px;
  padding: 18px 16px;
  border: 2px solid #3a506b;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.clue-inner p {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.55;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.fade-in-text {
  animation: fadeInText 0.5s ease-in forwards;
}
@keyframes fadeInText {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Aksiyon Butonları --- */
.action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 20px 16px 10px;
  flex-shrink: 0;
  transition: opacity 0.3s;
  /* Butonları dikeyde ortala */
  flex: 1 1 auto;
  min-height: 0;
}

/* HARF AL */
.btn-harf {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1c2541;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 16px 26px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 5px 5px 0 #000;
  transition: all 0.1s;
}

.btn-harf:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 #000;
}

.btn-harf:disabled {
  opacity: 0.5;
  pointer-events: none;
  box-shadow: 2px 2px 0 #000;
}

.hex-icon {
  width: 18px;
  height: 20px;
  background: #fff;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  flex-shrink: 0;
}

/* ZAMANI DURDUR */
.btn-stop {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #d32f2f;
  border: 4px solid #000;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 10px 0 #8b0000, 0 14px 0 #000;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-stop:active {
  transform: translateY(6px);
  box-shadow: 0 4px 0 #8b0000, 0 8px 0 #000;
}

.btn-stop:disabled {
  opacity: 0.5;
  pointer-events: none;
  box-shadow: 0 4px 0 #8b0000, 0 8px 0 #000;
  transform: translateY(6px);
}

/* Beyaz iç halka */
.stop-ring {
  position: absolute;
  inset: 7px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.stop-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
}

.stop-svg {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
}

.stop-label {
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  line-height: 1.15;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

/* --- Sanal Klavye --- */
.virtual-keyboard {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #0b132b;
  padding: 12px 6px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
  border-top: 4px solid #000;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px 20px 0 0;
}

.virtual-keyboard.active {
  transform: translateY(0);
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.kb-spacer {
  flex: 0.5;
}

.kb-key {
  background: #1c2541;
  border: 2px solid #000;
  color: #fff;
  border-radius: 6px;
  height: 52px;
  min-width: 28px;
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  box-shadow: 0 4px 0 #000;
  transition: all 0.05s;
  font-family: inherit;
}

.kb-key:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #000;
  background: #ffab00;
  color: #000;
}

.kb-enter {
  flex: 1.5;
  background: linear-gradient(180deg, #4caf50, #2e7d32);
  border-color: #81c784;
  font-size: 16px;
  box-shadow: 0 3px 0 #1b5e20;
}

.kb-enter:active {
  background: #2e7d32;
  box-shadow: 0 0 0 #1b5e20;
  color: #fff;
  border-color: #81c784;
}

.kb-del {
  flex: 1.5;
  background: #546e7a;
  border-color: #78909c;
  box-shadow: 0 3px 0 #37474f;
}

.kb-del:active {
  background: #37474f;
  box-shadow: 0 0 0 #37474f;
  color: #fff;
  border-color: #78909c;
}

/* ========================
   SONUÇ EKRANI
   ======================== */
.screen-result {
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 32px 24px;
}

.result-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
}

.result-big-score {
  font-size: 54px;
  font-weight: 900;
  color: #ffab00;
  text-shadow: 4px 4px 0 #000;
}

.result-label {
  font-size: 13px;
  color: #8899bb;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.result-record {
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 10px;
  padding: 10px 24px;
  color: #ffc107;
  font-weight: 800;
  font-size: 15px;
}

.result-record.hidden {
  display: none;
}

.result-grid {
  display: flex;
  gap: 16px;
}

.rg-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  min-width: 70px;
}

.rg-val {
  font-size: 26px;
  font-weight: 900;
}

.rg-lbl {
  font-size: 11px;
  color: #8899bb;
  text-transform: uppercase;
  margin-top: 3px;
}

.rg-card.correct .rg-val {
  color: #4caf50;
}

.rg-card.wrong .rg-val {
  color: #ff5252;
}

.rg-card.skip .rg-val {
  color: #607d8b;
}

.result-time {
  font-size: 14px;
  color: #8899bb;
}

.result-time strong {
  color: #fff;
}

/* ========================
   ANİMASYONLAR
   ======================== */
@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

@keyframes hexPulse {
  0% {
    transform: scale(1) translateY(0);
    animation-timing-function: ease-out;
  }

  80% {
    transform: scale(1.08) translateY(-10px);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }

  100% {
    transform: scale(1) translateY(0);
  }
}

.hex-cell.pulse-anim {
  animation: hexPulse 0.45s forwards;
}

@keyframes hexPop {
  0% {
    transform: rotateY(90deg) scale(0.8);
  }

  60% {
    transform: rotateY(0deg) scale(1.05);
  }

  100% {
    transform: rotateY(0deg) scale(1);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-6px);
  }

  40%,
  80% {
    transform: translateX(6px);
  }
}

@keyframes barFlash {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* Flash overlay */
.flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  animation: flashFade 0.7s ease forwards;
}

.flash-overlay.correct {
  background: radial-gradient(circle, rgba(76, 175, 80, 0.35), transparent 70%);
}

.flash-overlay.wrong {
  background: radial-gradient(circle, rgba(244, 67, 54, 0.35), transparent 70%);
}

@keyframes flashFade {
  0% {
    opacity: 0.9;
  }

  100% {
    opacity: 0;
  }
}

/* Son 5 saniye — kırmızı kenar yanıp sönme */
.screen-game.last5::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid rgba(255, 50, 50, 0.6);
  border-radius: 4px;
  animation: borderBlink 1s infinite;
  pointer-events: none;
  z-index: 50;
}

@keyframes borderBlink {

  0%,
  100% {
    border-color: rgba(255, 50, 50, 0.6);
  }

  50% {
    border-color: rgba(255, 50, 50, 0.05);
  }
}

/* Responsive */
@media (max-width: 374px) {
  .btn-stop {
    width: 110px;
    height: 110px;
  }

  .score-main {
    font-size: 20px;
    padding-right: 32px;
  }

  .timer-text {
    font-size: 28px;
  }

  .hex-cell {
    width: 38px;
    height: 43px;
    font-size: 18px;
  }
}

@media (min-width: 431px) {
  body {
    background: #010824;
  }

  .app {
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
  }
}

/* Offline & Update Notifications */
.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #1c2541;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10000;
  font-size: 13px;
  border-bottom: 3px solid #000;
  box-shadow: 0 4px 0 #000;
  animation: slideDown 0.3s ease-out forwards;
}

.offline-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  border: 3px solid #000;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-align: center;
  z-index: 10000;
  font-size: 14px;
  box-shadow: 4px 4px 0 #000;
  transition: opacity 0.4s ease;
  animation: slideDown 0.4s ease-out forwards;
}

.offline-toast.hide {
  opacity: 0;
}

@keyframes slideDown {
  from {
    transform: translate(-50%, -100%);
    opacity: 0;
  }

  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.update-banner {
  transform: none;
  /* override center transform for banner */
  animation: slideDownBanner 0.4s ease-out forwards;
}

@keyframes slideDownBanner {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

body.offline-mode #btn-home-result {
  display: none !important;
}

/* ========================
   FAZ 5: BRUTALIST UI EKLENTİLERİ
   ======================== */

.bg-gold {
  background: #ffab00;
  color: #000;
}

.bg-gold:hover {
  background: #e69a00;
}

.btn-brutal {
  border: 3px solid #000;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  transition: all 0.1s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-brutal:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.bg-dark {
  background: #1c2541;
  color: #fff;
}

.bg-dark:hover {
  background: #243054;
}

.input-brutal {
  width: 100%;
  padding: 14px;
  border: 3px solid #000;
  border-radius: 8px;
  background: #fff;
  color: #000;
  font-family: inherit;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 4px 4px 0 #000;
  margin-bottom: 12px;
  outline: none;
}

.input-brutal:focus {
  border-color: #ffab00;
}

.entry-actions {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.auth-box {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  background: #1c2541;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 6px 6px 0 #000;
}

.auth-box.hidden {
  display: none !important;
}

.screen-main-menu,
.screen-entry,
.screen-auth {
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.main-action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.btn-play-massive {
  padding: 24px 48px;
  font-size: 32px;
  border-width: 4px;
  box-shadow: 6px 6px 0 #000;
}

.btn-play-massive:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 #000;
}

.social-actions-sidebar {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}



.btn-social-icon {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #111640;
  border: 3px solid #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  transition: all 0.1s;
}

.btn-social-icon:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #000;
}

.btn-social-icon:hover {
  background: #243054;
  border-color: #ffab00;
}


/* Animate Clue Text */
#el-clue {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
#el-clue.visible {
  opacity: 1;
}

/* ========================
   DRAWER PANEL — BRUTALIST
   ======================== */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  visibility: hidden;
}

.drawer.open {
  pointer-events: auto;
  visibility: visible;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s;
}

.drawer.open .drawer-backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: #0b132b;
  border-left: 4px solid #000;
  box-shadow: -6px 0 0 #000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

.drawer.open .drawer-panel {
  transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(20px, calc(14px + env(safe-area-inset-top, 0px))) 20px 16px;
  background: #1c2541;
  border-bottom: 4px solid #000;
  flex-shrink: 0;
}

.drawer-header h2 {
  color: #ffab00;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  margin: 0;
}

.drawer-close {
  width: 44px;
  height: 44px;
  background: #0b132b;
  border: 3px solid #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  transition: all 0.1s;
  border-radius: 0;
}

.drawer-close:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #000;
}

/* Drawer Body */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-body::-webkit-scrollbar {
  width: 4px;
}

.drawer-body::-webkit-scrollbar-thumb {
  background: rgba(255, 171, 0, 0.3);
}

/* ========================
   DRAWER TABS — BRUTALIST
   ======================== */

.drawer-tabs {
  display: flex;
  gap: 0;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
  flex-shrink: 0;
}

.drawer-tabs.sub {
  border-width: 2px;
  box-shadow: 2px 2px 0 #000;
}

.drawer-tab {
  flex: 1;
  padding: 14px 8px;
  background: #1c2541;
  border: none;
  border-right: 3px solid #000;
  color: #8899bb;
  font-size: 13px;
  font-weight: 900;
  font-family: inherit;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
  min-height: 48px;
}

.drawer-tabs.sub .drawer-tab {
  padding: 10px 8px;
  font-size: 12px;
  border-right-width: 2px;
  min-height: 40px;
}

.drawer-tab:last-child {
  border-right: none;
}

.drawer-tab.active {
  background: #ffab00;
  color: #000;
}

.drawer-tab:active {
  transform: translateY(1px);
}

/* ========================
   SEARCH ROW
   ======================== */

.search-row {
  display: flex;
  gap: 0;
  margin-top: 8px;
}

.search-row .input-brutal.input-sm {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  border-radius: 0;
  margin-bottom: 0;
  border-right: none;
}

.btn-sm {
  padding: 12px 16px;
  font-size: 13px;
  border-radius: 0;
  white-space: nowrap;
  min-height: 48px;
}

/* ========================
   MY CODE BLOCK
   ======================== */

.my-code-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #1c2541;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
  margin-bottom: 12px;
}

.code-label {
  font-size: 11px;
  font-weight: 900;
  color: #8899bb;
  letter-spacing: 2px;
}

.code-value {
  font-size: 22px;
  font-weight: 900;
  color: #ffab00;
  letter-spacing: 6px;
  font-variant-numeric: tabular-nums;
}

/* ========================
   SECTION DIVIDER
   ======================== */

.section-divider {
  font-size: 11px;
  font-weight: 900;
  color: #8899bb;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 0 6px;
  border-bottom: 2px solid #1c2541;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-section.hidden {
  display: none !important;
}

/* ========================
   BADGE — BRUTALIST
   ======================== */

.badge-brutal {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #000;
  z-index: 10;
  border-radius: 0;
  font-family: inherit;
}

.badge-brutal.hidden {
  display: none !important;
}

.badge-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  background: #e53935;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 0 4px;
  border: 2px solid #000;
  border-radius: 0;
  font-family: inherit;
}

/* Make social icon button position relative for badge */
.btn-social-icon {
  position: relative;
}

/* ========================
   LIST ITEMS — BRUTALIST
   ======================== */

.list-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #1c2541;
  border: 2px solid #000;
  border-bottom: none;
  min-height: 52px;
  transition: background 0.1s;
}

.list-item:last-child {
  border-bottom: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
}

.list-item:first-child:last-child {
  box-shadow: 3px 3px 0 #000;
}

.list-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-score {
  font-size: 14px;
  font-weight: 900;
  color: #ffab00;
  font-variant-numeric: tabular-nums;
}

.list-item-rank {
  font-size: 16px;
  font-weight: 900;
  color: #8899bb;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.list-item-rank.gold { color: #ffab00; }
.list-item-rank.silver { color: #c0c0c0; }
.list-item-rank.bronze { color: #cd7f32; }

.list-item.me {
  background: rgba(255, 171, 0, 0.1);
  border-color: #ffab00;
}

.list-item.me + .list-item {
  border-top: 2px solid #000;
}

/* Action buttons in list items */
.list-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-action {
  width: 40px;
  height: 40px;
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  font-family: inherit;
  transition: all 0.1s;
  border-radius: 0;
  box-shadow: 2px 2px 0 #000;
}

.btn-action:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.btn-accept {
  background: #43a047;
  color: #fff;
}

.btn-reject {
  background: #e53935;
  color: #fff;
}

.btn-add-friend {
  background: #ffab00;
  color: #000;
}

.btn-remove-friend {
  background: transparent;
  color: #e53935;
}

.btn-chat {
  background: #1c2541;
  color: #2196f3;
  border-color: #2196f3;
}
.btn-chat:hover {
  background: #2196f3;
  color: #000;
}

.btn-menu {
  background: #1c2541;
  color: #8899bb;
  border-color: #8899bb;
}
.btn-menu:hover {
  background: #8899bb;
  color: #000;
}

/* ========================
   DROPDOWN MENU
   ======================== */
.dropdown-container {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #1c2541;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  z-index: 100;
  min-width: 160px;
  display: flex;
  flex-direction: column;
}

.dropdown-menu.hidden {
  display: none !important;
}

.dropdown-item {
  background: none;
  border: none;
  border-bottom: 2px solid #000;
  padding: 12px 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover:not(:disabled) {
  background: #ffab00;
  color: #000;
}

.dropdown-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================
   LEADERBOARD SCORE BAR
   ======================== */

.lb-bar-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lb-bar-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 60px;
}

.lb-bar-track {
  flex: 1;
  height: 8px;
  background: #0b132b;
  border: 1px solid #1c2541;
  position: relative;
  overflow: hidden;
}

.lb-bar-fill {
  height: 100%;
  background: #ffab00;
  transition: width 0.4s ease;
}

.list-item.me .lb-bar-fill {
  background: #fff;
}

/* My position (sticky bottom) */
.lb-my-pos {
  position: sticky;
  bottom: 0;
  background: #0b132b;
  border-top: 3px solid #ffab00;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
  margin-top: auto;
}

.lb-my-pos.hidden {
  display: none !important;
}

.lb-my-pos-label {
  color: #8899bb;
  font-size: 12px;
  letter-spacing: 1px;
}

.lb-my-pos-rank {
  color: #ffab00;
  font-size: 20px;
}

.lb-my-pos-score {
  color: #fff;
  font-size: 16px;
}

/* ========================
   EMPTY / LOADING STATES
   ======================== */

.list-empty {
  padding: 24px 16px;
  text-align: center;
  color: #8899bb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  border: 2px dashed #1c2541;
}

.list-loading {
  padding: 24px 16px;
  text-align: center;
  color: #ffab00;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  animation: pulse 1s infinite;
}

/* Tab content hide */
.ftab-content.hidden {
  display: none !important;
}

/* ========================
   DRAWER RESPONSIVE
   ======================== */

@media (max-width: 380px) {
  .drawer-panel {
    max-width: 100%;
  }
}

/* ========================
   TOAST NOTIFICATIONS
   ======================== */
.toast-container {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none; /* Let clicks pass through empty space */
}

.toast-brutal {
  background: #1c2541;
  border: 4px solid #ffab00;
  box-shadow: 6px 6px 0 #000;
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: toastSlideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: auto; /* Enable clicks on the toast itself */
}

.toast-brutal.hiding {
  animation: toastSlideUp 0.3s forwards;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-weight: 900;
  font-size: 16px;
  color: #ffab00;
  text-transform: uppercase;
}

.toast-desc {
  font-size: 14px;
  color: #d0d5e0;
}

.toast-actions {
  display: flex;
  gap: 8px;
}

@keyframes toastSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastSlideUp {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-100%); opacity: 0; }
}

/* ========================
   NOTIFICATION DRAWER ITEMS
   ======================== */
.notif-item {
  background: #1c2541;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notif-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-item-title {
  font-weight: 900;
  color: #ffab00;
  font-size: 15px;
}

.notif-item-time {
  font-size: 11px;
  color: #8899bb;
}

.notif-item-body {
}

/* ========================
   DUEL RESULT CARD
   ======================== */
.result-duel-card {
  background: #1c2541;
  border: 3px solid #000;
  padding: 16px;
  margin: 16px 0;
  text-align: center;
  box-shadow: 4px 4px 0 #000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-duel-card .duel-lbl {
  color: #8899bb;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.result-duel-card .duel-val {
  font-size: 36px;
  font-weight: 900;
  color: #ff5252;
}

.result-duel-card .duel-outcome {
  font-weight: 900;
  font-size: 18px;
  margin-top: 4px;
  letter-spacing: 1px;
}

/* Utility Class Eklendi */
.hidden { display: none !important; }
