/* ================================================================
   Kippi Flip — css/style.css
   ================================================================ */

/* ── Base ───────────────────────────────────────────────────── */
body {
  color: #e8edf5;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #060f1e;
  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: #2dd4bf; }

#userArea {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
}

/* ── Layout ─────────────────────────────────────────────────── */
body {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #040f1c;
  user-select: none;
  -webkit-user-select: none;
}

.game-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

#game-canvas {
  display: block;
  width: 100%;
  touch-action: none;   /* forhindrer scroll/zoom via touch */
  cursor: crosshair;
}

/* ── Overlay (felles base) ──────────────────────────────────── */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(4, 15, 28, 0.55);
}

.overlay.hidden { display: none; }

.overlay-card {
  background: rgba(10, 25, 47, 0.92);
  border: 1px solid rgba(45, 212, 191, 0.18);
  border-radius: 24px;
  padding: 32px 28px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: cardIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 0 60px rgba(45, 212, 191, 0.12);
}

@keyframes cardIn {
  from { opacity: 0; transform: scale(0.88) translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ── Start-overlay ──────────────────────────────────────────── */
.overlay-icon {
  font-size: 3rem;
  line-height: 1;
}

.overlay-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin: 0;
  background: linear-gradient(135deg, #7dd3fc 0%, #2dd4bf 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.overlay-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

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

.hint-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.10);
  color: rgba(45, 212, 191, 0.80);
  border: 1px solid rgba(45, 212, 191, 0.20);
}

/* Modus-label */
.mode-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin: 4px 0 0;
}

/* Modus-knapper side om side */
.mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

/* ── Game over-overlay ──────────────────────────────────────── */
.new-best {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.30);
  border-radius: 8px;
  padding: 6px 14px;
  text-align: center;
}

.new-best.hidden { display: none; }

/* Score-kort */
.score-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

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

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

.score-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.40);
}

.score-value {
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.90);
  line-height: 1;
}

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

/* Statistikk-rad */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 0;
  width: 120px;
}

.stat-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  text-align: center;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.80);
}

/* ── Knapper (full-bredde) ──────────────────────────────────── */
.btn--full { width: 100%; }

/* Teal-variant for Flip */
.btn--teal {
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);
  color: #fff;
  border: none;
  box-shadow: 0 0 20px rgba(13, 148, 136, 0.30);
}

.btn--teal:hover, .btn--teal:focus-visible {
  background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
  box-shadow: 0 0 28px rgba(13, 148, 136, 0.45);
}
