/*
 * style.css — identiteti vizual i Skivizko (markë vetjake) + paraqitja.
 *
 * Faqja kryesore: logo me gradient + sfond doodle, kartë me avatar dhe butona,
 * seksione informuese. Ekrani i lojës: lista majtas | kanavaca në mes | biseda
 * djathtas (flexbox).
 */

:root {
  /* Sfondi */
  --bg-1: #eef1ff;
  --bg-2: #f7f0ff;

  /* Ngjyrat e markës */
  --brand: #5b5ef4;
  --brand-dark: #4548d8;
  --brand-2: #ff7a9c; /* theks koral (vija e logos) */
  --brand-3: #9b6bff; /* vjollcë (gradienti i logos) */

  /* Sipërfaqe & tekst */
  --panel: #ffffff;
  --border: #e3e6f0;
  --text: #1f2233;
  --muted: #6b7088;
  --system: #9aa0b5;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow-x: hidden; /* asnjë rrëshqitje horizontale — faqja s'duhet të dalë anash kurrë */
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;

  /* Sfondi i përbashkët: pllaka doodle me vizatime (e njëjtë në gjithë faqen). */
  background-color: #5258e6; /* fallback që përputhet me imazhin */
  /* WebP i mprehtë (vija të holla) për shfletuesit modernë; JPG si rezervë. */
  background-image: url("/img/backgroundiriii.jpg");
  background-image: -webkit-image-set(url("/img/backgroundiriii.webp") type("image/webp"), url("/img/backgroundiriii.jpg") type("image/jpeg"));
  background-image: image-set(url("/img/backgroundiriii.webp") type("image/webp"), url("/img/backgroundiriii.jpg") type("image/jpeg"));
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

/* Brenda lojës përdoret i njëjti sf* (klasa mbetet për logjikën te game.js). */

/* Ndihmës: fsheh elementet. */
.hidden {
  display: none !important;
}

/* ═══════════ Header (vetëm gjatë lojës) ═══════════ */
#app-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: #fff;
  padding: 12px 20px;
  box-shadow: 0 2px 8px rgba(40, 40, 90, 0.18);
}

#app-header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Kontejneri kryesor: shfaqet vetëm një seksion njëherësh. */
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ═══════════ FAQJA KRYESORE / HYRJA ═══════════ */
#home-screen {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 20px 0;
}

.home-inner {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Logoja */
.logo-wrap {
  position: relative;
  display: inline-block;
  transform: rotate(-2deg);
  margin-bottom: 6px;
}

#logo {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.05;
  display: inline-flex;
}

/* Shkronjat kërcejnë me valë (vonesa e ndryshme për secilën nga JS). */
.logo-letter {
  display: inline-block;
  -webkit-text-fill-color: currentColor;
  /* Hije e errët që shkronjat e ndezura të dalin qartë mbi sfondin vjollcë. */
  text-shadow: 0 2px 5px rgba(28, 20, 60, 0.5), 0 0 1px rgba(28, 20, 60, 0.6);
  animation: logobob 1.9s ease-in-out infinite;
}
@keyframes logobob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  45% { transform: translateY(-10px) rotate(-5deg); }
}

/* Lapsi që tund/shkruan në fund të logos. */
.logo-pen {
  position: absolute;
  right: -30px;
  top: 2px;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  transform-origin: bottom left;
  animation: penwiggle 1.2s ease-in-out infinite;
}
@keyframes penwiggle {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(-5px); }
}

.logo-swoosh {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  width: 100%;
  height: 16px;
}

.logo-swoosh path {
  fill: none;
  stroke: var(--brand-2);
  stroke-width: 5;
  stroke-linecap: round;
  /* Vija nën-vizon "vizatohet" vetë në cikël (pathLength=1). */
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: swooshdraw 2.6s ease-in-out infinite;
}
@keyframes swooshdraw {
  0% { stroke-dashoffset: 1; }
  45%, 65% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* Respekto preferencën për lëvizje të reduktuar (qasshmëri). */
@media (prefers-reduced-motion: reduce) {
  .logo-letter, .logo-pen, .logo-swoosh path { animation: none; }
  .logo-swoosh path { stroke-dashoffset: 0; }
}

.tagline {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 4px rgba(40, 40, 90, 0.35);
  margin: 10px 0 0;
  font-size: 1.08rem;
  font-weight: 600;
}

/* Karta kryesore */
.home-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  width: 100%;
  max-width: 420px;
  margin-top: 20px;
  box-shadow: 0 12px 32px rgba(40, 40, 90, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#name-input {
  width: 100%;
  padding: 13px 14px;
  font-size: 1rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#name-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 94, 244, 0.15);
}

/* Zgjedhësi i avatarit */
.avatar-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* tre rreshta shigjetash (ngjyra/sy/gojë) flankojnë avatarin */
.avatar-arrows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #f3f4fb;
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.05s ease;
}

.avatar-arrow:hover {
  background: #e9ebfa;
}

.avatar-arrow:active {
  transform: scale(0.94);
}

.avatar-stage {
  position: relative;
  width: 140px;
  height: 140px;
}

#avatar-canvas {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #fbfcff;
  border: 2px solid var(--border);
  cursor: pointer; /* kliko avatarin për një të rastësishëm */
  transition: transform 0.06s ease;
}
#avatar-canvas:active {
  transform: scale(0.96);
}

.avatar-dice {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--brand);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(40, 40, 90, 0.28);
  transition: background 0.15s ease, transform 0.05s ease;
}

.avatar-dice:hover {
  background: var(--brand-dark);
}

.avatar-dice:active {
  transform: scale(0.92);
}

.avatar-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Butonat e veprimit */
.btn {
  width: 100%;
  padding: 13px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: 0 6px 16px rgba(91, 94, 244, 0.32);
}

.btn-primary:hover {
  box-shadow: 0 9px 22px rgba(91, 94, 244, 0.42);
}

.btn-secondary {
  color: var(--brand);
  background: #fff;
  border: 2px solid var(--brand);
}

.btn-secondary:hover {
  background: #f3f4fb;
}

.private-note {
  margin: 2px 0 0;
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 0.92rem;
}

/* Seksionet informuese */
.info-row {
  /* Rrjet i përgjegjshëm: dy kolona kur ka vend (≥240px secila), përndryshe një
     kolonë e grumbulluar. Kartat sa lartësia e vet (align:start) — pa boshllëk. */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
  gap: 16px;
  margin-top: 28px;
  width: 100%;
  text-align: left;
}

.info-card {
  min-width: 0; /* lejo tkurrjen brenda kolonës (pa dalje jashtë) */
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}

.info-card h3 {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 1.05rem;
}

.info-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  font-size: 0.95rem;
}

.info-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.55;
  font-size: 0.95rem;
}

.info-card li {
  margin-bottom: 4px;
}

/* ═══════════ EKRANI I LOJËS: tre kolona (rrjet i centruar, i kapur) ═══════════
   Anët fikse, mesi i lëvizshëm (minmax(0,1fr) → nuk del kurrë jashtë), kolona
   me lartësi të barabartë → bllok kompakt si skribbl, i centruar në ekrane të gjera. */
#game-screen {
  /* Lartësia = sa kanavaca (përmbajtja), por kurrë më shumë se dritarja. Bisedat dhe
     cilësimet rrëshqasin BRENDA kolonave të tyre, kështu faqja NUK rritet/rrëshqet. */
  flex: 0 1 auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 245px;
  grid-template-rows: minmax(0, 1fr) auto; /* rreshti 1 = kolonat, rreshti 2 = butonat */
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  min-height: 0;
  max-height: calc(100vh - 84px);
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  align-self: center;
  overflow: hidden; /* kolonat menaxhojnë scroll-in e vet */
}
/* Vendosja e qartë: tri kolonat lart, butonat poshtë (Fillo shtrihet mbi lojtarë+cilësime). */
#players-panel { grid-column: 1; grid-row: 1; }
#canvas-area   { grid-column: 2; grid-row: 1; }
#chat-panel    { grid-column: 3; grid-row: 1; }
#start-button  { grid-column: 1 / 3; grid-row: 2; }
#invite-button { grid-column: 3 / 4; grid-row: 2; }

/* Butonat e mëdhenj të lobby-t (si skribbl). */
.lobby-action {
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(40, 40, 90, 0.12);
}
#start-button {
  background: #3fbf57; /* jeshile e gjallë si skribbl */
}
#start-button:hover { background: #36a94c; }
#start-button:disabled { background: #b6c0e8; cursor: not-allowed; box-shadow: none; }
#invite-button {
  background: var(--brand);
}
#invite-button:hover { background: var(--brand-dark); }

/* ═══ Ekrane të ngushta (telefon) — paraqitje si skribbl ═══
   LOBBY: cilësimet lart (rrëshqasin brenda), butonat Fillo/Fto, pastaj lojtarët + biseda
          krah për krah poshtë.
   LOJË:  kanavaca lart (aq sa lartësia e vet, pa zbrazëti), lojtarët + biseda mbushin pjesën
          e mbetur, me fushën e hamendjes GJITHMONË të dukshme në fund. */
@media (max-width: 820px) {
  #game-screen {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); /* lojtarë | bisedë */
    grid-template-rows: minmax(110px, 1fr) auto minmax(120px, 0.85fr);
    grid-template-areas:
      "main    main"
      "btnL    btnR"
      "players chat";
    gap: 8px;
    padding: 8px;
    max-width: 680px;
    /* Mbush ekranin nën shiritin e sipërm; rreshtat shpërndahen brenda → pa "zbrazëti". */
    height: calc(100vh - 84px);
    height: calc(100dvh - 84px);
    max-height: calc(100vh - 84px);
    max-height: calc(100dvh - 84px);
  }
  #canvas-area   { grid-area: main; min-height: 0; }
  #start-button  { grid-area: btnL; }
  #invite-button { grid-area: btnR; }
  #players-panel { grid-area: players; min-height: 0; max-height: 100%; }
  #chat-panel    { grid-area: chat; min-height: 0; }

  /* LOBBY: cilësimet marrin lartësinë e tyre natyrale → #canvas-area i rrëshqet brenda
     (përndryshe flex:1 i ngjesh dhe rreshtat e poshtëm dalin jashtë / priten). */
  body:not(.playing) #settings-panel { flex: 0 0 auto; max-width: none; }

  /* LOJË: kanavaca vetëm aq sa lartësia e vet (pa zbrazëti); biseda merr pjesën tjetër.
     Vetëm dy rreshta (pa rreshtin bosh të butonave) → pa hapësirë të vdekur. */
  body.playing #game-screen {
    grid-template-rows: auto minmax(165px, 1fr);
    grid-template-areas:
      "main    main"
      "players chat";
  }
  body.playing #canvas-area { align-self: start; }
  /* Kanavaca + mjetet të hyjnë mbi rreshtin e bisedës edhe në ekrane të shkurtra. */
  body.playing #game-canvas { max-height: min(40dvh, calc(100dvh - 340px)); }

  /* Mbulesat e lojës (zgjedhja e fjalës / fundi i radhës) zënë GJITHË ekranin në telefon,
     që të mos priten brenda kanavacës së vogël (align-self:start e zvogëlon #canvas-area). */
  body.playing #word-choice-overlay,
  body.playing #turn-end-overlay {
    position: fixed;
    inset: 0;
    border: none;        /* pa kornizë rreth ekranit kur mbulesa zë gjithë dritaren */
    border-radius: 0;
    overflow-y: auto;
    z-index: 60;
  }
  /* Banderola "Raundi X" — po ashtu mbi gjithë ekranin (i njëjti shkak: #canvas-area i vogël). */
  body.playing #round-banner {
    position: fixed;
    inset: 0;
    border-radius: 0;
  }
}

/* Paneli i lojtarëve (majtas) */
#players-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  overflow-y: auto;
  min-width: 0;
  align-self: start;     /* sa lartësia e lojtarëve — pa kuti boshe të bardhë */
  max-height: 100%;      /* nëse ka shumë lojtarë, bën scroll brenda qelizës */
}

#players-panel h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

#player-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 5px;
  background: var(--bg-1);
  font-size: 0.95rem;
}
.player-text { flex: 1; min-width: 0; }

/* Rangu (#n / medalje) majtas. */
.player-rank {
  flex: 0 0 auto;
  width: 20px;
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Flluska kalimtare e hamendjes — pluskon ANËS rreshtit (si skribbl), e ankoruar
   me JS te rreshti i lojtarit; del nga paneli drejt kanavacës me një bisht majtas. */
.guess-float {
  position: fixed;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 11px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  max-width: 230px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  box-shadow: 0 4px 12px rgba(40, 40, 90, 0.2);
  z-index: 60;
  pointer-events: none;
  transition: opacity 0.18s ease;
  animation: bubblepop 0.14s ease;
}
.guess-float::before { /* bishti që tregon nga lojtari (majtas) */
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  border: 7px solid transparent;
  border-right-color: var(--border);
}
.guess-float::after { /* mbushja e bardhë e bishtit */
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #fff;
}
.guess-float.leaving { opacity: 0; }
@keyframes bubblepop {
  from { transform: translateY(-50%) scale(0.85); opacity: 0; }
  to { transform: translateY(-50%) scale(1); opacity: 1; }
}
.player-rank.medal { font-size: 1.05rem; }

/* Blloku emër + pikë (dy rreshta). */
.player-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.player-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-score {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}
.player-mark {
  flex: 0 0 auto;
  font-size: 1rem;
}
.player-item.guessed .player-mark { color: #2bb673; }

/* Avatarët pixel-art: pixel të qartë (jo të zbutur). */
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
.player-avatar { flex: none; border-radius: 5px; }
.score-avatar { flex: none; border-radius: 5px; }

/* Avatar te tabela e rezultatit (fund raundi / fund loje). */
.turnend-scores li,
.final-row { display: flex; align-items: center; gap: 8px; }

.player-item.me {
  font-weight: 700;
  border-left: 3px solid var(--brand);
}

/* Zona e kanavacës (në mes) */
#canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 0;
  overflow-y: auto; /* cilësimet e gjata (lobby) rrëshqasin brenda — pa rritur faqen */
  position: relative; /* kontekst për mbulesën e zgjedhjes së fjalës mbi kanavacë */
}

#toolbar {
  width: 100%;
  min-height: 8px; /* vend rezervë për mjetet e vizatimit (TODO) */
}

#game-canvas {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 8px;
  /* Replaced element me raport 4:3 (800×600): përshtatet brenda gjerësisë DHE
     lartësisë së dritares pa u shtrembëruar, sado e gjatë ose e ngushtë. */
  max-width: 100%;
  max-height: calc(100vh - 190px);
  cursor: crosshair;
  box-shadow: 0 4px 14px rgba(40, 40, 90, 0.08);
}

/* (#status-bar / #word-display ID-rregullat e vjetra u hoqën: bënin fjalën të zbehtë.
   Tani fjala stilizohet vetëm nga klasa .word-display te shiriti i lojës.) */

/* (Stilet e #start-button janë te seksioni i butonave të lobby-t më lart.) */

/* Paneli i bisedës (djathtas) */
#chat-panel {
  position: relative; /* .chat-inner pozicionohet absolut -> biseda s'e rrit rreshtin */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
  min-height: 0;
}
.chat-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  min-height: 0;
}

#chat-panel h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0; /* lejo tkurrjen që mesazhet të bëjnë scroll brenda kutisë */
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-1);
  margin-bottom: 10px;
}

.chat-message {
  padding: 5px 8px;
  margin-bottom: 2px;
  border-radius: 6px;
  font-size: 0.92rem;
  line-height: 1.35;
  word-wrap: break-word;
}
.chat-message:nth-child(even) { background: rgba(91, 94, 244, 0.06); } /* rreshta të alternuar, si skribbl */

.chat-message.system {
  color: var(--system);
  font-style: italic;
  text-align: center;
}

.chat-message.mine {
  color: var(--brand-dark);
  font-weight: 600;
}

#chat-form {
  display: flex;
  gap: 8px;
}

#chat-input {
  flex: 1;
  padding: 10px;
  font-size: 16px; /* ≥16px: pengon zoom-in automatik të iOS Safari në fokus */
  border: 1px solid var(--border);
  border-radius: 8px;
}
/* (Butoni "Dërgo" u hoq: dërgohet me Enter, si skribbl.) */

/* ═══════════ Hyrja: ndarësi "ose" + bashkohu me kod ═══════════ */
.home-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 2px 0;
}
.home-divider::before,
.home-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.join-row {
  display: flex;
  gap: 8px;
}

#join-code-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
#join-code-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 94, 244, 0.15);
}
.join-row .btn {
  width: auto;
  padding: 12px 18px;
  font-size: 1rem;
}

.home-error {
  margin: 4px 0 0;
  color: #d93a4a;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ═══════════ Header-i i dhomës ═══════════ */
#room-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: #fff;
  box-shadow: 0 2px 8px rgba(40, 40, 90, 0.18);
}
#room-brand {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}
#room-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 8px;
  border-radius: 999px;
}
#room-code-wrap {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}
#room-code {
  font-family: monospace;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 2px;
  color: #fff;
}
#room-status {
  margin-left: auto;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

/* ═══════════ Paneli i cilësimeve ═══════════ */
#settings-panel {
  width: 100%;
  max-width: 720px;
  flex: 1;            /* mbush lartësinë e kolonës */
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 12px 32px rgba(40, 40, 90, 0.1);
}
#settings-title {
  margin: 0 0 12px;
  color: var(--brand-dark);
  font-size: 1.1rem;
}
#settings-body {
  flex: 1;            /* trupi mbush; fusha e fjalëve zgjerohet poshtë */
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f1f6;
}
.setting-row > label {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}
.setting-row select {
  min-width: 150px;
  padding: 8px 10px;
  font-size: 16px; /* ≥16px: pengon zoom-in automatik të iOS Safari në fokus */
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
select:disabled,
textarea:disabled,
input:disabled {
  background: #f3f4f8;
  color: var(--muted);
  cursor: not-allowed;
}

.custom-words-block {
  padding-top: 14px;
  flex: 1;            /* zë hapësirën e mbetur; textarea zgjerohet ta mbushë */
  min-height: 90px;
  display: flex;
  flex-direction: column;
}
.custom-words-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.custom-words-head > label {
  font-weight: 600;
  font-size: 0.95rem;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}
#settings-body textarea {
  width: 100%;
  flex: 1;            /* mbushet me lartësinë e mbetur të kartës */
  resize: vertical;
  min-height: 64px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
#settings-body textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 94, 244, 0.15);
}

/* (#settings-footer u hoq: butonat tani janë rreshti i poshtëm i rrjetit.) */

/* ═══════════ ⚙ Cilësimet lokale (gear + modal) ═══════════ */
.settings-gear {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-dark);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(40, 40, 90, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background 0.15s ease;
}
.settings-gear:hover {
  background: #fff;
  transform: rotate(45deg);
}
/* Gjatë lojës shiriti i sipërm (#game-bar) është i përqendruar me max-width 1320px,
   kështu ⚙ shkon te fundi i djathtë i shiritit (jo në cep të faqes). */
body.playing .settings-gear {
  top: 22px;
  right: max(20px, calc(50vw - 651px));
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(72, 76, 224, 0.45);
}
body.playing .settings-gear:hover {
  background: var(--brand-dark);
}
/* Lër vend në fund të shiritit që fjala (në qendër) të mos kalojë nën ⚙ (42px + 20px offset). */
body.playing #game-bar {
  padding-right: 70px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 20, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--panel);
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: #fff;
}
.modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
}
.modal-close {
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}
.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.prefs-section {
  padding: 12px 0;
  border-bottom: 1px solid #f0f1f6;
}
.prefs-section:last-of-type {
  border-bottom: none;
}
.prefs-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--brand-dark);
}
.prefs-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.prefs-section-head h3 {
  margin: 0;
}
.mini-btn {
  border: 1px solid var(--border);
  background: #f3f4fb;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.mini-btn:hover {
  background: #e9ebfa;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-btn {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
#volume-range {
  flex: 1;
  cursor: pointer;
  accent-color: var(--brand);
}
.volume-value {
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
}

.hotkey-row,
.misc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.hotkey-label,
.misc-row > label {
  font-size: 0.92rem;
  color: var(--text);
}
.hotkey-key {
  min-width: 64px;
  padding: 6px 10px;
  font-family: monospace;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
  text-align: center;
}
.hotkey-key:hover {
  background: #f3f4fb;
}
.hotkey-key.capturing {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-family: inherit;
  font-weight: 600;
}
.misc-row select {
  min-width: 130px;
  padding: 7px 9px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.prefs-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

/* ═══════════ Loja: shiriti, mjetet, mbulesat ═══════════ */
/* Shiriti i lojës — header i plotë sa gjerësia (si skribbl) */
#game-bar {
  width: 100%;
  max-width: 1320px;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 16px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(40, 40, 90, 0.16);
}
/* Kohëmatësi: unazë rrethore që ZBRAZET ndërsa koha mbaron (lëviz) + frymëmarrje. */
#timer-num {
  --p: 100;                 /* përqindja e kohës që ka mbetur (vendoset nga JS) */
  --ring: var(--brand);
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring) calc(var(--p) * 3.6deg), #dde1f2 0);
  box-shadow: 0 2px 8px rgba(40, 40, 90, 0.18);
  animation: clockbreath 2.2s ease-in-out infinite;
}
#timer-num::before { /* fytyra e bardhë (vrima e unazës) */
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}
#timer-count {
  position: relative;
  z-index: 2;
  font-weight: 900;
  font-size: 1.2rem;
  color: #2b2740;
  font-variant-numeric: tabular-nums;
}
/* Zilet e sahatit alarm (sipër) — i japin pamjen e orës. */
.timer-bell {
  position: absolute;
  top: -5px;
  width: 14px;
  height: 12px;
  background: var(--ring);
  border-radius: 50% 50% 45% 45%;
  z-index: 1;
  transform-origin: bottom center;
}
.timer-bell-l { left: 1px; transform: rotate(-32deg); }
.timer-bell-r { right: 1px; transform: rotate(32deg); }
@keyframes clockbreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
/* Sekondat e fundit (≤10s): unazë e kuqe + dridhje (zilet "bien"). */
#game-bar.urgent #timer-num {
  --ring: #e23b3b;
  box-shadow: 0 2px 10px rgba(226, 59, 59, 0.5);
  animation: clockshake 0.32s ease-in-out infinite;
}
@keyframes clockshake {
  0%, 100% { transform: rotate(-7deg) scale(1.06); }
  50% { transform: rotate(7deg) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  #timer-num { animation: none; }
  #game-bar.urgent #timer-num { animation: none; }
}
.round-label {
  font-size: 0.92rem;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 700;
  flex: 0 0 auto;
}
.word-display {
  flex: 1;
  min-width: 0; /* lejo tkurrjen → fjala s'e shtyn shiritin jashtë ekranit (scroll horizontal) */
  text-align: center;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: #2b2740;
  overflow-x: auto;
  white-space: nowrap;
}
.word-display.word-blanks {
  font-family: "Courier New", monospace;
  letter-spacing: 8px;
}
/* Numri i shkronjave — i vogël, lart pas vizave (si skribbl). */
.wd-count {
  font-family: "Segoe UI", Roboto, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
  vertical-align: super;
  margin-left: 6px;
}
.word-display.word-real {
  letter-spacing: 1px;
  color: var(--brand-dark);
}

#toolbar {
  width: 100%;
  max-width: 800px;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.tb-colors {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 3px;
}
.tb-color {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}
.tb-color.active {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.tb-sizes {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tb-size {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tb-size.active {
  border-color: var(--brand);
  background: #f3f4fb;
}
.tb-dot {
  background: #1b1b1b;
  border-radius: 50%;
  display: inline-block;
}
.tb-tools {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.tb-tool {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.tb-tool.active {
  border-color: var(--brand);
  background: #f3f4fb;
}
.tb-tool:hover {
  background: #eef0fb;
}

.player-item.drawing {
  border-left: 3px solid var(--brand-3);
  font-weight: 600;
}
.player-item.guessed {
  background: #e7f9ee;
  border-left: 3px solid #2bb673;
}

.chat-message.correct {
  color: #1f9d57;
  font-weight: 700;
  text-align: center;
}
.chat-message.close {
  color: #e23b3b;
  font-weight: 700;
  text-align: center;
}

/* Mbulesa: zgjedhja e fjalës */
/* Zgjedhja e fjalës: panel i errët MBI kanavacë (si skribbl), fjalët në rresht. */
#word-choice-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(44, 47, 54, 0.97);
  border: 2px solid var(--border);
  border-radius: 8px;
}
.word-choice-inner { width: 100%; text-align: center; }
#word-choice-title {
  margin: 0 0 22px;
  color: #fff;
  font-size: clamp(1.3rem, 3.5vw, 1.7rem);
  font-weight: 800;
}
.word-choice-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.word-pick {
  padding: 14px 24px;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 700;
  border: none;
  background: #fff;
  color: #2c2f36;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.06s ease, background 0.15s ease, color 0.15s ease;
}
.word-pick:hover { background: var(--brand); color: #fff; }
.word-pick:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }
.word-choice-timer {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}
#word-choice-count {
  font-weight: 800;
  color: #fff;
}

/* Mbulesa: fundi i radhës */
/* Fundi i radhës: panel i errët MBI kanavacë (si skribbl). */
#turn-end-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(44, 47, 54, 0.97);
  border: 2px solid var(--border);
  border-radius: 8px;
}
.turnend-inner { width: 100%; max-width: 420px; text-align: center; }
.turnend-word {
  margin: 0 0 4px;
  font-size: clamp(1.2rem, 3.2vw, 1.6rem);
  font-weight: 800;
  color: #ffd93d; /* fjala në të verdhë, si skribbl */
}
.turnend-label {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.98rem;
}
.turnend-scores {
  list-style: none;
  margin: 0;
  padding: 0;
  color: #fff;
}
.turnend-scores li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  font-size: 0.98rem;
}
.turnend-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turnend-scores .turnend-points { color: #6ef08a; font-weight: 800; padding-left: 14px; } /* pikët në jeshile */

/* Mbulesa: fundi i lojës */
.gameover-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  max-height: 86vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.gameover-card h2 {
  margin: 0 0 6px;
  color: var(--brand-dark);
}
.gameover-winner {
  margin: 0 0 16px;
  font-weight: 700;
  font-size: 1.05rem;
}
.gameover-card h3 {
  margin: 8px 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.final-scores {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  text-align: left;
}
.final-row {
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: var(--bg-1);
}
.final-row.top1 {
  background: #fff7d6;
  border-left: 4px solid #e8b800;
  font-weight: 700;
}
.final-row.top2 {
  background: #f1f3f6;
  border-left: 4px solid #b5bcc7;
}
.final-row.top3 {
  background: #f7ece2;
  border-left: 4px solid #cd7f32;
}
.gameover-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Fokus i dukshëm me tastierë (a11y) */
.tb-color:focus-visible,
.tb-size:focus-visible,
.tb-tool:focus-visible,
.word-pick:focus-visible,
.gameover-actions .btn:focus-visible {
  outline: 3px solid var(--brand-dark);
  outline-offset: 2px;
}

/* Panelet mbi kanavacë bëjnë scroll nëse përmbajtja s'nxë në ekrane të vegjël */
.word-choice-inner,
.turnend-inner {
  max-height: 100%;
  overflow-y: auto;
}

/* ═══════════ Responsiv ═══════════ */
@media (max-width: 820px) {
  #game-bar {
    padding: 8px 12px;
    gap: 10px;
  }
  .word-display {
    font-size: 1rem;
    letter-spacing: 1px;
  }
  .word-display.word-blanks {
    letter-spacing: 3px;
  }
  #game-bar { gap: 8px; }
  /* Shiriti i mjeteve (vizatuesi): kompakt si skribbl — paleta zë gjithë gjerësinë në
     11 kolona (JO 1 kolonë e gjatë: auto-fit pa gjerësi të caktuar brenda flex-it
     shembet në një kolonë), madhësitë + veglat poshtë saj. */
  #toolbar { gap: 6px; padding: 6px 8px; margin-top: 8px; }
  .tb-colors {
    flex: 1 1 100%;                          /* gjerësi e plotë → grid-i di sa kolona */
    grid-template-columns: repeat(11, 1fr);
    gap: 4px;
  }
  .tb-color { width: 100%; height: 22px; }
  .tb-sizes, .tb-tools { gap: 5px; }
  .tb-size, .tb-tool { width: 30px; height: 30px; }
  .tb-tools { margin-left: auto; }
  /* (.info-row tashmë grumbullohet vetë me grid auto-fit.) */

  /* Panele më kompakte në telefon (krah për krah → pak hapësirë). */
  #players-panel { padding: 8px; }
  #players-panel h3,
  #chat-panel h3 { font-size: 0.9rem; margin-bottom: 6px; }
  .chat-inner { padding: 8px; }
  #chat-messages { min-height: 0; margin-bottom: 8px; }
  .player-item { padding: 5px 6px; gap: 4px; font-size: 0.9rem; }

  /* Shiriti i dhomës (lobby): pa prerje teksti — lër vend djathtas për ⚙ dhe lejo mbështjellje. */
  #room-header {
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 8px 56px 8px 14px;
  }
  #room-brand { font-size: 1.05rem; }
  #room-code { font-size: 1rem; }
  #room-status { font-size: 0.8rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   FAQET ME PËRMBAJTJE & ELEMENTE PARA-LOJE (home + Rreth/Privatësia/Kushtet)
   Reklamat shfaqen VETËM këtu (para se të hyjë lojtari), kurrë gjatë lojës.
   ═══════════════════════════════════════════════════════════════════ */

/* ——— Header i përbashkët (faqet statike me përmbajtje) ——— */
.site-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(4px);
}
.site-logo {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-decoration: none;
  background: linear-gradient(95deg, var(--brand) 0%, var(--brand-3) 50%, var(--brand-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--brand); }
.site-nav a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ——— Footer i përbashkët ——— */
.site-footer {
  width: 100%;
  margin-top: 48px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-brand { font-weight: 800; color: var(--brand-dark); }
.footer-tagline { color: var(--muted); margin: 4px 0 0; font-size: 0.95rem; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}
.footer-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.footer-nav a:hover { color: var(--brand); }
.footer-copy { color: var(--muted); font-size: 0.85rem; margin: 0; }
.footer-disclaimer {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  max-width: 580px;
  margin: 0 auto;
}

/* ——— Hapësirë reklame (placeholder; kodi i AdSense vendoset këtu pas aprovimit) ——— */
.ad-slot {
  width: 100%;
  max-width: 728px;
  min-height: 96px;
  margin: 26px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.ad-slot--wide { max-width: 970px; }

/* ——— Seksionet shtesë te faqja kryesore ——— */
.home-section {
  width: 100%;
  max-width: 680px;
  margin-top: 40px;
  text-align: left;
}
.home-section > h2 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 6px;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(28, 20, 60, 0.45);
}
.home-section > .section-sub {
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(28, 20, 60, 0.4);
  margin: 0 0 18px;
}

/* Veçoritë */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.feature {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(40, 40, 90, 0.07);
}
.feature-emoji { font-size: 1.8rem; line-height: 1; }
.feature h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

/* FAQ */
.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.faq-item h3 { margin: 0 0 6px; font-size: 1.02rem; }
.faq-item p { margin: 0; color: var(--muted); line-height: 1.6; }

/* ——— Faqet me përmbajtje (Rreth / Privatësia / Kushtet) ——— */
.content-main {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 22px 0;
  display: flex;
  flex-direction: column;
}
.content-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 34px;
  box-shadow: 0 12px 32px rgba(40, 40, 90, 0.1);
}
.content-card h1 {
  margin: 0 0 4px;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  color: var(--brand-dark);
}
.content-updated { color: var(--muted); font-size: 0.9rem; margin: 0 0 22px; }
.content-card h2 {
  font-size: 1.25rem;
  margin: 28px 0 10px;
  color: var(--text);
}
.content-card p,
.content-card li { line-height: 1.75; color: var(--text); }
.content-card ul, .content-card ol { padding-left: 22px; }
.content-card li { margin-bottom: 6px; }
.content-card a { color: var(--brand-dark); }
.content-lead { font-size: 1.08rem; color: var(--muted); }

@media (max-width: 560px) {
  .content-card { padding: 22px 18px; }
  .site-header { padding: 12px 16px; }
  .site-nav { gap: 12px; }
}

/* ——— Blogu (lista + artikujt) ——— */
.blog-list { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.blog-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 6px 18px rgba(40, 40, 90, 0.07);
  transition: transform 0.06s ease, box-shadow 0.15s ease;
}
.blog-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(40, 40, 90, 0.12); }
.blog-card h2 { margin: 0 0 6px; font-size: 1.2rem; color: var(--brand-dark); }
.blog-card p { margin: 0 0 10px; color: var(--muted); line-height: 1.6; }
.blog-card .blog-more { color: var(--brand); font-weight: 700; font-size: 0.95rem; }
.blog-meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; }
.blog-back { display: inline-block; margin-top: 8px; color: var(--brand-dark); font-weight: 600; text-decoration: none; }
.blog-back:hover { text-decoration: underline; }

/* Teaser-i i blogut te faqja kryesore */
.home-blog { display: flex; flex-direction: column; gap: 12px; }
.home-blog a {
  text-decoration: none;
  color: var(--brand-dark);
  font-weight: 700;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}
.home-blog a:hover { background: #f3f4fb; }
.home-blog a span { display: block; color: var(--muted); font-weight: 400; font-size: 0.92rem; margin-top: 3px; }

/* ——— Banderola e statusit të lidhjes ——— */
.net-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  max-width: 92%;
  margin-top: 10px;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
  box-shadow: 0 6px 18px rgba(40, 40, 90, 0.25);
}
.net-banner.warn { background: #e2861f; }
.net-banner.okay { background: #2bb673; }

/* ——— Ftesa në lobby (dhoma private) ——— */
#lobby-invite {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(40, 40, 90, 0.08);
}
#lobby-invite h3 {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 1.05rem;
}
.lobby-invite-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.lobby-invite-row {
  display: flex;
  gap: 8px;
}
#invite-link-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-1);
  color: var(--text);
}
#invite-copy-btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
#invite-copy-btn:hover { background: var(--brand-dark); }
.lobby-invite-code {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.lobby-invite-code strong {
  color: var(--brand-dark);
  letter-spacing: 2px;
  font-size: 1.1rem;
}

/* ——— Pritje/numërim në dhomat publike (luaj kundër të rastësishmëve) ——— */
#lobby-waiting {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 18px;
  margin-bottom: 12px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(40, 40, 90, 0.08);
}
.lobby-waiting-emoji { font-size: 2rem; line-height: 1; }
#lobby-waiting-text {
  margin: 10px 0 0;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 1.05rem;
}
#lobby-waiting.countdown #lobby-waiting-text { color: #2bb673; }

/* ——— "Si luhet" si rrëshqitje (karusel) ——— */
.howto-carousel {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
.howto-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.howto-slide {
  flex: 0 0 100%;
  min-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center; /* qendro vertikalisht — pa boshllëk te hapat e shkurtër */
  gap: 12px;
  padding: 6px 2px;
}
.howto-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.howto-art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  background: var(--bg-1);
  border-radius: 12px;
  padding: 6px;
}
.howto-svg { width: 160px; height: 92px; overflow: visible; }
.howto-svg [class^="ht-"], .howto-svg [class*=" ht-"] { transform-box: fill-box; }

/* Animacionet e ilustrimeve të hapave */
.ht-bob { transform-origin: center; animation: htbob 1.8s ease-in-out infinite; }
@keyframes htbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.ht-cursor { animation: htblink 1s steps(1) infinite; }
@keyframes htblink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.ht-btn { transform-origin: center; animation: htpulse 1.5s ease-in-out infinite; }
@keyframes htpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.9); } }
.ht-tap { transform-origin: top center; animation: httap 1.5s ease-in-out infinite; }
@keyframes httap { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-4px); } }

.ht-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: htdraw 2.6s ease-in-out infinite; }
@keyframes htdraw { 0% { stroke-dashoffset: 1; } 50%, 72% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
.ht-pen { transform-origin: bottom left; animation: htpen 1.2s ease-in-out infinite; }
@keyframes htpen { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(7deg); } }

.ht-pop { transform-origin: center; animation: htpop 2.6s ease-in-out infinite; }
@keyframes htpop {
  0% { transform: scale(0); opacity: 0; }
  12%, 80% { transform: scale(1); opacity: 1; }
  94%, 100% { transform: scale(0.9); opacity: 0; }
}
.ht-d { transform-origin: center; animation: htdot 1.2s ease-in-out infinite; }
.ht-d2 { animation-delay: 0.15s; }
.ht-d3 { animation-delay: 0.3s; }
@keyframes htdot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-4px); opacity: 1; } }

.ht-star { transform-origin: center; animation: htstar 1.8s ease-in-out infinite; }
@keyframes htstar { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.14) rotate(8deg); } }
.ht-plus { animation: htplus 2s ease-in-out infinite; }
@keyframes htplus { 0% { opacity: 0; transform: translateY(8px); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
.ht-spark { transform-origin: center; animation: htspark 1.6s ease-in-out infinite; }
.s2 { animation-delay: 0.5s; }
@keyframes htspark { 0%, 100% { opacity: 0; transform: scale(0.4); } 50% { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .ht-bob, .ht-cursor, .ht-btn, .ht-tap, .ht-draw, .ht-pen,
  .ht-pop, .ht-d, .ht-star, .ht-plus, .ht-spark { animation: none; }
  .ht-draw { stroke-dashoffset: 0; }
}
.howto-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(91, 94, 244, 0.3);
}
.howto-text {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  font-size: 0.95rem;
}
.howto-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}
.howto-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.howto-dot.active {
  background: var(--brand);
  transform: scale(1.35);
}
/* Fallback statik (reduced motion): hapat njëri poshtë tjetrit. */
.howto-static .howto-slide { margin-bottom: 8px; }

/* ——— Butoni i shpejtë i heshtjes (komponent i ripërdorshëm nga Sfx) ——— */
.sfx-mute {
  position: fixed;
  top: 12px;
  right: 64px; /* majtas ⚙ */
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-dark);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(40, 40, 90, 0.18);
  transition: transform 0.05s ease, background 0.15s ease;
}
.sfx-mute:hover { background: #fff; }
.sfx-mute:active { transform: scale(0.92); }

/* ——— Ekrani i reklamës para lojës (i kapërcyeshëm) ——— */
.pregame-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 640px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.pregame-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.pregame-card .ad-slot {
  min-height: 250px; /* hapësirë tipike interstitial; mbushe me ofruesin tënd */
  margin: 0 auto;
}
#pregame-skip {
  width: auto;
  min-width: 160px;
  margin: 16px auto 0;
}
#pregame-skip:disabled { opacity: 0.6; cursor: default; }
.pregame-note { margin: 10px 0 0; color: var(--muted); font-size: 0.85rem; }

/* ——— Podiumi i fundit të lojës (vendi 1/2/3) ——— */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin: 14px 0 18px;
}
.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 96px;
}
.podium-1 { width: 112px; }
.podium-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
}
.podium-crown { font-size: 1.3rem; line-height: 1; margin-bottom: -2px; }
.podium-avatar { border-radius: 6px; }
.podium-name {
  font-weight: 700;
  font-size: 0.9rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-points { font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.podium-block {
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1.7rem;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}
.podium-1 .podium-block { height: 104px; background: linear-gradient(180deg, #ffd93d, #f5b301); }
.podium-2 .podium-block { height: 78px;  background: linear-gradient(180deg, #d9dee8, #a9b3c3); }
.podium-3 .podium-block { height: 56px;  background: linear-gradient(180deg, #e7a973, #c97e44); }

/* ——— Njoftimi i raundit ("Raundi X") mbi kanavacë në fillim të çdo raundi ——— */
#round-banner {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 47, 54, 0.92);
  border-radius: 8px;
  animation: roundfade 1.7s ease forwards;
}
#round-banner-text {
  color: #fff;
  font-weight: 900;
  font-size: clamp(2rem, 7vw, 3.4rem);
  letter-spacing: 1px;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  animation: roundpop 0.5s ease;
}
@keyframes roundfade {
  0% { opacity: 0; }
  12%, 72% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes roundpop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #round-banner, #round-banner-text { animation: none; }
}
