/* ==========================================================================
   Vetenskapslabbet – CSS
   ========================================================================== */

:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #202432;
  --muted: #687084;
  --border: #e2e8f0;
  --primary: #06b6d4;
  --primary-light: #ecfeff;
  --success: #35b875;
  --success-light: #e8f8f0;
  --success-dark: #238b55;
  --warning: #f4b942;
  --warning-light: #fef8eb;
  --warning-dark: #d99115;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

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

body.vetenskap-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: 800px;
  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: #0891b2;
  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(--warning-light);
  border: 2px solid var(--warning);
  color: var(--warning-dark);
  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: center;
  text-align: center;
  position: relative;
  min-height: 440px;
}

/* Vattentank / Experimentyta */
.tank-wrap {
  width: 100%;
  max-width: 460px;
  height: 220px;
  background: linear-gradient(180deg, #ecfeff 0%, #cffafe 35%, #06b6d4 36%, #0891b2 100%);
  border: 4px solid #0e7490;
  border-radius: 0 0 24px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.1), 0 8px 24px rgba(6, 182, 212, 0.25);
  margin-bottom: 20px;
}

.water-line {
  position: absolute;
  top: 35%;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.experiment-item-in-tank {
  position: absolute;
  font-size: 40px;
  transition: all 0.6s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.experiment-item-in-tank.floating {
  top: 30%;
  animation: floatBob 2s ease-in-out infinite alternate;
}

.experiment-item-in-tank.sinking {
  top: 75%;
}

@keyframes floatBob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.lab-prompt {
  font-size: 20px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 16px;
}

.lab-target-item {
  font-size: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-weight: 900;
  color: var(--text);
}

.lab-choices-row {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn-lab-choice {
  min-width: 140px;
  min-height: 64px;
  font-size: 20px;
  font-weight: 900;
  border-radius: 16px;
  border: 3px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.btn-lab-choice:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-2px);
}

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

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

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

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

.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(--warning); }
.star-icon.empty { color: #cbd5e1; }

.finish-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.finish-screen.show { display: flex; }
