/* =========================================================
   FALKENMAN  –  Multiplayer gætter-spil
   ========================================================= */

/* ── Landing page ──────────────────────────────────────── */
.fk-landing {
  max-width: 480px;
  width: 100%;
  padding: 32px 16px 48px;
}

.fk-landing h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 4px;
  text-align: center;
}

.fk-landing .subtitle {
  color: var(--subtext);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 36px;
}

.fk-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  margin-bottom: 20px;
}

.fk-panel h3 {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 18px;
  color: var(--text);
}

.fk-form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fk-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--subtext);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.fk-input {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.fk-input:focus { border-color: #5588ee; }

.fk-input-code {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

.fk-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fk-chip {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 14px;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.fk-chip:hover { border-color: var(--subtext); }
.fk-chip.selected {
  border-color: #5588ee;
  background: rgba(85, 136, 238, 0.15);
  color: #88aaff;
}

.fk-mode-chips .fk-chip { flex: 1; text-align: center; }

.btn-fk-primary {
  background: linear-gradient(135deg, #3366cc, #5588ee);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 14px;
  width: 100%;
  margin-top: 8px;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-fk-primary:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.btn-fk-primary:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Game page ─────────────────────────────────────────── */
.fk-game-wrap {
  width: 100%;
  max-width: 520px;
  padding: 12px 8px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Lobby ─────────────────────────────────────────────── */
.fk-lobby {
  text-align: center;
  padding: 24px 0;
  width: 100%;
}

.fk-code-display {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
}

.fk-code-label {
  font-size: 0.75rem;
  color: var(--subtext);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.fk-code-value {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: #88aaff;
  cursor: pointer;
  user-select: all;
  line-height: 1;
}

.fk-code-hint {
  font-size: 0.75rem;
  color: var(--subtext);
  margin-top: 8px;
}

.fk-player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.fk-player-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.fk-player-row .fk-order {
  background: var(--border);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--subtext);
  flex-shrink: 0;
}

.fk-player-row.me { border-color: #5588ee; }
.fk-player-row.me .fk-order { background: #3355aa; color: #88aaff; }

.fk-waiting-msg {
  color: var(--subtext);
  font-size: 0.85rem;
  margin: 12px 0;
}

.btn-fk-start {
  background: linear-gradient(135deg, #228844, #33bb66);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  padding: 14px 32px;
  margin-top: 12px;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-fk-start:hover { opacity: 0.88; }
.btn-fk-start:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Scoreboard ────────────────────────────────────────── */
.fk-scoreboard {
  display: flex;
  gap: 5px;
  width: 100%;
  margin-bottom: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.fk-score-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 10px;
  flex: 1;
  min-width: 70px;
  max-width: 120px;
  transition: border-color 0.2s;
}

.fk-score-card.current-turn { border-color: #5588ee; background: rgba(85,136,238,0.1); }
.fk-score-card.me-card { box-shadow: 0 0 0 1px rgba(85,136,238,0.3); }

.fk-score-name {
  font-size: 0.68rem;
  color: var(--subtext);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}
.fk-score-card.current-turn .fk-score-name { color: #88aaff; }
.fk-score-pts {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
}

/* ── Turn banner ───────────────────────────────────────── */
.fk-turn-banner {
  font-size: 0.82rem;
  color: var(--subtext);
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}
.fk-turn-banner .highlight { color: #88aaff; }
.fk-turn-banner.my-turn .highlight { color: #66dd88; }
.fk-turn-banner.my-turn { color: #66dd88; }

/* ── Game layout ───────────────────────────────────────── */
.fk-layout {
  display: flex;
  gap: 16px;
  width: 100%;
  align-items: flex-start;
  justify-content: center;
}

/* Falcon drawing */
.fk-illustration {
  flex-shrink: 0;
  width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#fk-svg {
  width: 140px;
  height: 168px;
}

.fk-wrong-counter {
  font-size: 0.75rem;
  color: var(--subtext);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.fk-wrong-counter .count { color: #ee5566; }

/* Falcon SVG parts – hidden until revealed */
.fk-part { opacity: 0; transition: opacity 0.4s ease; }
.fk-part.visible { opacity: 1; }

/* ── Play area ─────────────────────────────────────────── */
.fk-play-area { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* Word display */
.fk-word {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.fk-letter {
  width: 36px;
  height: 44px;
  border-bottom: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  transition: color 0.2s, border-color 0.2s;
  text-transform: uppercase;
}
.fk-letter.revealed { border-color: #5588ee; color: #88aaff; }
.fk-letter.new-reveal {
  animation: fk-pop 0.3s ease;
}
@keyframes fk-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); color: #66dd88; }
  100% { transform: scale(1); }
}

/* Wrong letters */
.fk-wrong-bar {
  font-size: 0.8rem;
  color: var(--subtext);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.fk-wrong-letter {
  color: #ee5566;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Keyboard */
.fk-keyboard {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fk-kb-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.fk-key {
  background: var(--key-bg);
  border: none;
  border-radius: 4px;
  color: var(--key-text);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  height: 44px;
  flex: 1 1 0;
  max-width: 36px;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.fk-key:active:not(:disabled) { transform: scale(0.92); }
.fk-key:disabled { opacity: 0.25; cursor: not-allowed; }
.fk-key.correct  { background: var(--green); }
.fk-key.wrong    { background: #3a3a3c; opacity: 0.4; }

/* Not-my-turn overlay on keyboard */
.fk-keyboard.locked .fk-key:not(.correct):not(.wrong) { opacity: 0.35; cursor: not-allowed; }

/* Toast */
.fk-toast-area { height: 36px; display: flex; align-items: center; justify-content: center; }
.fk-toast {
  background: rgba(255,255,255,0.92);
  color: #111;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 18px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.fk-toast.show { opacity: 1; transform: translateY(0); }

/* ── End screen ────────────────────────────────────────── */
.fk-end {
  text-align: center;
  padding: 24px 16px;
  width: 100%;
}
.fk-end-icon { font-size: 3.5rem; margin-bottom: 10px; }
.fk-end h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.fk-end .fk-end-word {
  font-size: 1.1rem;
  color: var(--subtext);
  margin-bottom: 20px;
  letter-spacing: 2px;
}
.fk-end-word span { color: #88aaff; font-weight: 800; }

.fk-final-scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.fk-final-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
}
.fk-final-row.winner { border-color: #e8c050; background: rgba(232,192,80,0.1); }
.fk-final-row.winner .fk-final-name { color: #e8c050; }
.fk-final-row.winner .fk-final-pts  { color: #e8c050; }
.fk-winner-crown { margin-right: 6px; font-size: 1.1rem; }

/* Falcon shown on loss end-screen */
.fk-end-falcon {
  width: 150px;
  height: 180px;
  margin: 4px auto 14px;
}
.fk-end-falcon svg {
  width: 100%;
  height: 100%;
}
.fk-final-name { font-weight: 700; font-size: 0.95rem; }
.fk-final-pts  { font-weight: 800; color: var(--subtext); }

/* ── Confetti ───────────────────────────────────────────── */
.confetti-piece {
  position: fixed;
  pointer-events: none;
  border-radius: 2px;
  z-index: 9999;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

.btn-fk-new {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 28px;
  width: 100%;
  max-width: 320px;
  transition: border-color 0.15s;
}
.btn-fk-new:hover { border-color: var(--subtext); }

/* ── Guesses feed ──────────────────────────────────────── */
.fk-feed {
  max-height: 80px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--subtext);
  margin-top: 4px;
}
.fk-feed-item.correct { color: var(--green); }
.fk-feed-item.wrong   { color: #ee5566; }

/* ── Unlimited mode indicator ──────────────────────────── */
.fk-unlimited-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--subtext);
  margin-bottom: 4px;
}
.fk-inf { font-size: 1.2rem; color: #88aaff; font-weight: 900; }

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 400px) {
  .fk-layout { flex-direction: column; align-items: center; }
  .fk-illustration { width: 120px; }
  #fk-svg { width: 120px; height: 144px; }
  .fk-letter { width: 30px; height: 38px; font-size: 1.15rem; }
  .fk-key { height: 38px; font-size: 0.68rem; }
}
