/* ==========================================================================
   Pengadetektiven – CSS
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #10b981;
  --primary-light: #ecfdf5;
  --primary-dark: #059669;
  --gold: #f59e0b;
  --gold-light: #fffbeb;
  --copper: #b45309;
  --silver: #94a3b8;
  --danger: #ef4444;
  --radius: 20px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.penga-page {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
  touch-action: manipulation;
}

.game-viewport {
  max-width: 820px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.game-header {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-back {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: none;
  min-height: 48px;
  padding: 8px 18px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.game-title-text {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.star-counter-badge {
  background: var(--gold-light);
  border: 2px solid var(--gold);
  color: #b45309;
  font-size: 18px;
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sound {
  min-height: 44px;
  width: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.game-stage-card {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 16px 0;
  padding: 24px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  position: relative;
  min-height: 460px;
}

/* Butikshylla */
.shop-item-display {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  border: 2px solid var(--border);
  padding: 14px 28px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.shop-item-icon {
  font-size: 50px;
}

.shop-item-info {
  text-align: left;
}

.shop-item-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.shop-item-price {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary-dark);
}

/* Kassadisk med valda pengar */
.register-tray {
  width: 100%;
  max-width: 600px;
  min-height: 110px;
  background: #f1f5f9;
  border: 3px dashed #cbd5e1;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  margin-bottom: 12px;
}

.register-tray-empty {
  color: #94a3b8;
  font-size: 17px;
  font-weight: 700;
}

.tray-total-badge {
  position: absolute;
  top: -14px;
  right: 18px;
  background: var(--primary);
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Mynt & Sedlar bank */
.money-bank-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.money-bank-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  max-width: 640px;
}

/* Mynt-knappar */
.money-btn {
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  transition: transform 0.15s ease, filter 0.15s ease;
  user-select: none;
  touch-action: manipulation;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.money-btn:hover {
  transform: translateY(-3px) scale(1.03);
}

.money-btn:active {
  transform: translateY(1px) scale(0.96);
}

/* Myntstilar */
.coin-btn {
  border-radius: 50%;
  width: 58px;
  height: 58px;
  font-size: 16px;
  border: 2px solid rgba(0,0,0,0.15);
}

.coin-1kr { background: #b45309; color: #fff; }
.coin-2kr { background: #9a3412; color: #fff; }
.coin-5kr { background: #eab308; color: #713f12; }
.coin-10kr { background: #ca8a04; color: #fef08a; border: 3px solid #a16207; }

/* Sedlar */
.bill-btn {
  border-radius: 10px;
  width: 84px;
  height: 52px;
  font-size: 17px;
  border: 2px solid rgba(0,0,0,0.1);
  letter-spacing: 0.5px;
}

.bill-20kr { background: #a78bfa; color: #3b0764; }
.bill-50kr { background: #f97316; color: #7c2d12; }
.bill-100kr { background: #38bdf8; color: #0c4a6e; }

/* Inlagda mynt i disken */
.tray-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 900;
  cursor: pointer;
  width: 44px;
  height: 44px;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tray-bill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
  width: 64px;
  height: 40px;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.action-buttons-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  width: 100%;
}

.btn-pay {
  background: var(--primary);
  color: white;
  border: none;
  font-size: 20px;
  font-weight: 900;
  padding: 14px 40px;
  border-radius: 16px;
  cursor: pointer;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  transition: all 0.15s ease;
}

.btn-pay:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-reset-tray {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid var(--border);
  font-size: 17px;
  font-weight: 800;
  padding: 14px 20px;
  border-radius: 16px;
  cursor: pointer;
  min-height: 58px;
}

.feedback-banner {
  margin-top: 14px;
  padding: 10px 22px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 900;
  display: none;
}

.feedback-banner.show {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.feedback-banner.correct {
  background: var(--primary-light);
  border: 2px solid var(--primary);
  color: var(--primary-dark);
}

.feedback-banner.almost {
  background: #fffbeb;
  border: 2px solid var(--gold);
  color: #b45309;
}

.game-footer {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 800;
  color: var(--muted);
}

.stars-progress-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
}

.star-icon { color: var(--gold); }
.star-icon.empty { color: #cbd5e1; }
