/* ══════════════════════════════════════════════════════
   Kippi Tower — css/style.css
   ══════════════════════════════════════════════════════ */

/* ── Base ─────────────────────────────────────────────── */
body {
  background: #070e1b;
  color: #e8edf5;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;                   /* Ingen sidescroll */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Header ──────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #0c1525;
  flex-shrink: 0;
  height: 56px;
}

.back-btn {
  color: #8892aa;
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s;
}
.back-btn:hover { color: #e8edf5; }
.back-btn svg { width: 22px; height: 22px; }

.logo {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.logo span { color: #6c5fff; }

#userArea { display: flex; align-items: center; flex-shrink: 0; }

/* ── Spillflate ──────────────────────────────────────── */
.game-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;       /* Blokkér alle touch-gester på canvas */
  cursor: pointer;
}

/* ── Overlays ────────────────────────────────────────── */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 14, 27, 0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.overlay.hidden { display: none; }

.overlay-card {
  background: rgba(12, 21, 37, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 28px;
  padding: 40px 32px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: cardIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.overlay-icon {
  font-size: 3.2rem;
  line-height: 1;
}

.overlay-card h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #a78bfa 0%, #6c5fff 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.overlay-desc {
  font-size: 0.9rem;
  color: #8892aa;
  line-height: 1.65;
  margin: 0;
}

/* ── Hint-chips ──────────────────────────────────────── */
.hint-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.hint-chip {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(108, 95, 255, 0.12);
  border: 1px solid rgba(108, 95, 255, 0.22);
  border-radius: 99px;
  padding: 4px 12px;
  color: #a78bfa;
  letter-spacing: 0.02em;
}

/* ── Score-display (game over) ───────────────────────── */
.score-display {
  display: flex;
  gap: 12px;
  width: 100%;
}

.score-item {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-item--best {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.04);
}

.score-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8892aa;
}

.score-value {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  color: #e8edf5;
  line-height: 1;
}

.score-item--best .score-value { color: #fbbf24; }

/* ── Ny rekord-banner ─────────────────────────────────── */
.new-best {
  font-size: 1rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.03em;
  animation: pulse 0.6s ease 0.1s both;
}

@keyframes pulse {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── Knapper ──────────────────────────────────────────── */
/* Bruker .btn, .btn--primary, .btn--ghost fra kippi.css  */
/* Tilpasning for full bredde og riktig gap i overlay     */
.overlay-card .btn { margin-top: 2px; }

/* ── Ikon-knapp (lyd av/på) ───────────────────────────── */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: transparent;
  color: #e8edf5;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.07); }
